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

This commit is contained in:
jiangs 2025-08-29 14:16:43 +08:00
commit a2855b373a
19 changed files with 702 additions and 31 deletions

View File

@ -0,0 +1,26 @@
package com.czlis.common.core.domain.entity.lis;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ComLog {
private String yq;
private Date rzdt;
private String rzbz;
private String yhdh;
private String rznr;
private String dnmc;
private String bz;
private Date jyrq;
private String ybh;
}

View File

@ -0,0 +1,16 @@
package com.czlis.common.core.domain.entity.lis;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class LabChk {
private String yq;
private Integer xh;
private String hdnr;
private String tsxx;
}

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;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class LabRefused {
private String sqh;
private Date refusedtime;
private String refuseder;
private String ksdh;
private String bz;
private String refusetext;
private String jsr;
private Date jssj;
private String bz1;
}

View File

@ -36,7 +36,7 @@ public class LabReqmain extends BaseEntity {
private String zxys; private String zxys;
private Date zxsj; private Date zxsj;
private String bgddh; private String bgddh;
private BigDecimal costs; private Double costs;
private Integer nl; private Integer nl;
private String nldw; private String nldw;
private String zd; private String zd;

View File

@ -165,4 +165,39 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault()); ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault());
return Date.from(zdt.toInstant()); return Date.from(zdt.toInstant());
} }
/**
* 根据 Date 对象获取周几(周1-周7)
* @param date 目标日期
* @return 1-7
*/
public static int getWeekDay(Date date) {
// Date 转 LocalDate(默认系统时区)
LocalDate localDate = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
// 获取周索引:Monday=1,Sunday=7(更符合日常认知)
return localDate.getDayOfWeek().getValue();
}
/**
* 根据 Date 对象获取星期几(中文)
* @param date 目标日期
* @return 中文周几(如 "星期一"、"星期日")
*/
public static String getWeekDayName(Date date) {
// Date 转 LocalDate(默认系统时区)
LocalDate localDate = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
// 获取周索引:Monday=1,Sunday=7(更符合日常认知)
int weekIndex= localDate.getDayOfWeek().getValue();
String[] weekDays = {"", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"};
return weekDays[weekIndex];
}
/**
* 获取当前时间(时分秒)
* @param date
* @param format HH:mm/HH:mm:ss/hh:mm:ss a
* @return
*/
public static String time(Date date,String format) {
SimpleDateFormat hourMinFormatter = new SimpleDateFormat("HH:mm");
return hourMinFormatter.format(date);
}
} }

View File

@ -0,0 +1,13 @@
package com.czlis.interfaceCommon.mapper;
import com.czlis.common.core.domain.entity.lis.LabChk;
import com.czlis.common.core.domain.entity.lis.LabResult;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
public interface CheckResultMapper {
List<LabResult> getChkvaList(@Param("brdh") String brdh, @Param("startda") Date startda, @Param("endda") Date endda,@Param("yq") String yq,@Param("xmdh") String xmdh);
List<LabChk> getLabChkList(String yq);
}

View File

@ -0,0 +1,8 @@
package com.czlis.interfaceCommon.mapper;
import com.czlis.common.core.domain.entity.lis.ComLog;
import java.util.List;
public interface ComLogMapper {
List<ComLog> getComLog(ComLog comLog);
int insertComLog(ComLog comLog);
}

View File

@ -0,0 +1,13 @@
package com.czlis.interfaceCommon.mapper;
import com.czlis.common.core.domain.entity.lis.LabRefused;
import java.util.List;
public interface LabRefusedMapper {
List<LabRefused> getLabRefusedList(LabRefused labRefused);
LabRefused getLabRefusedOne(String sqh);
int delLabRefused(String sqh);
int insertLabRefused(LabRefused labRefused);
int updateLabRefused(LabRefused labRefused);
}

View File

