Pārlūkot izejas kodu

调整入院登记qc_type映射规则

liuqq 4 gadi atpakaļ
vecāks
revīzija
81c464dadc

+ 59 - 16
src/main/java/com/diagbot/entity/QcType.java

@@ -37,7 +37,27 @@ public class QcType implements Serializable {
     /**
      * 默认模版是否开启(0-否 1-是)
      */
-    private Long defaultModule;
+    private Integer defaultModule;
+
+    /**
+     * 父类质控id
+     */
+    private String parentTypeId;
+
+    /**
+     * 性别
+     */
+    private String sex;
+
+    /**
+     * 科室ID
+     */
+    private String behDeptId;
+
+    /**
+     * 科室名称
+     */
+    private String behDeptName;
 
     /**
      * 备注
@@ -76,7 +96,6 @@ public class QcType implements Serializable {
     public void setId(Long id) {
         this.id = id;
     }
-
     public Long getHospitalId() {
         return hospitalId;
     }
@@ -84,7 +103,6 @@ public class QcType implements Serializable {
     public void setHospitalId(Long hospitalId) {
         this.hospitalId = hospitalId;
     }
-
     public String getName() {
         return name;
     }
@@ -92,7 +110,41 @@ public class QcType implements Serializable {
     public void setName(String name) {
         this.name = name;
     }
+    public Integer getDefaultModule() {
+        return defaultModule;
+    }
 
+    public void setDefaultModule(Integer defaultModule) {
+        this.defaultModule = defaultModule;
+    }
+    public String getParentTypeId() {
+        return parentTypeId;
+    }
+
+    public void setParentTypeId(String parentTypeId) {
+        this.parentTypeId = parentTypeId;
+    }
+    public String getSex() {
+        return sex;
+    }
+
+    public void setSex(String sex) {
+        this.sex = sex;
+    }
+    public String getBehDeptId() {
+        return behDeptId;
+    }
+
+    public void setBehDeptId(String behDeptId) {
+        this.behDeptId = behDeptId;
+    }
+    public String getBehDeptName() {
+        return behDeptName;
+    }
+
+    public void setBehDeptName(String behDeptName) {
+        this.behDeptName = behDeptName;
+    }
     public String getRemark() {
         return remark;
     }
@@ -100,7 +152,6 @@ public class QcType implements Serializable {
     public void setRemark(String remark) {
         this.remark = remark;
     }
-
     public String getIsDeleted() {
         return isDeleted;
     }
@@ -108,7 +159,6 @@ public class QcType implements Serializable {
     public void setIsDeleted(String isDeleted) {
         this.isDeleted = isDeleted;
     }
-
     public Date getGmtCreate() {
         return gmtCreate;
     }
@@ -116,7 +166,6 @@ public class QcType implements Serializable {
     public void setGmtCreate(Date gmtCreate) {
         this.gmtCreate = gmtCreate;
     }
-
     public Date getGmtModified() {
         return gmtModified;
     }
@@ -124,7 +173,6 @@ public class QcType implements Serializable {
     public void setGmtModified(Date gmtModified) {
         this.gmtModified = gmtModified;
     }
-
     public String getCreator() {
         return creator;
     }
@@ -132,7 +180,6 @@ public class QcType implements Serializable {
     public void setCreator(String creator) {
         this.creator = creator;
     }
-
     public String getModifier() {
         return modifier;
     }
@@ -141,14 +188,6 @@ public class QcType implements Serializable {
         this.modifier = modifier;
     }
 
-    public Long getDefaultModule() {
-        return defaultModule;
-    }
-
-    public void setDefaultModule(Long defaultModule) {
-        this.defaultModule = defaultModule;
-    }
-
     @Override
     public String toString() {
         return "QcType{" +
@@ -156,6 +195,10 @@ public class QcType implements Serializable {
                 ", hospitalId=" + hospitalId +
                 ", name=" + name +
                 ", defaultModule=" + defaultModule +
+                ", parentTypeId=" + parentTypeId +
+                ", sex=" + sex +
+                ", behDeptId=" + behDeptId +
+                ", behDeptName=" + behDeptName +
                 ", remark=" + remark +
                 ", isDeleted=" + isDeleted +
                 ", gmtCreate=" + gmtCreate +

+ 20 - 24
src/main/java/com/diagbot/facade/data/ABehospitalInfoFacade.java

@@ -36,11 +36,7 @@ public class ABehospitalInfoFacade extends BehospitalInfoServiceImpl {
     @Autowired
     private QcTypeFacade qcTypeFacade;
     @Autowired
-    private AMedicalRecordFacade aMedicalRecordFacade;
-    @Autowired
     private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
-    @Autowired
-    private QcAbnormalFacade qcAbnormalFacade;
     @Value("${log_switch.enable}")
     private boolean logSwitch;
 
@@ -154,27 +150,27 @@ public class ABehospitalInfoFacade extends BehospitalInfoServiceImpl {
      * @param s
      * @return
      */
-    private Long initQcTypeId(BehospitalInfo s){
-        Long qcTypeId=Long.valueOf("0");
-        MedicalRecord medicalRecord = aMedicalRecordFacade.getOne(new QueryWrapper<MedicalRecord>()
-                .eq("behospital_code", s.getBehospitalCode())
+    private Long initQcTypeId(BehospitalInfo s) {
+        Long qcTypeId = Long.valueOf("0");
+        //根据科室查找对应质控类型
+        List<QcType> qcTypeList = qcTypeFacade.list(new QueryWrapper<QcType>()
+                .eq("beh_dept_id", s.getBehDeptId())
                 .eq("hospital_id", s.getHospitalId())
-                .eq("mode_id", Long.valueOf("1"))
-                .eq("is_deleted",IsDeleteEnum.N), false);
-        if(medicalRecord!=null){
-            QcType qcType=qcTypeFacade.getOne(new QueryWrapper<QcType>()
-                    .eq("name", medicalRecord.getRecTitle())
-                    .eq("hospital_id", medicalRecord.getHospitalId())
-                    .eq("is_deleted",IsDeleteEnum.N));
-            if(qcType!=null && qcType.getDefaultModule()==0){
-                qcTypeId=qcType.getId();
-            }else{
-                QcType qcTypeStand=qcTypeFacade.getOne(new QueryWrapper<QcType>()
-                        .eq("default_module", 1)
-                        .eq("hospital_id", medicalRecord.getHospitalId())
-                        .eq("is_deleted",IsDeleteEnum.N));
-                if(qcTypeStand!=null){
-                    qcTypeId=qcTypeStand.getId();
+                .eq("is_deleted", IsDeleteEnum.N));
+        if(qcTypeList == null || qcTypeList.size() == 0){
+            //无质控类型时,新增后初始化
+            QcType qcType = qcTypeFacade.getOne(new QueryWrapper<QcType>()
+                    .eq("default_module", 1)
+                    .eq("hospital_id", s.getHospitalId())
+                    .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();
                 }
             }
         }

+ 7 - 3
src/main/java/com/diagbot/facade/data/AMedicalRecordFacade.java

@@ -68,6 +68,9 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
     @Value("${encrypt.enable}")
     Boolean encryptFlag;
 
+    @Value("${xml_analyse.enable}")
+    Boolean xmlAnalyseFlag;
+
     @Value("${log_switch.enable}")
     private boolean logSwitch;
 
@@ -284,9 +287,10 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
                 aMedicalRecordContentFacade.executeMrRecordContent(s.getContents());
             });
 
-            //数据解析
-            splicingParam(aMrContentVO);
-
+            //数据解析,评分规则等还未完整时不解析
+            if(xmlAnalyseFlag){
+                splicingParam(aMrContentVO);
+            }
             //评分后返回结构体
             return mrIng(aMrContentVO);
 

+ 4 - 0
src/main/resources/mapper/QcTypeMapper.xml

@@ -8,6 +8,10 @@
         <result column="hospital_id" property="hospitalId" />
         <result column="name" property="name" />
         <result column="default_module" property="defaultModule" />
+        <result column="parent_type_id" property="parentTypeId" />
+        <result column="sex" property="sex" />
+        <result column="beh_dept_id" property="behDeptId" />
+        <result column="beh_dept_name" property="behDeptName" />
         <result column="remark" property="remark" />
         <result column="is_deleted" property="isDeleted" />
         <result column="gmt_create" property="gmtCreate" />

+ 2 - 2
src/test/java/com/diagbot/CodeGeneration.java

@@ -27,7 +27,7 @@ public class CodeGeneration {
 
         // 全局配置
         GlobalConfig gc = new GlobalConfig();
-        gc.setOutputDir("E://code//mrqcsys");
+        gc.setOutputDir("c://code//mrqcsys");
         gc.setFileOverride(true);
         gc.setActiveRecord(false);// 不需要ActiveRecord特性的请改为false
         gc.setEnableCache(false);// XML 二级缓存
@@ -56,7 +56,7 @@ public class CodeGeneration {
         StrategyConfig strategy = new StrategyConfig();
 //        strategy.setTablePrefix(new String[] { "med_" });// 此处可以修改为您的表前缀
         strategy.setNaming(NamingStrategy.underline_to_camel);// 表名生成策略
-        strategy.setInclude(new String[] { "str_consultation_record"}); // 需要生成的表
+        strategy.setInclude(new String[] { "qc_type"}); // 需要生成的表
 
         strategy.setSuperServiceClass(null);
         strategy.setSuperServiceImplClass(null);