yeguodong 1 month ago
parent
commit
f75947d8de

+ 44 - 0
src/main/java/thyyxxk/webserver/controller/lis/LisController.java

@@ -0,0 +1,44 @@
+package thyyxxk.webserver.controller.lis;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import thyyxxk.webserver.config.exception.ExceptionEnum;
+import thyyxxk.webserver.entity.ResultVo;
+import thyyxxk.webserver.entity.lis.LabRpt;
+import thyyxxk.webserver.entity.lis.MzJyReq;
+import thyyxxk.webserver.service.lis.LisService;
+import thyyxxk.webserver.utils.ResultVoUtil;
+import thyyxxk.webserver.utils.StringUtil;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/Lis")
+public class LisController {
+
+    @Autowired
+    private LisService lisService;
+
+    @GetMapping("/getMzJyReqByPatientId")
+    public ResultVo<List<MzJyReq>> getMzJyReqByPatientId(@RequestParam("patientId") String patientId) {
+        if (StringUtil.isBlank(patientId)) {
+            return ResultVoUtil.fail(ExceptionEnum.INVALID_PARAM, "patientId不能为空!");
+        }
+        return ResultVoUtil.success(lisService.getMzJyReqByPatientId(patientId));
+    }
+
+    @GetMapping("/getMzJyReqDetail")
+    public ResultVo<MzJyReq> getMzJyReqDetail(@RequestParam("reqNo") int reqNo) {
+
+        return ResultVoUtil.success(lisService.getMzJyReqDetail(reqNo));
+    }
+
+    @GetMapping("/getLabRpt")
+    public ResultVo<List<LabRpt>> getLabRpt(@RequestParam("reportId") String reportId, @RequestParam("patientId") String patientId) {
+        if (StringUtil.isBlank(reportId)) {
+            return ResultVoUtil.fail(ExceptionEnum.INVALID_PARAM, "reportId不能为空!");
+        }
+        return ResultVoUtil.success(lisService.getLabRpt(reportId, patientId));
+    }
+}

+ 34 - 0
src/main/java/thyyxxk/webserver/dao/lis/LisDao.java

@@ -0,0 +1,34 @@
+package thyyxxk.webserver.dao.lis;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+import thyyxxk.webserver.entity.lis.LabRpt;
+import thyyxxk.webserver.entity.lis.MzJyReq;
+
+import java.util.List;
+
+@Mapper
+public interface LisDao {
+
+    @Select("select m.req_no, m.trans_dt, m.order_name, m.group_name, m.report_id, m.p_name, m.patient_id, z.name as req_ward_name, j.name as inspect_stuff_name, " +
+            "mi.sex, mi.age, m.req_date, m.charge_date, m.req_comment, a.name as doctor_name, m.trans_user " +
+            "from mz_yj_req m " +
+            "left join zd_unit_code z on m.req_ward=z.code " +
+            "left join jy_zd_sample j on m.inspect_stuff=j.code " +
+            "left join mz_patient_mi mi on m.patient_id=mi.patient_id " +
+            "left join a_employee_mi a on m.req_doctor=a.code " +
+            "where m.patient_id = #{patientId} " +
+            "order by req_date desc")
+    List<MzJyReq> getMzJyReqByPatientId(String patientId);
+
+    @Select("select * " +
+            "from mz_yj_req " +
+            "where req_no = #{reqNo} " +
+            "order by req_no desc")
+    MzJyReq getMzJyReqDetail(Integer reqNo);
+
+    @Select("select * " +
+            "from lab_rpt " +
+            "where report_id = #{reportId} ")
+    List<LabRpt> getLabRpt(String reportId);
+}

+ 124 - 0
src/main/java/thyyxxk/webserver/entity/lis/LabRpt.java