@ -0,0 +1,133 @@
package com.czlis.interfaceCommon.utils;
import com.czlis.common.core.domain.Result;
import com.czlis.common.core.domain.entity.lis.*;
import com.czlis.interfaceCommon.mapper.CheckResultMapper;
import com.czlis.interfaceCommon.mapper.XmInfoMapper;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Component
public class CheckResultUtils {
@Autowired
XmInfoMapper xmInfoMapper;
@Autowired
CheckResultMapper checkResultMapper;
public String chksample(LabPat labPat, List<LabResult> labResultList) {
String errmsg = "";
String brdh = labPat.getBrdh();
if (brdh == null || "".equals(brdh)) {
return errmsg;
}
String yq = labPat.getYq();
Date jyrq = labPat.getJyrq();
String ybh = labPat.getYbh();
List<XmInfo> xmInfoList = xmInfoMapper.getXmInfoList(yq);
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);
//字典规定的结果值范围约束
Double xjx = xmInfo.getXjx();
Double sjx = xmInfo.getSjx();
if (xjx != null || sjx != null) {
String csjg = LisUtil.getOverNumber(labResult.getCsjg());
if (LisUtil.isNumber(csjg)) {
Double csjgnum = Double.parseDouble(csjg);
if (xjx != null && csjgnum <= xjx) {
errmsg = errmsg + LisUtil.LINE_SEPARATOR + xmdh + " 结果超出审核条件";
} else if (sjx != null && csjgnum >= sjx) {
errmsg = errmsg + LisUtil.LINE_SEPARATOR + xmdh + " 结果超出审核条件";
}
}
}
//字典规定的多少天内结果间隔范围约束
Integer jgjg = xmInfo.getJgjg();
Double jgz = xmInfo.getJgz();
String jgbz = xmInfo.getJgbz();
if (jgjg != null && jgjg > 0 && jgz != null && jgz > 0) {
String csjg = LisUtil.getOverNumber(labResult.getCsjg());
if (LisUtil.isNumber(csjg)) {
Double csjgnum = Double.parseDouble(csjg);
Date ldt_startda = LisUtil.relativeDate(jyrq, -jgjg);
Double lde_up = null;
Double lde_low = null;
if ("2".equals(jgbz)) {
lde_up = csjgnum / (1 - jgz / 100);
lde_low = csjgnum / (1 + jgz / 100);
} else {
lde_up = csjgnum + jgz;
lde_low = csjgnum - jgz;
}
List<LabResult> chkval = checkResultMapper.getChkvaList(brdh, ldt_startda, jyrq, yq, xmdh);
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 (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() + ") 相比超标";
}
}
}
}
}
}
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);
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 {
List<LabResult> collect = labResultList.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) {
boolean result = CalcUtils.getBooleanFromCalc(jsgs, variables);
if (!result) {
errmsg=errmsg+LisUtil.LINE_SEPARATOR+"审核条件: "+ jsgs + " 未通过!";
}
}
}
if(!"".equals(errmsg))errmsg= errmsg +LisUtil.LINE_SEPARATOR+ "请咨询该仪器组长或专业检验师 !";
return errmsg;
}
public Result chksamplenew(LabPat labPat, List<LabResult> labResultList){
return new Result("0", "");
}
}

View File

