Compare commits
No commits in common. "baf49b98437e1ca1184a246921e482b807e064ab" and "1a1b5bf21715400ba5ed242dd46c4edb1858949c" have entirely different histories.
baf49b9843
...
1a1b5bf217
@ -42,5 +42,4 @@ public class LabResult extends BaseEntity {
|
||||
private String xmmc;
|
||||
private String ygzd;
|
||||
private String ygzq;
|
||||
private Integer xsws;
|
||||
}
|
||||
|
||||
@ -1,19 +0,0 @@
|
||||
package com.czlis.common.core.domain.entity.lis;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class XmCalc {
|
||||
|
||||
private String yq;
|
||||
private String jsxm;
|
||||
private String xmdh;
|
||||
private String jsgs;
|
||||
private String bz;
|
||||
|
||||
|
||||
}
|
||||
@ -1,12 +0,0 @@
|
||||
package com.czlis.interfaceCommon.mapper;
|
||||
|
||||
import com.czlis.common.core.domain.entity.lis.XmCalc;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface XmCalcMapper {
|
||||
List<XmCalc> getXmCalcList(String yq);
|
||||
List<XmCalc> getXmCalc(@Param("yq") String yq,@Param("jsxm") String jsxm);
|
||||
List<XmCalc> getXmCalcbyxmdh(@Param("yq")String yq,@Param("xmdh") String xmdh);
|
||||
}
|
||||
@ -5,7 +5,6 @@ import com.czlis.common.core.domain.entity.lis.*;
|
||||
import com.czlis.interfaceCommon.mapper.CheckResultMapper;
|
||||
import com.czlis.interfaceCommon.mapper.LabCheckrulesMapper;
|
||||
import com.czlis.interfaceCommon.mapper.XmInfoMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
@ -33,12 +32,10 @@ public class CheckResultUtils {
|
||||
Date jyrq = labPat.getJyrq();
|
||||
String ybh = labPat.getYbh();
|
||||
List<XmInfo> xmInfoList0 = commonUtil.getXmInfoList(yq);
|
||||
if(xmInfoList0.size()==0) return errmsg;
|
||||
List<XmInfo> xmInfoList = xmInfoList0.stream().filter(xmInfo -> xmInfo.getXjx()!=null||xmInfo.getSjx()!=null||xmInfo.getJgjg()!=null||xmInfo.getJgz()!=null||xmInfo.getJgbz()!=null).collect(Collectors.toList());
|
||||
if(xmInfoList.size()>0) {
|
||||
for (LabResult labResult : labResultList) {
|
||||
String xmdh = labResult.getXmdh();
|
||||
|
||||
List<XmInfo> collect = xmInfoList.stream().filter(xmInfo -> xmInfo.getXmdh().equals(xmdh)).collect(Collectors.toList());
|
||||
if (collect.size() > 0) {
|
||||
XmInfo xmInfo = collect.get(0);
|
||||
@ -76,13 +73,12 @@ public class CheckResultUtils {
|
||||
lde_low = csjgnum - jgz;
|
||||
}
|
||||
List<LabResult> chkval = checkResultMapper.getChkvaList(brdh, ldt_startda, jyrq, yq, xmdh);
|
||||
if (chkval != null && chkval.size() > 0) {
|
||||
List<LabResult> collect0 = chkval.stream().filter(LabResult0 -> LisUtil.isNumber(LabResult0.getCsjg())).collect(Collectors.toList());
|
||||
if (collect0.size() > 0) {
|
||||
Double finalLde_up = lde_up;
|
||||
Double finalLde_low = lde_low;
|
||||
List<LabResult> collect1 = collect0.stream().filter(LabResult1 -> Double.parseDouble(LabResult1.getCsjg()) > finalLde_up && Double.parseDouble(LabResult1.getCsjg()) < finalLde_low).collect(Collectors.toList());
|
||||
if (collect1.size() > 0) {
|
||||
if (collect0.size() > 0) {
|
||||
errmsg = errmsg + LisUtil.LINE_SEPARATOR + xmdh + " 结果 (" + labResult.getCsjg() + ") 和 " +
|
||||
DateFormatUtils.format(collect1.get(0).getJyrq(), "yyyy-MM-dd") + "日" +
|
||||
collect1.get(0).getYbh() + " 号标本的结果 (" + collect1.get(0).getCsjg() + ") 相比超标";
|
||||
@ -91,14 +87,12 @@ public class CheckResultUtils {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
List<LabChk> labChkList = checkResultMapper.getLabChkList(yq);
|
||||
if(labChkList.size()==0) return errmsg;
|
||||
for (LabChk labChk : labChkList) {
|
||||
String jsgs = labChk.getHdnr();
|
||||
boolean setjgsg = true;
|
||||
@ -183,14 +177,14 @@ public class CheckResultUtils {
|
||||
String errmsg = checkcondition(labPat, labResultList, checkrules, ruledisplay);
|
||||
if (!"".equals(errmsg)) {
|
||||
if ("0".equals(checktype)) {
|
||||
errmsg = errmsg+ LisUtil.LINE_SEPARATOR + "你是否要强行通过?" ;
|
||||
errmsg = "审核规则触发,未通过审核!,你是否要强行通过?" + ruledisplay + LisUtil.LINE_SEPARATOR + "审核规则触发,未通过审核!,你是否要强行通过?" + LisUtil.LINE_SEPARATOR + errmsg;
|
||||
params.put("code", "5");
|
||||
params.put("msg", errmsg);
|
||||
int ruleid0 = labCheckrules.getRuleid();
|
||||
params.put("xh", i+1);
|
||||
return params;
|
||||
} else if ("3".equals(checktype)) {
|
||||
errmsg = errmsg + LisUtil.LINE_SEPARATOR + "不允许审核!";
|
||||
errmsg = "审核规则触发,未通过审核!" + LisUtil.LINE_SEPARATOR + "设置的组合审核条件:" + errmsg + LisUtil.LINE_SEPARATOR + "审核规则触发,未通过审核!,不允许审核!";
|
||||
params.put("code", "1");
|
||||
params.put("msg", errmsg);
|
||||
params.put("xh", i+1);
|
||||
@ -287,7 +281,7 @@ public class CheckResultUtils {
|
||||
errmsg.replace("[" + itemcode + "]", csjg);
|
||||
|
||||
}
|
||||
List<LabResult> labResultList0 = commonUtil.getLabResultWithSql(labPat.getJyrq(), labPat.getYq(), labPat.getYbh(), errmsg);
|
||||
List<LabResult> labResultList0 = commonUtil.labResultMapper.getLabResultWithSql(labPat.getJyrq(), labPat.getYq(), labPat.getYbh(), errmsg);
|
||||
if (labResultList0.size() > 0) flag = true;
|
||||
}
|
||||
if (flag = true) errmsg = "审核条件: " + ruledisplay + " 规则触发,未通过审核!";
|
||||
|
||||
@ -55,9 +55,6 @@ public class CommonUtil {
|
||||
ComLogMapper comLogMapper;
|
||||
@Autowired
|
||||
LabRefusedMapper labRefusedMapper;
|
||||
@Autowired
|
||||
XmCalcMapper xmCalcMapper;
|
||||
|
||||
//====检验主表操作方法集合===
|
||||
public LabPat getLabPatOne(Date jyrq, String yq, String ybh) {
|
||||
return labPatMapper.getLabPatOne(jyrq, yq, ybh);
|
||||
@ -114,11 +111,9 @@ public class CommonUtil {
|
||||
public List<LabReqsteplog> getLabReqsteplog(String sqh) {
|
||||
return labReqsteplogMapper.getLabReqsteplog(sqh);
|
||||
}
|
||||
|
||||
public List<LabRefused> getLabRefusedList(LabRefused labRefused){
|
||||
return labRefusedMapper.getLabRefusedList(labRefused);
|
||||
}
|
||||
|
||||
public int insertLabRefused(LabRefused labRefused){
|
||||
return labRefusedMapper.insertLabRefused(labRefused);
|
||||
}
|
||||
@ -153,10 +148,6 @@ public class CommonUtil {
|
||||
return labResultMapper.delNullLabResult(jyrq, yq, ybh);
|
||||
}
|
||||
|
||||
public List<LabResult> getLabResultWithSql(Date jyrq, String yq, String ybh, String errmsg) {
|
||||
return labResultMapper.getLabResultWithSql(jyrq, yq, ybh, errmsg);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int updateLabResult(LabResult labResult) {
|
||||
return labResultMapper.updateLabResult(labResult);
|
||||
@ -171,7 +162,6 @@ public class CommonUtil {
|
||||
return xmInfoMapper.getXmInfo(yq, xmdh);
|
||||
}
|
||||
|
||||
|
||||
public List<XmRef> getXmRefList(String yq) {
|
||||
return xmRefMapper.getXmRefList(yq);
|
||||
}
|
||||
@ -183,7 +173,6 @@ public class CommonUtil {
|
||||
public XmRef getXmRefValue(Map<String, Object> map) {
|
||||
return xmRefMapper.getXmRefValue(map);
|
||||
}
|
||||
|
||||
public XmRef getXmRefValue(String yq,String xmdh,String bbtype,String sex,Double age,String zd,String slzq) {
|
||||
return xmRefMapper.getXmRefValue(yq, xmdh, bbtype, sex, age, zd, slzq);
|
||||
}
|
||||
@ -195,17 +184,7 @@ public class CommonUtil {
|
||||
public List<XmAlarmdetail> getXmAlarmdetail(String yq, String xmdh) {
|
||||
return xmAlarmdetailMapper.getXmAlarmdetail(yq, xmdh);
|
||||
}
|
||||
|
||||
public List<XmAlarmdetail> getXmAlarmdetailList(String yq) {
|
||||
return xmAlarmdetailMapper.getXmAlarmdetailList(yq);
|
||||
}
|
||||
|
||||
public List<XmCalc> getXmCalcList(String yq) {
|
||||
return xmCalcMapper.getXmCalcList(yq);
|
||||
}
|
||||
public Integer insertComLog(ComLog comLog) {
|
||||
return comLogMapper.insertComLog(comLog);
|
||||
}
|
||||
public Integer insertComLog(ComLog comLog) {return comLogMapper.insertComLog(comLog);}
|
||||
|
||||
|
||||
public String getYqmc(String yq) {
|
||||
@ -272,11 +251,6 @@ public class CommonUtil {
|
||||
List<ComDict> collect = comDictList.stream().filter(comDict -> comDict.getZddh().equals(zddh)).collect(Collectors.toList());
|
||||
if (collect.size() > 0) {
|
||||
return collect.get(0).getZdmc();
|
||||
}else{
|
||||
List<ComDict> collect0 = comDictList.stream().filter(comDict -> comDict.getZdmc().equals(zddh)).collect(Collectors.toList());
|
||||
if (collect0.size() > 0) {
|
||||
return collect0.get(0).getZdmc();
|
||||
}
|
||||
}
|
||||
}
|
||||
//如果redis当中没有查到数据,则先在设置redis值,
|
||||
@ -289,12 +263,7 @@ public class CommonUtil {
|
||||
if (comDictList != null) {
|
||||
List<ComDict> collect = comDictList.stream().filter(comDict -> comDict.getZdmc().equals(zdmc)).collect(Collectors.toList());
|
||||
if (collect.size() > 0) {
|
||||
return collect.get(0).getZddh();
|
||||
}else{
|
||||
List<ComDict> collect0 = comDictList.stream().filter(comDict -> comDict.getZddh().equals(zdmc)).collect(Collectors.toList());
|
||||
if (collect0.size() > 0) {
|
||||
return collect0.get(0).getZddh();
|
||||
}
|
||||
return collect.get(0).getZdmc();
|
||||
}
|
||||
}
|
||||
//如果redis当中没有查到数据,则先在设置redis值,
|
||||
@ -332,14 +301,6 @@ public class CommonUtil {
|
||||
if (comOpt1 != null) {
|
||||
ComOptionUtils.setOptCache(yq, xxdh, comOpt1);
|
||||
return comOpt1.getXxqz();
|
||||
}else{
|
||||
ComOpt comOpt2=new ComOpt();
|
||||
comOpt2.setBz("");
|
||||
comOpt2.setXxdh(xxdh);
|
||||
comOpt2.setYq(yq);
|
||||
comOpt2.setXxqz("");
|
||||
comOpt2.setXxlb("");
|
||||
ComOptionUtils.setOptCache(yq, xxdh, comOpt2);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
package com.czlis.interfaceCommon.utils;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
@ -151,39 +149,57 @@ public class LisUtil {
|
||||
return input;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
保留指定小数位数(四舍五入)
|
||||
支持比较符号 (<=、>=、<、>) 和负号 (-) 同时存在的情况
|
||||
@param input 输入字符串,如 "123.1234"、">123.252"、"<=123.252"、"-45.67"、">=-89.01"
|
||||
@param decimalPlaces 要保留的小数位数,需为非负整数
|
||||
@return 格式化后的字符串,无法处理时返回原值
|
||||
* 保留指定小数位数
|
||||
* 支持比较符号(<=、>=、<、>)和负号(-)同时存在的情况
|
||||
* @param input 输入字符串,如"123.1234"、">123.252"、"<=123.252"、"-45.67"、">=-89.01"
|
||||
* @param decimalPlaces 要保留的小数位数,需为非负整数
|
||||
* @return 格式化后的字符串,无法处理时返回原值
|
||||
*/
|
||||
public static String round(String input, int decimalPlaces) {
|
||||
// 处理空输入或无效小数位数
|
||||
if (input == null || input.trim().isEmpty() || decimalPlaces < 0) {
|
||||
return input;
|
||||
}
|
||||
|
||||
// 定义比较运算符前缀(按长度排序,确保正确识别)
|
||||
String[] comparisonPrefixes = {"<=", ">=", "<", ">"};
|
||||
String comparisonPrefix = "";
|
||||
String remainingPart = input.trim (); // 去除首尾空格
|
||||
String remainingPart = input;
|
||||
|
||||
// 提取比较运算符前缀
|
||||
for (String prefix : comparisonPrefixes) {
|
||||
if (remainingPart.startsWith(prefix)) {
|
||||
comparisonPrefix = prefix;
|
||||
remainingPart = remainingPart.substring (prefix.length ()).trim (); // 去除前缀后的空格
|
||||
remainingPart = remainingPart.substring(prefix.length());
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 尝试解析剩余部分为数字(使用 BigDecimal 避免精度问题)
|
||||
|
||||
// 尝试解析剩余部分为数字
|
||||
try {
|
||||
// 解析为 BigDecimal(支持正负号和小数)
|
||||
BigDecimal number = new BigDecimal (remainingPart);
|
||||
// 设置四舍五入模式并保留指定小数位数
|
||||
BigDecimal rounded = number.setScale (decimalPlaces, RoundingMode.HALF_UP);
|
||||
// 拼接比较前缀和格式化后的数字
|
||||
return comparisonPrefix + rounded.toPlainString (); //toPlainString 避免科学计数法
|
||||
// 解析数字(包含可能的负号)
|
||||
double number = Double.parseDouble(remainingPart);
|
||||
|
||||
// 创建格式化模式(整数部分至少1位,小数部分固定位数)
|
||||
StringBuilder formatPattern = new StringBuilder();
|
||||
formatPattern.append("0");
|
||||
if (decimalPlaces > 0) {
|
||||
formatPattern.append(".");
|
||||
// 循环添加指定数量的0
|
||||
for (int i = 0; i < decimalPlaces; i++) {
|
||||
formatPattern.append("0");
|
||||
}
|
||||
}
|
||||
|
||||
// 格式化数字并拼接比较前缀
|
||||
String formattedNumber = String.format(
|
||||
"%s%s",
|
||||
comparisonPrefix,
|
||||
String.format(formatPattern.toString(), number)
|
||||
);
|
||||
|
||||
return formattedNumber;
|
||||
} catch (NumberFormatException e) {
|
||||
// 数字部分无法解析时返回原值
|
||||
return input;
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
select
|
||||
lab_result.jyrq, lab_result.yq, lab_result.ybh, lab_result.xmdh, wyh, csjg, od, cutoff, lab_result.jgbz, bz1, bz2, yhdh, instrid, operdt,
|
||||
operna, refs, flag, lab_result.dw, result_flag, alarm_flag, redo_flag, sqxmdh, redo_text,xm_info.xmmc,xm_info.ygzq,xm_info.ygzd
|
||||
,textresult,xm_info.xsws
|
||||
,textresult
|
||||
from lab_result join xm_info on xm_info.yq=lab_result.yq and xm_info.xmdh=lab_result.xmdh
|
||||
<where>
|
||||
<if test="jyrq != null ">
|
||||
@ -41,7 +41,7 @@
|
||||
select
|
||||
lab_result.jyrq, lab_result.yq, lab_result.ybh, lab_result.xmdh, wyh, csjg, od, cutoff, lab_result.jgbz, bz1, bz2, yhdh, instrid, operdt,
|
||||
operna, refs, flag, lab_result.dw, result_flag, alarm_flag, redo_flag, sqxmdh, redo_text,xm_info.xmmc,xm_info.ygzq,xm_info.ygzd
|
||||
,textresult,xm_info.xsws
|
||||
,textresult
|
||||
from lab_result join xm_info on xm_info.yq=lab_result.yq and xm_info.xmdh=lab_result.xmdh
|
||||
<where>
|
||||
<if test="jyrq != null ">
|
||||
|
||||
@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.czlis.interfaceCommon.mapper.XmCalcMapper">
|
||||
|
||||
<select id="getXmCalcList" resultType="com.czlis.common.core.domain.entity.lis.XmCalc">
|
||||
SELECT * FROM xm_calc WHERE yq=#{yq}
|
||||
</select>
|
||||
<select id="getXmCalc" resultType="com.czlis.common.core.domain.entity.lis.XmCalc">
|
||||
SELECT * FROM xm_calc WHERE yq=#{yq} and jsxm=#{jsxm}
|
||||
</select>
|
||||
<select id="getXmCalcbyxmdh" resultType="com.czlis.common.core.domain.entity.lis.XmCalc">
|
||||
SELECT * FROM xm_calc WHERE yq=#{yq}
|
||||
and jsxm=(select jsxm from xm_calc a where a.yq=#{yq} and a.xmdh=#{xmdh})
|
||||
</select>
|
||||
</mapper>
|
||||
@ -23,7 +23,6 @@ import com.czlis.liswork.mapper.dict.LabInstrvsreqclassMapper;
|
||||
import com.czlis.liswork.pojo.DTO.ResultCalcDTO;
|
||||
import com.czlis.liswork.service.LisWorkOperService;
|
||||
|
||||
import com.czlis.liswork.utils.LisWorkUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import lombok.val;
|
||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||
@ -52,8 +51,6 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
LabReqdetailMapper labReqdetailMapper;
|
||||
@Autowired
|
||||
CheckResultUtils checkResultUtils;
|
||||
@Autowired
|
||||
private LisWorkUtil lisWorkUtil;
|
||||
|
||||
@Override
|
||||
public Result newPatInfo(Date jyrq, String ybh, String sqh, String yq, Long userId) {
|
||||
@ -218,47 +215,33 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
//入参通过GET推送时使用ServletUtils.getParameterToInt获取
|
||||
//入参通过POSTJSON时使用JsonParamUtils.getParameterToInt获取
|
||||
int problemId = ServletUtils.getParameterToInt("problemId", 0);
|
||||
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
|
||||
labPat.setHdys(hdys);
|
||||
List<LabResult> labResultList = commonUtil.getLabResultList(jyrq, yq, ybh);
|
||||
if(problemId<3) {
|
||||
|
||||
//1,审核权限校验
|
||||
if (!commonUtil.getUserPower(yq, hdys, 20)) return new Result("-1", "当前核对者无权对本仪器报告审核!");
|
||||
//2:数据合法性校验
|
||||
Result result0 = beforeconfirm(labPat, labResultList, 2, problemId);
|
||||
if (!"0".equals(result0.getCode())) return result0;
|
||||
}
|
||||
if(problemId<3) problemId = 3;
|
||||
if(problemId<4) {
|
||||
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
|
||||
labPat.setHdys(hdys);
|
||||
Result result = beforeconfirm(labPat, 2, problemId);
|
||||
if (!"0".equals(result.getCode())) return result;
|
||||
//3:数据完整保存
|
||||
labResultList = saveallresult(labPat, labResultList);
|
||||
boolean wjz = getAlarmFlag(labResultList);
|
||||
int wjz = saveallresult(labPat);
|
||||
//同步主表危急值标识
|
||||
String alarmflag = labPat.getAlarmflag();
|
||||
if (("1".equals(alarmflag) && !wjz)) {
|
||||
if (("1".equals(alarmflag) && wjz != 1)) {
|
||||
labPat.setAlarmflag("1");
|
||||
commonUtil.updateLabPat(labPat);
|
||||
} else if (("".equals(alarmflag) || alarmflag == null) && wjz) {
|
||||
} else if (("".equals(alarmflag) || alarmflag == null) && wjz == 1) {
|
||||
labPat.setAlarmflag("");
|
||||
commonUtil.updateLabPat(labPat);
|
||||
}
|
||||
}
|
||||
if(problemId<4) problemId = 4;
|
||||
if(problemId<5) {
|
||||
//医学审核条件判断
|
||||
Result result = chksample(labPat, labResultList, problemId);
|
||||
if (!"0".equals(result.getCode())) return result;
|
||||
}
|
||||
if(problemId<5) problemId = 5;
|
||||
if(problemId<99) {
|
||||
//高级医学审核条件判断
|
||||
Result result = chksamplenew(labPat, labResultList, problemId);
|
||||
if (problemId < 3) problemId = 3;
|
||||
result = chksample(labPat, problemId);
|
||||
if ("99".equals(result.getCode())) {
|
||||
labPat.setBz(result.getMsg());
|
||||
result.setCode("0");
|
||||
}
|
||||
if (!"0".equals(result.getCode())) return result;
|
||||
}
|
||||
if (problemId < 99) problemId = 99;
|
||||
//4:CA请求业务的处理
|
||||
//Result result=addCA(jyrq, yq, ybh, hdys);
|
||||
@ -280,12 +263,11 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
public Result beforeconfirm(Date jyrq, String yq, String ybh) {
|
||||
int problemId = ServletUtils.getParameterToInt("problemId", 0);
|
||||
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
|
||||
List<LabResult> labResultList = commonUtil.getLabResultList(jyrq, yq, ybh);
|
||||
return beforeconfirm(labPat, labResultList,2, problemId);
|
||||
return beforeconfirm(labPat, 2, problemId);
|
||||
}
|
||||
|
||||
//内部使用
|
||||
private Result beforeconfirm(LabPat labPat,List<LabResult> labResultList, Integer checktype, Integer problemId) {
|
||||
private Result beforeconfirm(LabPat labPat, Integer checktype, Integer problemId) {
|
||||
Date jyrq = labPat.getJyrq();
|
||||
String yq = labPat.getYq();
|
||||
String ybh = labPat.getYbh();
|
||||
@ -328,6 +310,7 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
if ("1".equals(brly) || "3".equals(brly)) return new Result("-1", "门诊住院的病历号不能为空,禁止审核!");
|
||||
}
|
||||
String yqdl = commonUtil.getYqdl(yq);
|
||||
List<LabResult> labResultList = commonUtil.getLabResultList(jyrq, yq, ybh);
|
||||
if (labResultList == null || labResultList.size() == 0) return new Result("-1", "结果为空禁止审核!");
|
||||
for (LabResult labResult : labResultList) {
|
||||
String csjg = labResult.getCsjg();
|
||||
@ -429,34 +412,27 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
|
||||
/**
|
||||
* 医学审核条件判断
|
||||
*
|
||||
* @param labPat
|
||||
* @param problemId
|
||||
* @return
|
||||
*/
|
||||
private Result chksample(LabPat labPat, List<LabResult> labResultList,Integer problemId) {
|
||||
private Result chksample(LabPat labPat, Integer problemId) {
|
||||
List<LabResult> labResultList = commonUtil.getLabResultList(labPat.getJyrq(), labPat.getYq(), labPat.getYbh());
|
||||
//医学审核条件判断
|
||||
if (problemId < 5) {
|
||||
if (problemId < 4) {
|
||||
String checkvalue = checkResultUtils.chksample(labPat, labResultList);
|
||||
if (checkvalue != null && !"".equals(checkvalue)) {
|
||||
return new Result("5", checkvalue, 5);
|
||||
return new Result("5", checkvalue, 4);
|
||||
}
|
||||
}
|
||||
return new Result("0", "保存成功!");
|
||||
}
|
||||
/**
|
||||
* 高级医学审核条件判断
|
||||
* @param labPat
|
||||
* @param problemId
|
||||
* @return
|
||||
*/
|
||||
private Result chksamplenew(LabPat labPat, List<LabResult> labResultList,Integer problemId) {
|
||||
//医学审核条件判断
|
||||
|
||||
Boolean setbz = false;
|
||||
String bz = labPat.getBz();
|
||||
//医学审核条件判断(新规则),预留99个递归ID
|
||||
if (problemId < 5) problemId = 5;
|
||||
if (problemId < 4) problemId = 4;
|
||||
if (problemId < 99) {
|
||||
int xh = problemId - 5;
|
||||
int xh = problemId - 4;
|
||||
Map<String, Object> chksamplenewvalue = checkResultUtils.chksamplenew(labPat, labResultList, xh);
|
||||
String chkCode = (String) chksamplenewvalue.get("code");
|
||||
String chkMsg = (String) chksamplenewvalue.get("msg");
|
||||
@ -464,7 +440,7 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
labPat.setBz(bz);
|
||||
xh = (Integer) chksamplenewvalue.get("xh");
|
||||
setbz = (Boolean) chksamplenewvalue.get("setbz");
|
||||
problemId = 5 + xh;
|
||||
problemId = 4 + xh;
|
||||
if ("5".equals(chkCode)) {
|
||||
if (setbz) {
|
||||
commonUtil.updateLabPat(labPat);
|
||||
@ -479,6 +455,7 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
}
|
||||
return new Result("0", "保存成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核后步骤,在审核过程中,必须完成审核前校验通过,结果计算值填充,参考值结果标志危急值标志填写完成,最后使用此方法修改状态
|
||||
*
|
||||
@ -501,12 +478,11 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
String hdys = labPat.getHdys();
|
||||
String yqdl = commonUtil.getYqdl(yq);
|
||||
String itemvs = commonUtil.getHISOPT("itemvs");
|
||||
Result ret=new Result("0", "保存成功!");
|
||||
if ("1".equals(itemvs)) {
|
||||
if (!"细菌仪".equals(yqdl)) {
|
||||
String nullcount = lisWorkOperMapper.checkresultnosqxmdh(jyrq, yq, ybh);
|
||||
if (!"".equals(nullcount) && nullcount != null)
|
||||
ret=new Result("3", "警告!"+LisUtil.LINE_SEPARATOR +" 报告项目未对应申请项目,请进(收费项目报告项目对照)菜单维护对照:"+LisUtil.LINE_SEPARATOR + nullcount);
|
||||
return new Result("-1", "报告项目未对应申请项目,请进(收费项目报告项目对照)菜单维护对照:\r\n" + nullcount);
|
||||
}
|
||||
}
|
||||
|
||||
@ -550,7 +526,7 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
if (problemId < 100) {
|
||||
return new Result(result.getCode(), result.getMsg(), 100);
|
||||
}
|
||||
return ret;
|
||||
return new Result("0", "保存成功!");
|
||||
}
|
||||
if (!result.getCode().equals("0")) return result;
|
||||
//最后完成
|
||||
@ -562,7 +538,7 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
shcs = shcs + 1;
|
||||
labPat.setShcs(shcs);
|
||||
commonUtil.updateLabPat(labPat);
|
||||
return ret;
|
||||
return new Result("0", "保存成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -683,14 +659,13 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
|
||||
String finish = labPat.getFinish();
|
||||
if (!"细菌仪".equals(yqdl) && finish != null && finsh == 1) labPat.setFinish("1");
|
||||
labResultList = saveallresult(labPat,labResultList);
|
||||
boolean wjz=getAlarmFlag(labResultList);
|
||||
int wjz = saveallresult(labPat);
|
||||
//同步主表危急值标识
|
||||
String alarmflag = labPat.getAlarmflag();
|
||||
if (("1".equals(alarmflag) && !wjz )) {
|
||||
if (("1".equals(alarmflag) && wjz != 1)) {
|
||||
labPat.setAlarmflag("1");
|
||||
commonUtil.updateLabPat(labPat);
|
||||
} else if (("".equals(alarmflag) || alarmflag == null) && wjz) {
|
||||
} else if (("".equals(alarmflag) || alarmflag == null) && wjz == 1) {
|
||||
labPat.setAlarmflag("");
|
||||
commonUtil.updateLabPat(labPat);
|
||||
}
|
||||
@ -698,7 +673,7 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
}
|
||||
|
||||
//内部使用
|
||||
private List<LabResult> saveallresult(LabPat labPat,List<LabResult> labResultList) {
|
||||
private int saveallresult(LabPat labPat) {
|
||||
Date jyrq = labPat.getJyrq();
|
||||
String yq = labPat.getYq();
|
||||
String ybh = labPat.getYbh();
|
||||
@ -708,13 +683,19 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
commonUtil.delNullLabResult(jyrq, yq, ybh);
|
||||
}
|
||||
//计算项目更新
|
||||
labResultList=calcsample(labPat,labResultList);
|
||||
calcsample(labPat);
|
||||
//保存最新参考值结果标志
|
||||
int wjz = saverefs(labPat);
|
||||
String alarmflag = labPat.getAlarmflag();
|
||||
if (("1".equals(alarmflag) && wjz != 1)) {
|
||||
labPat.setAlarmflag("1");
|
||||
} else if (("".equals(alarmflag) || alarmflag == null) && wjz == 1) {
|
||||
labPat.setAlarmflag("");
|
||||
}
|
||||
//补写结果表申请单项目编号
|
||||
String sqh = labPat.getSqh();
|
||||
if (sqh != null && !"".equals(sqh)) setItemSqxmdh(jyrq, yq, ybh, sqh);
|
||||
//保存最新参考值结果标志
|
||||
labResultList = saverefs(labPat);
|
||||
return labResultList;
|
||||
return wjz;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -756,92 +737,71 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
@Override
|
||||
public Result calcsample(Date jyrq, String yq, String ybh) {
|
||||
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
|
||||
List<LabResult> labResultList = commonUtil.getLabResultList(jyrq, yq, ybh);
|
||||
calcsample(labPat,labResultList);
|
||||
calcsample(labPat);
|
||||
return new Result("0", "保存成功!");
|
||||
}
|
||||
private List<LabResult> calcsample(LabPat labPat,List<LabResult> labResultList) {
|
||||
|
||||
//内部使用
|
||||
private void calcsample(LabPat labPat) {
|
||||
Date jyrq = labPat.getJyrq();
|
||||
String yq = labPat.getYq();
|
||||
String ybh = labPat.getYbh();
|
||||
String jsxmold = "";
|
||||
List<XmCalc> xmCalcList =commonUtil.getXmCalcList(yq);
|
||||
for (XmCalc xmCalc : xmCalcList) {
|
||||
String jsxm = xmCalc.getJsxm();
|
||||
if (!jsxmold.equals(jsxm)) {
|
||||
jsxmold = jsxm;
|
||||
String jsgs = xmCalc.getJsgs();
|
||||
String xmdh= xmCalc.getXmdh();
|
||||
List<ResultCalcDTO> resultCalcDTO = lisWorkOperMapper.getResultCalc(jyrq, yq, ybh);
|
||||
String xmdhold = "";
|
||||
for (ResultCalcDTO resultCalc : resultCalcDTO) {
|
||||
String jsgs = resultCalc.getJsgs();
|
||||
String xmdh = resultCalc.getJsxm();
|
||||
if (!xmdhold.equals(xmdh)) {
|
||||
xmdhold = xmdh;
|
||||
boolean setjgsg = true;
|
||||
boolean lb_jsx= false;
|
||||
Map<String, String> variables = new HashMap<>();
|
||||
String[] parameters = CalcUtils.getParameters(jsgs);
|
||||
for (int i = 0; i < parameters.length; i++) {
|
||||
String itemcode = parameters[i];
|
||||
if ("SEX".equals(itemcode)) {
|
||||
String sex = labPat.getBrxb().trim();
|
||||
if ("男".equals(sex)) sex = "1";
|
||||
if ("女".equals(sex)) sex = "2";
|
||||
// if ("1".equals(sex)) sex = "男";
|
||||
// if ("2".equals(sex)) sex = "女";
|
||||
variables.put("SEX", sex);
|
||||
lb_jsx=true;
|
||||
} else if ("AGE".equals(itemcode)) {
|
||||
double age = AgeUtils.getDecimalAge(AgeUtils.getBirthDateByAge(labPat.getNl(), labPat.getNldw()));
|
||||
variables.put("AGE", String.valueOf(age));
|
||||
lb_jsx=true;
|
||||
} else {
|
||||
List<LabResult> collect = labResultList.stream().filter(result -> result.getXmdh().equals(itemcode)).collect(Collectors.toList());
|
||||
List<ResultCalcDTO> collect = resultCalcDTO.stream().filter(result -> result.getXmdh().equals(itemcode)).collect(Collectors.toList());
|
||||
if (collect.size() > 0) {
|
||||
variables.put(itemcode, collect.get(0).getCsjg());
|
||||
} else {
|
||||
setjgsg = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (setjgsg) {
|
||||
String result = CalcUtils.getValueFromCalc(jsgs, variables);
|
||||
if("0".equals(result) && lb_jsx)result=null;
|
||||
if (result != null && !result.trim().isEmpty()) {
|
||||
if(LisUtil.isNumber(result)) {
|
||||
Integer xsws =lisWorkOperMapper.getxsws(yq,xmdh);
|
||||
if (xsws >= 0) result = LisUtil.round(result, xsws);
|
||||
}
|
||||
//插入结果值
|
||||
Optional<LabResult> collect0 = labResultList.stream().filter(labR -> labR.getXmdh().equals(jsxm)).findFirst();
|
||||
if (collect0.isPresent()) {
|
||||
LabResult labResult =collect0.get();
|
||||
if(LisUtil.isNumber(result)) {
|
||||
Integer xsws =labResult.getXsws();
|
||||
if (xsws >= 0) result = LisUtil.round(result, xsws);
|
||||
}
|
||||
// log.info("result:{},getCsjg:{}",result,labResult.getCsjg());
|
||||
if(!result.equals(labResult.getCsjg())) {
|
||||
labResult.setCsjg(result);
|
||||
String finalResult = result;
|
||||
collect0.ifPresent(labR -> labR.setCsjg(finalResult));
|
||||
commonUtil.updateLabResult(labResult);
|
||||
}
|
||||
}else{
|
||||
XmInfo xmInfo=commonUtil.getXmInfo(yq,xmdh);
|
||||
if(LisUtil.isNumber(result)) {
|
||||
Integer xsws =xmInfo.getXsws();
|
||||
if (xsws >= 0) result = LisUtil.round(result, xsws);
|
||||
}
|
||||
LabResult labResult = new LabResult();
|
||||
LabResult labResult = commonUtil.getLabResult(jyrq, yq, ybh, xmdh);
|
||||
if (labResult == null) {
|
||||
labResult = new LabResult();
|
||||
labResult.setJyrq(jyrq);
|
||||
labResult.setYq(yq);
|
||||
labResult.setYbh(ybh);
|
||||
labResult.setXmdh(jsxm);
|
||||
labResult.setXmdh(xmdh);
|
||||
labResult.setCsjg(result);
|
||||
commonUtil.insertLabResult(labResult);
|
||||
labResult.setXsws(xmInfo.getXsws());
|
||||
labResult.setYgzd(xmInfo.getYgzd());
|
||||
labResult.setYgzq(xmInfo.getYgzq());
|
||||
labResult.setXmmc(xmInfo.getXmmc());
|
||||
labResultList.set(labResultList.size(), labResult);
|
||||
} else {
|
||||
labResult.setCsjg(result);
|
||||
commonUtil.updateLabResult(labResult);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return labResultList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算项目参考值结果异常标志
|
||||
*
|
||||
@ -852,14 +812,13 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
@Override
|
||||
public Result saverefs(Date jyrq, String yq, String ybh) {
|
||||
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
|
||||
List<LabResult> labResultList = saverefs(labPat);
|
||||
boolean wjz=getAlarmFlag(labResultList);
|
||||
int wjz = saverefs(labPat);
|
||||
//同步主表危急值标识
|
||||
String alarmflag = labPat.getAlarmflag();
|
||||
if (("1".equals(alarmflag) && !wjz )) {
|
||||
if (("1".equals(alarmflag) && wjz != 1)) {
|
||||
labPat.setAlarmflag("1");
|
||||
commonUtil.updateLabPat(labPat);
|
||||
} else if (("".equals(alarmflag) || alarmflag == null) && wjz) {
|
||||
} else if (("".equals(alarmflag) || alarmflag == null) && wjz == 1) {
|
||||
labPat.setAlarmflag("");
|
||||
commonUtil.updateLabPat(labPat);
|
||||
}
|
||||
@ -873,26 +832,12 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
* @param labPat
|
||||
* @return 返回值0正常, 1有危急值明细存在
|
||||
*/
|
||||
private List<LabResult> saverefs(LabPat labPat) {
|
||||
private int saverefs(LabPat labPat) {
|
||||
Date jyrq = labPat.getJyrq();
|
||||
String yq = labPat.getYq();
|
||||
String ybh = labPat.getYbh();
|
||||
String yqdl = commonUtil.getYqdl(yq);
|
||||
boolean lb_setbj = true, lb_wjz = false,nowjz=false;
|
||||
//危急值标识去除原则 nowjz = true 不能算做危急值
|
||||
String brxm = labPat.getBrxm();
|
||||
if (brxm != null) {
|
||||
if (brxm.contains("质控") || brxm.contains("复查") || brxm.contains("QC") || brxm.contains("qc") || brxm.contains("软化水") || brxm.contains("锅炉水")) {
|
||||
nowjz = true;
|
||||
}
|
||||
}
|
||||
String brly = labPat.getBrly();
|
||||
if (brly != null) brly = commonUtil.getComDictNameById("PT", brly);
|
||||
if (brly != null) if (brly.contains("质控")) nowjz = true;
|
||||
String ksdh = labPat.getKsdh();
|
||||
if (ksdh != null) ksdh = commonUtil.getComDictNameById("DP", ksdh);
|
||||
if (ksdh != null) if (ksdh.contains("检验科")) nowjz = true;
|
||||
List<LabResult> labResultList = null;
|
||||
boolean lb_setbj = true, lb_wjz = false;
|
||||
if (!"细菌仪".equals(yqdl)) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("jyrq", jyrq);
|
||||
@ -906,10 +851,7 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
String retMsg = String.valueOf(map.get("retmsg"));
|
||||
log.info("调用存储过程{}返回值:{},{}", "sp_setrefs", retCode, retMsg);
|
||||
if (retCode == null || "".equals(retCode) || "-1".equals(retCode)) lb_setbj = false;
|
||||
labResultList = commonUtil.getLabResultList(jyrq, yq, ybh);
|
||||
List<XmInfo> xmInfoList= commonUtil.getXmInfoList(yq);
|
||||
List<XmAlarmdetail> xmAlarmdetailList=null;
|
||||
if(!nowjz){xmAlarmdetailList =commonUtil.getXmAlarmdetailList(yq);}
|
||||
List<LabResult> labResultList = commonUtil.getLabResultList(jyrq, yq, ybh);
|
||||
for (LabResult labResult : labResultList) {
|
||||
String csjg = labResult.getCsjg();
|
||||
boolean lb_nummode = LisUtil.isTureNumber(csjg);
|
||||
@ -917,16 +859,7 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
String ygzd = labResult.getYgzd();
|
||||
//当结果为数值并且与周期诊断无关,计算存储过程保存成功后,只进行危急值判断
|
||||
if (lb_nummode && lb_setbj && !"Y".equals(ygzd) && !"Y".equals(ygzq)) {
|
||||
if(nowjz){
|
||||
String resultalarmflag1 = labResult.getAlarmFlag();
|
||||
if (!"".equals(resultalarmflag1) && resultalarmflag1 != null){
|
||||
labResult.setAlarmFlag("");
|
||||
commonUtil.updateLabResult(labResult);
|
||||
}
|
||||
}else {
|
||||
String xmdh=labResult.getXmdh();
|
||||
List<XmAlarmdetail> getXmAlarmdetail = xmAlarmdetailList.stream().filter(detail-> detail.getXmdh().equals(xmdh)).collect(Collectors.toList());
|
||||
int wjz = alarmcondition(labPat, labResult, getXmAlarmdetail);
|
||||
int wjz = alarmcondition(labPat, labResult);
|
||||
if (wjz != -1) {//危急值标识特殊判断存在时优先使用特殊结果
|
||||
String resultalarmflag = labResult.getAlarmFlag();
|
||||
if (("".equals(resultalarmflag) && lb_wjz)) {
|
||||
@ -941,26 +874,28 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
}
|
||||
String resultalarmflag1 = labResult.getAlarmFlag();
|
||||
if (!"".equals(resultalarmflag1) && resultalarmflag1 != null) lb_wjz = true;
|
||||
}
|
||||
} else {
|
||||
String xmdh=labResult.getXmdh();
|
||||
List<XmInfo> xmInfo0=xmInfoList.stream().filter(xm->xm.getXmdh().equals(xmdh)).collect(Collectors.toList());
|
||||
if(xmInfo0.size()>0){
|
||||
XmInfo xmInfo=xmInfo0.get(0);
|
||||
List<XmAlarmdetail> getXmAlarmdetail = xmAlarmdetailList.stream().filter(detail-> detail.getXmdh().equals(xmdh)).collect(Collectors.toList());
|
||||
LabResult labResult0 = setxmdhrefs(labPat, labResult,xmInfo,getXmAlarmdetail,nowjz);
|
||||
labResult.setCsjg(csjg);
|
||||
labResult.setDw(labResult0.getDw());
|
||||
labResult.setRefs(labResult0.getRefs());
|
||||
labResult.setResultFlag(labResult0.getResultFlag());
|
||||
labResult.setJgbz(labResult0.getJgbz());
|
||||
labResult.setAlarmFlag(labResult0.getAlarmFlag());
|
||||
int wjz = setrefs(labPat, labResult);
|
||||
if (wjz == 1) lb_wjz = true;
|
||||
}
|
||||
}
|
||||
//危急值标识去除原则
|
||||
String brxm = labPat.getBrxm();
|
||||
if (brxm != null)
|
||||
if (brxm.contains("质控") || brxm.contains("复查") || brxm.contains("QC") || brxm.contains("qc") || brxm.contains("软化水") || brxm.contains("锅炉水")) {
|
||||
lb_wjz = false;
|
||||
}
|
||||
|
||||
;
|
||||
String brly = labPat.getBrly();
|
||||
if (brly != null) brly = commonUtil.getComDictNameById("PT", brly);
|
||||
if (brly != null) if (brly.contains("质控")) lb_wjz = false;
|
||||
String ksdh = labPat.getKsdh();
|
||||
if (ksdh != null) ksdh = commonUtil.getComDictNameById("DP", ksdh);
|
||||
if (ksdh != null) if (ksdh.contains("检验科")) lb_wjz = false;
|
||||
//同步主表危急值标识
|
||||
if (lb_wjz) return 1;
|
||||
}
|
||||
return labResultList;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -970,16 +905,18 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
* @param labResult
|
||||
* @return
|
||||
*/
|
||||
private LabResult setxmdhrefs(LabPat labPat, LabResult labResult,XmInfo xmInfo,List<XmAlarmdetail> getXmAlarmdetail,boolean nowjz) {
|
||||
private int setrefs(LabPat labPat, LabResult labResult) {
|
||||
String yq = labPat.getYq();
|
||||
String resultflag = "M", wjzflag = "";
|
||||
int wjz = 0;
|
||||
String xmdh = labResult.getXmdh();
|
||||
String csjg = labResult.getCsjg();
|
||||
if (csjg == null || csjg.trim().isEmpty()) return labResult;
|
||||
if (csjg == null || csjg.trim().isEmpty()) return 0;
|
||||
String csjgnew = LisUtil.getOverNumber(csjg.trim());
|
||||
boolean lb_nummode = LisUtil.isNumber(csjgnew);
|
||||
//当结果为数值时计算上下限
|
||||
if (lb_nummode) {
|
||||
XmInfo xmInfo = commonUtil.getXmInfo(yq, xmdh);
|
||||
String dw = xmInfo.getDw();
|
||||
String refs = xmInfo.getDyckz();
|
||||
Double ckxx = xmInfo.getCkxx();
|
||||
@ -1043,15 +980,14 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
Double csjgnum = Double.valueOf(csjgnew);
|
||||
if (ckxx != null) if (csjgnum < ckxx) resultflag = "L";
|
||||
if (cksx != null) if (csjgnum > cksx) resultflag = "H";
|
||||
if(!nowjz) {
|
||||
int wjzf = alarmcondition(labPat, labResult, getXmAlarmdetail);
|
||||
int wjzf = alarmcondition(labPat, labResult);
|
||||
if (wjzf == -1) {
|
||||
if (llimit != null) if (csjgnum < llimit) wjzflag = "L";
|
||||
if (hlimit != null) if (csjgnum > hlimit) wjzflag = "H";
|
||||
} else if (wjzf == 1) {
|
||||
wjzflag = resultflag;
|
||||
}
|
||||
}
|
||||
if (!"".equals(wjzflag)) wjz = 1;
|
||||
} else {
|
||||
//文字型结果判断
|
||||
String jgbzold = labResult.getJgbz();
|
||||
@ -1059,13 +995,11 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
if ("P".equals(jgbzold) && (csjg.indexOf("阳") >= 0 || csjg.indexOf("+") >= 0 || csjg.indexOf(":") >= 0) && (lmtflag == null || lmtflag.trim().isEmpty()))
|
||||
lmtflag = "P";
|
||||
resultflag = lmtflag;
|
||||
if(!nowjz) {
|
||||
if ("J".equals(lmtflag)) wjzflag = "H";
|
||||
int wjzf = alarmcondition(labPat, labResult, getXmAlarmdetail);
|
||||
int wjzf = alarmcondition(labPat, labResult);
|
||||
if (wjzf == 1) wjzflag = "H";//满足特定危机值条件
|
||||
if (wjzf == 0) wjzflag = "";//存在特定危机值条件,但不满足不提示
|
||||
}
|
||||
}
|
||||
//小数保留位数计算
|
||||
Integer xsws = xmInfo.getXsws();
|
||||
if (xsws >= 0) csjg = LisUtil.round(csjg, xsws);
|
||||
@ -1078,7 +1012,8 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
|
||||
commonUtil.updateLabResult(labResult);
|
||||
}
|
||||
return labResult;
|
||||
if (!"".equals(wjzflag)) wjz = 1;
|
||||
return wjz;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1088,13 +1023,14 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
* @param labResult
|
||||
* @return
|
||||
*/
|
||||
private int alarmcondition(LabPat labPat, LabResult labResult,List<XmAlarmdetail> getXmAlarmdetail) {
|
||||
if (getXmAlarmdetail == null) return -1;
|
||||
private int alarmcondition(LabPat labPat, LabResult labResult) {
|
||||
boolean lb_fcb = false, lb_hasval = false;
|
||||
String csjg = labResult.getCsjg();
|
||||
if (csjg == null || csjg.trim().isEmpty()) return -1;
|
||||
String yq = labPat.getYq();
|
||||
String xmdh = labResult.getXmdh();
|
||||
List<XmAlarmdetail> getXmAlarmdetail = commonUtil.getXmAlarmdetail(yq, xmdh);
|
||||
if (getXmAlarmdetail == null) return -1;
|
||||
String brxm = "";
|
||||
String brdh = "";
|
||||
String ksdh = labPat.getKsdh();
|
||||
@ -1264,17 +1200,4 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询明细是否有危急值标识
|
||||
* @param labResultList
|
||||
* @return
|
||||
*/
|
||||
private boolean getAlarmFlag(List<LabResult> labResultList){
|
||||
boolean wjz=false;
|
||||
List<LabResult> labResultList0=labResultList.stream().filter(xm->!"".equals(xm.getAlarmFlag())&&xm.getAlarmFlag()!=null).collect(Collectors.toList());
|
||||
if(labResultList0.size()>0){
|
||||
wjz=true;
|
||||
}
|
||||
return wjz;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user