@@ -0,0 +1,124 @@
+package thyyxxk.webserver.entity.lis;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+@Data
+@TableName("lab_rpt")
+public class LabRpt {
+
+    /**
+     * 结果id
+     */
+    private String resultId;
+
+    /**
+     * 报告id
+     */
+    private String reportId;
+
+    /**
+     * 病人类型  1=门诊,2=急诊,3=住院,4=体检等,体检时也可直接保存名称
+     */
+    private String patType;
+
+    /**
+     * 英文缩写
+     */
+    private String itemcodeEn;
+
+    /**
+     * 英文名称
+     */
+    private String itemnameEn;
+
+    /**
+     * 临床意义
+     */
+    private String clinicsign;
+
+    /**
+     * 关联req_no
+     */
+    private String hisRecordId;
+
+    /**
+     * 预留字段1
+     */
+    private String hisRefcol1;
+
+    /**
+     * 预留字段2
+     */
+    private String hisRefcol2;
+
+    /**
+     * 预留字段3
+     */
+    private String hisRefcol3;
+
+    /**
+     * 申请项目代码
+     */
+    private String reqItemcode;
+
+    /**
+     * 申请项目名称
+     */
+    private String reqItemname;
+
+    /**
+     * 报告项目代码
+     */
+    private String rptItemcode;
+
+    /**
+     * 报告项目名称
+     */
+    private String rptItemname;
+
+    /**
+     * 数字结果
+     */
+    private String resultNum;
+
+    /**
+     * 文本结果
+     */
+    private String resultStr;
+
+    /**
+     * H偏高、HH偏高报警、L偏低、LL偏低报警、P阳性、Q弱阳性、E错误
+     */
+    private String resultFlag;
+
+    /**
+     * 危急值标志 1表示危急值
+     */
+    private String alertFlag;
+
+    /**
+     * 单位
+     */
+    private String resultUnit;
+
+    /**
+     * 参考值
+     */
+    private String resultRef;
+
+    /**
+     * 报告单元名称(仪器名称)
+     */
+    private String rptUnitName;
+
+    /**
+     * 测试方法
+     */
+    private String testMethod;
+
+    /**
+     * 类型(0:普通报告,1:微生物,2:危急值)
+     */
+    private String rptType;
+}

+ 308 - 0
src/main/java/thyyxxk/webserver/entity/lis/MzJyReq.java

@@ -0,0 +1,308 @@
+package thyyxxk.webserver.entity.lis;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+@TableName("mz_jy_req")
+public class MzJyReq {
+
+    /**
+     * 申请编号
+     */
+    private Integer reqNo;
+
+    /**
+     * 患者ID
+     */
+    private String patientId;
+
+    /**
+     * 患者姓名
+     */
+    private String pName;
+
+    /**
+     * 出生日期
+     */
+    private Date birthDate;
+
+    /**
+     * 次数
+     */
+    private Short times;
+
+    /**
+     * 收据编号
+     */
+    private Short receiptNo;
+
+    /**
+     * 订单编号
+     */
+    private Short orderNo;
+
+    /**
+     * 项目序号
+     */
+    private Short itemNo;
+
+    /**
+     * 患者条码
+     */
+    private String pBarCode;
+
+    /**
+     * 组名称
+     */
+    private String groupName;
+
+    /**
+     * 项目编号
+     */
+    private String orderCode;
+
+    /**
+     * 项目名称
+     */
+    private String orderName;
+
+    /**
+     * 页码
+     */
+    private String pageNo;
+
+    /**
+     * 申请原因
+     */
+    private String reqComment;
+
+    /**
+     * 申请医生
+     */
+    private String reqDoctor;
+
+    private String doctorName;
+
+    /**
+     * 申请科室
+     */
+    private String reqWard;
+
+    private String reqWardName;
+
+    /**
+     * 执行科室
+     */
+    private String execDept;
+
+    /**
+     * 申请日期
+     */
+    private Date reqDate;
+
+    /**
+     * 检查部位
+     */
+    private String inspectPart;
+
+    /**
+     * 标本
+     */
+    private String inspectStuff;
+
+    private String inspectStuffName;
+
+    /**
+     * 标本状态
+     */
+    private String sampleStatus;
+
+    /**
+     * 打印标识
+     */
+    private String printFlag;
+
+    /**
+     * 接收标识(默认值:0)
+     */
+    private String receiveFlag;
+
+    /**
+     * 申请单类型:2:检验;3:检查
+     */
+    private String reqType;
+
+    /**
+     * 结果备注
+     */
+    private String resultComment;
+
+    /**
+     * 系统日期
+     */
+    private Date sysDate;
+
+    /**
+     * 支付标记
+     */
+    private String payMark;
+
+    /**
+     * 状态标记
+     */
+    private String statusFlag;
+
+    /**
+     * 序列号
+     */
+    private Integer serialNo;
+
+    /**
+     * 收费员ID
+     */
+    private String cashId;
+
+    /**
+     * 检验备注
+     */
+    private String jyRemark;
+
+    /**
+     * 其他申请结果
+     */
+    private String reqOtherResult;
+
+    /**
+     * 原始清单编号
+     */
+    private String originalListNo;
+
+    /**
+     * 申请通知备注
+     */
+    private String reqTzComment;
+
+    /**
+     * 急诊标记
+     */
+    private String jzFlag;
+
+    /**
+     * 申请研究ID
+     */
+    private String reqStudyid;
+
+    /**
+     * 百分比(精度10,小数位3)
+     */
+    private BigDecimal percentFt;
+
+    /**
+     * 确认标记
+     */
+    private String confirmFlag;
+
+    /**
+     * 确认时间
+     */
+    private Date confirmTime;
+
+    /**
+     * 确认人ID
+     */
+    private String confirmId;
+
+    /**
+     * 打印标记_应急
+     */
+    private String printFlagYj;
+
+    /**
+     * 请求身份
+     */
+    private String responceType;
+
+    /**
+     * 删除标记(默认值:0)
+     */
+    private Byte delFlag;
+
+    /**
+     * 记录日期
+     */
+    private String recordDate;
+
+    /**
+     * 开始时间
+     */
+    private String beginTime;
+
+    /**
+     * 结束时间
+     */
+    private String endTime;
+
+    /**
+     * 数量
+     */
+    private Integer quantity;
+
+    /**
+     * 收费日期
+     */
+    private Date chargeDate;
+
+    /**
+     * 收费金额(精度10,小数位2)
+     */
+    private BigDecimal chargeFee;
+
+    /**
+     * 体检号
+     */
+    private String tjNo;
+
+    /**
+     * 报告id(LIS返回)
+     */
+    private String reportId;
+
+    /**
+     * 相关执行人(LIS返回)
+     */
+    private String transUser;
+
+    /**
+     * 相关执行时间(LIS返回)
+     */
+    private String transDt;
+
+    /**
+     * 检验状态(LIS返回)
+     * 条码检验科接收:RECIEVE
+     * 条码取消签收:CANCELRECIEVE
+     * 条码检验科剔回:UNRECIEVE
+     * 条码生成:CREATE
+     * 条码取消生成:UNCREATE
+     * 条码打印:PRINT
+     * 条码修改(增加项目):MODIFY
+     * 采样确认:COLLECT
+     * 报告审核:CHECK
+     * 报告发布:SEND
+     * 报告发布:BACK
+     */
+    private String stat;
+
+    /**
+     * 当前整张报告pdf数据(base64字符串)(LIS返回)
+     */
+    private String pdf;
+
+    private String sex;
+
+    private int age;
+}

