Compare commits

..

No commits in common. "2b7a4e7480db9db4ccc4259deb430bdb0a2ddc4f" and "a18b715bba65d773d11446aa6990af7c19b2d96b" have entirely different histories.

12 changed files with 68 additions and 507 deletions

View File

@ -1,33 +1,20 @@
package com.czlis.common.core.domain;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson2.JSON;
import com.czlis.common.utils.JsonParamUtils;
import com.czlis.common.utils.ServletUtils;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.Map;
/**
* 出参格式
* {"code":"","message":""}
*/
@Slf4j
@Data
@NoArgsConstructor
public class Result {
private String code;
private String msg;
private Object data;
private String url;// 下一步请求的URL
private String method;// 下一步请求的方法(get/post等)
private Object params;// 下一步请求的URL参数
private Integer problemId;// 问题ID(之前提到的关键标识)
public Result(String resultCode, String message) {
super();
this.code = resultCode;
@ -39,23 +26,4 @@ public class Result {
this.msg = message;
this.data = data;
}
public Result(String resultCode, String message,Integer problemId) {
this.code = resultCode;
this.msg = message;
Integer problemId0=problemId;
HttpServletRequest request =ServletUtils.getRequest();
this.url = request.getContextPath() + request.getServletPath();
this.method = request.getMethod();
if("GET".equals(this.method)){
this.params = ServletUtils.getParamMap(request);
}else {
try {
this.data = JsonParamUtils.getJsonParams(request);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
this.problemId=problemId0;
}
}

View File

@ -1,130 +0,0 @@
package com.czlis.common.utils;
import com.czlis.common.core.text.Convert;
import com.fasterxml.jackson.databind.ObjectMapper;
import javax.servlet.http.HttpServletRequest;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* 从 POST JSON 请求中获取参数清单的工具类
*/
public class JsonParamUtils {
private static final ObjectMapper objectMapper = new ObjectMapper();
public static Map<String, Object> getJsonParams(){
try {
return getJsonParams(ServletUtils.getRequest());
} catch (IOException e) {
throw new RuntimeException(e);
}
}
/**
* 读取 POST JSON 请求的参数,返回参数名-值映射
*/
public static Map<String, Object> getJsonParams(HttpServletRequest request) throws IOException {
// 1. 读取请求体中的 JSON 字符串
StringBuilder jsonSb = new StringBuilder();
String line;
try (BufferedReader reader = new BufferedReader(
new InputStreamReader(request.getInputStream(), StandardCharsets.UTF_8))) {
while ((line = reader.readLine()) != null) {
jsonSb.append(line);
}
}
String jsonStr = jsonSb.toString();
// 2. 若 JSON 为空,返回空 Map
if (jsonStr.isEmpty()) {
return new HashMap<>();
}
// 3. 将 JSON 字符串解析为 Map(键为参数名,值为参数值)
return objectMapper.readValue(jsonStr, Map.class);
}
/**
* 获取String参数
*/
public static String getParameter(String name) {
return getString(getJsonParams(),name);
}
/**
* 获取String参数
*/
public static String getParameter(String name, String defaultValue) {
return Convert.toStr(getString(getJsonParams(),name), defaultValue);
}
/**
* 获取Integer参数
*/
public static Integer getParameterToInt(String name) {
return Convert.toInt(getString(getJsonParams(),name));
}
/**
* 获取Integer参数
*/
public static Integer getParameterToInt(String name, Integer defaultValue) {
return Convert.toInt(getString(getJsonParams(),name), defaultValue);
}
/**
* 从 Map 中安全获取 String 类型参数
*/
public static String getString(Map<String, Object> map, String key) {
if (map == null || key == null) {
return null;
}
Object value = map.get(key);
return (value instanceof String) ? (String) value : null;
}
/**
* 从 Map 中安全获取 Integer 类型参数
*/
public static Integer getInteger(Map<String, Object> map, String key) {
if (map == null || key == null) {
return null;
}
Object value = map.get(key);
// 支持数字类型(如 Integer、Long、Double 等)转为 Integer
if (value instanceof Number) {
return ((Number) value).intValue();
}
return null;
}
/**
* 从 Map 中安全获取 Date 类型参数(指定格式)
*/
public static Date getDate(Map<String, Object> map, String key, String pattern) {
String dateStr = getString(map, key);
if (dateStr == null) {
return null;
}
try {
return new SimpleDateFormat(pattern).parse(dateStr);
} catch (ParseException e) {
return null; // 格式错误返回 null
}
}
/**
* 从 Map 中安全获取 Boolean 类型参数
*/
public static Boolean getBoolean(Map<String, Object> map, String key) {
if (map == null || key == null) {
return null;
}
Object value = map.get(key);
return (value instanceof Boolean) ? (Boolean) value : null;
}
}

View File

@ -12,16 +12,4 @@ public class LisinterfaceNameConstants {
//获取门诊病人信息列表
public static final String DAYMESSAGE_GETOUTPATLIST = "222";
public static final String DAYMESSAGE_GETPATIENT = "204";
/**
* 准备发送报告-5
*/
public static final String REPORTSTART = "5";
/**
* 发送报告-1
*/
public static final String REPORTEND = "1";
/**
* 撤销报告-0
*/
public static final String REPORTCANCAL = "0";
}

View File

@ -1,35 +0,0 @@
package com.czlis.interfaceCommon.constants;
/**
* 检验报告单状态常量(lab_pat.jgbz)
*/
public class ReportStatusConstants {
/**
* 未审核报告默认状态=0
*/
public static final String DEFAULT = "0";
/**
* 初审=1
*/
public static final String PRELIM = "1";
/**
* 终审报告完成=2
*/
public static final String CONFIRM = "2";
/**
* 初级报告发出=3
*/
public static final String FIRST = "3";
/**
* 二级报告发出=4
*/
public static final String SECOND = "4";
/**
* 报告锁定=5
*/
public static final String STOP = "5";
/**
* 撤销报告=C
*/
public static final String CANCAL = "C";
}

View File

@ -1,45 +1,6 @@
package com.czlis.interfaceCommon.constants;
/**
* 申请单状态常量(lab_reqmain.zt)
*/
public class SampleStatusConstants {
/**
* 标本开单,新建样本-1
*/
public static final String CREATE="1";
/**
* 标本执行,打印条码-11
*/
public static final String PRINT="11";
/**
* 标本采样-12
*/
public static final String COLLECTION="12";
/**
* 标本送出-13
*/
public static final String SEND="13";
/**
* 标本签收-2
*/
public static final String SIGNFOR = "2";
/**
* 上机开始检测-3(暂时未使用)
*/
public static final String START = "3";
/**
* 审核完成-4
*/
public static final String CONFIRM = "4";
/**
* 剔回样本-8
*/
public static final String REBACK = "8";
/**
* 作废样本-9
*/
public static final String CANCAL = "9";
public static final String SIGNFOR = "2"; //标本签收
}

View File

@ -1,17 +0,0 @@
package com.czlis.interfaceCommon.mapper;
import com.czlis.common.core.domain.entity.lis.LabInstr;
import com.czlis.common.core.domain.entity.lis.XmInfo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface LabInstrMapper {
List<LabInstr> getLabInstrAll();
List<LabInstr> getLabInstrList(LabInstr labInstr);
LabInstr getLabInstr(@Param("yq")String yq);
String getYqmc(@Param("yq")String yq);
String getYqdl(@Param("yq")String yq);
String getBgdh(@Param("yq")String yq);
String getLisgroup(@Param("yq")String yq);
}

View File

@ -43,8 +43,6 @@ public class CommonUtil {
@Autowired
XmValMapper xmValMapper;
@Autowired
LabInstrMapper labInstrMapper;
@Autowired
XmAlarmdetailMapper xmAlarmdetailMapper;
//====检验主表操作方法集合===
@ -123,23 +121,47 @@ public class CommonUtil {
}
//=====项目字典查询=========
public List<XmInfo> getXmInfoList(String yq) {return xmInfoMapper.getXmInfoList(yq);}
public XmInfo getXmInfo(String yq,String xmdh) {return xmInfoMapper.getXmInfo(yq,xmdh);}
public List<XmRef> getXmRefList(String yq) {return xmRefMapper.getXmRefList(yq);}
public XmRef getXmRef(String yq,String xmdh) {return xmRefMapper.getXmRef(yq,xmdh);}
public XmRef getXmRefValue(Map<String,Object> map) {return xmRefMapper.getXmRefValue(map);}
public String getXmRefJgbz(String yq,String xmdh,String csjg,String csjg1,String csjg2) {return xmValMapper.getXmValJgbz(yq,xmdh,csjg,csjg1,csjg2);}
public List<XmAlarmdetail> getXmAlarmdetail(String yq,String xmdh){return xmAlarmdetailMapper.getXmAlarmdetail(yq,xmdh);};
public String getYqmc(String yq){return labInstrMapper.getYqmc(yq);}
public String getYqdl(String yq){return labInstrMapper.getYqdl(yq);}
public LabInstr getLabInstr(String yq){return labInstrMapper.getLabInstr(yq);}
public List<LabInstr> getLabInstrList(LabInstr labInstr){return labInstrMapper.getLabInstrList(labInstr);}
public List<XmInfo> getXmInfoList(String yq) {
return xmInfoMapper.getXmInfoList(yq);
}
public XmInfo getXmInfo(String yq, String xmdh) {
return xmInfoMapper.getXmInfo(yq, xmdh);
}
public List<XmRef> getXmRefList(String yq) {
return xmRefMapper.getXmRefList(yq);
}
public XmRef getXmRef(String yq, String xmdh) {
return xmRefMapper.getXmRef(yq, xmdh);
}
public XmRef getXmRefValue(Map<String, Object> map) {
return xmRefMapper.getXmRefValue(map);
}
public String getXmRefJgbz(String yq, String xmdh, String csjg, String csjg1, String csjg2) {
return xmValMapper.getXmValJgbz(yq, xmdh, csjg, csjg1, csjg2);
}
public List<XmAlarmdetail> getXmAlarmdetail(String yq, String xmdh) {
return xmAlarmdetailMapper.getXmAlarmdetail(yq, xmdh);
}
//服务器时间方法
public Date getCurrentTime(){return commonMapper.getCurrentTime();}
public String getCurrentDate(){return getDateString(getCurrentTime());}
public String getCurrentDateTime(){return getDateTimeString(getCurrentTime());}
public String getDateString(Date rq){return DateFormatUtils.format(rq, "yyyy-MM-dd");}
public String getDateTimeString(Date rq){return DateFormatUtils.format(rq, "yyyy-MM-dd HH:mm:ss");}
public Date getCurrentTime() {
return commonMapper.getCurrentTime();
}
public String getCurrentDate() {
return DateFormatUtils.format(commonMapper.getCurrentTime(), "yyyy-MM-dd");
}
public String getCurrentDateTime() {
return DateFormatUtils.format(commonMapper.getCurrentTime(), "yyyy-MM-dd HH:mm:ss");
}
//字典查询单位名称
public String getCompany(String yljg) {
@ -196,12 +218,6 @@ public class CommonUtil {
return comDictMapper.getComDictListByZdlb(zdlb);
}
}
/**
* 获取本院设置全局参数yq=HISOPT
* @param xxdh
* @return
*/
public String getHISOPT(String xxdh){return getComOptValue("HISOPT",xxdh);}
public String getComOptValue(String yq, String xxdh) {
ComOpt comOpt = getOptCache(yq, xxdh);

View File

@ -1,41 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.czlis.interfaceCommon.mapper.LabInstrMapper">
<select id="getLabInstrAll" resultType="com.czlis.common.core.domain.entity.lis.LabInstr">
select * from lab_instr
</select>
<select id="getLabInstr" resultType="com.czlis.common.core.domain.entity.lis.LabInstr">
select * from lab_instr where yq=#{yq}
</select>
<select id="getYqmc" resultType="String">
select yqmc from lab_instr where yq=#{yq}
</select>
<select id="getBgdh" resultType="String">
select bgdh from lab_instr where yq=#{yq}
</select>
<select id="getYqdl" resultType="String">
select yqdl from lab_instr where yq=#{yq}
</select>
<select id="getLisgroup" resultType="String">
select lisgroup from lab_instr where yq=#{yq}
</select>
<select id="getLabInstrList" resultType="com.czlis.common.core.domain.entity.lis.LabInstr" parameterType="com.czlis.common.core.domain.entity.lis.LabInstr">
select * from lab_instr
<where>
<if test="yq != null and yq !=''">and yq = #{yq}</if>
<if test="yqmc != null and yqmc !=''">and yqmc = #{yqmc}</if>
<if test="zcm != null and zcm !=''">and zcm = #{zcm}</if>
<if test="yqdl != null and yqdl !=''">and yqdl = #{yqdl}</if>
<if test="lisgroup != null and lisgroup !=''">and lisgroup = #{lisgroup}</if>
<if test="yljg != null and yljg !=''">and yljg = #{yljg}</if>
<if test="useflag != null and useflag !=''">and useflag = #{useflag}</if>
<if test="instrid != null and instrid !=''">and instrid = #{instrid}</if>
<if test="bgdh != null and bgdh !=''">and bgdh = #{bgdh}</if>
</where>
</select>
</mapper>

View File

@ -3,18 +3,16 @@ package com.czlis.liswork.controller.work;
import com.czlis.common.core.controller.BaseController;
import com.czlis.common.core.domain.Result;
import com.czlis.common.core.domain.entity.lis.LabPat;
import com.czlis.common.utils.ServletUtils;
import com.czlis.liswork.service.LisWorkOperService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
@Slf4j
@RestController
@RequestMapping("/lisworkoper")
public class LisWorkOperController extends BaseController {
@ -48,12 +46,9 @@ public class LisWorkOperController extends BaseController {
* @param hdys 核对医生
* @return
*/
@ApiOperation("审核报告")
@GetMapping("/check2")
public Result check21( Date jyrq, String yq, String ybh, String hdys){
log.info("yq:{}", yq);
hdys="lis";
@ApiOperation("修改病人信息")
@PostMapping("/check2")
public Result check2(Date jyrq, String yq, String ybh,String hdys){
return lisWorkOperService.check2(jyrq, yq, ybh, hdys);
}
}

View File

@ -1,6 +1,5 @@
package com.czlis.liswork.mapper;
import com.czlis.common.core.domain.entity.lis.LabPat;
import com.czlis.liswork.pojo.DTO.ResultCalcDTO;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
@ -10,13 +9,10 @@ import java.util.Map;
public interface LisWorkOperMapper {
Long checkReqClass(@Param("sqh") String sqh,@Param("yq") String yq);
String selectSqxmdh(String sqh);
String selectYqdl(String yq);
void sp_setrefs(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);
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

@ -2,18 +2,14 @@ package com.czlis.liswork.service.impl;
import com.czlis.common.core.domain.entity.lis.*;
import com.czlis.common.utils.ServletUtils;
import com.czlis.common.utils.StringUtils;
import com.czlis.common.utils.ip.IpUtils;
import com.czlis.interfaceCommon.constants.LisinterfaceNameConstants;
import com.czlis.common.core.domain.Result;
import com.czlis.interfaceCommon.constants.ReportStatusConstants;
import com.czlis.interfaceCommon.constants.SampleStatusConstants;
import com.czlis.interfaceCommon.mapper.LabReqdetailMapper;
import com.czlis.interfaceCommon.mapper.LabReqmainMapper;
import com.czlis.interfaceCommon.pojo.inter.DayMessage;
import com.czlis.interfaceCommon.pojo.inter.GetReqInterface;
import com.czlis.interfaceCommon.pojo.inter.SetReport;
import com.czlis.interfaceCommon.pojo.inter.SetReqStatus;
import com.czlis.interfaceCommon.utils.*;
import com.czlis.liswork.mapper.LisWorkOperMapper;
@ -22,7 +18,6 @@ import com.czlis.liswork.pojo.DTO.ResultCalcDTO;
import com.czlis.liswork.service.LisWorkOperService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -109,8 +104,8 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
private Result checkZT(String sqh, String yq, String zt) {
if (zt.equals("9")) return new Result("-1", "当前条码已经作废,不允许上机!");
String SP_GETTOWREQOK = commonUtil.getHISOPT("SP_GETTOWREQOK"); //申请单禁止重复上机
String SP_GETTOWREQOKYQ = commonUtil.getHISOPT("SP_GETTOWREQOKYQ");//申请单禁止同仪器重复上机
String SP_GETTOWREQOK = commonUtil.getComOptValue("HISOPT", "SP_GETTOWREQOK"); //申请单禁止重复上机
String SP_GETTOWREQOKYQ = commonUtil.getComOptValue("HISOPT", "SP_GETTOWREQOKYQ");//申请单禁止同仪器重复上机
if (zt.equals("2")) {
if (SP_GETTOWREQOK.equals("1")) return new Result("-1", "当前条码已经上机!");
if (SP_GETTOWREQOKYQ.equals("1")) {
@ -206,41 +201,26 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
* @return
*/
public Result check2(Date jyrq, String yq, String ybh, String hdys) {
if (hdys == null || "".equals(hdys)) new Result("-1", "审核者为空,无法审核!");
//入参通过GET推送时使用ServletUtils.getParameterToInt获取
//入参通过POSTJSON时使用JsonParamUtils.getParameterToInt获取
int problemId = ServletUtils.getParameterToInt("problemId", 0);
//1,审核权限校验
if (!commonUtil.getUserPower(yq, hdys, 20)) return new Result("-1", "当前核对者无权对本仪器报告审核!");
//2:数据合法性校验
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
Result result = beforecheck2(labPat, hdys, problemId);
Result result = beforecheck2(jyrq, yq, ybh, hdys);
if ("0".equals(result.getCode())) return result;
//3:数据完整性校验
result = saveallresult(jyrq, yq, ybh);
if ("0".equals(result.getCode())) return result;
//3:数据完整保存
saveallresult(jyrq, yq, ybh);
//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 result=aftercheck2(jyrq, yq, ybh, hdys);
//if("0".equals(result.getCode()))return result;
return new Result("0", "保存成功!");
}
public Result beforecheck2(Date jyrq, String yq, String ybh, String hdys) {
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);
}
private Result beforecheck2(LabPat labPat, String hdys, Integer problemId) {
if (hdys == null || "".equals(hdys)) new Result("-1", "审核者为空,无法审核!");
Date jyrq = labPat.getJyrq();
String yq = labPat.getYq();
String ybh = labPat.getYbh();
if (labPat == null) return new Result("-1", "病人信息为空禁止审核!");
String jgbz = labPat.getJgbz();
if ("2".equals(jgbz)) new Result("0", "保存成功!");
@ -249,34 +229,8 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
String f_check1 = commonUtil.getComOptValue(yq, "f_check1");
if ("1".equals(f_check1)) return new Result("-1", "审核前必须先初审!");
}
String limit_brly = commonUtil.getHISOPT("limit_brly");
String brly = labPat.getBrly();
if ("1".equals(limit_brly) && (brly == null || "".equals(brly)))
return new Result("-1", "病人类型为空,禁止审核!");
String limit_yblx = commonUtil.getHISOPT("limit_yblx");
String yblx = labPat.getYblx();
if ("1".equals(limit_yblx) && (yblx == null || "".equals(yblx)))
return new Result("-1", "样本类型为空,禁止审核!");
String limit_brxm = commonUtil.getHISOPT("limit_brxm");
String brxm = labPat.getBrxm();
if ("1".equals(limit_brxm) && (brxm == null || "".equals(brxm)))
return new Result("-1", "病人姓名为空,禁止审核!");
if ((brxm == null || "".equals(brxm)) && problemId < 1) new Result("5", "姓名为空,你确定要审核吗?", 1);
String limit_ksdh = commonUtil.getHISOPT("limit_ksdh");
String ksdh = labPat.getKsdh();
if ("1".equals(limit_ksdh) && (ksdh == null || "".equals(ksdh)))
return new Result("-1", "科室单位为空,禁止审核!");
String limit_patno = commonUtil.getHISOPT("limit_patno");
String brdh = labPat.getBrdh();
String brlyname = commonUtil.getComDictNameById("PT", brly);
if ("1".equals(limit_patno) && (brdh == null || "".equals(brdh))) {
if (!"质控".equals(brlyname)) return new Result("-1", "病历号不能为空,禁止审核!");
}
String limit_brpatno = commonUtil.getHISOPT("limit_brpatno");
if ("1".equals(limit_brpatno) && (brdh == null || "".equals(brdh))) {
if ("1".equals(brly) || "3".equals(brly)) return new Result("-1", "门诊住院的病历号不能为空,禁止审核!");
}
if (brxm == null || "".equals(brxm)) new Result("-1", "姓名为空禁止审核!");
List<LabResult> labResultList = commonUtil.getLabResultList(jyrq, yq, ybh);
if (labResultList == null) return new Result("-1", "结果为空禁止审核!");
for (LabResult labResult : labResultList) {
@ -291,75 +245,6 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
}
}
if (problemId < 2) {
//多做结果判断
String otherresultmsg = commonUtil.getComOptValue(yq, "otherresultmsg");
if ("1".equals(otherresultmsg)) {
String yqdl = commonUtil.getYqdl(yq);
if (!"细菌仪".equals(yqdl)) {
int nullcount = lisWorkOperMapper.checkresultsqxmdh(jyrq, yq, ybh, labPat.getSqh());
if (nullcount > 0) return new Result("5", "结果有多做的项目,是否审核?", 2);
}
}
}
String limit_jgwxh4 = commonUtil.getHISOPT("limit_jgwxh4");
if ("1".equals(limit_jgwxh4)) {
int wxh = lisWorkOperMapper.checkresultwxh(jyrq, yq, ybh);
if (wxh > 0) return new Result("-1", "有结果为****禁止审核!");
}
String sqh = labPat.getSqh();
if (sqh == null || "".equals(sqh)) {
if (!"质控".equals(brlyname)) {
if ("1".equals(commonUtil.getHISOPT("sp_dublereport"))) {
LabPat labPat0 = lisWorkOperMapper.checkdublereport(sqh, ybh);
if(labPat0 !=null){
String yqmc=commonUtil.getYqmc(yq);
String msg="该申请单已经发过结果了,禁止审核!\r\n日期:"+commonUtil.getDateString(jyrq)+",仪器:"+yqmc+",样本号:"+ybh;
return new Result("-1", msg);
}
} else if ("1".equals(commonUtil.getHISOPT("sp_yqdublereport"))) {
LabPat labPat0 = lisWorkOperMapper.checkyqdublereport(sqh,yq, ybh);
if(labPat0 !=null){
String yqmc=commonUtil.getYqmc(yq);
String msg="该申请单已经发过结果了,禁止审核!\r\n日期:"+commonUtil.getDateString(jyrq)+",仪器:"+yqmc+",样本号:"+ybh;
return new Result("-1", msg);
}
}
}
}
//调用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.setStatus(LisinterfaceNameConstants.REPORTSTART);
Result result = lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.SETREPORT, setReport);
if (result.getCode().equals("5")) {
if (problemId < 3) {
return new Result(result.getCode(), result.getMsg(), 3);
}
return new Result("0", "保存成功!");
}
if (!result.getCode().equals("0")) return result;
return new Result("0", "保存成功!");
}
public Result aftercheck2(Date jyrq, String yq, String ybh, String hdys) {
//调用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.setStatus(LisinterfaceNameConstants.REPORTEND);
Result result = lisInterfaceUtil.invokeLisInterface(LisinterfaceNameConstants.SETREPORT, setReport);
return new Result("0", "保存成功!");
}
@ -370,29 +255,20 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
* @return
*/
public Result saveallresult(Date jyrq, String yq, String ybh) {
//查询病人信息
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
saveallresult(labPat);
return new Result("0", "保存成功!");
}
//内部使用
private void saveallresult(LabPat labPat) {
Date jyrq = labPat.getJyrq();
String yq = labPat.getYq();
String ybh = labPat.getYbh();
//清除空白结果
String keepnodataitem = commonUtil.getComOptValue(yq, "keepnodataitem");
if (!"1".equals(keepnodataitem)) {
commonUtil.delNullLabResult(jyrq, yq, ybh);
}
//查询病人信息
LabPat labPat = commonUtil.getLabPatOne(jyrq, yq, ybh);
//计算项目更新
calcsample(labPat);
//保存最新参考值结果标志
saverefs(labPat);
//补写结果表申请单项目编号
String sqh = labPat.getYbh();
if (sqh != null && !"".equals(sqh)) setItemSqxmdh(jyrq, yq, ybh, sqh);
setItemSqxmdh(jyrq, yq, ybh, labPat.getSqh());
return new Result("0", "保存成功!");
}
/**
@ -489,7 +365,6 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
saverefs(labPat);
return new Result("0", "保存成功!");
}
//内部使用
/**
* 计算项目参考值结果异常标志(内部使用)
@ -501,7 +376,7 @@ public class LisWorkOperServiceImpl implements LisWorkOperService {
Date jyrq = labPat.getJyrq();
String yq = labPat.getYq();
String ybh = labPat.getYbh();
String yqdl = commonUtil.getYqdl(yq);
String yqdl = lisWorkOperMapper.selectYqdl(yq);
boolean lb_setbj = true, lb_wjz = false;
if (!"细菌仪".equals(yqdl)) {
Map<String, Object> map = new HashMap<>();

View File

@ -4,30 +4,15 @@
<mapper namespace="com.czlis.liswork.mapper.LisWorkOperMapper">
<select id="checkReqClass" resultType="Long">
select COUNT(1) from xm_feeinstr,lab_reqdetail
select COUNT(*) from xm_feeinstr,lab_reqdetail
where lab_reqdetail.sqxmdh=xm_feeinstr.sfxmdh
and lab_reqdetail.sqh=#{sqh} and xm_feeinstr.yq=#{yq};
</select>
<select id="selectSqxmdh" resultType="String">
select sqxmdh from lab_reqdetail where lab_reqdetail.sqh=#{sqh}
</select>
<select id="checkresultsqxmdh" resultType="Integer">
select count(1) from lab_result a join xm_info on a.yq=xm_info.yq and a.xmdh=xm_info.xmdh and xm_info.jsxm != 'Y' AND xm_info.dylx='1'
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="checkresultwxh" resultType="Integer">
select count(1) from lab_result,xm_info
where lab_result.yq = xm_info.yq and lab_result.xmdh = xm_info.xmdh and
lab_result.yq =#{yq} And lab_result.jyrq =#{jyrq} And lab_result.ybh =#{ybh} and (lab_result.csjg='****')
</select>
<select id="checkdublereport" resultType="com.czlis.common.core.domain.entity.lis.LabPat">
select top 1 jyrq,yq,ybh from lab_pat where jgbz='2' and sqh=#{sqh} and ybh !=#{ybh}
</select>
<select id="checkyqdublereport" resultType="com.czlis.common.core.domain.entity.lis.LabPat">
select top 1 jyrq,yq,ybh from lab_pat where jgbz='2' and sqh=#{sqh} and yq=#{yq} and ybh !=#{ybh}
<select id="selectYqdl" resultType="String">
select yqdl from lab_instr where lab_instr.yq=#{yq}
</select>
<update id="updatelabresultsqxmdhall">
update lab_result set sqxmdh=#{sqxmdh} where yq=#{yq} and jyrq=#{jyrq} and ybh=#{ybh};