Переглянути джерело

Merge remote-tracking branch 'origin/his/commonNew' into his/hzqy

# Conflicts:
#	src/main/java/com/diagbot/facade/str/BStrContentFacade.java
shiyue 4 роки тому
батько
коміт
c44c02eb9b

+ 196 - 0
src/main/java/com/diagbot/entity/StrTotalInfo.java

@@ -0,0 +1,196 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 结构化文书异常监察表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-03-12
+ */
+public class StrTotalInfo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 记录编号
+     */
+    private String recId;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 病历号
+     */
+    private String behospitalCode;
+
+    /**
+     * 医院模板ID
+     */
+    private String modelId;
+
+    /**
+     * 医院模板名称
+     */
+    private String modelName;
+
+    /**
+     * 结构化数据
+     */
+    private String wholeData;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 是否删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人
+     */
+    private String creator;
+
+    /**
+     * 修改人
+     */
+    private String modifier;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+    public String getRecId() {
+        return recId;
+    }
+
+    public void setRecId(String recId) {
+        this.recId = recId;
+    }
+    public Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+    public String getBehospitalCode() {
+        return behospitalCode;
+    }
+
+    public void setBehospitalCode(String behospitalCode) {
+        this.behospitalCode = behospitalCode;
+    }
+    public String getModelId() {
+        return modelId;
+    }
+
+    public void setModelId(String modelId) {
+        this.modelId = modelId;
+    }
+    public String getModelName() {
+        return modelName;
+    }
+
+    public void setModelName(String modelName) {
+        this.modelName = modelName;
+    }
+    public String getWholeData() {
+        return wholeData;
+    }
+
+    public void setWholeData(String wholeData) {
+        this.wholeData = wholeData;
+    }
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+    public Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+
+    @Override
+    public String toString() {
+        return "StrTotalInfo{" +
+            "id=" + id +
+            ", recId=" + recId +
+            ", hospitalId=" + hospitalId +
+            ", behospitalCode=" + behospitalCode +
+            ", modelId=" + modelId +
+            ", modelName=" + modelName +
+            ", wholeData=" + wholeData +
+            ", remark=" + remark +
+            ", isDeleted=" + isDeleted +
+            ", gmtCreate=" + gmtCreate +
+            ", gmtModified=" + gmtModified +
+            ", creator=" + creator +
+            ", modifier=" + modifier +
+        "}";
+    }
+}

+ 22 - 23
src/main/java/com/diagbot/facade/data/ABehospitalInfoFacade.java