+ 11 - 2
src/main/java/thyyxxk/webserver/service/lc/company/LcCompanyService.java

@@ -9,6 +9,7 @@ import org.springframework.stereotype.Service;
 import thyyxxk.webserver.dao.his.lc.company.LcCompanyDao;
 import thyyxxk.webserver.entity.lc.company.LcCompany;
 import thyyxxk.webserver.entity.lc.company.LcCompanyParam;
+import thyyxxk.webserver.entity.lc.purchasePlan.LcPurchasePlanDetail;
 
 import java.util.UUID;
 
@@ -34,7 +35,15 @@ public class LcCompanyService {
     }
 
     public int insertLcCompany(LcCompany lcCompany) {
-        lcCompany.setId(UUID.randomUUID().toString().replace("-", ""));
-        return dao.insert(lcCompany);
+        int num = 0;
+        if(StringUtils.isNotBlank(lcCompany.getId())) {
+            num = dao.updateById(lcCompany);
+        } else {
+            lcCompany.setId(UUID.randomUUID().toString().replace("-", ""));
+            num = dao.insert(lcCompany);
+
+        }
+
+        return num;
     }
 }

+ 30 - 0
src/main/java/thyyxxk/webserver/service/lis/LisService.java

@@ -0,0 +1,30 @@
+package thyyxxk.webserver.service.lis;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import thyyxxk.webserver.dao.lis.LisDao;
+import thyyxxk.webserver.entity.lis.LabRpt;
+import thyyxxk.webserver.entity.lis.MzJyReq;
+
+import java.util.List;
+
+@Slf4j
+@Service
+public class LisService {
+
+    @Autowired
+    private LisDao dao;
+
+    public List<MzJyReq> getMzJyReqByPatientId(String patientId) {
+        return dao.getMzJyReqByPatientId(patientId);
+    }
+
+    public MzJyReq getMzJyReqDetail(int reqNo) {
+        return dao.getMzJyReqDetail(reqNo);
+    }
+
+    public List<LabRpt> getLabRpt(String reportId, String patientId) {
+        return dao.getLabRpt(reportId);
+    }
+}