主程序

This commit is contained in:
tangw 2025-11-04 09:29:40 +08:00
parent a2d94ed107
commit 678779da9c
6 changed files with 267 additions and 185 deletions

View File

@ -12,6 +12,10 @@ public class LisinterfaceNameConstants {
//获取门诊病人信息列表 //获取门诊病人信息列表
public static final String DAYMESSAGE_GETOUTPATLIST = "222"; public static final String DAYMESSAGE_GETOUTPATLIST = "222";
public static final String DAYMESSAGE_GETPATIENT = "204"; public static final String DAYMESSAGE_GETPATIENT = "204";
//获取电子病历
public static final String DAYMESSAGE_EMR = "996";
//获取病人360视图
public static final String DAYMESSAGE_ALLPAT = "997";
/** /**
* 准备发送报告-5 * 准备发送报告-5
*/ */

View File

@ -31,6 +31,10 @@ public class LisWorkBase {
String getIP(){ String getIP(){
return IpUtils.getIpAddr(); return IpUtils.getIpAddr();
} }
/**获取当前登录的医疗机构**/
String getYLJG(){
return loginConfigParamUtil.getLoginConfigParam().getLoginYLJG();
}
/**获取当前会话循环次数**/ /**获取当前会话循环次数**/
int getProblemId() { int getProblemId() {
return JsonParamUtils.getParameterToInt("problemId", 0); return JsonParamUtils.getParameterToInt("problemId", 0);

View File

@ -1,5 +1,10 @@
package com.czlis.interfaceCommon.utils; package com.czlis.interfaceCommon.utils;
import com.czlis.common.core.domain.Result;
import com.czlis.common.utils.SecurityUtils;
import com.czlis.common.utils.ip.IpUtils;
import com.czlis.interfaceCommon.constants.LisinterfaceNameConstants;
import com.czlis.interfaceCommon.pojo.inter.DayMessage;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -7,4 +12,19 @@ import org.springframework.stereotype.Component;
@Slf4j @Slf4j
public class LisWorkUtils extends LisWorkconfirm{ public class LisWorkUtils extends LisWorkconfirm{
/**
* 通用调用医院定制接口
* @param msgid
* @param content
* @return
*/
public Result setDayMessage(String msgid,String content){
DayMessage dayMessage = new DayMessage();
dayMessage.setIp(getIP());
dayMessage.setYljg(getYLJG());
dayMessage.setUserid(getusername());
dayMessage.setMsgid(msgid);
dayMessage.setMsg(content);
return lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.DAYMESSAGE, dayMessage);
}
} }

View File

@ -124,4 +124,19 @@ public class LisWorkController extends BaseController {
public Result printReport(LabPat labPat) { public Result printReport(LabPat labPat) {
return lisWorkService.printReport(labPat); return lisWorkService.printReport(labPat);
} }
@ApiOperation("查看电子病历")
@GetMapping("/emrquery")
public Result emrquery(Date jyrq, String yq, String ybh) {
return lisWorkService.emrquery(jyrq,yq,ybh);
}
@ApiOperation("查看患者360视图")
@GetMapping("/allpatquery")
public Result allpatquery(Date jyrq, String yq, String ybh) {
return lisWorkService.allpatquery(jyrq,yq,ybh);
}
@ApiOperation("双工流水线")
@GetMapping("/datalink")
public Result datalink(Date jyrq, String yq, String ybh) {
return lisWorkService.datalink(jyrq,yq,ybh);
}
} }

View File

@ -23,4 +23,7 @@ public interface LisWorkService {
Result setinputmdl(Date jyrq, String yq, String ybh,String mbmc); Result setinputmdl(Date jyrq, String yq, String ybh,String mbmc);
Result printReport(LabPat labPat); Result printReport(LabPat labPat);
Result getresultchangelog(Date jyrq, String yq, String ybh,String xmdh); Result getresultchangelog(Date jyrq, String yq, String ybh,String xmdh);
Result allpatquery(Date jyrq, String yq, String ybh);
Result emrquery(Date jyrq, String yq, String ybh);
Result datalink(Date jyrq, String yq, String ybh);
} }

View File

@ -10,9 +10,12 @@ import com.czlis.common.utils.DateUtils;
import com.czlis.common.utils.MessageUtils; import com.czlis.common.utils.MessageUtils;
import com.czlis.common.utils.SecurityUtils; import com.czlis.common.utils.SecurityUtils;
import com.czlis.common.utils.StringUtils; import com.czlis.common.utils.StringUtils;
import com.czlis.common.utils.ip.IpUtils;
import com.czlis.interfaceCommon.constants.ComLogConstants; import com.czlis.interfaceCommon.constants.ComLogConstants;
import com.czlis.interfaceCommon.constants.LabReqmainConstants; import com.czlis.interfaceCommon.constants.LabReqmainConstants;
import com.czlis.interfaceCommon.constants.LisinterfaceNameConstants;
import com.czlis.interfaceCommon.pojo.entity.LastLabPatParam; import com.czlis.interfaceCommon.pojo.entity.LastLabPatParam;
import com.czlis.interfaceCommon.pojo.inter.DayMessage;
import com.czlis.interfaceCommon.utils.*; import com.czlis.interfaceCommon.utils.*;
import com.czlis.liswork.mapper.LisWorkMapper; import com.czlis.liswork.mapper.LisWorkMapper;
@ -28,6 +31,8 @@ import java.util.stream.Collectors;
@Service @Service
@Slf4j @Slf4j
public class LisWorkServiceImpl implements LisWorkService { public class LisWorkServiceImpl implements LisWorkService {
@Autowired
LisInterfaceUtil lisInterfaceUtil;
@Autowired @Autowired
LisWorkMapper lisWorkMapper; LisWorkMapper lisWorkMapper;
@Autowired @Autowired
@ -40,16 +45,16 @@ public class LisWorkServiceImpl implements LisWorkService {
LisWorkUtils lisWorkUtils; LisWorkUtils lisWorkUtils;
@Override @Override
public Result getXmInfo(String yq) { public Result getXmInfo(String yq) {
List<XmInfo> xmInfoList =commonUtil.getXmInfoList(yq); List<XmInfo> xmInfoList = commonUtil.getXmInfoList(yq);
return new Result("0","获取成功!",xmInfoList); return new Result("0", "获取成功!", xmInfoList);
} }
@Override @Override
public Result getXmVal(String yq,String xmdh) { public Result getXmVal(String yq, String xmdh) {
List<XmVal> xmInfoList =commonUtil.getXmVal(yq,xmdh); List<XmVal> xmInfoList = commonUtil.getXmVal(yq, xmdh);
return new Result("0","获取成功!",xmInfoList); return new Result("0", "获取成功!", xmInfoList);
} }
@Override @Override
@ -57,24 +62,24 @@ public class LisWorkServiceImpl implements LisWorkService {
Date jyrq = labPat.getJyrq(); Date jyrq = labPat.getJyrq();
String yq = labPat.getYq(); String yq = labPat.getYq();
String ybh = labPat.getYbh(); String ybh = labPat.getYbh();
labPat=commonUtil.getLabPatOne(jyrq, yq, ybh); labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
if(labPat==null) return new Result("-1","未找到报告单,打印失败!"); if (labPat == null) return new Result("-1", "未找到报告单,打印失败!");
String jgbz=labPat.getJgbz(); String jgbz = labPat.getJgbz();
if(jgbz==null|| jgbz.isEmpty()) return new Result("-1","未找到报告单,打印失败!"); if (jgbz == null || jgbz.isEmpty()) return new Result("-1", "未找到报告单,打印失败!");
if(!"2".equals(jgbz))return new Result("1","报告单未审核,禁止打印!"); if (!"2".equals(jgbz)) return new Result("1", "报告单未审核,禁止打印!");
Result res=reportUtil.printReport(labPat); Result res = reportUtil.printReport(labPat);
if(!"1".equals(labPat.getDybz())) { if (!"1".equals(labPat.getDybz())) {
commonUtil.updateLabPatByColumn(jyrq,yq,ybh,"dybz","1"); commonUtil.updateLabPatByColumn(jyrq, yq, ybh, "dybz", "1");
} }
if(labPat.getDysj()==null) { if (labPat.getDysj() == null) {
String dysj=commonUtil.getDateTimeString(new Date()); String dysj = commonUtil.getDateTimeString(new Date());
commonUtil.updateLabPatByColumn(jyrq,yq,ybh,"dysj",dysj); commonUtil.updateLabPatByColumn(jyrq, yq, ybh, "dysj", dysj);
} }
String yhdh=SecurityUtils.getLoginUser().getUsername(); String yhdh = SecurityUtils.getLoginUser().getUsername();
lisWorkUtils.setComLog(jyrq,yq,ybh,yhdh, ComLogConstants.LG_P,""); lisWorkUtils.setComLog(jyrq, yq, ybh, yhdh, ComLogConstants.LG_P, "");
String sqh=labPat.getSqh(); String sqh = labPat.getSqh();
if(sqh!=null&& !sqh.isEmpty()){ if (sqh != null && !sqh.isEmpty()) {
lisWorkUtils.setlabReqsteplog(sqh, LabReqmainConstants.REPORT,yhdh); lisWorkUtils.setlabReqsteplog(sqh, LabReqmainConstants.REPORT, yhdh);
} }
return res; return res;
} }
@ -82,36 +87,37 @@ public class LisWorkServiceImpl implements LisWorkService {
@Override @Override
public Result getInstrdList() { public Result getInstrdList() {
List<LabInstr> labInstr=commonUtil.querybylisgroup("","","0"); List<LabInstr> labInstr = commonUtil.querybylisgroup("", "", "0");
return new Result("0","获取仪器列表成功!",labInstr); return new Result("0", "获取仪器列表成功!", labInstr);
} }
@Override @Override
public Result getGroupInstrdList(String groupId) { public Result getGroupInstrdList(String groupId) {
if("ALL".equals(groupId))groupId=""; if ("ALL".equals(groupId)) groupId = "";
String yhdh=SecurityUtils.getLoginUser().getUsername(); String yhdh = SecurityUtils.getLoginUser().getUsername();
SysLoginParam loginConfigParam =loginConfigParamUtil.getLoginConfigParam(); SysLoginParam loginConfigParam = loginConfigParamUtil.getLoginConfigParam();
String yljg=loginConfigParam.getLoginYLJG(); String yljg = loginConfigParam.getLoginYLJG();
if("".equals(yljg)||yljg==null)yljg="1"; if ("".equals(yljg) || yljg == null) yljg = "1";
List<LabInstr> labInstr; List<LabInstr> labInstr;
if("admin".equals(yhdh)||"lis".equals(yhdh)){ if ("admin".equals(yhdh) || "lis".equals(yhdh)) {
labInstr = commonUtil.querybylisgroup(groupId, yljg, "0"); labInstr = commonUtil.querybylisgroup(groupId, yljg, "0");
}else{ } else {
labInstr = commonUtil.getInstrdList(groupId, yljg, "0", yhdh, "2"); labInstr = commonUtil.getInstrdList(groupId, yljg, "0", yhdh, "2");
} }
return new Result("0","获取分组仪器列表成功!",labInstr); return new Result("0", "获取分组仪器列表成功!", labInstr);
} }
@Override @Override
public Result getInstrdConfig(String yq) { public Result getInstrdConfig(String yq) {
// List<ComOpt> comOptlist = lisWorkMapper.getInstrdConfig(yq); // List<ComOpt> comOptlist = lisWorkMapper.getInstrdConfig(yq);
List<LabInputcol> labInputcolList = commonUtil.getLabInputcol(yq); List<LabInputcol> labInputcolList = commonUtil.getLabInputcol(yq);
for(LabInputcol labInputcol:labInputcolList){ for (LabInputcol labInputcol : labInputcolList) {
String zdmc=labInputcol.getZdmc(); String zdmc = labInputcol.getZdmc();
// if("!".equals(labInputcol.getMrts()))labInputcol.setKj("0"); // if("!".equals(labInputcol.getMrts()))labInputcol.setKj("0");
labInputcol.setZdlb("1"); labInputcol.setZdlb("1");
labInputcol.setDict(""); labInputcol.setDict("");
switch(zdmc){ switch (zdmc) {
case "shcs": case "shcs":
labInputcol.setKj("0"); labInputcol.setKj("0");
break; break;
@ -174,44 +180,44 @@ public class LisWorkServiceImpl implements LisWorkService {
labInputcol.setDict(""); labInputcol.setDict("");
} }
} }
Map<String,Object> instrdConfig= new HashMap<>(); Map<String, Object> instrdConfig = new HashMap<>();
instrdConfig.put("ResultConfig",getInstrdResultConfig(yq)); instrdConfig.put("ResultConfig", getInstrdResultConfig(yq));
instrdConfig.put("labInputcolList",labInputcolList); instrdConfig.put("labInputcolList", labInputcolList);
return new Result("0","获取仪器参数成功!",instrdConfig); return new Result("0", "获取仪器参数成功!", instrdConfig);
} }
private List<LabInputcol> getInstrdResultConfig(String yq){ private List<LabInputcol> getInstrdResultConfig(String yq) {
String showod= commonUtil.getComOptValue(yq,"SHOWOD"); String showod = commonUtil.getComOptValue(yq, "SHOWOD");
if(showod==null|| showod.isEmpty())showod="0"; if (showod == null || showod.isEmpty()) showod = "0";
String showodflag="0"; String showodflag = "0";
String showcutoffflag="0"; String showcutoffflag = "0";
String showrefsflag="1"; String showrefsflag = "1";
char firstChar = showod.charAt(0); char firstChar = showod.charAt(0);
switch (firstChar){ switch (firstChar) {
case '1': case '1':
showodflag="1"; showodflag = "1";
showcutoffflag="1"; showcutoffflag = "1";
showrefsflag="0"; showrefsflag = "0";
break; break;
case '2': case '2':
showodflag="1"; showodflag = "1";
showcutoffflag="1"; showcutoffflag = "1";
showrefsflag="1"; showrefsflag = "1";
break; break;
case '3': case '3':
showodflag="1"; showodflag = "1";
showcutoffflag="0"; showcutoffflag = "0";
showrefsflag="1"; showrefsflag = "1";
break; break;
} }
String result_label= commonUtil.getComOptValue(yq,"RESULT_LABEL"); String result_label = commonUtil.getComOptValue(yq, "RESULT_LABEL");
if(result_label==null|| result_label.isEmpty())result_label="结果"; if (result_label == null || result_label.isEmpty()) result_label = "结果";
String od_label= commonUtil.getComOptValue(yq,"OD_LABEL"); String od_label = commonUtil.getComOptValue(yq, "OD_LABEL");
if(od_label==null|| od_label.isEmpty())od_label="OD"; if (od_label == null || od_label.isEmpty()) od_label = "OD";
String cutoff_label= commonUtil.getComOptValue(yq,"CUTOFF_LABEL"); String cutoff_label = commonUtil.getComOptValue(yq, "CUTOFF_LABEL");
if(cutoff_label==null|| cutoff_label.isEmpty())cutoff_label="CUTOFF"; if (cutoff_label == null || cutoff_label.isEmpty()) cutoff_label = "CUTOFF";
List<LabInputcol> ResultConfig=new ArrayList<>(); List<LabInputcol> ResultConfig = new ArrayList<>();
LabInputcol labInputcol=new LabInputcol(); LabInputcol labInputcol = new LabInputcol();
labInputcol.setXh(0); labInputcol.setXh(0);
labInputcol.setYq(yq); labInputcol.setYq(yq);
labInputcol.setZdmc("index"); labInputcol.setZdmc("index");
@ -219,8 +225,8 @@ public class LisWorkServiceImpl implements LisWorkService {
labInputcol.setKybj("0"); labInputcol.setKybj("0");
labInputcol.setZdts(""); labInputcol.setZdts("");
labInputcol.setMrz("45"); labInputcol.setMrz("45");
ResultConfig.add(0,labInputcol); ResultConfig.add(0, labInputcol);
LabInputcol labInputcol1=new LabInputcol(); LabInputcol labInputcol1 = new LabInputcol();
labInputcol1.setXh(1); labInputcol1.setXh(1);
labInputcol1.setYq(yq); labInputcol1.setYq(yq);
labInputcol1.setZdmc("redo_flag"); labInputcol1.setZdmc("redo_flag");
@ -228,7 +234,7 @@ public class LisWorkServiceImpl implements LisWorkService {
labInputcol1.setKybj("0"); labInputcol1.setKybj("0");
labInputcol1.setZdts("复"); labInputcol1.setZdts("复");
labInputcol1.setMrz("45"); labInputcol1.setMrz("45");
ResultConfig.add(1,labInputcol1); ResultConfig.add(1, labInputcol1);
LabInputcol labInputcol2 = new LabInputcol(); LabInputcol labInputcol2 = new LabInputcol();
labInputcol2.setXh(2); labInputcol2.setXh(2);
labInputcol2.setYq(yq); labInputcol2.setYq(yq);
@ -238,8 +244,8 @@ public class LisWorkServiceImpl implements LisWorkService {
labInputcol2.setZdts("项目"); labInputcol2.setZdts("项目");
labInputcol2.setDict("xmdh"); labInputcol2.setDict("xmdh");
labInputcol2.setMrz("90"); labInputcol2.setMrz("90");
ResultConfig.add(2,labInputcol2); ResultConfig.add(2, labInputcol2);
LabInputcol labInputcol3 =new LabInputcol(); LabInputcol labInputcol3 = new LabInputcol();
labInputcol3.setXh(3); labInputcol3.setXh(3);
labInputcol3.setYq(yq); labInputcol3.setYq(yq);
labInputcol3.setZdmc("xmmc"); labInputcol3.setZdmc("xmmc");
@ -247,8 +253,8 @@ public class LisWorkServiceImpl implements LisWorkService {
labInputcol3.setKybj("0"); labInputcol3.setKybj("0");
labInputcol3.setZdts("名称"); labInputcol3.setZdts("名称");
labInputcol3.setMrz("100"); labInputcol3.setMrz("100");
ResultConfig.add(3,labInputcol3); ResultConfig.add(3, labInputcol3);
LabInputcol labInputcol4 =new LabInputcol(); LabInputcol labInputcol4 = new LabInputcol();
labInputcol4.setXh(4); labInputcol4.setXh(4);
labInputcol4.setYq(yq); labInputcol4.setYq(yq);
labInputcol4.setZdmc("csjg"); labInputcol4.setZdmc("csjg");
@ -257,8 +263,8 @@ public class LisWorkServiceImpl implements LisWorkService {
labInputcol4.setZdts(result_label); labInputcol4.setZdts(result_label);
labInputcol4.setDict("xmval"); labInputcol4.setDict("xmval");
labInputcol4.setMrz("100"); labInputcol4.setMrz("100");
ResultConfig.add(4,labInputcol4); ResultConfig.add(4, labInputcol4);
LabInputcol labInputcol5 =new LabInputcol(); LabInputcol labInputcol5 = new LabInputcol();
labInputcol5.setXh(5); labInputcol5.setXh(5);
labInputcol5.setYq(yq); labInputcol5.setYq(yq);
labInputcol5.setZdmc("cp_compa"); labInputcol5.setZdmc("cp_compa");
@ -266,8 +272,8 @@ public class LisWorkServiceImpl implements LisWorkService {
labInputcol5.setKybj("0"); labInputcol5.setKybj("0");
labInputcol5.setZdts("上次结果"); labInputcol5.setZdts("上次结果");
labInputcol5.setMrz("100"); labInputcol5.setMrz("100");
ResultConfig.add(5,labInputcol5); ResultConfig.add(5, labInputcol5);
LabInputcol labInputcol6 =new LabInputcol(); LabInputcol labInputcol6 = new LabInputcol();
labInputcol.setXh(6); labInputcol.setXh(6);
labInputcol6.setYq(yq); labInputcol6.setYq(yq);
labInputcol6.setZdmc("od"); labInputcol6.setZdmc("od");
@ -275,8 +281,8 @@ public class LisWorkServiceImpl implements LisWorkService {
labInputcol6.setKybj("1"); labInputcol6.setKybj("1");
labInputcol6.setZdts(od_label); labInputcol6.setZdts(od_label);
labInputcol6.setMrz("100"); labInputcol6.setMrz("100");
ResultConfig.add(6,labInputcol6); ResultConfig.add(6, labInputcol6);
LabInputcol labInputcol7 =new LabInputcol(); LabInputcol labInputcol7 = new LabInputcol();
labInputcol7.setXh(7); labInputcol7.setXh(7);
labInputcol7.setYq(yq); labInputcol7.setYq(yq);
labInputcol7.setZdmc("cutoff"); labInputcol7.setZdmc("cutoff");
@ -284,8 +290,8 @@ public class LisWorkServiceImpl implements LisWorkService {
labInputcol7.setKybj("1"); labInputcol7.setKybj("1");
labInputcol7.setZdts(cutoff_label); labInputcol7.setZdts(cutoff_label);
labInputcol7.setMrz("100"); labInputcol7.setMrz("100");
ResultConfig.add(7,labInputcol7); ResultConfig.add(7, labInputcol7);
LabInputcol labInputcol8 =new LabInputcol(); LabInputcol labInputcol8 = new LabInputcol();
labInputcol8.setXh(8); labInputcol8.setXh(8);
labInputcol8.setYq(yq); labInputcol8.setYq(yq);
labInputcol8.setZdmc("refs"); labInputcol8.setZdmc("refs");
@ -293,7 +299,7 @@ public class LisWorkServiceImpl implements LisWorkService {
labInputcol8.setKybj("0"); labInputcol8.setKybj("0");
labInputcol8.setZdts("参考值"); labInputcol8.setZdts("参考值");
labInputcol8.setMrz("120"); labInputcol8.setMrz("120");
ResultConfig.add(8,labInputcol8); ResultConfig.add(8, labInputcol8);
// labInputcol=new LabInputcol(); // labInputcol=new LabInputcol();
// labInputcol.setXh(9); // labInputcol.setXh(9);
// labInputcol.setYq(yq); // labInputcol.setYq(yq);
@ -303,7 +309,7 @@ public class LisWorkServiceImpl implements LisWorkService {
// labInputcol.setZdts("单位"); // labInputcol.setZdts("单位");
// labInputcol.setMrz("80"); // labInputcol.setMrz("80");
// ResultConfig.add(9,labInputcol); // ResultConfig.add(9,labInputcol);
LabInputcol labInputcol9 =new LabInputcol(); LabInputcol labInputcol9 = new LabInputcol();
labInputcol9.setXh(9); labInputcol9.setXh(9);
labInputcol9.setYq(yq); labInputcol9.setYq(yq);
labInputcol9.setZdmc("bz1"); labInputcol9.setZdmc("bz1");
@ -311,15 +317,16 @@ public class LisWorkServiceImpl implements LisWorkService {
labInputcol9.setKybj("0"); labInputcol9.setKybj("0");
labInputcol9.setZdts("子模块"); labInputcol9.setZdts("子模块");
labInputcol9.setMrz("80"); labInputcol9.setMrz("80");
ResultConfig.add(9,labInputcol9); ResultConfig.add(9, labInputcol9);
return ResultConfig; return ResultConfig;
} }
@Override @Override
public Result getresultinfo(Date jyrq, String yq, String ybh){ public Result getresultinfo(Date jyrq, String yq, String ybh) {
List<LabResult> labResultList=commonUtil.getLabResultList(jyrq,yq,ybh); List<LabResult> labResultList = commonUtil.getLabResultList(jyrq, yq, ybh);
if(labResultList.size()==0){ if (labResultList.size() == 0) {
List<LabInputmdl> labInputmdlList=lisWorkUtils.chkautoinput(yq,ybh); List<LabInputmdl> labInputmdlList = lisWorkUtils.chkautoinput(yq, ybh);
if(!labInputmdlList.isEmpty()) { if (!labInputmdlList.isEmpty()) {
for (LabInputmdl labInputmdl : labInputmdlList) { for (LabInputmdl labInputmdl : labInputmdlList) {
labResultList = lisWorkUtils.batchinput(jyrq, yq, ybh, labResultList, labInputmdl.getMbmc(), false); labResultList = lisWorkUtils.batchinput(jyrq, yq, ybh, labResultList, labInputmdl.getMbmc(), false);
String yblx = labInputmdl.getYblx(); String yblx = labInputmdl.getYblx();
@ -328,18 +335,18 @@ public class LisWorkServiceImpl implements LisWorkService {
// } // }
} }
} }
return new Result("0","成功!",labResultList); return new Result("0", "成功!", labResultList);
} }
List<LabResultlog> labResultlog=commonUtil.getLabResultlog(jyrq,yq,ybh); List<LabResultlog> labResultlog = commonUtil.getLabResultlog(jyrq, yq, ybh);
if(!labResultList.isEmpty() && !labResultlog.isEmpty()) { if (!labResultList.isEmpty() && !labResultlog.isEmpty()) {
for (LabResult labResult : labResultList) { for (LabResult labResult : labResultList) {
String xmdh=labResult.getXmdh(); String xmdh = labResult.getXmdh();
String csjg=labResult.getCsjg(); String csjg = labResult.getCsjg();
if(csjg==null)csjg=""; if (csjg == null) csjg = "";
if(xmdh!=null&& !xmdh.isEmpty()) { if (xmdh != null && !xmdh.isEmpty()) {
List<LabResultlog> labResultlog0 = labResultlog.stream().filter(rlog -> xmdh.equals(rlog.getXmdh())).collect(Collectors.toList()); List<LabResultlog> labResultlog0 = labResultlog.stream().filter(rlog -> xmdh.equals(rlog.getXmdh())).collect(Collectors.toList());
if(!labResultlog0.isEmpty()) { if (!labResultlog0.isEmpty()) {
for(LabResultlog labResultlog1 : labResultlog0) { for (LabResultlog labResultlog1 : labResultlog0) {
String csjg0 = labResultlog1.getCsjg(); String csjg0 = labResultlog1.getCsjg();
if (csjg0 == null) csjg0 = ""; if (csjg0 == null) csjg0 = "";
if (!csjg.equals(csjg0)) { if (!csjg.equals(csjg0)) {
@ -351,8 +358,8 @@ public class LisWorkServiceImpl implements LisWorkService {
} }
} }
} }
LabPat labPat =commonUtil.getLabPatOne(jyrq,yq,ybh); LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
if(labPat!=null) { if (labPat != null) {
List<LabResult> labResultList0 = getlastresult(labPat, labResultList); List<LabResult> labResultList0 = getlastresult(labPat, labResultList);
if (!labResultList0.isEmpty()) { if (!labResultList0.isEmpty()) {
@ -364,13 +371,13 @@ public class LisWorkServiceImpl implements LisWorkService {
if (!labResult0.isEmpty()) { if (!labResult0.isEmpty()) {
String csjg0 = labResult0.get(0).getCsjg(); String csjg0 = labResult0.get(0).getCsjg();
String result_flag = labResult0.get(0).getResult_flag(); String result_flag = labResult0.get(0).getResult_flag();
String alarm_flag= labResult0.get(0).getAlarm_flag(); String alarm_flag = labResult0.get(0).getAlarm_flag();
if ("未做".equals(csjg0) || csjg0 == null) { if ("未做".equals(csjg0) || csjg0 == null) {
csjg0 = ""; csjg0 = "";
result_flag = ""; result_flag = "";
} }
if(!"".equals(alarm_flag)&&!" ".equals(alarm_flag)&&alarm_flag!=null) { if (!"".equals(alarm_flag) && !" ".equals(alarm_flag) && alarm_flag != null) {
result_flag="J"; result_flag = "J";
} }
labResult.setCp_compa(csjg0); labResult.setCp_compa(csjg0);
labResult.setCp_lastflag(result_flag); labResult.setCp_lastflag(result_flag);
@ -379,39 +386,41 @@ public class LisWorkServiceImpl implements LisWorkService {
} }
} }
} }
return new Result("0","成功!",labResultList); return new Result("0", "成功!", labResultList);
} }
@Override @Override
public Result setinputmdl(Date jyrq, String yq, String ybh,String mbmc){ public Result setinputmdl(Date jyrq, String yq, String ybh, String mbmc) {
List<LabResult> labResultList=new ArrayList<>(); List<LabResult> labResultList = new ArrayList<>();
labResultList = lisWorkUtils.batchinput(jyrq, yq, ybh, labResultList, mbmc, false); labResultList = lisWorkUtils.batchinput(jyrq, yq, ybh, labResultList, mbmc, false);
return new Result("0","成功!",labResultList); return new Result("0", "成功!", labResultList);
} }
@Override @Override
public Result getresultchangelog(Date jyrq, String yq, String ybh,String xmdh){ public Result getresultchangelog(Date jyrq, String yq, String ybh, String xmdh) {
Map<String,String> map=new HashMap<>(); Map<String, String> map = new HashMap<>();
LabResult labResult=commonUtil.getLabResult(jyrq,yq,ybh,xmdh); LabResult labResult = commonUtil.getLabResult(jyrq, yq, ybh, xmdh);
List<LabResultlog> labResultlog=commonUtil.getLabResultlogxmdh(jyrq,yq,ybh,xmdh); List<LabResultlog> labResultlog = commonUtil.getLabResultlogxmdh(jyrq, yq, ybh, xmdh);
if(labResult!=null && !labResultlog.isEmpty()) { if (labResult != null && !labResultlog.isEmpty()) {
String csjg = labResult.getCsjg(); String csjg = labResult.getCsjg();
if(csjg==null)csjg=""; if (csjg == null) csjg = "";
String finalCsjg = csjg; String finalCsjg = csjg;
List<LabResultlog> labResultlog0 = labResultlog.stream().filter(rlog -> !finalCsjg.equals(rlog.getCsjg())).collect(Collectors.toList()); List<LabResultlog> labResultlog0 = labResultlog.stream().filter(rlog -> !finalCsjg.equals(rlog.getCsjg())).collect(Collectors.toList());
if(!labResultlog0.isEmpty()) { if (!labResultlog0.isEmpty()) {
for(LabResultlog labResultlog1 : labResultlog0) { for (LabResultlog labResultlog1 : labResultlog0) {
String csjg0 = labResultlog1.getCsjg(); String csjg0 = labResultlog1.getCsjg();
if (csjg0 == null) csjg0 = ""; if (csjg0 == null) csjg0 = "";
if (!csjg.equals(csjg0)) { if (!csjg.equals(csjg0)) {
Date xgrq=labResultlog1.getXgrq(); Date xgrq = labResultlog1.getXgrq();
LabPatlog labPatlog=commonUtil.getLabPatlog(jyrq,yq,ybh,xgrq); LabPatlog labPatlog = commonUtil.getLabPatlog(jyrq, yq, ybh, xgrq);
Date dysj=labPatlog.getDysj(); Date dysj = labPatlog.getDysj();
String hdys=labPatlog.getHdys(); String hdys = labPatlog.getHdys();
String xgr=labResultlog1.getXgyhdh(); String xgr = labResultlog1.getXgyhdh();
map.put("csjg",csjg0); map.put("csjg", csjg0);
map.put("xgr",xgr); map.put("xgr", xgr);
map.put("xgrq", commonUtil.getDateTimeString(xgrq)); map.put("xgrq", commonUtil.getDateTimeString(xgrq));
map.put("shys",hdys); map.put("shys", hdys);
map.put("shsj",commonUtil.getDateTimeString(dysj)); map.put("shsj", commonUtil.getDateTimeString(dysj));
break; break;
} }
} }
@ -419,88 +428,91 @@ public class LisWorkServiceImpl implements LisWorkService {
} }
return new Result("0","成功!",map); return new Result("0", "成功!", map);
} }
/** /**
* 获取上一次结果 * 获取上一次结果
*
* @param labPat 病人信息 * @param labPat 病人信息
* @param labResultall 结果 * @param labResultall 结果
* @return 上一次结果 * @return 上一次结果
*/ */
public List<LabResult> getlastresult(LabPat labPat,List<LabResult> labResultall){ public List<LabResult> getlastresult(LabPat labPat, List<LabResult> labResultall) {
Date jyrq=labPat.getJyrq(); Date jyrq = labPat.getJyrq();
String yq=labPat.getYq(); String yq = labPat.getYq();
String ybh=labPat.getYbh(); String ybh = labPat.getYbh();
LastLabPatParam lastLabPatParam=new LastLabPatParam(); LastLabPatParam lastLabPatParam = new LastLabPatParam();
String comparecol = commonUtil.getComOptValue(yq,"COMPARECOL"); String comparecol = commonUtil.getComOptValue(yq, "COMPARECOL");
String brdh=labPat.getBrdh(); String brdh = labPat.getBrdh();
String mzh=labPat.getMzh(); String mzh = labPat.getMzh();
String sfzh=labPat.getSfzh(); String sfzh = labPat.getSfzh();
String brxm=labPat.getBrxm(); String brxm = labPat.getBrxm();
List<LabResult> labResultList=new ArrayList<>(); List<LabResult> labResultList = new ArrayList<>();
switch (comparecol){ switch (comparecol) {
case "住院号": case "住院号":
if("".equals(brdh)||brdh==null){ if ("".equals(brdh) || brdh == null) {
return labResultList; return labResultList;
} }
lastLabPatParam.setBrdh(brdh); lastLabPatParam.setBrdh(brdh);
break; break;
case "卡号": case "卡号":
if("".equals(mzh)||mzh==null){ if ("".equals(mzh) || mzh == null) {
return labResultList; return labResultList;
} }
lastLabPatParam.setMzh(mzh); lastLabPatParam.setMzh(mzh);
break; break;
case "身份证": case "身份证":
if("".equals(sfzh)||sfzh==null){ if ("".equals(sfzh) || sfzh == null) {
return labResultList; return labResultList;
} }
lastLabPatParam.setSfzh(sfzh); lastLabPatParam.setSfzh(sfzh);
break; break;
case "姓名": case "姓名":
if("".equals(brxm)||brxm==null){ if ("".equals(brxm) || brxm == null) {
return labResultList; return labResultList;
} }
lastLabPatParam.setBrxm(brxm); lastLabPatParam.setBrxm(brxm);
break; break;
default: default:
if("".equals(brdh)||brdh==null){ if ("".equals(brdh) || brdh == null) {
return labResultList; return labResultList;
} }
if("".equals(brxm)||brxm==null){ if ("".equals(brxm) || brxm == null) {
return labResultList; return labResultList;
} }
lastLabPatParam.setBrdh(brdh); lastLabPatParam.setBrdh(brdh);
lastLabPatParam.setBrxm(brxm); lastLabPatParam.setBrxm(brxm);
} }
String interval = commonUtil.getComOptValue(yq,"COMPAREDA"); String interval = commonUtil.getComOptValue(yq, "COMPAREDA");
if(interval==null|| interval.isEmpty())interval="60"; if (interval == null || interval.isEmpty()) interval = "60";
int getday=-Integer.parseInt(interval); int getday = -Integer.parseInt(interval);
lastLabPatParam.setEndda(jyrq); lastLabPatParam.setEndda(jyrq);
lastLabPatParam.setStartda(LisUtil.relativeDate(jyrq,getday)); lastLabPatParam.setStartda(LisUtil.relativeDate(jyrq, getday));
String compother= commonUtil.getComOptValue(yq,"COMPOTHERINSTR"); String compother = commonUtil.getComOptValue(yq, "COMPOTHERINSTR");
if(compother!=null&& !compother.isEmpty()) { if (compother != null && !compother.isEmpty()) {
String instrlist = commonUtil.getComOptValue(yq, "COMPOTHERINSTRLIST"); String instrlist = commonUtil.getComOptValue(yq, "COMPOTHERINSTRLIST");
//'CAL800','XS500I','33','40' //'CAL800','XS500I','33','40'
if("".equals(instrlist)||instrlist==null){lastLabPatParam.setYq(yq);} if ("".equals(instrlist) || instrlist == null) {
else { lastLabPatParam.setYq(yq);
instrlist="("+instrlist+",'"+yq+"')"; } else {
instrlist = "(" + instrlist + ",'" + yq + "')";
lastLabPatParam.setInstrlist(instrlist); lastLabPatParam.setInstrlist(instrlist);
} }
} }
List<LabPat> labPatList =commonUtil.getlastLabPat(lastLabPatParam); List<LabPat> labPatList = commonUtil.getlastLabPat(lastLabPatParam);
if(!labPatList.isEmpty()) { if (!labPatList.isEmpty()) {
for(LabPat labPat0:labPatList) { for (LabPat labPat0 : labPatList) {
Date jyrq0 = labPat0.getJyrq(); Date jyrq0 = labPat0.getJyrq();
String yq0 = labPat0.getYq(); String yq0 = labPat0.getYq();
String ybh0 = labPat0.getYbh(); String ybh0 = labPat0.getYbh();
if (!jyrq0.equals(jyrq) ||!yq0.equals(yq) ||!ybh0.equals(ybh)) { if (!jyrq0.equals(jyrq) || !yq0.equals(yq) || !ybh0.equals(ybh)) {
List<LabResult> labResultList0 = commonUtil.getLabResultList(jyrq0, yq0, ybh0); List<LabResult> labResultList0 = commonUtil.getLabResultList(jyrq0, yq0, ybh0);
for(LabResult labResult:labResultList0) { for (LabResult labResult : labResultList0) {
String xmdh=labResult.getXmdh(); String xmdh = labResult.getXmdh();
List<LabResult> labResult0 = labResultall.stream().filter(rlog -> xmdh.equals(rlog.getXmdh())).collect(Collectors.toList()); List<LabResult> labResult0 = labResultall.stream().filter(rlog -> xmdh.equals(rlog.getXmdh())).collect(Collectors.toList());
if(!labResult0.isEmpty()){ if (!labResult0.isEmpty()) {
return labResultList0; return labResultList0;
} }
} }
@ -512,17 +524,19 @@ public class LisWorkServiceImpl implements LisWorkService {
@Override @Override
public List<LabPat> getSampleList(Date jyrq, String yq, Long days) { public List<LabPat> getSampleList(Date jyrq, String yq, Long days) {
if(days>1) { if (days > 1) {
return commonUtil.getSampleListday(yq, days);//new Result("0", "获取样本数据成功!", labPatListday); return commonUtil.getSampleListday(yq, days);//new Result("0", "获取样本数据成功!", labPatListday);
}else { } else {
return commonUtil.getsamplelist(jyrq, yq);//new Result("0", "获取样本数据成功!", labPatListday); return commonUtil.getsamplelist(jyrq, yq);//new Result("0", "获取样本数据成功!", labPatListday);
} }
} }
@Override @Override
public Result getLabPat(Date jyrq, String yq, String ybh) { public Result getLabPat(Date jyrq, String yq, String ybh) {
List<LabPat> labPat = lisWorkMapper.getLabPat(jyrq, yq, ybh); List<LabPat> labPat = lisWorkMapper.getLabPat(jyrq, yq, ybh);
return new Result("0", "获取该样本数据成功!", labPat); return new Result("0", "获取该样本数据成功!", labPat);
} }
@Override @Override
public Result sampleMedInfo(Date jyrq, String yq, String ybh) { public Result sampleMedInfo(Date jyrq, String yq, String ybh) {
LabResult labResult = new LabResult(); LabResult labResult = new LabResult();
@ -535,18 +549,18 @@ public class LisWorkServiceImpl implements LisWorkService {
labResultMed.setYq(yq); labResultMed.setYq(yq);
labResultMed.setYbh(ybh); labResultMed.setYbh(ybh);
List<LabResultMed> labResultMedInfoList = lisWorkMapper.getLabResultMedInfo(labResultMed); List<LabResultMed> labResultMedInfoList = lisWorkMapper.getLabResultMedInfo(labResultMed);
List<Map<String,Object>> queryList = new ArrayList<>(); List<Map<String, Object>> queryList = new ArrayList<>();
Map<String,Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("labResultList",labResultList); map.put("labResultList", labResultList);
map.put("labResultMedInfoList",labResultMedInfoList); map.put("labResultMedInfoList", labResultMedInfoList);
queryList.add(map); queryList.add(map);
return new Result("0","获取微生物数据成功!",queryList); return new Result("0", "获取微生物数据成功!", queryList);
} }
@Override @Override
public Result checkUser(String yhdh, String mm) { public Result checkUser(String yhdh, String mm) {
if(yhdh == null || yhdh.isEmpty()) return new Result("-1","用户名不能为空!"); if (yhdh == null || yhdh.isEmpty()) return new Result("-1", "用户名不能为空!");
if(mm == null || mm.isEmpty()) return new Result("-1","密码不能为空!"); if (mm == null || mm.isEmpty()) return new Result("-1", "密码不能为空!");
SysUser sysUser = lisWorkMapper.getSysUser(yhdh); SysUser sysUser = lisWorkMapper.getSysUser(yhdh);
if (StringUtils.isNull(sysUser)) { if (StringUtils.isNull(sysUser)) {
log.info("登录用户:{} 不存在.", yhdh); log.info("登录用户:{} 不存在.", yhdh);
@ -560,12 +574,34 @@ public class LisWorkServiceImpl implements LisWorkService {
log.info("登录用户:{} 已被停用.", yhdh); log.info("登录用户:{} 已被停用.", yhdh);
throw new ServiceException(MessageUtils.message("user.blocked")); throw new ServiceException(MessageUtils.message("user.blocked"));
} }
boolean matchesflag =SecurityUtils.matchesPassword(mm,sysUser.getPassword()); boolean matchesflag = SecurityUtils.matchesPassword(mm, sysUser.getPassword());
if(matchesflag){ if (matchesflag) {
return new Result("0","登录成功!"); return new Result("0", "登录成功!");
}else{ } else {
return new Result("-1","登录失败,账户密码不正确!"); return new Result("-1", "登录失败,账户密码不正确!");
} }
} }
@Override
public Result emrquery(Date jyrq, String yq, String ybh) {
LabPat labPat=commonUtil.getLabPatOne(jyrq, yq, ybh);
if(labPat==null)return new Result("-1", "当前样本信息为空!");
String brdh=labPat.getBrdh();
String sqh=labPat.getSqh();
String val = brdh + "|" + sqh + "|" ;
return lisWorkUtils.setDayMessage(LisinterfaceNameConstants.DAYMESSAGE_EMR,val);
}
@Override
public Result allpatquery(Date jyrq, String yq, String ybh) {
LabPat labPat=commonUtil.getLabPatOne(jyrq, yq, ybh);
if(labPat==null)return new Result("-1", "当前样本信息为空!");
String brdh=labPat.getBrdh();
String sqh=labPat.getSqh();
String val = brdh + "|" + sqh + "|" ;
return lisWorkUtils.setDayMessage(LisinterfaceNameConstants.DAYMESSAGE_ALLPAT,val);
}
@Override
public Result datalink(Date jyrq, String yq, String ybh) {
return new Result("0", "获取成功!");
}
} }