主业务添加代码
This commit is contained in:
parent
33dcb8c5aa
commit
59bb8a7b97
@ -21,6 +21,7 @@ public class CheckResultUtils {
|
||||
LabCheckrulesMapper labCheckrulesMapper;
|
||||
@Autowired
|
||||
CommonUtil commonUtil = new CommonUtil();
|
||||
|
||||
public String chksample(LabPat labPat, List<LabResult> labResultList) {
|
||||
String errmsg = "";
|
||||
String brdh = labPat.getBrdh();
|
||||
@ -88,9 +89,9 @@ public class CheckResultUtils {
|
||||
}
|
||||
|
||||
}
|
||||
List<LabChk> labChkList=checkResultMapper.getLabChkList(yq);
|
||||
for(LabChk labChk:labChkList){
|
||||
String jsgs=labChk.getHdnr();
|
||||
List<LabChk> labChkList = checkResultMapper.getLabChkList(yq);
|
||||
for (LabChk labChk : labChkList) {
|
||||
String jsgs = labChk.getHdnr();
|
||||
boolean setjgsg = true;
|
||||
Map<String, String> variables = new HashMap<>();
|
||||
String[] parameters = CalcUtils.getParameters(jsgs);
|
||||
@ -114,82 +115,84 @@ public class CheckResultUtils {
|
||||
}
|
||||
}
|
||||
//项目不全,此公式跳过
|
||||
if(setjgsg) {
|
||||
if (setjgsg) {
|
||||
boolean result = CalcUtils.getBooleanFromCalc(jsgs, variables);
|
||||
if (!result) {
|
||||
errmsg=errmsg+LisUtil.LINE_SEPARATOR+"审核条件: "+ jsgs + " 未通过!";
|
||||
errmsg = errmsg + LisUtil.LINE_SEPARATOR + "审核条件: " + jsgs + " 未通过!";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if(!"".equals(errmsg))errmsg= errmsg +LisUtil.LINE_SEPARATOR+ "请咨询该仪器组长或专业检验师 !";
|
||||
if (!"".equals(errmsg)) errmsg = errmsg + LisUtil.LINE_SEPARATOR + "请咨询该仪器组长或专业检验师 !";
|
||||
return errmsg;
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动审核时,询问默认失败,填备注默认每次都填
|
||||
*
|
||||
* @param labPat
|
||||
* @param labResultList
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> autochksamplenew(LabPat labPat, List<LabResult> labResultList) {
|
||||
|
||||
Map<String, Object> params=chksamplenew(labPat, labResultList,0);
|
||||
String code=(String)params.get("code");
|
||||
if ("3".equals(code))params.put("code","0");
|
||||
if ("5".equals(code))params.put("code","-1");
|
||||
if ("1".equals(code))params.put("code","-1");
|
||||
Map<String, Object> params = chksamplenew(labPat, labResultList, 0);
|
||||
String code = (String) params.get("code");
|
||||
if ("3".equals(code)) params.put("code", "0");
|
||||
if ("5".equals(code)) params.put("code", "-1");
|
||||
if ("1".equals(code)) params.put("code", "-1");
|
||||
return params;
|
||||
}
|
||||
|
||||
/**
|
||||
* 高级审核,对于重复询问通过xh递归询问
|
||||
*
|
||||
* @param labPat
|
||||
* @param labResultList
|
||||
* @param xh
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> chksamplenew(LabPat labPat, List<LabResult> labResultList,int xh){
|
||||
public Map<String, Object> chksamplenew(LabPat labPat, List<LabResult> labResultList, int xh) {
|
||||
String yq = labPat.getYq();
|
||||
String bz= labPat.getBz();
|
||||
String bz = labPat.getBz();
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("code", "0");
|
||||
params.put("msg","");
|
||||
params.put("bz",bz);
|
||||
params.put("setbz",false);
|
||||
params.put("xh",xh);
|
||||
List<LabCheckrules> labCheckruleslist=labCheckrulesMapper.getLabCheckrules(yq);
|
||||
if(labCheckruleslist.size()==0)return params;
|
||||
if(xh>=labCheckruleslist.size())return params;
|
||||
for (int i = xh; i < labCheckruleslist.size(); i++){
|
||||
LabCheckrules labCheckrules=labCheckruleslist.get(i);
|
||||
String checkrules=labCheckrules.getCheckrules();
|
||||
String checktype=labCheckrules.getChecktype();
|
||||
String logcontent=labCheckrules.getLogcontent();
|
||||
String ruledisplay=labCheckrules.getRuledisplay();
|
||||
String errmsg=checkcondition(labPat,labResultList,checkrules,ruledisplay);
|
||||
if(!"".equals(errmsg)) {
|
||||
if("0".equals(checktype)) {
|
||||
errmsg="审核未通过,你是否要强行通过?"+ruledisplay+LisUtil.LINE_SEPARATOR+"审核未通过,你是否要强行通过?"+LisUtil.LINE_SEPARATOR+errmsg;
|
||||
params.put("msg", "");
|
||||
params.put("bz", bz);
|
||||
params.put("setbz", false);
|
||||
params.put("xh", xh);
|
||||
List<LabCheckrules> labCheckruleslist = labCheckrulesMapper.getLabCheckrules(yq);
|
||||
if (labCheckruleslist.size() == 0) return params;
|
||||
if (xh >= labCheckruleslist.size()) return params;
|
||||
for (int i = xh; i < labCheckruleslist.size(); i++) {
|
||||
LabCheckrules labCheckrules = labCheckruleslist.get(i);
|
||||
String checkrules = labCheckrules.getCheckrules();
|
||||
String checktype = labCheckrules.getChecktype();
|
||||
String logcontent = labCheckrules.getLogcontent();
|
||||
String ruledisplay = labCheckrules.getRuledisplay();
|
||||
String errmsg = checkcondition(labPat, labResultList, checkrules, ruledisplay);
|
||||
if (!"".equals(errmsg)) {
|
||||
if ("0".equals(checktype)) {
|
||||
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);
|
||||
params.put("msg", errmsg);
|
||||
int ruleid0 = labCheckrules.getRuleid();
|
||||
params.put("xh", i);
|
||||
return params;
|
||||
}else if("3".equals(checktype)) {
|
||||
errmsg="审核未通过"+LisUtil.LINE_SEPARATOR+"设置的组合审核条件:"+errmsg+LisUtil.LINE_SEPARATOR+"审核未通过,不允许审核!";
|
||||
} else if ("3".equals(checktype)) {
|
||||
errmsg = "审核未通过" + LisUtil.LINE_SEPARATOR + "设置的组合审核条件:" + errmsg + LisUtil.LINE_SEPARATOR + "审核未通过,不允许审核!";
|
||||
params.put("code", "1");
|
||||
params.put("msg",errmsg);
|
||||
params.put("msg", errmsg);
|
||||
return params;
|
||||
}else if("4".equals(checktype)) {
|
||||
bz=replacebz(labPat,labResultList,logcontent);
|
||||
} else if ("4".equals(checktype)) {
|
||||
bz = replacebz(labPat, labResultList, logcontent);
|
||||
labPat.setBz(bz);
|
||||
params.put("setbz", true);
|
||||
errmsg="此次审核将产生一个备注信息"+LisUtil.LINE_SEPARATOR+bz;
|
||||
errmsg = "此次审核将产生一个备注信息" + LisUtil.LINE_SEPARATOR + bz;
|
||||
params.put("code", "3");
|
||||
params.put("msg",errmsg);
|
||||
params.put("bz",bz);
|
||||
params.put("msg", errmsg);
|
||||
params.put("bz", bz);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -198,19 +201,20 @@ public class CheckResultUtils {
|
||||
|
||||
/**
|
||||
* 计算公式注入参数执行,返回为真则证明筛选条件成立,需要禁止审核通过!
|
||||
*
|
||||
* @param labPat
|
||||
* @param labResultList
|
||||
* @param checkrules
|
||||
* @param ruledisplay
|
||||
* @return
|
||||
*/
|
||||
private String checkcondition(LabPat labPat, List<LabResult> labResultList,String checkrules,String ruledisplay){
|
||||
String errmsg="";
|
||||
boolean flag=false;
|
||||
checkrules=checkrules.replace("\"","'");
|
||||
if(checkrules.contains("ANY_")){
|
||||
private String checkcondition(LabPat labPat, List<LabResult> labResultList, String checkrules, String ruledisplay) {
|
||||
String errmsg = "";
|
||||
boolean flag = false;
|
||||
checkrules = checkrules.replace("\"", "'");
|
||||
if (checkrules.contains("ANY_")) {
|
||||
Map<String, String> variables = new HashMap<>();
|
||||
String[] parameters=CalcUtils.getParameters(checkrules);
|
||||
String[] parameters = CalcUtils.getParameters(checkrules);
|
||||
for (int i = 0; i < parameters.length; i++) {
|
||||
String itemcode = parameters[i];
|
||||
switch (itemcode) {
|
||||
@ -225,21 +229,21 @@ public class CheckResultUtils {
|
||||
errmsg.replace("[AGE]", String.valueOf(age));
|
||||
break;
|
||||
case "BRLY":
|
||||
String brly=labPat.getBrly();
|
||||
String brlymc= commonUtil.getComDictNameById("PT",brly);
|
||||
if(!"".equals(brlymc)||brlymc != null) brly=brlymc;
|
||||
String brly = labPat.getBrly();
|
||||
String brlymc = commonUtil.getComDictNameById("PT", brly);
|
||||
if (!"".equals(brlymc) || brlymc != null) brly = brlymc;
|
||||
errmsg.replace("[BRLY]", brly);
|
||||
break;
|
||||
case "KSDH":
|
||||
String ksdh=labPat.getKsdh();
|
||||
String ksdhmc= commonUtil.getComDictNameById("DP",ksdh);
|
||||
if(!"".equals(ksdhmc)||ksdhmc != null) ksdh=ksdhmc;
|
||||
String ksdh = labPat.getKsdh();
|
||||
String ksdhmc = commonUtil.getComDictNameById("DP", ksdh);
|
||||
if (!"".equals(ksdhmc) || ksdhmc != null) ksdh = ksdhmc;
|
||||
errmsg.replace("[KSDH]", ksdh);
|
||||
break;
|
||||
case "YBLX":
|
||||
String yblx=labPat.getYblx();
|
||||
String yblxmc= commonUtil.getComDictNameById("BT",yblx);
|
||||
if(!"".equals(yblxmc)||yblxmc != null) yblx=yblxmc;
|
||||
String yblx = labPat.getYblx();
|
||||
String yblxmc = commonUtil.getComDictNameById("BT", yblx);
|
||||
if (!"".equals(yblxmc) || yblxmc != null) yblx = yblxmc;
|
||||
errmsg.replace("[YBLX]", yblx);
|
||||
break;
|
||||
case "BZ":
|
||||
@ -267,18 +271,18 @@ public class CheckResultUtils {
|
||||
errmsg.replace("[ANY_CRI]", "lab_result.xmdh");
|
||||
break;
|
||||
default:
|
||||
String csjg=Optional.ofNullable(labResultList).flatMap(list -> list.stream().filter(result -> result != null && itemcode.equals(result.getXmdh())).map(LabResult::getCsjg).findFirst()).orElse(null);
|
||||
if(csjg==null)csjg="";
|
||||
errmsg.replace("["+itemcode+"]", csjg);
|
||||
String csjg = Optional.ofNullable(labResultList).flatMap(list -> list.stream().filter(result -> result != null && itemcode.equals(result.getXmdh())).map(LabResult::getCsjg).findFirst()).orElse(null);
|
||||
if (csjg == null) csjg = "";
|
||||
errmsg.replace("[" + itemcode + "]", csjg);
|
||||
|
||||
}
|
||||
List<LabResult> labResultList0=commonUtil.labResultMapper.getLabResultWithSql(labPat.getJyrq(),labPat.getYq(),labPat.getYbh(),errmsg);
|
||||
if(labResultList0.size()>0)flag=true;
|
||||
List<LabResult> labResultList0 = commonUtil.labResultMapper.getLabResultWithSql(labPat.getJyrq(), labPat.getYq(), labPat.getYbh(), errmsg);
|
||||
if (labResultList0.size() > 0) flag = true;
|
||||
}
|
||||
if(flag=true) errmsg = "审核条件: " + ruledisplay + " 未通过!" ;
|
||||
}else{
|
||||
if (flag = true) errmsg = "审核条件: " + ruledisplay + " 未通过!";
|
||||
} else {
|
||||
Map<String, String> variables = new HashMap<>();
|
||||
String[] parameters=CalcUtils.getParameters(checkrules);
|
||||
String[] parameters = CalcUtils.getParameters(checkrules);
|
||||
for (int i = 0; i < parameters.length; i++) {
|
||||
String itemcode = parameters[i];
|
||||
switch (itemcode) {
|
||||
@ -293,21 +297,21 @@ public class CheckResultUtils {
|
||||
variables.put(itemcode, String.valueOf(age));
|
||||
break;
|
||||
case "BRLY":
|
||||
String brly=labPat.getBrly();
|
||||
String brlymc= commonUtil.getComDictNameById("PT",brly);
|
||||
if(!"".equals(brlymc)||brlymc != null) brly=brlymc;
|
||||
String brly = labPat.getBrly();
|
||||
String brlymc = commonUtil.getComDictNameById("PT", brly);
|
||||
if (!"".equals(brlymc) || brlymc != null) brly = brlymc;
|
||||
variables.put(itemcode, brly);
|
||||
break;
|
||||
case "KSDH":
|
||||
String ksdh=labPat.getKsdh();
|
||||
String ksdhmc= commonUtil.getComDictNameById("DP",ksdh);
|
||||
if(!"".equals(ksdhmc)||ksdhmc != null) ksdh=ksdhmc;
|
||||
String ksdh = labPat.getKsdh();
|
||||
String ksdhmc = commonUtil.getComDictNameById("DP", ksdh);
|
||||
if (!"".equals(ksdhmc) || ksdhmc != null) ksdh = ksdhmc;
|
||||
variables.put(itemcode, ksdh);
|
||||
break;
|
||||
case "YBLX":
|
||||
String yblx=labPat.getYblx();
|
||||
String yblxmc= commonUtil.getComDictNameById("BT",yblx);
|
||||
if(!"".equals(yblxmc)||yblxmc != null) yblx=yblxmc;
|
||||
String yblx = labPat.getYblx();
|
||||
String yblxmc = commonUtil.getComDictNameById("BT", yblx);
|
||||
if (!"".equals(yblxmc) || yblxmc != null) yblx = yblxmc;
|
||||
variables.put(itemcode, yblx);
|
||||
break;
|
||||
case "BZ":
|
||||
@ -317,28 +321,29 @@ public class CheckResultUtils {
|
||||
variables.put(itemcode, labPat.getZd());
|
||||
break;
|
||||
default:
|
||||
String csjg=Optional.ofNullable(labResultList).flatMap(list -> list.stream().filter(result -> result != null && itemcode.equals(result.getXmdh())).map(LabResult::getCsjg).findFirst()).orElse(null);
|
||||
if(csjg==null)csjg="";
|
||||
String csjg = Optional.ofNullable(labResultList).flatMap(list -> list.stream().filter(result -> result != null && itemcode.equals(result.getXmdh())).map(LabResult::getCsjg).findFirst()).orElse(null);
|
||||
if (csjg == null) csjg = "";
|
||||
variables.put(itemcode, csjg);
|
||||
|
||||
}
|
||||
}
|
||||
flag=CalcUtils.getBooleanFromCalc(checkrules, variables);
|
||||
if(flag=true) errmsg = "审核条件: " + ruledisplay + " 未通过!" ;
|
||||
flag = CalcUtils.getBooleanFromCalc(checkrules, variables);
|
||||
if (flag = true) errmsg = "审核条件: " + ruledisplay + " 未通过!";
|
||||
}
|
||||
return errmsg;
|
||||
}
|
||||
|
||||
/**
|
||||
* 备注信息公式转换备注内容
|
||||
*
|
||||
* @param labPat
|
||||
* @param labResultList
|
||||
* @param logcontent
|
||||
* @return
|
||||
*/
|
||||
private String replacebz(LabPat labPat, List<LabResult> labResultList,String logcontent){
|
||||
String errmsg=logcontent;
|
||||
String[] parameters=CalcUtils.getParameters(logcontent);
|
||||
private String replacebz(LabPat labPat, List<LabResult> labResultList, String logcontent) {
|
||||
String errmsg = logcontent;
|
||||
String[] parameters = CalcUtils.getParameters(logcontent);
|
||||
for (int i = 0; i < parameters.length; i++) {
|
||||
String itemcode = parameters[i];
|
||||
switch (itemcode) {
|
||||
@ -346,28 +351,28 @@ public class CheckResultUtils {
|
||||
String sex = labPat.getBrxb().trim();
|
||||
if ("1".equals(sex)) sex = "男";
|
||||
if ("2".equals(sex)) sex = "女";
|
||||
errmsg.replace("[SEX]",sex);
|
||||
errmsg.replace("[SEX]", sex);
|
||||
break;
|
||||
case "AGE":
|
||||
double age = AgeUtils.getDecimalAge(AgeUtils.getBirthDateByAge(labPat.getNl(), labPat.getNldw()));
|
||||
errmsg.replace("[AGE]",String.valueOf(age));
|
||||
errmsg.replace("[AGE]", String.valueOf(age));
|
||||
break;
|
||||
case "BRLY":
|
||||
String brly=labPat.getBrly();
|
||||
String brlymc= commonUtil.getComDictNameById("PT",brly);
|
||||
if(!"".equals(brlymc)||brlymc != null) brly=brlymc;
|
||||
String brly = labPat.getBrly();
|
||||
String brlymc = commonUtil.getComDictNameById("PT", brly);
|
||||
if (!"".equals(brlymc) || brlymc != null) brly = brlymc;
|
||||
errmsg.replace("[BRLY]", brly);
|
||||
break;
|
||||
case "KSDH":
|
||||
String ksdh=labPat.getKsdh();
|
||||
String ksdhmc= commonUtil.getComDictNameById("DP",ksdh);
|
||||
if(!"".equals(ksdhmc)||ksdhmc != null) ksdh=ksdhmc;
|
||||
String ksdh = labPat.getKsdh();
|
||||
String ksdhmc = commonUtil.getComDictNameById("DP", ksdh);
|
||||
if (!"".equals(ksdhmc) || ksdhmc != null) ksdh = ksdhmc;
|
||||
errmsg.replace("[KSDH]", ksdh);
|
||||
break;
|
||||
case "YBLX":
|
||||
String yblx=labPat.getYblx();
|
||||
String yblxmc= commonUtil.getComDictNameById("BT",yblx);
|
||||
if(!"".equals(yblxmc)||yblxmc != null) yblx=yblxmc;
|
||||
String yblx = labPat.getYblx();
|
||||
String yblxmc = commonUtil.getComDictNameById("BT", yblx);
|
||||
if (!"".equals(yblxmc) || yblxmc != null) yblx = yblxmc;
|
||||
errmsg.replace("[YBLX]", yblx);
|
||||
break;
|
||||
case "BZ":
|
||||
@ -377,31 +382,31 @@ public class CheckResultUtils {
|
||||
errmsg.replace("[ZD]", labPat.getZd());
|
||||
break;
|
||||
default:
|
||||
String csjg=Optional.ofNullable(labResultList).flatMap(list -> list.stream().filter(result -> result != null && itemcode.equals(result.getXmdh())).map(LabResult::getCsjg).findFirst()).orElse(null);
|
||||
if(csjg==null)csjg="";
|
||||
errmsg.replace("["+itemcode+"]", csjg);
|
||||
String csjg = Optional.ofNullable(labResultList).flatMap(list -> list.stream().filter(result -> result != null && itemcode.equals(result.getXmdh())).map(LabResult::getCsjg).findFirst()).orElse(null);
|
||||
if (csjg == null) csjg = "";
|
||||
errmsg.replace("[" + itemcode + "]", csjg);
|
||||
}
|
||||
}
|
||||
String bz=labPat.getBz();
|
||||
if(errmsg!=null && !"".equals(errmsg))
|
||||
if(bz==null||"".equals(bz)) bz=errmsg;
|
||||
else {
|
||||
String bz0=String.valueOf(bz.charAt(bz.length() - 1));
|
||||
switch (bz0) {
|
||||
case ",":
|
||||
case ":":
|
||||
case ";":
|
||||
case ".":
|
||||
case "。":
|
||||
case ",":
|
||||
case "、":
|
||||
case ";":
|
||||
case ":":
|
||||
bz=bz+errmsg;
|
||||
break;
|
||||
default:
|
||||
bz=bz+","+errmsg;
|
||||
}}
|
||||
String bz = labPat.getBz();
|
||||
if (errmsg == null || "".equals(errmsg)) return bz;
|
||||
if (bz == null || "".equals(bz)) return errmsg;
|
||||
if (bz.contains(errmsg)) return bz;
|
||||
String bz0 = String.valueOf(bz.charAt(bz.length() - 1));
|
||||
switch (bz0) {
|
||||
case ",":
|
||||
case ":":
|
||||
case ";":
|
||||
case ".":
|
||||
case "。":
|
||||
case ",":
|
||||
case "、":
|
||||
case ";":
|
||||
case ":":
|
||||
bz = bz + errmsg;
|
||||
break;
|
||||
default:
|
||||
bz = bz + "," + errmsg;
|
||||
}
|
||||
return bz;
|
||||
}
|
||||
|
||||
|
||||
@ -51,6 +51,7 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
LabReqdetailMapper labReqdetailMapper;
|
||||
@Autowired
|
||||
CheckResultUtils checkResultUtils;
|
||||
|
||||
@Override
|
||||
public Result newPatInfo(Date jyrq, String ybh, String sqh, String yq, Long userId) {
|
||||
|
||||
@ -220,7 +221,7 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
//2:数据合法性校验
|
||||
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
|
||||
labPat.setHdys(hdys);
|
||||
Result result = beforeconfirm(labPat, problemId);
|
||||
Result result = beforeconfirm(labPat, 2, problemId);
|
||||
if (!"0".equals(result.getCode())) return result;
|
||||
//3:数据完整保存
|
||||
int wjz = saveallresult(labPat);
|
||||
@ -234,14 +235,14 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
commonUtil.updateLabPat(labPat);
|
||||
}
|
||||
//医学审核条件判断
|
||||
if(problemId<4)problemId=4;
|
||||
result=chksample(labPat,problemId);
|
||||
if (problemId < 4) problemId = 4;
|
||||
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;
|
||||
if (problemId < 99) problemId = 99;
|
||||
//4:CA请求业务的处理
|
||||
//Result result=addCA(jyrq, yq, ybh, hdys);
|
||||
//if("0".equals(result.getCode()))return result;
|
||||
@ -262,11 +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);
|
||||
return beforeconfirm(labPat, problemId);
|
||||
return beforeconfirm(labPat, 2, problemId);
|
||||
}
|
||||
|
||||
//内部使用
|
||||
private Result beforeconfirm(LabPat labPat, Integer problemId) {
|
||||
private Result beforeconfirm(LabPat labPat, Integer checktype, Integer problemId) {
|
||||
Date jyrq = labPat.getJyrq();
|
||||
String yq = labPat.getYq();
|
||||
String ybh = labPat.getYbh();
|
||||
@ -274,11 +275,13 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
String jgbz = labPat.getJgbz();
|
||||
if ("2".equals(jgbz)) return new Result("1", "报告已审核!");
|
||||
if ("5".equals(jgbz)) return new Result("-1", "已锁定报告禁止审核!");
|
||||
if (!"1".equals(jgbz)) {
|
||||
if (!"1".equals(jgbz) && checktype == 2) {
|
||||
String f_check1 = commonUtil.getComOptValue(yq, "f_check1");
|
||||
if ("1".equals(f_check1)) return new Result("-1", "审核前必须先初审!");
|
||||
}
|
||||
if (checkWorkTime(labPat) == 1) return new Result("-1", "核对医生不允许与检验医生相同!");
|
||||
if (checktype == 2) {
|
||||
if (checkWorkTime(labPat) == 1) return new Result("-1", "核对医生不允许与检验医生相同!");
|
||||
}
|
||||
String limit_brly = commonUtil.getHISOPT("limit_brly");
|
||||
String brly = labPat.getBrly();
|
||||
if ("1".equals(limit_brly) && (brly == null || "".equals(brly)))
|
||||
@ -343,14 +346,14 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
LabPat labPat0 = lisWorkOperMapper.checkdublereport(sqh, ybh);
|
||||
if (labPat0 != null) {
|
||||
String yqmc = commonUtil.getYqmc(yq);
|
||||
String msg = "该申请单已经发过结果了,禁止审核!"+LisUtil.LINE_SEPARATOR+"日期:" + commonUtil.getDateString(jyrq) + ",仪器:" + yqmc + ",样本号:" + ybh;
|
||||
String msg = "该申请单已经发过结果了,禁止审核!" + LisUtil.LINE_SEPARATOR + "日期:" + commonUtil.getDateString(jyrq) + ",仪器:" + yqmc + ",样本号:" + ybh;
|
||||
return new Result("-1", msg);
|
||||
}
|
||||
} else if ("1".equals(commonUtil.getHISOPT("sp_yqdublereport"))) {
|
||||
LabPat labPat0 = lisWorkOperMapper.checkyqdublereport(sqh, yq, ybh);
|
||||
if (labPat0 != null) {
|
||||
String yqmc = commonUtil.getYqmc(yq);
|
||||
String msg = "该申请单已经发过结果了,禁止审核!"+LisUtil.LINE_SEPARATOR+"日期:" + commonUtil.getDateString(jyrq) + ",仪器:" + yqmc + ",样本号:" + ybh;
|
||||
String msg = "该申请单已经发过结果了,禁止审核!" + LisUtil.LINE_SEPARATOR + "日期:" + commonUtil.getDateString(jyrq) + ",仪器:" + yqmc + ",样本号:" + ybh;
|
||||
return new Result("-1", msg);
|
||||
}
|
||||
}
|
||||
@ -362,7 +365,8 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
if (Userid == null || "".equals(Userid)) {
|
||||
Userid = SecurityUtils.getLoginUser().getUsername();
|
||||
}
|
||||
|
||||
//初审不需要调用接口
|
||||
if (checktype == 1) return new Result("0", "保存成功!");
|
||||
//调用his报告接口,检查外部接口对审核前的定制需求
|
||||
SetReport setReport = new SetReport();
|
||||
setReport.setIp(IpUtils.getIpAddr());
|
||||
@ -408,47 +412,49 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
|
||||
|
||||
/**
|
||||
* 医学审核条件判断
|
||||
*
|
||||
* @param labPat
|
||||
* @param problemId
|
||||
* @return
|
||||
*/
|
||||
private Result chksample(LabPat labPat,Integer problemId) {
|
||||
List<LabResult> labResultList = commonUtil.getLabResultList(labPat.getJyrq(),labPat.getYq(),labPat.getYbh());
|
||||
private Result chksample(LabPat labPat, Integer problemId) {
|
||||
List<LabResult> labResultList = commonUtil.getLabResultList(labPat.getJyrq(), labPat.getYq(), labPat.getYbh());
|
||||
//医学审核条件判断
|
||||
if(problemId<3) {
|
||||
if (problemId < 3) {
|
||||
String checkvalue = checkResultUtils.chksample(labPat, labResultList);
|
||||
if (checkvalue != null && !"".equals(checkvalue)) {
|
||||
return new Result("5", checkvalue, 3);
|
||||
}
|
||||
}
|
||||
Boolean setbz=false;
|
||||
String bz=labPat.getBz();
|
||||
Boolean setbz = false;
|
||||
String bz = labPat.getBz();
|
||||
//医学审核条件判断(新规则),预留99个递归ID
|
||||
if(problemId<99) {
|
||||
int xh=0;
|
||||
if(problemId>4)xh=problemId - 4;
|
||||
Map<String, Object> chksamplenewvalue = checkResultUtils.chksamplenew(labPat, labResultList,xh);
|
||||
String chkCode=(String)chksamplenewvalue.get("code");
|
||||
String chkMsg=(String)chksamplenewvalue.get("code");
|
||||
bz=(String)chksamplenewvalue.get("bz");
|
||||
if (problemId < 99) {
|
||||
int xh = 0;
|
||||
if (problemId > 4) xh = problemId - 4;
|
||||
Map<String, Object> chksamplenewvalue = checkResultUtils.chksamplenew(labPat, labResultList, xh);
|
||||
String chkCode = (String) chksamplenewvalue.get("code");
|
||||
String chkMsg = (String) chksamplenewvalue.get("code");
|
||||
bz = (String) chksamplenewvalue.get("bz");
|
||||
labPat.setBz(bz);
|
||||
xh=(Integer) chksamplenewvalue.get("xh");
|
||||
setbz=(Boolean) chksamplenewvalue.get("setbz");
|
||||
problemId=4+xh;
|
||||
xh = (Integer) chksamplenewvalue.get("xh");
|
||||
setbz = (Boolean) chksamplenewvalue.get("setbz");
|
||||
problemId = 4 + xh;
|
||||
if ("5".equals(chkCode)) {
|
||||
if (setbz){
|
||||
if (setbz) {
|
||||
commonUtil.updateLabPat(labPat);
|
||||
}
|
||||
return new Result("5", chkMsg, problemId);
|
||||
}
|
||||
if (!"0".equals(chkCode)) return new Result(chkCode, chkMsg, problemId);
|
||||
}
|
||||
if (setbz){
|
||||
if (setbz) {
|
||||
commonUtil.updateLabPat(labPat);
|
||||
return new Result("99", bz);
|
||||
}
|
||||
return new Result("0", "保存成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核后步骤,在审核过程中,必须完成审核前校验通过,结果计算值填充,参考值结果标志危急值标志填写完成,最后使用此方法修改状态
|
||||
*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user