@ -5,6 +5,7 @@ import com.czlis.common.core.domain.entity.lis.*;
import com.czlis.common.utils.ComDictUtils; import com.czlis.common.utils.ComDictUtils;
import com.czlis.common.utils.ComOptionUtils; import com.czlis.common.utils.ComOptionUtils;
import com.czlis.interfaceCommon.mapper.*; import com.czlis.interfaceCommon.mapper.*;
import com.sun.org.apache.bcel.internal.generic.RETURN;
import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -50,7 +51,10 @@ public class CommonUtil {
LabReqreportPdffileMapper labReqreportPdffileMapper; LabReqreportPdffileMapper labReqreportPdffileMapper;
@Autowired @Autowired
LabReqsteplogMapper labReqsteplogMapper; LabReqsteplogMapper labReqsteplogMapper;
@Autowired
ComLogMapper comLogMapper;
@Autowired
LabRefusedMapper labRefusedMapper;
//====检验主表操作方法集合=== //====检验主表操作方法集合===
public LabPat getLabPatOne(Date jyrq, String yq, String ybh) { public LabPat getLabPatOne(Date jyrq, String yq, String ybh) {
return labPatMapper.getLabPatOne(jyrq, yq, ybh); return labPatMapper.getLabPatOne(jyrq, yq, ybh);
@ -107,6 +111,13 @@ public class CommonUtil {
public List<LabReqsteplog> getLabReqsteplog(String sqh) { public List<LabReqsteplog> getLabReqsteplog(String sqh) {
return labReqsteplogMapper.getLabReqsteplog(sqh); return labReqsteplogMapper.getLabReqsteplog(sqh);
} }
public List<LabRefused> getLabRefusedList(LabRefused labRefused){
return labRefusedMapper.getLabRefusedList(labRefused);
}
public int insertLabRefused(LabRefused labRefused){
return labRefusedMapper.insertLabRefused(labRefused);
}
//申请单明细表集合 //申请单明细表集合
//====检验结果表操作方法集合=== //====检验结果表操作方法集合===
@ -173,8 +184,8 @@ public class CommonUtil {
public List<XmAlarmdetail> getXmAlarmdetail(String yq, String xmdh) { public List<XmAlarmdetail> getXmAlarmdetail(String yq, String xmdh) {
return xmAlarmdetailMapper.getXmAlarmdetail(yq, xmdh); return xmAlarmdetailMapper.getXmAlarmdetail(yq, xmdh);
} }
public Integer insertComLog(ComLog comLog) {return comLogMapper.insertComLog(comLog);}
;
public String getYqmc(String yq) { public String getYqmc(String yq) {
return labInstrMapper.getYqmc(yq); return labInstrMapper.getYqmc(yq);

View File

@ -1,10 +1,12 @@
package com.czlis.interfaceCommon.utils; package com.czlis.interfaceCommon.utils;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.Map; import java.util.Map;
public class LisUtil { public class LisUtil {
// 换行符常量(跨平台)
public static final String LINE_SEPARATOR = System.lineSeparator();
/** /**
* 生日格式为:yyyy-MM-dd * 生日格式为:yyyy-MM-dd
* 根据出生日期计算年龄 * 根据出生日期计算年龄
@ -203,4 +205,55 @@ public class LisUtil {
return input; return input;
} }
} }
/**
* 根据天数返回日期,正数往后推,负数往前推
* @param day
* @return
*/
public static Date relativeDate(int day) {
// 1. 获取当前时间(基于Calendar)
Calendar calendar = Calendar.getInstance(); // 当前时间
calendar.add(Calendar.DAY_OF_MONTH, day);
// 2重置时间为00:00:00
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
// 3. 返回推算的出生日期
return calendar.getTime();
}
public static Date relativeDate(Date date,int day) {
// 1. 获取当前时间(基于Calendar)
Calendar calendar =Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.DAY_OF_MONTH, day);
// 2重置时间为00:00:00
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
// 3. 返回推算的出生日期
return calendar.getTime();
}
/**
* 根据天数返回日期时间,正数往后推,负数往前推
* @param day
* @return
*/
public static Date relativeDateTime(int day) {
// 1. 获取当前时间(基于Calendar)
Calendar calendar = Calendar.getInstance(); // 当前时间
// 2天:忽略小时,按整天推算
calendar.add(Calendar.DAY_OF_MONTH, day);
// 3. 返回推算的时间
return calendar.getTime();
}
public static Date relativeDateTime(Date date,int day) {
// 1. 获取当前时间(基于Calendar)
Calendar calendar = Calendar.getInstance(); // 当前时间
calendar.setTime(date);
// 2天:忽略小时,按整天推算
calendar.add(Calendar.DAY_OF_MONTH, day);
// 3. 返回推算的时间
return calendar.getTime();
}
} }

View File

@ -21,5 +21,12 @@
and DATEPART(weekday, GETDATE()- 1)>= a.weekday and a.weekday1>=DATEPART(weekday, GETDATE()- 1) and DATEPART(weekday, GETDATE()- 1)>= a.weekday and a.weekday1>=DATEPART(weekday, GETDATE()- 1)
and a.bglqdh = #{bglqdh} and a.bglqdh = #{bglqdh}
</select> </select>
<select id="getbglqsm" resultType="String">
select isnull((SELECT top 1 d.bglqsm FROM lab_rptgetruledetail d WHERE d.bglqdh
in(select isnull(xm_fee.bglqdh,c.bglqdh) from xm_fee,lab_reqdetail where xm_fee.sfxmdh=lab_reqdetail.sqxmdh and lab_reqdetail.sqh=b.sqh)
and CONVERT(varchar(5), GETDATE(), 8) >= d.kssj AND d.jssj >= CONVERT(varchar(5), GETDATE(), 8) AND
DATEPART(weekday, GETDATE()- 1)>= d.weekday and d.weekday1>=DATEPART(weekday, GETDATE()- 1)
order by bgxss desc ),'') as bglqsm
from lab_reqmain b left join lab_feeitemclass c on c.sflbdh=b.bgddh where b.sqh = #{sqh}
</select>
</mapper> </mapper>

View File

@ -0,0 +1,26 @@
<?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.CheckResultMapper">
<select id="getChkvaList" resultType="com.czlis.common.core.domain.entity.lis.LabResult">
SELECT lab_result.jyrq,
lab_result.ybh,
lab_result.csjg
FROM lab_result,
lab_pat
WHERE ( lab_result.jyrq = lab_pat.jyrq ) and
( lab_result.yq = lab_pat.yq ) and
( lab_result.ybh = lab_pat.ybh ) and
( ( lab_pat.brdh = #{brdh} ) AND
( lab_result.jyrq >= #{startda} ) AND
( #{endda} >= lab_result.jyrq ) AND
( lab_result.yq = #{yq} ) AND
( lab_result.xmdh =#{xmdh} ) )
</select>
<select id="getLabChkList" resultType="com.czlis.common.core.domain.entity.lis.LabChk">
SELECT lab_chk.yq ,lab_chk.xh,lab_chk.hdnr,lab_chk.tsxx
FROM lab_chk WHERE lab_chk.yq = #{yq}
</select>
</mapper>

View File

@ -0,0 +1,42 @@
<?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.ComLogMapper">
<select id="getComLog" resultType="com.czlis.common.core.domain.entity.lis.ComLog">
select * from com_log
<where>
<if test="yq != null ">
and yq = #{yq}
</if>
<if test="rzbz != null ">
and rzbz = #{rzbz}
</if>
<if test="jyrq != null ">
and jyrq = #{jyrq}
</if>
<if test="ybh != null ">
and ybh = #{ybh}
</if>
</where>
</select>
<insert id="insertComLog" parameterType="com.czlis.common.core.domain.entity.lis.ComLog">
insert into com_log(yq,rzdt,
<if test="rzbz != null ">rzbz,</if>
<if test="yhdh != null">yhdh,</if>
<if test="rznr != null and rznr != ''">rznr,</if>
<if test="dnmc != null and dnmc != ''">dnmc,</if>
<if test="bz != null and bz != ''">bz,</if>
<if test="jyrq != null and jyrq != ''">jyrq,</if>
<if test="ybh != null and ybh != ''">ybh</if>
)values(#{yq},#{rzdt},
<if test="rzbz != null ">#{rzbz},</if>
<if test="yhdh != null">#{yhdh},</if>
<if test="rznr != null and rznr != ''">#{rznr},</if>
<if test="dnmc != null and dnmc != ''">#{dnmc},</if>
<if test="bz != null and bz != ''">#{bz},</if>
<if test="jyrq != null and jyrq != ''">#{jyrq},</if>
<if test="ybh != null and ybh != ''">#{ybh}</if>
)
</insert>
</mapper>

View File

@ -7,7 +7,7 @@
</select> </select>
<select id="getLabPatList" resultType="com.czlis.common.core.domain.entity.lis.LabPat"> <select id="getLabPatList" resultType="com.czlis.common.core.domain.entity.lis.LabPat">
select * from lab_pat where where sqh = #{sqh} select * from lab_pat where sqh = #{sqh}
</select> </select>
<sql id="selectLabPatVo"> <sql id="selectLabPatVo">
select jyrq,yq,ybh,jzbz,jgbz,dybz,brly,brdh,brxm,brxb,nl,nldw,ksdh,jymd,yljg from lab_pat select jyrq,yq,ybh,jzbz,jgbz,dybz,brly,brdh,brxm,brxb,nl,nldw,ksdh,jymd,yljg from lab_pat

View File

@ -0,0 +1,55 @@
<?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.LabRefusedMapper">
<select id="getLabRefusedOne" resultType="com.czlis.common.core.domain.entity.lis.LabRefused" parameterType="String">
select * from lab_refused where sqh = #{sqh}
</select>
<select id="getLabRefusedList" resultType="com.czlis.common.core.domain.entity.lis.LabRefused">
select * from lab_refused
<where>
<if test="sqh != null and yq !=''">and sqh = #{sqh}</if>
<if test="refusedtime != null">and refusedtime = #{refusedtime}</if>
<if test="refuseder != null and refuseder !=''">and refuseder = #{refuseder}</if>
<if test="ksdh != null and ksdh !=''">and ksdh = #{ksdh}</if>
<if test="bz != null and bz !=''">and bz = #{bz}</if>
<if test="refusetext != null and refusetext !=''">and refusetext = #{refusetext}</if>
<if test="bz1 != null and bz1 !=''">and bz1 = #{bz1}</if>
</where>
</select>
<delete id="delLabRefused" parameterType="String">
delete from lab_refused where sqh = #{sqh}
</delete>
<insert id="insertLabRefused" parameterType="com.czlis.common.core.domain.entity.lis.LabRefused">
insert into lab_refused(
<if test="refusedtime != null">refusedtime,</if>
<if test="refuseder != null and refuseder != ''">refuseder,</if>
<if test="ksdh != null and ksdh != ''">ksdh,</if>
<if test="bz != null and bz != ''">bz,</if>
<if test="refusetext != null and refusetext != ''">refusetext,</if>
<if test="bz1 != null and bz1 != ''">bz1,</if>
sqh
)values(
<if test="refusedtime != null">#{refusedtime},</if>
<if test="refuseder != null and refuseder != ''">#{refuseder},</if>
<if test="ksdh != null and ksdh != ''">#{ksdh},</if>
<if test="bz != null and bz != ''">#{bz},</if>
<if test="refusetext != null and yljg != ''">#{refusetext},</if>
<if test="bz1 != null and bz1 != ''">#{bz1},</if>
#{sqh}
)
</insert>
<update id="updateLabRefused" parameterType="com.czlis.common.core.domain.entity.lis.LabRefused">
update lab_refused
<set>
<if test="refusedtime != null and refusedtime !=''">refusedtime= #{refusedtime},</if>
<if test="refuseder != null and refuseder != ''">refuseder = #{refuseder},</if>
<if test="ksdh != null and ksdh != ''">ksdh = #{ksdh},</if>
<if test="bz != null and bz != ''">bz = #{bz},</if>
<if test="refusetext != null and refusetext != ''">refusetext = #{refusetext},</if>
<if test="bz1 != null and bz1 != ''">bz1 = #{bz1},</if>
sqh = #{sqh}
</set>
where sqh = #{sqh}
</update>
</mapper>

View File

@ -8,6 +8,55 @@ import java.util.Date;
public interface LisWorkOperService { public interface LisWorkOperService {
Result newPatInfo(Date jyrq,String ybh, String sqh, String yq, Long userId); Result newPatInfo(Date jyrq,String ybh, String sqh, String yq, Long userId);
Result changePat(LabPat labPat); Result changePat(LabPat labPat);
/**
* 保存所有结果的修正值,涉及:空结果清除,计算项目添加,添加单位,添加申请项目编码,参考值重新计算更新,结果标志重新计算更新,危急值标志计算更新
*
* @param jyrq
* @param yq
* @param ybh
* @return
*/
Result saveallresult(Date jyrq, String yq, String ybh);
/**
* 结果表补充申请单项目代码
*
* @param jyrq
* @param yq
* @param ybh
*/
void setItemSqxmdh(Date jyrq, String yq, String ybh);
/**
* 审核报告
* @param jyrq
* @param yq
* @param ybh
* @param hdys
* @return
*/
Result confirm(Date jyrq, String yq, String ybh, String hdys); Result confirm(Date jyrq, String yq, String ybh, String hdys);
/**
* 计算项目参考值结果异常标志
*
* @param jyrq
* @param yq
* @param ybh
*/
Result saverefs(Date jyrq, String yq, String ybh);
/**
* 计算项目增加及重新计算
*
* @param jyrq
* @param yq
* @param ybh
*/
Result calcsample(Date jyrq, String yq, String ybh);
/**
* 获取常用取值结果标志
*
* @param yq
* @param xmdh
* @param csjg
* @return
*/
String getitemlmtflag(String yq, String xmdh, String csjg);
} }

View File

@ -129,10 +129,7 @@ public class ComDictServiceImpl implements ComDictService {
if (row > 0) failureNum++; if (row > 0) failureNum++;
} }
if (failureNum > 0) { if (failureNum > 0) {
ComDict comDict0 = new ComDict(); commonUtil.setDictCache(zdlb, commonUtil.getComDictList(zdlb));
comDict0.setZdlb(zdlb);
List<ComDict> comDictList1 = comDictMapper.getComDictList(comDict0);
commonUtil.setDictCache(comDict0.getZdlb(), comDictList1);
if (failureNum == comDictList.size()) { if (failureNum == comDictList.size()) {
return new Result("0", "数据已全部导入成功!共 " + comDictList.size() + " 条"); return new Result("0", "数据已全部导入成功!共 " + comDictList.size() + " 条");
} else { } else {
@ -172,7 +169,7 @@ public class ComDictServiceImpl implements ComDictService {
if (zddh == null || zddh.equals("")) return new Result("-1", "字典代号不能为空!"); if (zddh == null || zddh.equals("")) return new Result("-1", "字典代号不能为空!");
if (yljg == null || yljg.equals("")) return new Result("-1", "医疗机构不能为空!"); if (yljg == null || yljg.equals("")) return new Result("-1", "医疗机构不能为空!");
int row = comDictMapper.delComDict(comDict); int row = comDictMapper.delComDict(comDict);
if (row > 0) commonUtil.setDictCache(zdlb, comDictMapper.getComDictListByZdlb(zdlb)); if (row > 0) commonUtil.setDictCache(zdlb, commonUtil.getComDictList(zdlb));
return new Result("0", "删除成功!"); return new Result("0", "删除成功!");
} }

View File

@ -2,6 +2,7 @@ package com.czlis.liswork.service.impl;
import com.czlis.common.core.domain.entity.lis.*; import com.czlis.common.core.domain.entity.lis.*;
import com.czlis.common.utils.DateUtils;
import com.czlis.common.utils.SecurityUtils; import com.czlis.common.utils.SecurityUtils;
import com.czlis.common.utils.ServletUtils; import com.czlis.common.utils.ServletUtils;
import com.czlis.common.utils.StringUtils; import com.czlis.common.utils.StringUtils;
@ -23,6 +24,7 @@ import com.czlis.liswork.pojo.DTO.ResultCalcDTO;
import com.czlis.liswork.service.LisWorkOperService; import com.czlis.liswork.service.LisWorkOperService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -47,7 +49,8 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
LabReqmainMapper labReqmainMapper; LabReqmainMapper labReqmainMapper;
@Autowired @Autowired
LabReqdetailMapper labReqdetailMapper; LabReqdetailMapper labReqdetailMapper;
@Autowired
CheckResultUtils checkResultUtils;
@Override @Override
public Result newPatInfo(Date jyrq, String ybh, String sqh, String yq, Long userId) { public Result newPatInfo(Date jyrq, String ybh, String sqh, String yq, Long userId) {
@ -234,7 +237,7 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
//5:数据状态修改,异步上传接口作业创建 //5:数据状态修改,异步上传接口作业创建
Result result1 = afterconfirm(labPat, problemId); Result result1 = afterconfirm(labPat, problemId);
if (!"0".equals(result1.getCode())) return result1; if (!"0".equals(result1.getCode())) return result1;
return new Result("0", "保存成功!"); return new Result("3", "审核成功!");
} }
/** /**
@ -258,12 +261,13 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
String ybh = labPat.getYbh(); String ybh = labPat.getYbh();
if (labPat == null) return new Result("-1", "病人信息为空禁止审核!"); if (labPat == null) return new Result("-1", "病人信息为空禁止审核!");
String jgbz = labPat.getJgbz(); String jgbz = labPat.getJgbz();
if ("2".equals(jgbz)) new Result("0", "保存成功!"); if ("2".equals(jgbz)) return new Result("1", "报告已审核!");
if ("5".equals(jgbz)) return new Result("-1", "已锁定报告禁止审核!"); if ("5".equals(jgbz)) return new Result("-1", "已锁定报告禁止审核!");
if (!"1".equals(jgbz)) { if (!"1".equals(jgbz)) {
String f_check1 = commonUtil.getComOptValue(yq, "f_check1"); String f_check1 = commonUtil.getComOptValue(yq, "f_check1");
if ("1".equals(f_check1)) return new Result("-1", "审核前必须先初审!"); if ("1".equals(f_check1)) return new Result("-1", "审核前必须先初审!");
} }
if (checkWorkTime(labPat) == 1) return new Result("-1", "核对医生不允许与检验医生相同!");
String limit_brly = commonUtil.getHISOPT("limit_brly"); String limit_brly = commonUtil.getHISOPT("limit_brly");
String brly = labPat.getBrly(); String brly = labPat.getBrly();
if ("1".equals(limit_brly) && (brly == null || "".equals(brly))) if ("1".equals(limit_brly) && (brly == null || "".equals(brly)))
@ -291,7 +295,7 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
if ("1".equals(limit_brpatno) && (brdh == null || "".equals(brdh))) { if ("1".equals(limit_brpatno) && (brdh == null || "".equals(brdh))) {
if ("1".equals(brly) || "3".equals(brly)) return new Result("-1", "门诊住院的病历号不能为空,禁止审核!"); if ("1".equals(brly) || "3".equals(brly)) return new Result("-1", "门诊住院的病历号不能为空,禁止审核!");
} }
String yqdl = commonUtil.getYqdl(yq);
List<LabResult> labResultList = commonUtil.getLabResultList(jyrq, yq, ybh); List<LabResult> labResultList = commonUtil.getLabResultList(jyrq, yq, ybh);
if (labResultList == null || labResultList.size() == 0) return new Result("-1", "结果为空禁止审核!"); if (labResultList == null || labResultList.size() == 0) return new Result("-1", "结果为空禁止审核!");
for (LabResult labResult : labResultList) { for (LabResult labResult : labResultList) {
@ -310,7 +314,6 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
//多做结果判断 //多做结果判断
String otherresultmsg = commonUtil.getComOptValue(yq, "otherresultmsg"); String otherresultmsg = commonUtil.getComOptValue(yq, "otherresultmsg");
if ("1".equals(otherresultmsg)) { if ("1".equals(otherresultmsg)) {
String yqdl = commonUtil.getYqdl(yq);
if (!"细菌仪".equals(yqdl)) { if (!"细菌仪".equals(yqdl)) {
int nullcount = lisWorkOperMapper.checkresultsqxmdh(jyrq, yq, ybh, labPat.getSqh()); int nullcount = lisWorkOperMapper.checkresultsqxmdh(jyrq, yq, ybh, labPat.getSqh());
if (nullcount > 0) return new Result("5", "结果有多做的项目,是否审核?", 2); if (nullcount > 0) return new Result("5", "结果有多做的项目,是否审核?", 2);
@ -329,14 +332,14 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
LabPat labPat0 = lisWorkOperMapper.checkdublereport(sqh, ybh); LabPat labPat0 = lisWorkOperMapper.checkdublereport(sqh, ybh);
if (labPat0 != null) { if (labPat0 != null) {
String yqmc = commonUtil.getYqmc(yq); String yqmc = commonUtil.getYqmc(yq);
String msg = "该申请单已经发过结果了,禁止审核!\r\n日期:" + commonUtil.getDateString(jyrq) + ",仪器:" + yqmc + ",样本号:" + ybh; String msg = "该申请单已经发过结果了,禁止审核!"+LisUtil.LINE_SEPARATOR+"日期:" + commonUtil.getDateString(jyrq) + ",仪器:" + yqmc + ",样本号:" + ybh;
return new Result("-1", msg); return new Result("-1", msg);
} }
} else if ("1".equals(commonUtil.getHISOPT("sp_yqdublereport"))) { } else if ("1".equals(commonUtil.getHISOPT("sp_yqdublereport"))) {
LabPat labPat0 = lisWorkOperMapper.checkyqdublereport(sqh, yq, ybh); LabPat labPat0 = lisWorkOperMapper.checkyqdublereport(sqh, yq, ybh);
if (labPat0 != null) { if (labPat0 != null) {
String yqmc = commonUtil.getYqmc(yq); String yqmc = commonUtil.getYqmc(yq);
String msg = "该申请单已经发过结果了,禁止审核!\r\n日期:" + commonUtil.getDateString(jyrq) + ",仪器:" + yqmc + ",样本号:" + ybh; String msg = "该申请单已经发过结果了,禁止审核!"+LisUtil.LINE_SEPARATOR+"日期:" + commonUtil.getDateString(jyrq) + ",仪器:" + yqmc + ",样本号:" + ybh;
return new Result("-1", msg); return new Result("-1", msg);
} }
} }
@ -348,22 +351,61 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
if (Userid == null || "".equals(Userid)) { if (Userid == null || "".equals(Userid)) {
Userid = SecurityUtils.getLoginUser().getUsername(); Userid = SecurityUtils.getLoginUser().getUsername();
} }
//医学审核条件判断
if(problemId<3) {
String checkvalue = checkResultUtils.chksample(labPat, labResultList);
if (checkvalue != null && !"".equals(checkvalue)) {
return new Result("5", checkvalue, 3);
}
}
//医学审核条件判断(新规则)
if(problemId<4) {
Result chksamplenewvalue = checkResultUtils.chksamplenew(labPat, labResultList);
if (chksamplenewvalue.getCode().equals("5")) {
return new Result("5", chksamplenewvalue.getMsg(), 4);
}
if (!chksamplenewvalue.getCode().equals("0")) return chksamplenewvalue;
}
//调用his报告接口,检查外部接口对审核前的定制需求 //调用his报告接口,检查外部接口对审核前的定制需求
SetReport setReport = new SetReport(); SetReport setReport = new SetReport();
setReport.setIp(IpUtils.getIpAddr()); setReport.setIp(IpUtils.getIpAddr());
setReport.setJyrq(DateFormatUtils.format(jyrq, "yyyy-MM-dd")); setReport.setJyrq(DateFormatUtils.format(jyrq, "yyyy-MM-dd"));
setReport.setYq(yq.trim());
setReport.setYbh(ybh); setReport.setYbh(ybh);
setReport.setUserid(Userid); setReport.setUserid(Userid);
setReport.setYq(yq.trim());
setReport.setStatus(LisinterfaceNameConstants.REPORTSTART);
if (!"细菌仪".equals(yqdl)) {
if (!"1".equals(commonUtil.getHISOPT("wswcbbgbl"))) {
String ls_cbbgyq = commonUtil.getComOptValue(yq, "cbbgyq");
if (ls_cbbgyq != null && !"".equals(ls_cbbgyq)) {
String ls_ejbgyq = "EJBG" + ls_cbbgyq;
ls_cbbgyq = "CBBG" + ls_cbbgyq;
int count = commonUtil.getCountByKey(jyrq, ls_cbbgyq, ybh);
if (count > 0) {
setReport.setYq(ls_cbbgyq);
setReport.setStatus(LisinterfaceNameConstants.REPORTCANCAL);
Result result = lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.SETREPORT, setReport);
}
count = commonUtil.getCountByKey(jyrq, ls_ejbgyq, ybh);
if (count > 0) {
setReport.setYq(ls_ejbgyq);
setReport.setStatus(LisinterfaceNameConstants.REPORTCANCAL);
Result result = lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.SETREPORT, setReport);
}
}
}
}
setReport.setYq(yq.trim());
setReport.setStatus(LisinterfaceNameConstants.REPORTSTART); setReport.setStatus(LisinterfaceNameConstants.REPORTSTART);
Result result = lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.SETREPORT, setReport); Result result = lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.SETREPORT, setReport);
if (result.getCode().equals("5")) { if (result.getCode().equals("5")) {
if (problemId < 3) { if (problemId < 5) {
return new Result(result.getCode(), result.getMsg(), 3); return new Result(result.getCode(), result.getMsg(), 5);
} }
return new Result("0", "保存成功!"); return new Result("0", "保存成功!");
} }
if (!result.getCode().equals("0")) return result; if (!result.getCode().equals("0")) return result;
checkxpywrgjz(labPat);
return new Result("0", "保存成功!"); return new Result("0", "保存成功!");
} }
@ -387,9 +429,9 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
String yq = labPat.getYq(); String yq = labPat.getYq();
String ybh = labPat.getYbh(); String ybh = labPat.getYbh();
String hdys = labPat.getHdys(); String hdys = labPat.getHdys();
String yqdl = commonUtil.getYqdl(yq);
String itemvs = commonUtil.getHISOPT("itemvs"); String itemvs = commonUtil.getHISOPT("itemvs");
if ("1".equals(itemvs)) { if ("1".equals(itemvs)) {
String yqdl = commonUtil.getYqdl(yq);
if (!"细菌仪".equals(yqdl)) { if (!"细菌仪".equals(yqdl)) {
String nullcount = lisWorkOperMapper.checkresultnosqxmdh(jyrq, yq, ybh); String nullcount = lisWorkOperMapper.checkresultnosqxmdh(jyrq, yq, ybh);
if (!"".equals(nullcount) && nullcount != null) if (!"".equals(nullcount) && nullcount != null)
@ -441,7 +483,13 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
} }
if (!result.getCode().equals("0")) return result; if (!result.getCode().equals("0")) return result;
//最后完成 //最后完成
String finish = labPat.getFinish();
if (!"细菌仪".equals(yqdl) && finish != null) labPat.setFinish("1");
labPat.setJgbz(ReportStatusConstants.CONFIRM); labPat.setJgbz(ReportStatusConstants.CONFIRM);
Integer shcs = labPat.getShcs();
if (shcs == null) shcs = 0;
shcs = shcs + 1;
labPat.setShcs(shcs);
commonUtil.updateLabPat(labPat); commonUtil.updateLabPat(labPat);
return new Result("0", "保存成功!"); return new Result("0", "保存成功!");
} }
@ -542,9 +590,28 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
* @param jyrq * @param jyrq
* @return * @return
*/ */
@Override
public Result saveallresult(Date jyrq, String yq, String ybh) { public Result saveallresult(Date jyrq, String yq, String ybh) {
int finsh = 1;
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();
if ("未做".equals(csjg)) {
finsh = 0;
}
if (csjg != null) {
if (csjg.contains("ERR")) finsh = 0;
if (csjg.contains("需稀释")) finsh = 0;
if (csjg.contains("需复做")) finsh = 0;
}
}
String yqdl = commonUtil.getYqdl(yq);
//查询病人信息 //查询病人信息
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh); LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
String finish = labPat.getFinish();
if (!"细菌仪".equals(yqdl) && finish != null && finsh == 1) labPat.setFinish("1");
int wjz = saveallresult(labPat); int wjz = saveallresult(labPat);
//同步主表危急值标识 //同步主表危急值标识
String alarmflag = labPat.getAlarmflag(); String alarmflag = labPat.getAlarmflag();
@ -572,6 +639,12 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
calcsample(labPat); calcsample(labPat);
//保存最新参考值结果标志 //保存最新参考值结果标志
int wjz = saverefs(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(); String sqh = labPat.getSqh();
if (sqh != null && !"".equals(sqh)) setItemSqxmdh(jyrq, yq, ybh, sqh); if (sqh != null && !"".equals(sqh)) setItemSqxmdh(jyrq, yq, ybh, sqh);
@ -585,6 +658,7 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
* @param yq * @param yq
* @param ybh * @param ybh
*/ */
@Override
public void setItemSqxmdh(Date jyrq, String yq, String ybh) { public void setItemSqxmdh(Date jyrq, String yq, String ybh) {
String sqh = commonUtil.getSqhByKey(jyrq, yq, ybh); String sqh = commonUtil.getSqhByKey(jyrq, yq, ybh);
if (sqh == null || "".equals(sqh)) { if (sqh == null || "".equals(sqh)) {
@ -613,6 +687,7 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
* @param yq * @param yq
* @param ybh * @param ybh
*/ */
@Override
public Result calcsample(Date jyrq, String yq, String ybh) { public Result calcsample(Date jyrq, String yq, String ybh) {
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh); LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
calcsample(labPat); calcsample(labPat);
@ -683,6 +758,7 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
* @param yq * @param yq
* @param ybh * @param ybh
*/ */
@Override
public Result saverefs(Date jyrq, String yq, String ybh) { public Result saverefs(Date jyrq, String yq, String ybh) {
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh); LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
int wjz = saverefs(labPat); int wjz = saverefs(labPat);
@ -754,7 +830,8 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
} }
//危急值标识去除原则 //危急值标识去除原则
String brxm = labPat.getBrxm(); String brxm = labPat.getBrxm();
if(brxm !=null)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; lb_wjz = false;
} }
; ;
@ -814,7 +891,9 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
String zd = null; String zd = null;
if ("Y".equals(ygzd)) { if ("Y".equals(ygzd)) {
zd = labPat.getZd(); zd = labPat.getZd();
if (zd == null) {zd="";} if (zd == null) {
zd = "";
}
} }
String slzq = null; String slzq = null;
if ("Y".equals(ygzq)) { if ("Y".equals(ygzq)) {
@ -968,6 +1047,7 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
* @param csjg * @param csjg
* @return * @return
*/ */
@Override
public String getitemlmtflag(String yq, String xmdh, String csjg) { public String getitemlmtflag(String yq, String xmdh, String csjg) {
String jgbz = ""; String jgbz = "";
if (csjg == null || csjg.isEmpty()) { if (csjg == null || csjg.isEmpty()) {
@ -987,4 +1067,86 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
} }
return jgbz; return jgbz;
} }
/**
* 工作时间校验检验者审核者不允许相同 上班时间上午8点-12点下午2点到5点,周末不算
*
* @param labPat
* @return 返回0通过, 返回1不允许相同
*/
private int checkWorkTime(LabPat labPat) {
String yhdh = labPat.getYhdh();
String hdys = labPat.getHdys();
if (yhdh == null || yhdh.isEmpty()) return 0;
if (hdys == null || hdys.isEmpty()) return 0;
if (!yhdh.equals(hdys)) return 0;
String sb1 = commonUtil.getHISOPT("SHTIME1");
String sb2 = commonUtil.getHISOPT("SHTIME2");
String sb3 = commonUtil.getHISOPT("SHTIME3");
String sb4 = commonUtil.getHISOPT("SHTIME4");
if ((sb1 == null || sb1.isEmpty()) && (sb2 == null || sb2.isEmpty()) && (sb3 == null || sb3.isEmpty()) && (sb4 == null || sb4.isEmpty()))
return 0;
Date currenttime = DateUtils.getNowDate();
int weekDay = DateUtils.getWeekDay(currenttime);
//周末不算
if (weekDay == 6 && weekDay == 7) return 0;
int lt_now = Integer.parseInt(DateUtils.time(currenttime, "HH:mm").replace(":", ""));
if ((sb1 == null || sb1.isEmpty()) && (sb2 == null || sb2.isEmpty())) {
sb1 = sb1.replace(":", "");
sb2 = sb2.replace(":", "");
if (LisUtil.isTureNumber(sb1) && LisUtil.isTureNumber(sb2)) {
int nsb1 = Integer.parseInt(sb1);
int nsb2 = Integer.parseInt(sb2);
if (lt_now > nsb1 && lt_now < nsb2) return 1;
}
if (LisUtil.isTureNumber(sb3) && LisUtil.isTureNumber(sb4)) {
int nsb3 = Integer.parseInt(sb3);
int nsb4 = Integer.parseInt(sb4);
if (lt_now > nsb3 && lt_now < nsb4) return 1;
}
}
return 0;
}
/**
* 备注自动登记血培养污染记录
*
* @param labPat
* @return
*/
private int checkxpywrgjz(LabPat labPat) {
String ls_bz = labPat.getBz();
String ls_sqh = labPat.getSqh();
String yq = labPat.getYq();
if (ls_sqh == null || ls_sqh.isEmpty()) return 0;
if (ls_bz == null || ls_bz.isEmpty()) return 0;
String ls_xpywr = commonUtil.getComOptValue(yq, "xpywrgjz");
if (ls_xpywr == null || ls_xpywr.isEmpty()) return 0;
if (ls_bz.contains(ls_xpywr)) {
String ls_yblx = labPat.getYblx();
if (ls_yblx == null || ls_yblx.isEmpty()) return 0;
String ls_yblxmc = commonUtil.getComDictNameById("BT", ls_yblx);
if (ls_yblxmc == null || ls_yblxmc.isEmpty()) return 0;
if (ls_yblxmc.contains("血") || ls_yblx.contains("血")) {
String ls_xpywrdh = commonUtil.getComOptValue(yq, "xpywrdh");
if (ls_xpywrdh == null || ls_xpywrdh.isEmpty()) return 0;
String ls_hdys = labPat.getHdys();
if (ls_hdys == null || ls_hdys.isEmpty()) ls_hdys = labPat.getYhdh();
LabRefused labRefused = new LabRefused();
labRefused.setSqh(ls_sqh);
labRefused.setRefusetext(ls_xpywrdh);
List<LabRefused> labRefusedList = commonUtil.getLabRefusedList(labRefused);
if (labRefusedList.size() == 0) {
labRefused.setRefusedtime(new Date());
labRefused.setKsdh(labPat.getKsdh());
labRefused.setBz("0");
labRefused.setRefuseder(ls_hdys);
commonUtil.insertLabRefused(labRefused);
}
}
}
return 0;
}
} }