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

This commit is contained in:
jiangs 2025-11-20 18:13:16 +08:00
commit edbbf50ad6
9 changed files with 151 additions and 23 deletions

View File

@ -48,4 +48,5 @@ public class LabResult extends BaseEntity {
private String cp_compa; private String cp_compa;
private String cp_lastflag; private String cp_lastflag;
private Date cp_lastjyrq; private Date cp_lastjyrq;
private String germclass;
} }

View File

@ -24,4 +24,5 @@ public class LabResultMed {
private String txtresult; private String txtresult;
private String ckz; private String ckz;
private String cp_bz; private String cp_bz;
private String ywmc;
} }

View File

@ -90,7 +90,7 @@ public class LisWorkBase {
* @param labPat 病人信息 * @param labPat 病人信息
* @return 返回 * @return 返回
*/ */
boolean checknowjz(LabPat labPat) { public boolean checknowjz(LabPat labPat) {
//危急值标识去除原则 nowjz = true 不能算做危急值 //危急值标识去除原则 nowjz = true 不能算做危急值
String brxm = labPat.getBrxm(); String brxm = labPat.getBrxm();
if (brxm != null) { if (brxm != null) {

View File

@ -397,7 +397,7 @@ public class LisWorkcom extends LisWorkBase{
* @param labResult * @param labResult
* @return * @return
*/ */
private LabResult setxmdhrefs(LabPat labPat, LabResult labResult, XmInfo xmInfo, List<XmAlarmdetail> getXmAlarmdetail, boolean nowjz) { public LabResult setxmdhrefs(LabPat labPat, LabResult labResult, XmInfo xmInfo, List<XmAlarmdetail> getXmAlarmdetail, boolean nowjz) {
String yq = labPat.getYq(); String yq = labPat.getYq();
String resultflag = "M", wjzflag = ""; String resultflag = "M", wjzflag = "";
String xmdh = labResult.getXmdh(); String xmdh = labResult.getXmdh();

View File

@ -24,7 +24,7 @@
select select
lab_result.jyrq, lab_result.yq, lab_result.ybh, lab_result.xmdh, wyh, csjg, od, cutoff, lab_result.jgbz, bz1, bz2, yhdh, instrid, operdt, lab_result.jyrq, lab_result.yq, lab_result.ybh, lab_result.xmdh, wyh, csjg, od, cutoff, lab_result.jgbz, bz1, bz2, yhdh, instrid, operdt,
operna, refs, flag, lab_result.dw, result_flag, alarm_flag, redo_flag, sqxmdh, redo_text,xm_info.xmmc,xm_info.ygzq,xm_info.ygzd operna, refs, flag, lab_result.dw, result_flag, alarm_flag, redo_flag, sqxmdh, redo_text,xm_info.xmmc,xm_info.ygzq,xm_info.ygzd
,textresult,xm_info.xsws ,textresult,xm_info.xsws,xm_info.germclass
from lab_result join xm_info on xm_info.yq=lab_result.yq and xm_info.xmdh=lab_result.xmdh from lab_result join xm_info on xm_info.yq=lab_result.yq and xm_info.xmdh=lab_result.xmdh
<where> <where>
<if test="jyrq != null "> <if test="jyrq != null ">

View File

@ -1,11 +1,14 @@
package com.czlis.liswork.controller.work; package com.czlis.liswork.controller.work;
import com.czlis.common.annotation.Log;
import com.czlis.common.core.controller.BaseController; import com.czlis.common.core.controller.BaseController;
import com.czlis.common.core.domain.Result; import com.czlis.common.core.domain.Result;
import com.czlis.common.core.domain.entity.lis.LabPat; import com.czlis.common.core.domain.entity.lis.LabPat;
import com.czlis.common.core.domain.entity.lis.LabResult; import com.czlis.common.core.domain.entity.lis.LabResult;
import com.czlis.common.core.domain.entity.lis.LabResultMed; import com.czlis.common.core.domain.entity.lis.LabResultMed;
import com.czlis.common.core.page.TableDataInfo; import com.czlis.common.core.page.TableDataInfo;
import com.czlis.common.enums.BusinessType;
import com.czlis.interfaceCommon.constants.SysLogConstants;
import com.czlis.liswork.service.LisWorkGermService; import com.czlis.liswork.service.LisWorkGermService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -23,11 +26,39 @@ import java.util.List;
public class LisWorkGermController extends BaseController { public class LisWorkGermController extends BaseController {
@Autowired @Autowired
LisWorkGermService lisWorkGermService; LisWorkGermService lisWorkGermService;
@ApiOperation("获取微生物样本信息") @ApiOperation("获取药敏数据")
@GetMapping("/sampleMedInfo") @GetMapping("/getresultmedlist")
public Result sampleMedInfo(Date jyrq, String yq, String ybh) { public Result getresultmedlist(Date jyrq, String yq, String ybh,String xmdh) {
return lisWorkGermService.sampleMedInfo(jyrq, yq, ybh); return lisWorkGermService.sampleMedInfo(jyrq, yq, ybh,xmdh);
} }
@ApiOperation("获取检验结果")
@GetMapping("/getresultlist")
public Result getresultlist(LabResult labResult) {
Date jyrq = labResult.getJyrq();
String yq = labResult.getYq();
String ybh = labResult.getYbh();
return lisWorkGermService.getresultinfo(jyrq, yq, ybh);
}
@Log(title = SysLogConstants.LISWORK_LOG,businessType = BusinessType.UPDATE_DETAIL)
@ApiOperation("修改微生物结果")
@PostMapping("/changeresult")
public Result changeresult(@RequestBody LabResult labResult) {
return lisWorkGermService.changeresult(labResult);
}
@Log(title = SysLogConstants.LISWORK_LOG,businessType = BusinessType.INSERT_DETAIL)
@ApiOperation("新增微生物结果")
@PostMapping("/newresult")
public Result newresult(@RequestBody LabResult labResult) {
return lisWorkGermService.newresult(labResult);
}
@Log(title = SysLogConstants.LISWORK_LOG,businessType = BusinessType.UPDATE_DETAIL)
@ApiOperation("保存微生物结果")
@PostMapping("/saveresult")
public Result saveresult(@RequestBody List<LabResult> labResult) {
return lisWorkGermService.saveallresult(labResult);
}
@ApiOperation("获取仪器ID") @ApiOperation("获取仪器ID")
@GetMapping("/getinstrid") @GetMapping("/getinstrid")
public Result getInstrid(String yq){ public Result getInstrid(String yq){

View File

@ -10,6 +10,7 @@ import java.util.List;
public interface LisWorkGermService { public interface LisWorkGermService {
Result saveTestResult(LabResult labResult); Result saveTestResult(LabResult labResult);
Result getresultinfo(Date jyrq, String yq, String ybh);
Result getInstrid(String yq); Result getInstrid(String yq);
Result getmedium(Date jyrq, String yq, String ybh); Result getmedium(Date jyrq, String yq, String ybh);
Result getcomlog(Date jyrq, String yq, String ybh); Result getcomlog(Date jyrq, String yq, String ybh);
@ -17,7 +18,10 @@ public interface LisWorkGermService {
Result savemedresult(LabResultMed labResultmed); Result savemedresult(LabResultMed labResultmed);
Result savemedresultall(List<LabResultMed> labResultmedlist); Result savemedresultall(List<LabResultMed> labResultmedlist);
Result deletemedresult(LabResultMed labResultmed); Result deletemedresult(LabResultMed labResultmed);
Result sampleMedInfo(Date jyrq, String yq, String ybh); Result sampleMedInfo(Date jyrq, String yq, String ybh,String xmdh);
List<LabPat> getSampleList(Date jyrq, String yq, Integer days); List<LabPat> getSampleList(Date jyrq, String yq, Integer days);
Result changeresult(LabResult labResult);
Result newresult(LabResult labResult);
Result saveallresult(List<LabResult> labResult);
} }

View File

@ -8,6 +8,7 @@ import com.czlis.interfaceCommon.mapper.ComDictMapper;
import com.czlis.interfaceCommon.mapper.LabResultMedMapper; import com.czlis.interfaceCommon.mapper.LabResultMedMapper;
import com.czlis.interfaceCommon.utils.CommonUtil; import com.czlis.interfaceCommon.utils.CommonUtil;
import com.czlis.interfaceCommon.utils.LisUtil; import com.czlis.interfaceCommon.utils.LisUtil;
import com.czlis.interfaceCommon.utils.LisWorkUtils;
import com.czlis.liswork.mapper.LisWorkGermMapper; import com.czlis.liswork.mapper.LisWorkGermMapper;
import com.czlis.liswork.mapper.LisWorkMapper; import com.czlis.liswork.mapper.LisWorkMapper;
import com.czlis.liswork.mapper.xtwh.XmMedgroupMapper; import com.czlis.liswork.mapper.xtwh.XmMedgroupMapper;
@ -28,23 +29,25 @@ public class LisWorkGermServiceImpl implements LisWorkGermService {
@Autowired @Autowired
CommonUtil commonUtil; CommonUtil commonUtil;
@Autowired @Autowired
LisWorkUtils lisWorkUtils;
@Autowired
LisWorkGermMapper lisWorkGermMapper; LisWorkGermMapper lisWorkGermMapper;
@Autowired @Autowired
XmMedgroupMapper xmMedgroupMapper; XmMedgroupMapper xmMedgroupMapper;
@Override @Override
public Result sampleMedInfo(Date jyrq, String yq, String ybh) { public Result getresultinfo(Date jyrq, String yq, String ybh){
List<LabResult> labResultList = commonUtil.getLabResultList(jyrq, yq, ybh); List<LabResult> labResultList = commonUtil.getLabResultList(jyrq, yq, ybh);
return new Result("0", "成功!", labResultList);
}
@Override
public Result sampleMedInfo(Date jyrq, String yq, String ybh,String xmdh) {
LabResultMed labResultMed = new LabResultMed(); LabResultMed labResultMed = new LabResultMed();
labResultMed.setJyrq(jyrq); labResultMed.setJyrq(jyrq);
labResultMed.setYq(yq); labResultMed.setYq(yq);
labResultMed.setYbh(ybh); labResultMed.setYbh(ybh);
labResultMed.setXmdh(xmdh);
List<LabResultMed> labResultMedInfoList = lisWorkGermMapper.getLabResultMedInfo(labResultMed); List<LabResultMed> labResultMedInfoList = lisWorkGermMapper.getLabResultMedInfo(labResultMed);
List<Map<String, Object>> queryList = new ArrayList<>(); return new Result("0", "获取药敏数据成功!", labResultMedInfoList);
Map<String, Object> map = new HashMap<>();
map.put("labResultList", labResultList);
map.put("labResultMedInfoList", labResultMedInfoList);
queryList.add(map);
return new Result("0", "获取微生物数据成功!", queryList);
} }
/** /**
* 保存专家评语 * 保存专家评语
@ -183,6 +186,93 @@ public class LisWorkGermServiceImpl implements LisWorkGermService {
xmMedgroup.setYwzmc(mbmc); xmMedgroup.setYwzmc(mbmc);
return new Result("0","成功",xmMedgroupMapper.query(xmMedgroup)); return new Result("0","成功",xmMedgroupMapper.query(xmMedgroup));
} }
/**
* 修改结果
*
* @param labResult 一行结果
* @return 返回状态
*/
@Override
public Result changeresult(LabResult labResult) {
String yq = labResult.getYq();
Date jyrq = labResult.getJyrq();
String ybh = labResult.getYbh();
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
if ("2".equals(labPat.getJgbz())) return new Result("-1", "结果已审核禁止修改!");
if ("5".equals(labPat.getJgbz())) return new Result("-1", "结果已锁定禁止修改!");
if ("1".equals(labPat.getJgbz())) return new Result("-1", "结果已初审禁止修改!");
if(!lisWorkUtils.canmodifysample(labPat))return new Result("-1","目标标本不可修改");
commonUtil.updateLabResult(labResult);
return new Result("0", "保存成功");
}
/**
* 保存所有结果的修正值,涉及:空结果清除,计算项目添加,添加单位,添加申请项目编码,参考值重新计算更新,结果标志重新计算更新,危急值标志计算更新
*
* @param labResultList 结果集合
* @return 返回
*/
@Override
public Result saveallresult(List<LabResult> labResultList) {
if (labResultList == null || labResultList.isEmpty()) return new Result("-1", "结果集为空!");
Date jyrq0 = labResultList.get(0).getJyrq();
String yq0 = labResultList.get(0).getYq();
String ybh0 = labResultList.get(0).getYbh();
if (jyrq0 == null) return new Result("-1", "主键为空!");
if (yq0 == null || yq0.isEmpty()) return new Result("-1", "主键为空!");
if (ybh0 == null || ybh0.isEmpty()) return new Result("-1", "主键为空!");
LabPat labPat = commonUtil.getLabPatOne(jyrq0, yq0, ybh0);
if (!lisWorkUtils.canmodifysample(labPat)) return new Result("-1", "目标标本不可修改");
for (LabResult labResult : labResultList) {
Date jyrq = labResult.getJyrq();
String yq = labResult.getYq();
String ybh = labResult.getYbh();
String xmdh = labResult.getXmdh();
if (jyrq == null) return new Result("-1", "主键为空!");
if (yq == null || yq.isEmpty()) return new Result("-1", "主键为空!");
if (ybh == null || ybh.isEmpty()) return new Result("-1", "主键为空!");
if (xmdh == null || xmdh.isEmpty()) return new Result("-1", "主键为空!");
LabResult labResult0=commonUtil.getLabResult(jyrq, yq, ybh,xmdh);
if(labResult0==null){
commonUtil.insertLabResult(labResult);
}else {
commonUtil.updateLabResult(labResult);
}
}
return new Result("0", "保存成功");
}
@Override
public Result newresult(LabResult labResult) {
String yq = labResult.getYq();
Date jyrq = labResult.getJyrq();
String ybh = labResult.getYbh();
String xmdh = labResult.getXmdh();
if ("".equals(xmdh) || xmdh == null) return new Result("-1", "项目代号不能为空!");
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
if(labPat==null){
labPat=new LabPat();
labPat.setJyrq(jyrq);
labPat.setYbh(ybh);
labPat.setYq(yq);
labPat.setJgbz("0");
}
if ("2".equals(labPat.getJgbz())) return new Result("-1", "结果已审核禁止修改!");
if ("5".equals(labPat.getJgbz())) return new Result("-1", "结果已锁定禁止修改!");
if ("1".equals(labPat.getJgbz())) return new Result("-1", "结果已初审禁止修改!");
if(!lisWorkUtils.canmodifysample(labPat))return new Result("-1","目标标本不可修改");
XmInfo xmInfo = commonUtil.getXmInfo(yq, xmdh);
String mrz=xmInfo.getMrz();
if("阳性".equals(mrz))mrz="P";
if("阴性".equals(mrz))mrz="N";
labResult.setJgbz(mrz);
boolean nowjz = lisWorkUtils.checknowjz(labPat);
List<XmAlarmdetail> getXmAlarmdetail = commonUtil.getXmAlarmdetail(yq, xmdh);
labResult = lisWorkUtils.setxmdhrefs(labPat, labResult, xmInfo, getXmAlarmdetail, nowjz);
commonUtil.insertLabResult(labResult);
return new Result("0", "保存成功");
}
@Override @Override
public Result savemedresult(LabResultMed labResultmed) { public Result savemedresult(LabResultMed labResultmed) {
Date jyrq=labResultmed.getJyrq(); Date jyrq=labResultmed.getJyrq();

View File

@ -7,20 +7,21 @@
</sql> </sql>
<select id="getLabResultMedInfo" resultType="com.czlis.common.core.domain.entity.lis.LabResultMed"> <select id="getLabResultMedInfo" resultType="com.czlis.common.core.domain.entity.lis.LabResultMed">
select a.*, select a.*,m.ywmc,
case case
when isnull(a.mic)!='' then isnull(c.micref,d.micref) when isnull(a.mic,'')!='' then isnull(c.micref,d.micref)
when isnull(a.rad)!='' then isnull(c.radref,d.radref) when isnull(a.rad,'')!='' then isnull(c.radref,d.radref)
else '' end as ckz,e.bz as cp_bz from lab_resultmed a else '' end as ckz,e.bz as cp_bz from lab_resultmed a
join xm_info b on b.yq=a.yq and b.xmdh=a.xmdh join xm_info b on b.yq=a.yq and b.xmdh=a.xmdh
left join xm_med m on m.ywdh=a.ywdh
left join com_dict e on e.zdlb='germclass' and e.zddh=b.germclass left join com_dict e on e.zdlb='germclass' and e.zddh=b.germclass
left join xm_meddetail c on b.germclass=c.xmdh and c.ywdh=a.ywdh left join xm_meddetail c on b.germclass=c.xmdh and c.ywdh=a.ywdh
left join xm_meddetail d on d.ywzmc = '细菌' and d.yq=a.yq and d.ywdh=a.ywdh left join xm_meddetail d on d.ywzmc = '细菌' and d.yq=a.yq and d.ywdh=a.ywdh
where jyrq = #{jyrq} and yq = #{yq} where a.jyrq = #{jyrq} and a.yq = #{yq}
<if test="ybh != null and ybh !=''">and ybh = #{ybh}</if> <if test="ybh != null and ybh !=''">and a.ybh = #{ybh}</if>
<if test="xmdh != null and xmdh !=''">and xmdh = #{xmdh}</if> <if test="xmdh != null and xmdh !=''">and a.xmdh = #{xmdh}</if>
<if test="xh != null">and xh = #{xh}</if> <if test="xh != null">and a.xh = #{xh}</if>
<if test="ywdh != null and ywdh != ''">and ywdh = #{ywdh}</if> <if test="ywdh != null and ywdh != ''">and a.ywdh = #{ywdh}</if>
</select> </select>
<select id="getSampleListWSW" resultType="com.czlis.common.core.domain.entity.lis.LabPat"> <select id="getSampleListWSW" resultType="com.czlis.common.core.domain.entity.lis.LabPat">
<include refid="selectLabPatVoWSW"></include> <include refid="selectLabPatVoWSW"></include>