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