Merge remote-tracking branch 'lis8.0/master'

This commit is contained in:
jiangs 2025-08-26 16:48:32 +08:00
commit f0c204eef2
18 changed files with 723 additions and 198 deletions

View File

@ -55,8 +55,6 @@ public class LabPat extends BaseEntity {
private String instrid;
private String jzbz;
private String sbbr;
// private String qrr;
// private Date qrsj;
private String alarmflag;
private String alarmconfirm;
private Date alarmconfirmdt;
@ -80,4 +78,6 @@ public class LabPat extends BaseEntity {
private String fault;
private String faults;
private Date faultdt;
private String sn_tss;
private String sn_result;
}

View File

@ -42,6 +42,29 @@ public class LabReqmain extends BaseEntity {
private String zd;
private Date cysj;
private Date cksj;
private String ckzj;
private String ckyh;
private String djry;
private String inputman;
private String powerman;
private String contactman;
private String refsqh;
private String cyr;
private String bbsjr;
private Date bbsjsj;
private String performby;
private String sbbr;
private String inzt;
private String libpos;
private Date inlibtime;
private String inlibman;
private Date outlibtime;
private String outlibman;
private String refused;
private Date confirmtime;
private String confirmer;
private String cybl;
private String bbsjbl;
private String yljg;
private String kh;
private String klx;
@ -50,21 +73,15 @@ public class LabReqmain extends BaseEntity {
private String sfzh;
private String phone;
private String phone1;
private Date confirmtime;
private String confirmer;
private String cyr;
private String addr;
private String fb;
private String bbsjr;
private Date bbsjsj;
private String czid;
private String czmc;
private String jzjlid;
private String hzdh;
private String zxks;
private String hosid;
private String lstd;
private String jcptbz;
private String slzq;
private String yqdh;
private Date sjsj;
private String addr;
private String lstd;
private String ssrq;
private String slzq;
private Date cyblsj;
private Date bbsjblsj;
private String ybrl;
private String qsyljg;
private String cjbw;
}

View File

@ -0,0 +1,25 @@
package com.czlis.common.core.domain.entity.lis;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
@NoArgsConstructor
@AllArgsConstructor
@Data
public class LabReqsteplog {
private String sqh;
private Integer xh;
private String zt;
private String userid;
private Date changedate;
private Date logdate;
private String comname;
private String comip;
private String bz;
}

View File

@ -18,6 +18,7 @@ public class LabResult extends BaseEntity {
private String yq;
private String ybh;
private String xmdh;
private String wyh;
private String csjg;
private String od;
private String cutoff;
@ -25,8 +26,7 @@ public class LabResult extends BaseEntity {
private String bz1;
private String bz2;
private String yhdh;
private String textresult;
private String instrid;
private Integer instrid;
private Date operdt;
private String operna;
private String refs;
@ -36,6 +36,9 @@ public class LabResult extends BaseEntity {
private String alarmFlag;
private String redoFlag;
private String sqxmdh;
private String redoText;
private String bz3;
private String textresult;
private String xmmc;
private String ygzd;
private String ygzq;

View File

@ -6,6 +6,9 @@ import java.util.Map;
public interface LabReqmainMapper {
LabReqmain getLabReqmainOne(String sqh);
void updateLabReqmain(LabReqmain labReqmain);
void updateLabReqmainZT(Map<String,Object> map);
int updateLabReqmain(LabReqmain labReqmain);
int updateLabReqmainAll(LabReqmain labReqmain);
int deleteLabReqmain(String sqh);
void insertLabReqmain(LabReqmain labReqmain);
int updateLabReqmainZT(Map<String,Object> map);
}

View File

@ -0,0 +1,12 @@
package com.czlis.interfaceCommon.mapper;
import com.czlis.common.core.domain.entity.lis.LabReqmain;
import com.czlis.common.core.domain.entity.lis.LabReqsteplog;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface LabReqsteplogMapper {
LabReqsteplog getLabReqsteplogOne(@Param("sqh") String sqh,@Param("xh") Integer xh);
List<LabReqsteplog> getLabReqsteplog(String sqh);
}

View File

@ -10,4 +10,5 @@ public interface XmRefMapper {
List<XmRef> getXmRefList(String yq);
XmRef getXmRef(@Param("yq")String yq, @Param("xmdh")String xmdh);
XmRef getXmRefValue(Map<String,Object> map);
XmRef getXmRefValue(@Param("yq")String yq, @Param("xmdh")String xmdh,@Param("bbtype")String bbtype, @Param("sex")String sex,@Param("age")Double age, @Param("zd")String zd, @Param("slzq")String slzq);
}

View File

@ -17,45 +17,65 @@ public class CalcUtils {
* @param variableMap 入参MAP
* @return
*/
public static String getValueFromCalc(String CalcExpression,Map<String,String> variableMap){
// 创建SpEL解析器
public static String getValueFromCalc(String CalcExpression, Map<String, String> variableMap) {
ExpressionParser parser = new SpelExpressionParser();
// 创建评估上下文
StandardEvaluationContext context = new StandardEvaluationContext();
// 循环遍历Map,将键值对添加到上下文
for (Map.Entry<String, String> entry : variableMap.entrySet()) {
// 键作为变量名,值作为变量值
String str = entry.getValue();
if(isNumber(str)){
if (isNumber(str)) {
context.setVariable(entry.getKey(), Double.parseDouble(str));
}else {
} else {
context.setVariable(entry.getKey(), entry.getValue());
}
}
// 测试表达式:使用多个变量进行判断"#score >= 60 ? #name + '的' + #subject + '成绩及格' : #name + '的' + #subject + '成绩不及格'"
String expression = getCalc(CalcExpression);
Expression exp = parser.parseExpression(expression);
// 执行表达式(传入上下文)
try {
String result = exp.getValue(context, String.class);
//System.out.println(result); // 输出:张三的数学成绩及格
return result;
} catch (Exception e) {
// 意外错误时返回null
return null;
}
// 先获取原始结果(可能是Number、Boolean、String等)
Object result = exp.getValue(context);
// 安全转换为String
if (result == null) {
return ""; // 空值返回空字符串(或根据业务返回null)
}
// 特殊处理数字类型,避免科学计数法(如1000000.0 → "1000000")
if (result instanceof Number) {
Number num = (Number) result;
// 判断是否为整数(无小数部分)
if (num.doubleValue() == Math.floor(num.doubleValue())) {
return String.valueOf(num.longValue());
} else {
return String.valueOf(num.doubleValue());
}
}
// 其他类型直接调用toString()
return result.toString();
} catch (Exception e) {
throw new RuntimeException("表达式计算失败: " + expression, e);
}
}
public static boolean getBooleanFromCalc(String CalcExpression,Map<String,String> variableMap){
public static boolean getBooleanFromCalc(String CalcExpression, Map<String, String> variableMap) {
ExpressionParser parser = new SpelExpressionParser();
StandardEvaluationContext context = new StandardEvaluationContext();
// 统一变量处理:数字转Double,否则保留String
for (Map.Entry<String, String> entry : variableMap.entrySet()) {
context.setVariable(entry.getKey(), entry.getValue());
String str = entry.getValue();
if (isNumber(str)) {
context.setVariable(entry.getKey(), Double.parseDouble(str));
} else {
context.setVariable(entry.getKey(), entry.getValue());
}
}
String expression = getCalc(CalcExpression);
Expression exp = parser.parseExpression(expression);
boolean result = exp.getValue(context, Boolean.class);
return result;
try {
return exp.getValue(context, Boolean.class);
} catch (Exception e) {
throw new RuntimeException("布尔表达式计算失败: " + expression, e); // 增强异常信息
}
}
/**
@ -64,6 +84,7 @@ public class CalcUtils {
* @return
*/
public static String getCalc(String CalcExpression){
// 1. 替换逻辑运算符:and→&&,or→||
String processed = CalcExpression.replaceAll("\\band|AND\\b", "&&").replaceAll("\\bor|OR\\b", "||");
// 2. 替换变量格式:[a] → #a
@ -72,9 +93,47 @@ public class CalcUtils {
processed = replaceLenFunction(processed);
//4.like '%aa'或者 like 'aa%'或者 like '%aa%'
processed = replaceLikeExpressions(processed);
// 1. 先将所有比较用的=替换为==(关键修复)
processed = processed.replaceAll("(\\w+)\\s*=\\s*('.*?'|\\w+)", "$1 == $2");
//5. 递归处理if结构:if(cond, trueExpr, falseExpr) → cond?trueExpr:falseExpr
return processIf(processed);
}
/**
* 取出公式中所有[参数]返回数组,供调用传值引用
* @param input
* @return
*/
public static String[] getParameters(String input) {
// 正则表达式匹配 [] 中的内容
Pattern pattern = Pattern.compile("\\[(.*?)\\]");
Matcher matcher = pattern.matcher(input);
// 第一步:统计匹配数量,确定数组长度
int count = 0;
// 临时存储匹配结果的数组(初始长度设为10,可根据实际场景调整)
String[] tempArray = new String[10];
// 循环查找所有匹配项
while (matcher.find()) {
// 存储当前匹配的内容([]中的字符串)
tempArray[count] = matcher.group(1);
count++;
// 若临时数组容量不足,扩容(每次翻倍)
if (count == tempArray.length) {
String[] newArray = new String[tempArray.length * 2];
System.arraycopy(tempArray, 0, newArray, 0, tempArray.length);
tempArray = newArray;
}
}
// 第二步:创建与实际数量匹配的结果数组
String[] result = new String[count];
System.arraycopy(tempArray, 0, result, 0, count);
return result;
}
/**
* 递归解析并替换if表达式
*/
@ -162,29 +221,29 @@ public class CalcUtils {
for (int i = 0; i < 3; i++) {
parts[i] = new StringBuilder();
}
boolean inQuotes = false; // 标记是否在字符串中(单引号内)
for (char c : inner.toCharArray()) {
if (c == ',' && stack.isEmpty()) {
// 处理单引号包裹的字符串(忽略内部逗号)
if (c == '\'') {
inQuotes = !inQuotes;
parts[partIndex].append(c);
continue;
}
// 仅当不在字符串中且栈为空时,才用逗号分割参数
if (c == ',' && !inQuotes && stack.isEmpty()) {
partIndex++;
if (partIndex >= 3) {
break;
}
if (partIndex >= 3) break;
} else {
if (c == '(') {
stack.push('(');
} else if (c == ')') {
if (!stack.isEmpty()) {
stack.pop();
}
}
if (c == '(') stack.push('(');
else if (c == ')') if (!stack.isEmpty()) stack.pop();
parts[partIndex].append(c);
}
}
return new String[]{
parts[0].toString(),
parts[1].toString(),
parts[2].toString()
parts[0].toString().trim(),
parts[1].toString().trim(),
parts[2].toString().trim()
};
}
/**
@ -215,24 +274,18 @@ public class CalcUtils {
* 支持:like '%xxx'、like 'xxx%'、like '%xxx%'、like 'xxx'(精确匹配)
*/
private static String replaceLikeExpressions(String expression) {
// 正则匹配 like 表达式(支持空格变化和引号)
// 分组说明:
// group1: 左侧表达式(如字段或变量)
// group2: 匹配模式(如'%aa%'、'aa%'等)
Pattern pattern = Pattern.compile("(\\w+)\\s+like\\s+'([^']+)'", Pattern.CASE_INSENSITIVE);
// 修正正则:左侧表达式允许包含#、字母、数字、下划线(#[a-zA-Z0-9_]+)
Pattern pattern = Pattern.compile("([#\\w]+)\\s+like\\s+'([^']+)'", Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(expression);
StringBuffer result = new StringBuffer();
while (matcher.find()) {
String leftExpr = matcher.group(1); // 左侧表达式(如 field1)
String patternStr = matcher.group(2); // 匹配模式(如 %aa%)
// 根据模式生成对应的SpEL方法调用
String leftExpr = matcher.group(1); // 支持#变量(如#RESULT)
String patternStr = matcher.group(2);
String replacement = generateLikeReplacement(leftExpr, patternStr);
matcher.appendReplacement(result, replacement);
}
matcher.appendTail(result);
return result.toString();
}
/**
@ -270,9 +323,8 @@ public class CalcUtils {
*/
public static boolean isNumber(String str) {
if (str == null || str.trim().isEmpty()) {
return false;
return false; // 空值不视为数字
}
// 正则表达式:匹配正负整数、正负小数
String regex = "^[+-]?([0-9]+(\\.[0-9]*)?|\\.[0-9]+)$";
return str.matches(regex);
}

View File

@ -48,6 +48,8 @@ public class CommonUtil {
XmAlarmdetailMapper xmAlarmdetailMapper;
@Autowired
LabReqreportPdffileMapper labReqreportPdffileMapper;
@Autowired
LabReqsteplogMapper labReqsteplogMapper;
//====检验主表操作方法集合===
public LabPat getLabPatOne(Date jyrq, String yq, String ybh) {
@ -89,6 +91,22 @@ public class CommonUtil {
public LabReqmain getLabReqmainOne(String sqh) {
return labReqmainMapper.getLabReqmainOne(sqh);
}
public int updateLabReqmain(LabReqmain labReqmain) {
return labReqmainMapper.updateLabReqmain(labReqmain);
}
public int deleteLabReqmain(String sqh) {
return labReqmainMapper.deleteLabReqmain(sqh);
}
public void insertLabReqmain(LabReqmain labReqmain) {
labReqmainMapper.insertLabReqmain(labReqmain);
}
public List<LabReqsteplog> getLabReqsteplog(String sqh) {
return labReqsteplogMapper.getLabReqsteplog(sqh);
}
//申请单明细表集合
//====检验结果表操作方法集合===
@ -101,8 +119,8 @@ public class CommonUtil {
}
@Transactional(rollbackFor = Exception.class)
public int insertLabResult(LabResult labResult) {
return labResultMapper.insertLabResult(labResult);
public void insertLabResult(LabResult labResult) {
labResultMapper.insertLabResult(labResult);
}
public List<LabResult> getresultinfo(Date jyrq, String yq, String ybh) {
@ -144,6 +162,9 @@ 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);
}
public String getXmRefJgbz(String yq, String xmdh, String csjg, String csjg1, String csjg2) {
return xmValMapper.getXmValJgbz(yq, xmdh, csjg, csjg1, csjg2);
@ -266,8 +287,11 @@ public class CommonUtil {
} else {
//没有获取到缓存,则先从数据库中查询数据,然后再进行缓存
ComOpt comOpt1 = comOptMapper.getComOptOne(yq, xxdh);
ComOptionUtils.setOptCache(yq, xxdh, comOpt1);
return comOpt1.getXxqz();
if (comOpt1 != null) {
ComOptionUtils.setOptCache(yq, xxdh, comOpt1);
return comOpt1.getXxqz();
}
return null;
}
}
@ -306,7 +330,7 @@ public class CommonUtil {
return labReqreportPdffileMapper.getLabReqreportPdffileList(sqh);
}
public LabReqreportPdffile getLabReqreportPdffileOne(Date jyrq,String yq,String ybh) {
return labReqreportPdffileMapper.getLabReqreportPdffileOne(jyrq,yq,ybh);
public LabReqreportPdffile getLabReqreportPdffileOne(Date jyrq, String yq, String ybh) {
return labReqreportPdffileMapper.getLabReqreportPdffileOne(jyrq, yq, ybh);
}
}

View File

@ -76,8 +76,6 @@
<if test="instrid != null and instrid != ''">instrid,</if>
<if test="jzbz != null and jzbz != ''">jzbz,</if>
<if test="sbbr != null and sbbr != ''">sbbr,</if>
<if test="qrr != null and qrr != ''">qrr,</if>
<if test="qrsj != null ">qrsj,</if>
<if test="alarmflag != null and alarmflag != ''">alarmflag,</if>
<if test="alarmconfirm != null and alarmconfirm != ''">alarmconfirm,</if>
<if test="alarmconfirmdt != null ">alarmconfirmdt,</if>
@ -99,15 +97,8 @@
<if test="lstd != null and lstd !=''">lstd,</if>
<if test="zjlx != null and zjlx != ''">zjlx,</if>
<if test="slzq != null and slzq != ''">slzq,</if>
<if test="uploaddate != null">uploaddate,</if>
<if test="lastupdatetime != null">lastupdatetime,</if>
<if test="ylfw != null and ylfw != ''">ylfw,</if>
<if test="upload != null and upload != ''">upload,</if>
<if test="checker != null and checker != ''">checker,</if>
<if test="lisptsc != null and lisptsc != ''">lisptsc,</if>
<if test="autojgbz != null and autojgbz != ''">autojgbz,</if>
<if test="crbsj != null and crbsj != ''">crbsj,</if>
<if test="testName != null and testName != ''">testName,</if>
jyrq,yq,ybh
)
values(
@ -151,8 +142,6 @@
<if test="instrid != null and instrid != ''">#{instrid},</if>
<if test="jzbz != null and jzbz != ''">#{jzbz},</if>
<if test="sbbr != null and sbbr != ''">#{sbbr},</if>
<if test="qrr != null and qrr != ''">#{qrr},</if>
<if test="qrsj != null ">#{qrsj},</if>
<if test="alarmflag != null and alarmflag != ''">#{alarmflag},</if>
<if test="alarmconfirm != null and alarmconfirm != ''">#{alarmconfirm},</if>
<if test="alarmconfirmdt != null ">#{alarmconfirmdt},</if>
@ -174,15 +163,8 @@
<if test="lstd != null and lstd !=''">#{lstd},</if>
<if test="zjlx != null and zjlx != ''">#{zjlx},</if>
<if test="slzq != null and slzq != ''">#{slzq},</if>
<if test="uploaddate != null">#{uploaddate},</if>
<if test="lastupdatetime != null">#{lastupdatetime},</if>
<if test="ylfw != null and ylfw != ''">#{ylfw},</if>
<if test="upload != null and upload != ''">#{upload},</if>
<if test="checker != null and checker != ''">#{checker},</if>
<if test="lisptsc != null and lisptsc != ''">#{lisptsc},</if>
<if test="autojgbz != null and autojgbz != ''">#{autojgbz},</if>
<if test="crbsj != null and crbsj != ''">#{crbsj},</if>
<if test="testName != null and testName != ''">#{testName},</if>
#{jyrq},#{yq},#{ybh}
)
</insert>
@ -309,12 +291,6 @@
<if test="sbbr != null">
sbbr = #{sbbr,jdbcType=VARCHAR},
</if>
<if test="qrr != null">
qrr = #{qrr,jdbcType=VARCHAR},
</if>
<if test="qrsj != null">
qrsj = #{qrsj,jdbcType=TIMESTAMP},
</if>
<if test="alarmflag != null">
alarmflag = #{alarmflag,jdbcType=CHAR},
</if>
@ -375,12 +351,6 @@
<if test="slzq != null">
slzq = #{slzq,jdbcType=VARCHAR},
</if>
<if test="uploaddate != null">
uploaddate = #{uploaddate,jdbcType=TIMESTAMP},
</if>
<if test="whonetupdate != null">
whonetupdate = #{whonetupdate,jdbcType=TIMESTAMP},
</if>
<if test="checker != null">
checker = #{checker,jdbcType=VARCHAR},
</if>

View File

@ -11,8 +11,201 @@
UPDATE lab_reqmain SET zt = '2', jsys = #{userId}, jssj =getdate() WHERE sqh = #{sqh} AND (zt < '2' or zt='8' or jssj<zxsj)
]]>
</update>
<delete id="deleteLabReqmain" parameterType="String">
delete from lab_reqmain
where sqh = #{sqh}
</delete>
<insert id="insertLabReqmain" parameterType="com.czlis.common.core.domain.entity.lis.LabReqmain">
insert into lab_reqmain (sqh, ksdh, sqys,
sqsj, jsys, jssj,
zt, jjzt, brly, brdh,
brxm, brxb, brsr, bz1,
bz2, bz3, jzbz, txm,
ch, yblx, zxys, zxsj,
bgddh, costs, nl, nldw,
zd, cysj, cksj,
ckzj, ckyh, djry, inputman,
powerman, contactman, refsqh,
cyr, bbsjr, bbsjsj,
performby, sbbr, inzt,
libpos, inlibtime, inlibman,
outlibtime, outlibman, refused,
confirmtime, confirmer, cybl,
bbsjbl, yljg, kh, klx,
jzsj, jymd, sfzh,
phone, phone1, yqdh, sjsj,
addr, lstd, ssrq,
slzq, cyblsj, bbsjblsj,
ybrl,qsyljg,cjbw)
values (#{sqh}, #{ksdh}, #{sqys},
#{sqsj}, #{jsys}, #{jssj},
#{zt}, #{jjzt}, #{brly}, #{brdh},
#{brxm}, #{brxb}, #{brsr}, #{bz1},
#{bz2}, #{bz3}, #{jzbz}, #{txm},
#{ch}, #{yblx}, #{zxys}, #{zxsj},
#{bgddh}, #{costs}, #{nl}, #{nldw},
#{zd}, #{cysj}, #{cksj},
#{ckzj}, #{ckyh}, #{djry}, #{inputman},
#{powerman}, #{contactman}, #{refsqh},
#{cyr}, #{bbsjr}, #{bbsjsj},
#{performby}, #{sbbr}, #{inzt},
#{libpos}, #{inlibtime}, #{inlibman},
#{outlibtime}, #{outlibman}, #{refused},
#{confirmtime}, #{confirmer}, #{cybl},
#{bbsjbl}, #{yljg}, #{kh}, #{klx},
#{jzsj}, #{jymd}, #{sfzh},
#{phone}, #{phone1}, #{yqdh}, #{sjsj},
#{addr}, #{lstd}, #{ssrq},
#{slzq}, #{cyblsj}, #{bbsjblsj},
#{ybrl},#{qsyljg},#{cjbw})
</insert>
<update id="updateLabReqmain" parameterType="com.czlis.common.core.domain.entity.lis.LabReqmain">
update lab_reqmain
<set>
<if test="ksdh != null">ksdh = #{ksdh},</if>
<if test="sqys != null">sqys = #{sqys},</if>
<if test="sqsj != null">sqsj = #{sqsj},</if>
<if test="jsys != null">jsys = #{jsys},</if>
<if test="jssj != null">jssj = #{jssj},</if>
<if test="zt != null">zt = #{zt},</if>
<if test="jjzt != null">jjzt = #{jjzt},</if>
<if test="brly != null">brly = #{brly},</if>
<if test="brdh != null">brdh = #{brdh},</if>
<if test="brxm != null">brxm = #{brxm},</if>
<if test="brxb != null">brxb = #{brxb},</if>
<if test="brsr != null">brsr = #{brsr},</if>
<if test="bz1 != null">bz1 = #{bz1},</if>
<if test="bz2 != null">bz2 = #{bz2},</if>
<if test="bz3 != null">bz3 = #{bz3},</if>
<if test="jzbz != null">jzbz = #{jzbz},</if>
<if test="txm != null">txm = #{txm},</if>
<if test="ch != null">ch = #{ch},</if>
<if test="yblx != null">yblx = #{yblx},</if>
<if test="zxys != null">zxys = #{zxys},</if>
<if test="zxsj != null">zxsj = #{zxsj},</if>
<if test="bgddh != null">bgddh = #{bgddh},</if>
<if test="costs != null">costs = #{costs},</if>
<if test="nl != null">nl = #{nl},</if>
<if test="nldw != null">nldw = #{nldw},</if>
<if test="zd != null">zd = #{zd},</if>
<if test="cysj != null">cysj = #{cysj},</if>
<if test="cksj != null">cksj = #{cksj},</if>
<if test="ckzj != null">ckzj = #{ckzj},</if>
<if test="ckyh != null">ckyh = #{ckyh},</if>
<if test="djry != null">djry = #{djry},</if>
<if test="inputman != null">inputman = #{inputman},</if>
<if test="powerman != null">powerman = #{powerman},</if>
<if test="contactman != null">contactman = #{contactman},</if>
<if test="refsqh != null">refsqh = #{refsqh},</if>
<if test="cyr != null">cyr = #{cyr},</if>
<if test="bbsjr != null">bbsjr = #{bbsjr},</if>
<if test="bbsjsj != null">bbsjsj = #{bbsjsj},</if>
<if test="performby != null">performby = #{performby},</if>
<if test="sbbr != null">sbbr = #{sbbr},</if>
<if test="inzt != null">inzt = #{inzt},</if>
<if test="libpos != null">libpos = #{libpos},</if>
<if test="inlibtime != null">inlibtime = #{inlibtime},</if>
<if test="inlibman != null">inlibman = #{inlibman},</if>
<if test="outlibtime != null">outlibtime = #{outlibtime},</if>
<if test="outlibman != null">outlibman = #{outlibman},</if>
<if test="refused != null">refused = #{refused},</if>
<if test="confirmtime != null">confirmtime = #{confirmtime},</if>
<if test="confirmer != null">confirmer = #{confirmer},</if>
<if test="cybl != null">cybl = #{cybl},</if>
<if test="bbsjbl != null">bbsjbl = #{bbsjbl},</if>
<if test="yljg != null">yljg = #{yljg},</if>
<if test="kh != null">kh = #{kh},</if>
<if test="klx != null">klx = #{klx},</if>
<if test="jzsj != null">jzsj = #{jzsj},</if>
<if test="jymd != null">jymd = #{jymd},</if>
<if test="sfzh != null">sfzh = #{sfzh},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="phone1 != null">phone1 = #{phone1},</if>
<if test="yqdh != null">yqdh = #{yqdh},</if>
<if test="sjsj != null">sjsj = #{sjsj},</if>
<if test="addr != null">addr = #{addr},</if>
<if test="lstd != null">lstd = #{lstd},</if>
<if test="ssrq != null">ssrq = #{ssrq},</if>
<if test="slzq != null">slzq = #{slzq},</if>
<if test="cyblsj != null">cyblsj = #{cyblsj},</if>
<if test="bbsjblsj != null">bbsjblsj = #{bbsjblsj},</if>
<if test="ybrl != null">ybrl = #{ybrl},</if>
<if test="qsyljg != null">qsyljg = #{qsyljg},</if>
</set>
where sqh = #{sqh}
</update>
<update id="updateLabReqmainAll" parameterType="com.czlis.common.core.domain.entity.lis.LabReqmain">
update lab_reqmain
set ksdh = #{ksdh},
sqys = #{sqys},
sqsj = #{sqsj},
jsys = #{jsys},
jssj = #{jssj},
zt = #{zt},
jjzt = #{jjzt},
brly = #{brly},
brdh = #{brdh},
brxm = #{brxm},
brxb = #{brxb},
brsr = #{brsr},
bz1 = #{bz1},
bz2 = #{bz2},
bz3 = #{bz3},
jzbz = #{jzbz},
txm = #{txm},
ch = #{ch},
yblx = #{yblx},
zxys = #{zxys},
zxsj = #{zxsj},
bgddh = #{bgddh},
costs = #{costs},
nl = #{nl},
nldw = #{nldw},
zd = #{zd},
cysj = #{cysj},
cksj = #{cksj},
ckzj = #{ckzj},
ckyh = #{ckyh},
djry = #{djry},
inputman = #{inputman},
powerman = #{powerman},
contactman = #{contactman},
refsqh = #{refsqh},
cyr = #{cyr},
bbsjr = #{bbsjr},
bbsjsj = #{bbsjsj},
performby = #{performby},
sbbr = #{sbbr},
inzt = #{inzt},
libpos = #{libpos},
inlibtime = #{inlibtime},
inlibman = #{inlibman},
outlibtime = #{outlibtime},
outlibman = #{outlibman},
refused = #{refused},
confirmtime = #{confirmtime},
confirmer = #{confirmer},
cybl = #{cybl},
bbsjbl = #{bbsjbl},
yljg = #{yljg},
kh = #{kh},
klx = #{klx},
jzsj = #{jzsj},
jymd = #{jymd},
sfzh = #{sfzh},
phone = #{phone},
phone1 = #{phone1},
yqdh = #{yqdh},
sjsj = #{sjsj},
addr = #{addr},
lstd = #{lstd},
ssrq = #{ssrq},
slzq = #{slzq},
cyblsj = #{cyblsj},
bbsjblsj = #{bbsjblsj},
ybrl = #{ybrl},
qsyljg = #{qsyljg}
where sqh = #{sqh}
</update>
</mapper>

View File

@ -0,0 +1,15 @@
<?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.LabReqsteplogMapper">
<select id="getLabReqsteplogOne" resultType="com.czlis.common.core.domain.entity.lis.LabReqsteplog">
select * from lab_reqsteplog where sqh = #{sqh} and xh=#{xh}
</select>
<select id="getLabReqsteplog" resultType="com.czlis.common.core.domain.entity.lis.LabReqsteplog">
select * from lab_reqsteplog where sqh = #{sqh}
</select>
</mapper>

View File

@ -25,7 +25,7 @@
<if test="sex != null and sex != ''">
and xb = #{sex}
</if>
<if test="age != null and age != 0">
<if test="age != null ">
and nl2 >= #{age} and #{age}>=nl1
</if>
<if test="zd != null ">

View File

@ -50,10 +50,10 @@ public class LisWorkOperController extends BaseController {
*/
@ApiOperation("审核报告")
@GetMapping("/check2")
public Result check21( Date jyrq, String yq, String ybh, String hdys){
public Result check2( Date jyrq, String yq, String ybh, String hdys){
log.info("yq:{}", yq);
hdys="lis";
return lisWorkOperService.check2(jyrq, yq, ybh, hdys);
return lisWorkOperService.confirm(jyrq, yq, ybh, hdys);
}
}

View File

@ -10,12 +10,13 @@ import java.util.Map;
public interface LisWorkOperMapper {
Long checkReqClass(@Param("sqh") String sqh,@Param("yq") String yq);
String selectSqxmdh(String sqh);
void sp_setrefs(Map<String,Object> map);
void spSetrefs(Map<String,Object> map);
void updatelabresultsqxmdhall(@Param("jyrq") Date jyrq,@Param("yq") String yq,@Param("ybh") String ybh,@Param("sqxmdh") String sqxmdh);
void updatelabresultsqxmdh(@Param("jyrq") Date jyrq,@Param("yq") String yq,@Param("ybh") String ybh,@Param("sqh") String sqh);
List<ResultCalcDTO> getResultCalc(@Param("jyrq") Date jyrq, @Param("yq") String yq, @Param("ybh") String ybh);
Integer getLimitCount(Map<String,Object> map);
Integer checkresultsqxmdh(@Param("jyrq") Date jyrq,@Param("yq") String yq,@Param("ybh") String ybh,@Param("sqh") String sqh);
String checkresultnosqxmdh(@Param("jyrq") Date jyrq,@Param("yq") String yq,@Param("ybh") String ybh);
Integer checkresultwxh(@Param("jyrq") Date jyrq, @Param("yq") String yq, @Param("ybh") String ybh);
LabPat checkdublereport(@Param("sqh") String sqh, @Param("ybh") String ybh);
LabPat checkyqdublereport(@Param("sqh") String sqh,@Param("yq") String yq, @Param("ybh") String ybh);

View File

@ -9,5 +9,5 @@ public interface LisWorkOperService {
Result newPatInfo(Date jyrq,String ybh, String sqh, String yq, Long userId);
Result changePat(LabPat labPat);
Result check2(Date jyrq, String yq, String ybh, String hdys);
Result confirm(Date jyrq, String yq, String ybh, String hdys);
}

View File

@ -2,6 +2,7 @@ package com.czlis.liswork.service.impl;
import com.czlis.common.core.domain.entity.lis.*;
import com.czlis.common.utils.SecurityUtils;
import com.czlis.common.utils.ServletUtils;
import com.czlis.common.utils.StringUtils;
import com.czlis.common.utils.ip.IpUtils;
@ -205,7 +206,7 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
* @param hdys
* @return
*/
public Result check2(Date jyrq, String yq, String ybh, String hdys) {
public Result confirm(Date jyrq, String yq, String ybh, String hdys) {
if (hdys == null || "".equals(hdys)) new Result("-1", "审核者为空,无法审核!");
//入参通过GET推送时使用ServletUtils.getParameterToInt获取
//入参通过POSTJSON时使用JsonParamUtils.getParameterToInt获取
@ -215,29 +216,43 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
if (!commonUtil.getUserPower(yq, hdys, 20)) return new Result("-1", "当前核对者无权对本仪器报告审核!");
//2:数据合法性校验
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
Result result = beforecheck2(labPat, hdys, problemId);
if ("0".equals(result.getCode())) return result;
labPat.setHdys(hdys);
Result result = beforeconfirm(labPat, problemId);
if (!"0".equals(result.getCode())) return result;
//3:数据完整保存
saveallresult(jyrq, yq, ybh);
int wjz = saveallresult(labPat);
//同步主表危急值标识
String alarmflag = labPat.getAlarmflag();
if (("1".equals(alarmflag) && wjz != 1)) {
labPat.setAlarmflag("1");
} else if (("".equals(alarmflag) || alarmflag == null) && wjz == 1) {
labPat.setAlarmflag("");
}
//4:CA请求业务的处理
//Result result=addCA(jyrq, yq, ybh, hdys);
//if("0".equals(result.getCode()))return result;
//5:数据状态修改,异步上传接口作业创建
Result result1 = aftercheck2(jyrq, yq, ybh, hdys);
if ("0".equals(result1.getCode())) return result1;
Result result1 = afterconfirm(labPat, problemId);
if (!"0".equals(result1.getCode())) return result1;
return new Result("0", "保存成功!");
}
public Result beforecheck2(Date jyrq, String yq, String ybh, String hdys) {
/**
* 审核前校验数据完整性,审核业务和初审业务都可使用
*
* @param jyrq
* @param yq
* @param ybh
* @return
*/
public Result beforeconfirm(Date jyrq, String yq, String ybh) {
int problemId = ServletUtils.getParameterToInt("problemId", 0);
if (hdys == null || "".equals(hdys)) new Result("-1", "审核者为空,无法审核!");
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
return beforecheck2(labPat, hdys, problemId);
return beforeconfirm(labPat, problemId);
}
private Result beforecheck2(LabPat labPat, String hdys, Integer problemId) {
if (hdys == null || "".equals(hdys)) new Result("-1", "审核者为空,无法审核!");
//内部使用
private Result beforeconfirm(LabPat labPat, Integer problemId) {
Date jyrq = labPat.getJyrq();
String yq = labPat.getYq();
String ybh = labPat.getYbh();
@ -278,7 +293,7 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
}
List<LabResult> labResultList = commonUtil.getLabResultList(jyrq, yq, ybh);
if (labResultList == null) return new Result("-1", "结果为空禁止审核!");
if (labResultList == null || labResultList.size() == 0) return new Result("-1", "结果为空禁止审核!");
for (LabResult labResult : labResultList) {
String csjg = labResult.getCsjg();
if ("未做".equals(csjg)) {
@ -308,7 +323,7 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
if (wxh > 0) return new Result("-1", "有结果为****禁止审核!");
}
String sqh = labPat.getSqh();
if (sqh == null || "".equals(sqh)) {
if (sqh != null && !"".equals(sqh)) {
if (!"质控".equals(brlyname)) {
if ("1".equals(commonUtil.getHISOPT("sp_dublereport"))) {
LabPat labPat0 = lisWorkOperMapper.checkdublereport(sqh, ybh);
@ -329,14 +344,17 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
}
}
String Userid = labPat.getHdys();
if (Userid == null || "".equals(Userid)) {
Userid = SecurityUtils.getLoginUser().getUsername();
}
//调用his报告接口,检查外部接口对审核前的定制需求
SetReport setReport = new SetReport();
setReport.setIp(IpUtils.getIpAddr());
setReport.setJyrq(DateFormatUtils.format(jyrq, "yyyy-MM-dd"));
setReport.setYq(yq.trim());
setReport.setYbh(ybh);
setReport.setUserid(hdys);
setReport.setUserid(Userid);
setReport.setStatus(LisinterfaceNameConstants.REPORTSTART);
Result result = lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.SETREPORT, setReport);
if (result.getCode().equals("5")) {
@ -349,7 +367,63 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
return new Result("0", "保存成功!");
}
public Result aftercheck2(Date jyrq, String yq, String ybh, String hdys) {
/**
* 审核后步骤,在审核过程中,必须完成审核前校验通过,结果计算值填充,参考值结果标志危急值标志填写完成,最后使用此方法修改状态
*
* @param jyrq
* @param yq
* @param ybh
* @return
*/
public Result afterconfirm(Date jyrq, String yq, String ybh) {
int problemId = ServletUtils.getParameterToInt("problemId", 0);
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
return afterconfirm(labPat, problemId);
}
//内部使用
private Result afterconfirm(LabPat labPat, Integer problemId) {
Date jyrq = labPat.getJyrq();
String yq = labPat.getYq();
String ybh = labPat.getYbh();
String hdys = labPat.getHdys();
String itemvs = commonUtil.getHISOPT("itemvs");
if ("1".equals(itemvs)) {
String yqdl = commonUtil.getYqdl(yq);
if (!"细菌仪".equals(yqdl)) {
String nullcount = lisWorkOperMapper.checkresultnosqxmdh(jyrq, yq, ybh);
if (!"".equals(nullcount) && nullcount != null)
return new Result("-1", "报告项目未对应申请项目,请进(收费项目报告项目对照)菜单维护对照:\r\n" + nullcount);
}
}
Date Confirmdt = new Date();
labPat.setConfirmdt(Confirmdt);
labPat.setConfirmer(hdys);
labPat.setLastdt(Confirmdt);
labPat.setLastuser(hdys);
Date dysj = labPat.getDysj();
if (dysj == null) dysj = Confirmdt;
if (commonUtil.getDateString(dysj).equals(commonUtil.getCurrentDate())) dysj = Confirmdt;
Date jysj = labPat.getSqsj();
if (jysj.after(dysj)) jysj = dysj;
labPat.setDysj(dysj);
String sqh = labPat.getSqh();
LabReqmain labReqmain = commonUtil.getLabReqmainOne(sqh);
if (labReqmain != null) {
String zt = labReqmain.getZt();
if (SampleStatusConstants.CANCAL.equals(zt)) return new Result("-1", "申请单已作废禁止审核!");
labReqmain.setYqdh(yq);
labReqmain.setSjsj(jysj);
labReqmain.setConfirmer(hdys);
labReqmain.setConfirmtime(Confirmdt);
labReqmain = checklabReqmainTAT(labReqmain);
if (!SampleStatusConstants.CANCAL.equals(zt)) labReqmain.setZt(SampleStatusConstants.CONFIRM);
commonUtil.updateLabReqmain(labReqmain);
Date cysj = labReqmain.getCysj();
if (cysj != null) labPat.setCyrq(cysj);
}
//调用his报告接口,完成报告同时调用外部接口任务
SetReport setReport = new SetReport();
setReport.setIp(IpUtils.getIpAddr());
@ -359,10 +433,109 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
setReport.setUserid(hdys);
setReport.setStatus(LisinterfaceNameConstants.REPORTEND);
Result result = lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.SETREPORT, setReport);
if (result.getCode().equals("5")) {
if (problemId < 4) {
return new Result(result.getCode(), result.getMsg(), 4);
}
return new Result("0", "保存成功!");
}
if (!result.getCode().equals("0")) return result;
//最后完成
labPat.setJgbz(ReportStatusConstants.CONFIRM);
commonUtil.updateLabPat(labPat);
return new Result("0", "保存成功!");
}
/**
* 申请单表校验TAT时间顺序,恢复时间倒置的时间轴
*
* @param labReqmain
* @return
*/
private LabReqmain checklabReqmainTAT(LabReqmain labReqmain) {
if (labReqmain != null) {
Date confirmtime = labReqmain.getConfirmtime();
Date jysj = labReqmain.getSjsj();
String sqh = labReqmain.getSqh();
Date zxsj = labReqmain.getZxsj();
Date cysj = labReqmain.getCysj();
Date bbsjsj = labReqmain.getBbsjsj();
Date jssj = labReqmain.getJssj();
Date sjsj = labReqmain.getSjsj();
if (sjsj == null) sjsj = jysj;
if (sjsj.after(confirmtime)) sjsj = jysj;
if (jssj == null) jssj = sjsj;
if (jssj.after(confirmtime)) jssj = sjsj;
if (bbsjsj != null) {
if (bbsjsj.after(jssj) && jysj.after(bbsjsj)) jssj = jysj;
}
if (cysj != null) {
if (cysj.after(jssj) && jysj.after(cysj)) jssj = jysj;
}
if (jssj.after(sjsj)) sjsj = jysj;
List<LabReqsteplog> labReqsteplog = commonUtil.getLabReqsteplog(sqh);
if (bbsjsj != null && bbsjsj.after(jssj)) {
Date sj = jssj;
Date finalSj = sj;
Optional<LabReqsteplog> maxTimeEntity = labReqsteplog.stream()
.filter(entity -> "13".equals(entity.getZt()))
.filter(entity -> entity.getChangedate().before(finalSj))
.max(Comparator.comparing(LabReqsteplog::getChangedate));
if (maxTimeEntity.isPresent()) {
sj = maxTimeEntity.get().getChangedate();
}
bbsjsj = sj;
labReqmain.setBbsjsj(bbsjsj);
} else {
bbsjsj = jssj;
}
if (cysj != null && cysj.after(bbsjsj)) {
Date sj = bbsjsj;
Date finalSj = sj;
Optional<LabReqsteplog> maxTimeEntity = labReqsteplog.stream()
.filter(entity -> "12".equals(entity.getZt()))
.filter(entity -> entity.getChangedate().before(finalSj))
.max(Comparator.comparing(LabReqsteplog::getChangedate));
if (maxTimeEntity.isPresent()) {
sj = maxTimeEntity.get().getChangedate();
}
cysj = sj;
labReqmain.setCysj(cysj);
}
if (cysj != null && zxsj.after(cysj) && bbsjsj.after(zxsj)) {
Date sj = bbsjsj;
Date finalSj = sj;
Optional<LabReqsteplog> maxTimeEntity = labReqsteplog.stream()
.filter(entity -> "12".equals(entity.getZt()))
.filter(entity -> entity.getChangedate().before(finalSj))
.max(Comparator.comparing(LabReqsteplog::getChangedate));
if (maxTimeEntity.isPresent()) {
cysj = maxTimeEntity.get().getChangedate();
} else cysj = zxsj;
labReqmain.setCysj(cysj);
} else {
cysj = bbsjsj;
}
if (zxsj != null && zxsj.after(cysj)) {
Date sj = cysj;
Date finalSj = sj;
Optional<LabReqsteplog> maxTimeEntity = labReqsteplog.stream()
.filter(entity -> "11".equals(entity.getZt()))
.filter(entity -> entity.getChangedate().before(finalSj))
.max(Comparator.comparing(LabReqsteplog::getChangedate));
if (maxTimeEntity.isPresent()) {
sj = maxTimeEntity.get().getChangedate();
}
zxsj = sj;
labReqmain.setZxsj(zxsj);
}
labReqmain.setSjsj(sjsj);
}
return labReqmain;
}
/**
* 保存所有结果的修正值,涉及:空结果清除,计算项目添加,添加单位,添加申请项目编码,参考值重新计算更新,结果标志重新计算更新,危急值标志计算更新
*
@ -372,12 +545,21 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
public Result saveallresult(Date jyrq, String yq, String ybh) {
//查询病人信息
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
saveallresult(labPat);
int wjz = saveallresult(labPat);
//同步主表危急值标识
String alarmflag = labPat.getAlarmflag();
if (("1".equals(alarmflag) && wjz != 1)) {
labPat.setAlarmflag("1");
commonUtil.updateLabPat(labPat);
} else if (("".equals(alarmflag) || alarmflag == null) && wjz == 1) {
labPat.setAlarmflag("");
commonUtil.updateLabPat(labPat);
}
return new Result("0", "保存成功!");
}
//内部使用
private void saveallresult(LabPat labPat) {
private int saveallresult(LabPat labPat) {
Date jyrq = labPat.getJyrq();
String yq = labPat.getYq();
String ybh = labPat.getYbh();
@ -389,10 +571,11 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
//计算项目更新
calcsample(labPat);
//保存最新参考值结果标志
saverefs(labPat);
int wjz = saverefs(labPat);
//补写结果表申请单项目编号
String sqh = labPat.getYbh();
String sqh = labPat.getSqh();
if (sqh != null && !"".equals(sqh)) setItemSqxmdh(jyrq, yq, ybh, sqh);
return wjz;
}
/**
@ -412,8 +595,7 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
//内部使用
private void setItemSqxmdh(Date jyrq, String yq, String ybh, String sqh) {
if (sqh == null || "".equals(sqh)) {
} else {
if (sqh != null && !"".equals(sqh)) {
int sl = labReqdetailMapper.getCountByKey(sqh);
if (sl == 1) {
String sqxmdh = lisWorkOperMapper.selectSqxmdh(sqh);
@ -449,28 +631,45 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
String xmdh = resultCalc.getJsxm();
if (!xmdhold.equals(xmdh)) {
xmdhold = xmdh;
String sex = labPat.getBrxb().trim();
if ("1".equals(sex)) sex = "男";
if ("2".equals(sex)) sex = "女";
double age = AgeUtils.getDecimalAge(AgeUtils.getBirthDateByAge(labPat.getNl(), labPat.getNldw()));
boolean setjgsg = true;
Map<String, String> variables = new HashMap<>();
variables.put("SEX", sex); // 示例值
variables.put("AGE", String.valueOf(age));
String result = CalcUtils.getValueFromCalc(jsgs, variables);
if (result != null && !result.trim().isEmpty()) {
//插入结果值
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(xmdh);
labResult.setCsjg(result);
commonUtil.insertLabResult(labResult);
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 ("1".equals(sex)) sex = "男";
if ("2".equals(sex)) sex = "女";
variables.put("SEX", sex);
} else if ("AGE".equals(itemcode)) {
double age = AgeUtils.getDecimalAge(AgeUtils.getBirthDateByAge(labPat.getNl(), labPat.getNldw()));
variables.put("AGE", String.valueOf(age));
} else {
labResult.setCsjg(result);
commonUtil.updateLabResult(labResult);
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;
}
}
}
if (setjgsg) {
String result = CalcUtils.getValueFromCalc(jsgs, variables);
if (result != null && !result.trim().isEmpty()) {
//插入结果值
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(xmdh);
labResult.setCsjg(result);
commonUtil.insertLabResult(labResult);
} else {
labResult.setCsjg(result);
commonUtil.updateLabResult(labResult);
}
}
}
}
@ -486,7 +685,16 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
*/
public Result saverefs(Date jyrq, String yq, String ybh) {
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
saverefs(labPat);
int wjz = saverefs(labPat);
//同步主表危急值标识
String alarmflag = labPat.getAlarmflag();
if (("1".equals(alarmflag) && wjz != 1)) {
labPat.setAlarmflag("1");
commonUtil.updateLabPat(labPat);
} else if (("".equals(alarmflag) || alarmflag == null) && wjz == 1) {
labPat.setAlarmflag("");
commonUtil.updateLabPat(labPat);
}
return new Result("0", "保存成功!");
}
//内部使用
@ -511,7 +719,7 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
map.put("settype", "1");
map.put("retcode", "");
map.put("retmsg", "");
lisWorkOperMapper.sp_setrefs(map);
lisWorkOperMapper.spSetrefs(map);
String retCode = String.valueOf(map.get("retcode"));
String retMsg = String.valueOf(map.get("retmsg"));
log.info("调用存储过程{}返回值:{},{}", "sp_setrefs", retCode, retMsg);
@ -546,26 +754,18 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
}
//危急值标识去除原则
String brxm = labPat.getBrxm();
if (brxm.contains("质控") || brxm.contains("复查") || brxm.contains("QC") || brxm.contains("qc") || brxm.contains("软化水") || brxm.contains("锅炉水")) {
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();
brly = commonUtil.getComDictNameById("PT", brly);
if (brly.contains("质控")) lb_wjz = false;
if(brly !=null)brly = commonUtil.getComDictNameById("PT", brly);
if(brly !=null)if (brly.contains("质控")) lb_wjz = false;
String ksdh = labPat.getKsdh();
ksdh = commonUtil.getComDictNameById("DP", ksdh);
if (ksdh.contains("检验科")) lb_wjz = false;
if(ksdh !=null)ksdh = commonUtil.getComDictNameById("DP", ksdh);
if(ksdh !=null)if (ksdh.contains("检验科")) lb_wjz = false;
//同步主表危急值标识
String alarmflag = labPat.getAlarmflag();
if (("1".equals(alarmflag) && !lb_wjz)) {
labPat.setAlarmflag("1");
commonUtil.updateLabPat(labPat);
} else if (("".equals(alarmflag) || alarmflag == null) && lb_wjz) {
labPat.setAlarmflag("");
commonUtil.updateLabPat(labPat);
}
if (lb_wjz) return 1;
}
return 0;
}
@ -600,44 +800,41 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
String ygbb = xmInfo.getYgbb();
String ygzq = xmInfo.getYgzq();
String ygzd = xmInfo.getYgzd();
String sex = "";
String sex = null;
if ("Y".equals(ygxb)) {
sex = labPat.getBrxb().trim();
if (sex == null) sex = "";
}
String yblx = "";
String yblx = null;
if ("Y".equals(ygbb)) {
yblx = labPat.getYblx();
String bb = commonUtil.getComDictIdByName("BT", yblx);
if (bb != null && !bb.trim().isEmpty()) yblx = bb;
}
String zd = "";
String zd = null;
if ("Y".equals(ygzd)) {
zd = labPat.getZd();
String icd10 = commonUtil.getComDictIdByName("ICD10", zd);
if (icd10 != null && !icd10.trim().isEmpty()) zd = icd10;
if (zd == null) {zd="";}
}
String slzq = "";
String slzq = null;
if ("Y".equals(ygzq)) {
slzq = labPat.getSlzq();
String zq = commonUtil.getComDictIdByName("SLZQ", slzq);
if (zq != null && !zq.trim().isEmpty()) slzq = zq;
if (slzq != null) {
String zq = commonUtil.getComDictIdByName("SLZQ", slzq);
if (zq != null && !zq.trim().isEmpty()) slzq = zq;
} else {
slzq = "";
}
}
double age = 0;
Double age = null;
if ("Y".equals(ygnl)) {
age = AgeUtils.getDecimalAge(AgeUtils.getBirthDateByAge(labPat.getNl(), labPat.getNldw()));
}
XmRef xmRef = new XmRef();
if ("Y".equals(ygxb) || "Y".equals(ygbb) || "Y".equals(ygnl) || "Y".equals(ygzd) || "Y".equals(ygzq)) {
Map<String, Object> map = new HashMap<>();
map.put("yq", yblx);
map.put("xmdh", sex);
map.put("bbtype", yblx);
map.put("sex", sex);
map.put("age", age);
map.put("zd", zd);
map.put("slzq", slzq);
xmRef = commonUtil.getXmRefValue(map);
xmRef = commonUtil.getXmRefValue(yq, xmdh, yblx, sex, age, zd, slzq);
}
if (xmRef != null) {
ckxx = xmRef.getCkxx();
@ -669,10 +866,10 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
lmtflag = "P";
resultflag = lmtflag;
if ("J".equals(lmtflag)) wjzflag = "H";
int wjzf = alarmcondition(labPat, labResult);
if (wjzf == 1) wjzflag = "H";//满足特定危机值条件
if (wjzf == 0) wjzflag = "";//存在特定危机值条件,但不满足不提示
}
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);
@ -707,11 +904,15 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
String brxm = "";
String brdh = "";
String ksdh = labPat.getKsdh();
String ksdh1 = commonUtil.getComDictIdByName("BT", ksdh);
if (ksdh1 != null && !ksdh1.trim().isEmpty()) ksdh = ksdh1;
if (ksdh != null && !ksdh.trim().isEmpty()) {
String ksdh1 = commonUtil.getComDictIdByName("DP", ksdh);
if (ksdh1 != null && !ksdh1.trim().isEmpty()) ksdh = ksdh1;
}
String ybzt = labPat.getYbzt();
String ybzt1 = commonUtil.getComDictIdByName("ST", ybzt);
if (ybzt1 != null && !ybzt1.trim().isEmpty()) ybzt = ybzt1;
if (ybzt != null && !ybzt.trim().isEmpty()) {
String ybzt1 = commonUtil.getComDictIdByName("ST", ybzt);
if (ybzt1 != null && !ybzt1.trim().isEmpty()) ybzt = ybzt1;
}
String zd = labPat.getZd();
for (XmAlarmdetail xmAlarmdetail : getXmAlarmdetail) {
String samplecondition = xmAlarmdetail.getSamplecondition();

View File

@ -16,6 +16,14 @@
where a.xmdh not in (select b.xmdh from xm_reqitem_vs_reportitem b ,lab_reqdetail c where b.sqxmdh=c.sqxmdh and b.yq=a.yq and c.sqh=#{sqh})
and a.yq=#{yq} and a.ybh=#{ybh} and a.jyrq=#{jyrq} AND a.xmdh NOT LIKE 'GLU%'
</select>
<select id="checkresultnosqxmdh" resultType="String">
select (select c.xmmc+ ';' from lab_result a join xm_info c on c.yq=a.yq and c.xmdh=a.xmdh and c.dylx !='3'
where a.jyrq=b.jyrq and a.yq=b.yq and a.ybh=b.ybh and isnull(a.sqxmdh,'')='' FOR XML PATH(''))
from lab_pat b join lab_instr on lab_instr.yqdl !='细菌仪' and lab_instr.yq=b.yq
where b.yq =#{yq} And b.jyrq =#{jyrq} And b.ybh =#{ybh} and b.sqh !=''
</select>
<select id="checkresultwxh" resultType="Integer">
select count(1) from lab_result,xm_info