@@ -70,6 +70,19 @@ public class ABehospitalInfoFacade extends BehospitalInfoServiceImpl {
     public RespDTO<List<ABehospitalInfoDTO>> executeBehospital(List<ABehospitalInfoVO> list) {
         try {
             if(list!=null && list.size()>0) {
+                //循环验证数据有效性
+                for (ABehospitalInfoVO behospitalInfo:list) {
+                    if("".equals(behospitalInfo.getBehospitalCode())) {
+                        return RespDTO.onError("请输入病人住院编码!");
+                    }else if(behospitalInfo.getHospitalId()==null){
+                        return RespDTO.onError("请输入医院编码!");
+                    }else if("".equals(behospitalInfo.getBehDeptId())){
+                        return RespDTO.onError("请输入住院科室编码!");
+                    }else if("".equals(behospitalInfo.getBehDeptName())){
+                        return RespDTO.onError("请输入住院科室名称!");
+                    }
+                }
+
                 List<BehospitalInfo> behospitalInfoList = Lists.newArrayList();
                 list.stream().forEach(s->{
                     BehospitalInfo behospitalInfo=new BehospitalInfo();
@@ -90,18 +103,6 @@ public class ABehospitalInfoFacade extends BehospitalInfoServiceImpl {
 
                 });
 
-                //循环验证数据有效性
-                for (BehospitalInfo behospitalInfo:behospitalInfoList) {
-                    if("".equals(behospitalInfo.getBehospitalCode())) {
-                        return RespDTO.onError("请输入病人住院编码!");
-                    }else if(behospitalInfo.getHospitalId()==null){
-                        return RespDTO.onError("请输入医院编码!");
-                    }else if("".equals(behospitalInfo.getBehDeptId())){
-                        return RespDTO.onError("请输入住院科室编码!");
-                    }else if("".equals(behospitalInfo.getBehDeptName())){
-                        return RespDTO.onError("请输入住院科室名称!");
-                    }
-                }
                 execute(behospitalInfoList);
                 if(logSwitch){
                     behospitalInfoList.forEach(s->{
@@ -153,26 +154,24 @@ public class ABehospitalInfoFacade extends BehospitalInfoServiceImpl {
     private Long initQcTypeId(BehospitalInfo s) {
         Long qcTypeId = Long.valueOf("0");
         //根据科室查找对应质控类型
-        List<QcType> qcTypeList = qcTypeFacade.list(new QueryWrapper<QcType>()
+        QcType qcTypeList = qcTypeFacade.getOne(new QueryWrapper<QcType>()
                 .eq("beh_dept_id", s.getBehDeptId())
                 .eq("hospital_id", s.getHospitalId())
+                .eq("default_module", 0)
+                .eq("sex",s.getSex())
                 .eq("is_deleted", IsDeleteEnum.N));
-        if(qcTypeList == null || qcTypeList.size() == 0){
+        if(qcTypeList == null){
             //无质控类型时,新增后初始化
             QcType qcType = qcTypeFacade.getOne(new QueryWrapper<QcType>()
                     .eq("default_module", 1)
                     .eq("hospital_id", s.getHospitalId())
+                    .eq("sex",s.getSex())
                     .eq("is_deleted", IsDeleteEnum.N));
-            qcTypeId = qcType.getId();
-        } else if (qcTypeList.size() == 1) {
-            qcTypeId = qcTypeList.get(0).getId();
-        }else {
-            //查找是否有性别区分质控类型
-            for (QcType qcType:qcTypeList) {
-                if (qcType.getSex().equals(s.getSex())) {
-                    qcTypeId = qcType.getId();
-                }
+            if(qcType!=null){
+                qcTypeId = qcType.getId();
             }
+        }else {
+            qcTypeId = qcTypeList.getId();
         }
         return qcTypeId;
     }

+ 9 - 1
src/main/java/com/diagbot/facade/data/AHomePageFacade.java

@@ -49,6 +49,9 @@ public class AHomePageFacade extends HomePageServiceImpl{
     @Value("${log_switch.enable}")
     private boolean logSwitch;
 
+    @Value("${xml_analyse.enable}")
+    private boolean xmlAnalyse;
+
     private TZDBConn tzDBConn = new TZDBConn();
 
     /**
@@ -116,8 +119,13 @@ public class AHomePageFacade extends HomePageServiceImpl{
 
             //装载数据
             updateHomePageIng(aHomePageIngVO);
+
+            if(xmlAnalyse){
+                //评分后返回结构体
+                return homePageIng(aHomePageIngVO);
+            }
             //评分后返回结构体
-            return homePageIng(aHomePageIngVO);
+            return RespDTO.onSuc("操作成功!");
         }else{
             return RespDTO.onError("未接收到数据!");
         }

+ 20 - 15
src/main/java/com/diagbot/facade/data/AMedicalRecordFacade.java

@@ -116,7 +116,7 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
             execute(medicalRecordList);
 
             List<AMedicalRecordDTO> medicalRecordDTOList = BeanUtil.listCopyTo(list, AMedicalRecordDTO.class);
-            return RespDTO.onSuc(medicalRecordDTOList);
+            return RespDTO.onSuc("操作成功!");
         } else {
             return RespDTO.onError("未接收到数据!");
         }
@@ -316,7 +316,7 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
             Map<String, Object> map = new HashMap<String, Object>();
             List<AMedicalRecordDTO> medicalRecordDTOList = BeanUtil.listCopyTo(aMrContentVO.getRecords(), AMedicalRecordDTO.class);
             map.put("records", medicalRecordDTOList);
-            return RespDTO.onSuc(map);
+            return RespDTO.onSuc("操作成功!");
         } else if (aMrContentVO.getDockModeType().equals("1")) {
             if (modeId == 0 || modeId == null) {
                 return RespDTO.onError("无对应的文书类型");
@@ -387,7 +387,7 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
                                 .eq("hospital_id", s.getHospitalId()), false);
                         if (behospitalInfo != null) {
                             //如果病人住院信息存在,更新对应的qc_type_id
-                            Long qcTypeId = initQcTypeId(s);
+                            Long qcTypeId = initQcTypeId(behospitalInfo);
                             behospitalInfo.setQcTypeId(qcTypeId);
                             behospitalInfoList.add(behospitalInfo);
                         }
@@ -429,25 +429,30 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
     /**
      * 初始化质控类型ID
      *
-     * @param medicalRecord
+     * @param s
      * @return
      */
-    private Long initQcTypeId(MedicalRecord medicalRecord) {
+    private Long initQcTypeId(BehospitalInfo s) {
         Long qcTypeId = Long.valueOf("0");
-        QcType qcType = qcTypeFacade.getOne(new QueryWrapper<QcType>()
-                .eq("name", medicalRecord.getRecTitle())
-                .eq("hospital_id", medicalRecord.getHospitalId())
+        //根据科室查找对应质控类型
+        QcType qcTypeList = qcTypeFacade.getOne(new QueryWrapper<QcType>()
+                .eq("beh_dept_id", s.getBehDeptId())
+                .eq("hospital_id", s.getHospitalId())
+                .eq("default_module", 0)
+                .eq("sex",s.getSex())
                 .eq("is_deleted", IsDeleteEnum.N));
-        if (qcType != null && qcType.getDefaultModule() == 0) {
-            qcTypeId = qcType.getId();
-        } else {
-            QcType qcTypeStand = qcTypeFacade.getOne(new QueryWrapper<QcType>()
+        if(qcTypeList == null){
+            //无质控类型时,新增后初始化
+            QcType qcType = qcTypeFacade.getOne(new QueryWrapper<QcType>()
                     .eq("default_module", 1)
-                    .eq("hospital_id", medicalRecord.getHospitalId())
+                    .eq("hospital_id", s.getHospitalId())
+                    .eq("sex",s.getSex())
                     .eq("is_deleted", IsDeleteEnum.N));
-            if (qcTypeStand != null) {
-                qcTypeId = qcTypeStand.getId();
+            if(qcType!=null){
+                qcTypeId = qcType.getId();
             }
+        }else {
+            qcTypeId = qcTypeList.getId();
         }
         return qcTypeId;
     }

+ 10 - 6
src/main/java/com/diagbot/facade/str/BStrContentFacade.java

@@ -9,18 +9,20 @@ package com.diagbot.facade.str;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.diagbot.dto.RespDTO;
-import com.diagbot.entity.MedicalRecord;
 import com.diagbot.entity.ModelHospital;
+import com.diagbot.entity.StrTotalInfo;
 import com.diagbot.enums.ModeIdEnum;
 import com.diagbot.facade.ModelHospitalFacade;
 import com.diagbot.facade.data.AMedAbnormalInfoFacade;
 import com.diagbot.facade.data.ColumnFacade;
 import com.diagbot.vo.str.StrContentVO;
-import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 
+import java.util.Date;
+
 @Component
 public class BStrContentFacade {
 
@@ -29,9 +31,10 @@ public class BStrContentFacade {
 
     @Autowired
     private ColumnFacade columnFacade;
-
     @Autowired
     private ModelHospitalFacade modelHospitalFacade;
+    @Autowired
+    private StrTotalInfoFacade strTotalInfoFacade;
 
     @Value("${log_switch.enable}")
     private boolean logSwitch;
@@ -43,8 +46,6 @@ public class BStrContentFacade {
         try{
             if("".equals(strContentVO.getModelId())){
                 return RespDTO.onError("请输入模板类型ID!");
-            }else if(StringUtils.isEmpty(strContentVO.getModelName())){
-                return RespDTO.onError("请输入模板类型名称!");
             }else if("".equals(strContentVO.getRecId())) {
                 return RespDTO.onError("请输入记录编号!");
             }else if(strContentVO.getHospitalId()==null){
@@ -65,7 +66,10 @@ public class BStrContentFacade {
                     }
                 }else{
                     //无对应的modelId时,存入对应表中,方便后面追述
-
+                    StrTotalInfo strTotalInfo=new StrTotalInfo();
+                    BeanUtils.copyProperties(strContentVO,strTotalInfo);
+                    strTotalInfo.setGmtCreate(new Date());
+                    strTotalInfoFacade.save(strTotalInfo);
                 }
 
                 if(logSwitch){

+ 8 - 0
src/main/java/com/diagbot/facade/str/StrTotalInfoFacade.java

@@ -0,0 +1,8 @@
+package com.diagbot.facade.str;
+
+import com.diagbot.service.impl.StrTotalInfoServiceImpl;
+import org.springframework.stereotype.Component;
+
+@Component
+public class StrTotalInfoFacade extends StrTotalInfoServiceImpl {
+}

+ 16 - 0
src/main/java/com/diagbot/mapper/StrTotalInfoMapper.java

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.StrTotalInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 结构化文书异常监察表 Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-03-12
+ */
+public interface StrTotalInfoMapper extends BaseMapper<StrTotalInfo> {
+
+}

+ 16 - 0
src/main/java/com/diagbot/service/StrTotalInfoService.java

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.StrTotalInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 结构化文书异常监察表 服务类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-03-12
+ */
+public interface StrTotalInfoService extends IService<StrTotalInfo> {
+
+}

+ 20 - 0
src/main/java/com/diagbot/service/impl/StrTotalInfoServiceImpl.java

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.StrTotalInfo;
+import com.diagbot.mapper.StrTotalInfoMapper;
+import com.diagbot.service.StrTotalInfoService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 结构化文书异常监察表 服务实现类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-03-12
+ */
+@Service
+public class StrTotalInfoServiceImpl extends ServiceImpl<StrTotalInfoMapper, StrTotalInfo> implements StrTotalInfoService {
+
+}

+ 70 - 0
src/main/java/com/diagbot/vo/data/AHomePageVO.java

@@ -638,6 +638,76 @@ public class AHomePageVO {
      */
     private String returnToType;
 
+    /**
+     * 住院期间身体约束
+     */
+    private String isPhysicalRestraint;
+
+    /**
+     * 颅脑损伤患者昏迷时间(入院前)
+     */
+    private String tbiBehospitalBeforeTime;
+
+    /**
+     * 颅脑损伤患者昏迷时间(入院后)
+     */
+    private String tbiBehospitalAfterTime;
+
+    /**
+     * 住院期间是否发生跌倒或坠床
+     */
+    private String isFallBed;
+
+    /**
+     * 医院感染
+     */
+    private String isNosocomialInfection;
+
+    /**
+     * 入住ICU情况
+     */
+    private String isIntoIcu;
+
+    /**
+     * 并发症情况
+     */
+    private String isComplications;
+
+    /**
+     * 是否发生压疮
+     */
+    private String isPressureSore;
+
+    /**
+     * 是否住院期间发生压疮
+     */
+    private String isBehospitalPressureSore;
+
+    /**
+     * 非计划再次手术
+     */
+    private String isUnplannedReoperation;
+
+    /**
+     * 治疗结果
+     */
+    private String treatmentResults;
+
+    /**
+     * 并发症
+     */
+    private String complicationsResults;
+
+    /**
+     * 感染部位
+     */
+    private String infectionSite;
+
+    /**
+     * 住院期间有无告病危
+     */
+    private String isBeInDanger;
+
     /**
      * 出院诊断
      */

+ 22 - 0
src/main/resources/mapper/StrTotalInfoMapper.xml

@@ -0,0 +1,22 @@
+<?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.diagbot.mapper.StrTotalInfoMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.StrTotalInfo">
+        <id column="id" property="id" />
+        <result column="rec_id" property="recId" />
+        <result column="hospital_id" property="hospitalId" />
+        <result column="behospital_code" property="behospitalCode" />
+        <result column="model_id" property="modelId" />
+        <result column="model_name" property="modelName" />
+        <result column="whole_data" property="wholeData" />
+        <result column="remark" property="remark" />
+        <result column="is_deleted" property="isDeleted" />
+        <result column="gmt_create" property="gmtCreate" />
+        <result column="gmt_modified" property="gmtModified" />
+        <result column="creator" property="creator" />
+        <result column="modifier" property="modifier" />
+    </resultMap>
+
+</mapper>