瀏覽代碼

Merge remote-tracking branch 'origin/debug' into debug

wangyu 5 年之前
父節點
當前提交
f106bb480f

+ 10 - 6
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0494.java

@@ -1,6 +1,7 @@
 package com.lantone.qc.kernel.catalogue.behospitalized;
 
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.KernelConstants;
 import com.lantone.qc.kernel.util.RedisUtil;
 import com.lantone.qc.kernel.util.SpringContextUtil;
 import com.lantone.qc.pub.model.InputInfo;
@@ -30,12 +31,15 @@ public class BEH0494 extends QCCatalogue {
         }
         if (StringUtils.isNotEmpty(doctorName)) {
             RedisUtil redisUtil = SpringContextUtil.getBean("redisUtil");
-            Map<String, String> surgeon = new HashMap<>();
-            surgeon = (Map<String, String>) redisUtil.get(doctorName);
-            if (surgeon != null) {
-                if (StringUtils.isNotEmpty(surgeon.get("professor")) && surgeon.get("professor").contains("医师")) {
-                    status.set("0");
-                }
+            Map<String, Object> surgeon = redisUtil.getJsonStringValue(KernelConstants.HOSPITAL_DOCTOR_MAP);
+            if (surgeon == null) {
+                return;
+            }
+            Map<String, String> doctor = (Map) surgeon.get(doctorName);
+            String occup = doctor.get("occup");
+            if (StringUtils.isNotEmpty(occup) && "1".equals(occup)) {
+                status.set("0");
+                return;
             }
         } else {
             status.set("0");

+ 18 - 8
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstcourserecord/FIRC0093.java

@@ -1,6 +1,7 @@
 package com.lantone.qc.kernel.catalogue.firstcourserecord;
 
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.CatalogueUtil;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.doc.BeHospitalizedDoc;
@@ -35,14 +36,23 @@ public class FIRC0093 extends QCCatalogue {
                 if (StringUtils.isNotEmpty(couDate) && StringUtils.isNotEmpty(beDate)) {
                     Date date_in = StringUtil.parseDateTime(beDate);
                     Date date_out = StringUtil.parseDateTime(couDate);
-                    Calendar from = Calendar.getInstance();
-                    from.setTime(date_in);
-                    Calendar to = Calendar.getInstance();
-                    to.setTime(date_out);
-                    int fromHour = from.get(Calendar.HOUR_OF_DAY);
-                    int toHour = to.get(Calendar.HOUR_OF_DAY);
-                    int hour = toHour - fromHour;
-                    if (hour > 8) {
+                    if (date_in == null || date_out == null) return;
+                    boolean firc = CatalogueUtil.compareTime(date_in, date_out, 8 * 60L);
+                    if (firc) {
+                        status.set("-1");
+                    }
+                }
+            }
+        } else {
+            Map<String, String> beHospitalizedDocStructureMap = beHospitalizedDoc.getStructureMap();
+            if (beHospitalizedDocStructureMap != null) {
+                String beDate = beHospitalizedDocStructureMap.get("入院日期");
+                if (StringUtils.isNotEmpty(beDate)) {
+                    Date date_in = StringUtil.parseDateTime(beDate);
+                    Date date_out = new Date();
+                    if (date_in == null) return;
+                    boolean firc = CatalogueUtil.compareTime(date_in, date_out, 8 * 60L);
+                    if (firc) {
                         status.set("-1");
                     }
                 }

+ 3 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/operationdiscussion/OPE0630.java

@@ -34,6 +34,9 @@ public class OPE0630 extends QCCatalogue {
         }
         if (ListUtil.isNotEmpty(operationDocs)) {
             for (OperationDoc operationDoc : operationDocs) {
+                if (operationDoc.getOperationRecordDoc() == null){
+                    continue;
+                }
                 String operationStartDateStr = operationDoc.getOperationRecordDoc().getStructureMap().get("手术开始时间");
                 if (CatalogueUtil.isEmpty(operationStartDateStr)) {
                     continue;

+ 3 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/operationdiscussion/OPE0631.java

@@ -34,6 +34,9 @@ public class OPE0631 extends QCCatalogue {
         }
         if (ListUtil.isNotEmpty(operationDocs)) {
             for (OperationDoc operationDoc : operationDocs) {
+                if (operationDoc.getOperationRecordDoc() == null){
+                    continue;
+                }
                 String operationEndDateStr = operationDoc.getOperationRecordDoc().getStructureMap().get("手术结束时间");
                 if (CatalogueUtil.isEmpty(operationEndDateStr)) {
                     continue;

+ 17 - 19
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0094.java

@@ -1,10 +1,13 @@
 package com.lantone.qc.kernel.catalogue.threelevelward;
 
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.KernelConstants;
 import com.lantone.qc.kernel.util.RedisUtil;
 import com.lantone.qc.kernel.util.SpringContextUtil;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
+import com.lantone.qc.pub.model.doc.FirstCourseRecordDoc;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Component;
 
 import java.util.Map;
@@ -18,30 +21,25 @@ import java.util.Map;
 @Component
 public class THR0094 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
-        status.set("0");
-        if (inputInfo.getThreeLevelWardDocs().size() == 0) {
+        FirstCourseRecordDoc firstCourseRecordDoc = inputInfo.getFirstCourseRecordDoc();
+        if (firstCourseRecordDoc == null) {
+            status.set("0");
             return;
         }
+
         String sign = inputInfo.getFirstCourseRecordDoc().getStructureMap().get("记录医师");
         sign = (null==sign)?"":sign.trim();
 
-        if(sign.length() > 0 || true) {
-            RedisUtil redisUtil = SpringContextUtil.getBean("redisUtil");
-            int cnt = 0;
-
-            Map<String, String> surgeon;
-
-            if (null != redisUtil.get(sign)) {
-                surgeon = (Map)redisUtil.get(sign);
-                String prof = surgeon.get("职称").trim();
-                if (null != prof && prof.contains("医师")) {
-                    cnt += 1;
-                }
-            }
-
-            if (cnt == 0) {
-                status.set("-1");
-            }
+        RedisUtil redisUtil = SpringContextUtil.getBean("redisUtil");
+        Map<String, Object> surgeon = redisUtil.getJsonStringValue(KernelConstants.HOSPITAL_DOCTOR_MAP);
+        if (surgeon == null) {
+            return;
+        }
+        Map<String, String> doctor = (Map) surgeon.get(sign);
+        String occup = doctor.get("occup");
+        if (StringUtils.isNotEmpty(occup) && "1".equals(occup)) {
+            status.set("0");
+            return;
         }
     }
 }

+ 12 - 20
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0602.java

@@ -21,7 +21,7 @@ import java.util.Map;
 
 /**
  * @ClassName : THR0602
- * @Description : 主医师在术后48小时内无查房记录
+ * @Description : 主医师在术后48小时内无查房记录
  * @Author : 胡敬
  * @Date: 2020-03-30 14:03
  */
@@ -34,8 +34,8 @@ public class THR0602 extends QCCatalogue {
         if (ListUtil.isEmpty(operationDocs) || ListUtil.isEmpty(threeLevelWardDocs)) {
             return;
         }
-        //所有主治医师查房记录
-        List<AttendingDoctorWardDoc> attendingDoctorWardDocs = threeLevelWardDocs.get(0).getAttendingDoctorWardDocs();
+        //所有医师查房记录
+        List<ThreeLevelWardDoc> allDoctorWradDocs = threeLevelWardDocs.get(0).getAllDoctorWradDocs();
         for (OperationDoc operationDoc : operationDocs) {
             OperationRecordDoc operationRecordDoc = operationDoc.getOperationRecordDoc();
             if (operationRecordDoc == null) {
@@ -47,10 +47,10 @@ public class THR0602 extends QCCatalogue {
                 continue;
             }
             Map<String, String> doctorRecord = extractWardRecord(
-                    attendingDoctorWardDocs,
+                    allDoctorWradDocs,
                     operationEndDateStr,
                     48 * 60);
-            if (!doctorRecord.containsKey(Content.attend)) {
+            if (!doctorRecord.containsKey("主刀")) {
                 status.set("-1");
                 return;
             }
@@ -60,14 +60,14 @@ public class THR0602 extends QCCatalogue {
     }
 
     /**
-     * 抽取住院duration分钟内查房记录并取第一条主治医师查房记录以及第一条主任/副主任医师查房记录
+     * 抽取住院duration分钟内查房记录并取第一条主医师查房记录
      *
-     * @param attendingDoctorWardDocs
+     * @param allDoctorWradDocs
      * @param admisTime
      * @param duration
      * @return
      */
-    private static Map<String, String> extractWardRecord(List<AttendingDoctorWardDoc> attendingDoctorWardDocs, String admisTime, int duration) {
+    private static Map<String, String> extractWardRecord(List<ThreeLevelWardDoc> allDoctorWradDocs, String admisTime, int duration) {
         Map<Date, String> dateRecord = new HashMap<>();
         List<String> sortRecord = new ArrayList<>();
         Map<String, String> doctorRecord = new HashMap<>();
@@ -76,7 +76,7 @@ public class THR0602 extends QCCatalogue {
         if (admisDate == null) {
             return doctorRecord;
         }
-        for (AttendingDoctorWardDoc attendingDoctorWardDoc : attendingDoctorWardDocs) {
+        for (ThreeLevelWardDoc attendingDoctorWardDoc : allDoctorWradDocs) {
             Map<String, String> threeLevelWardStructureMap = attendingDoctorWardDoc.getStructureMap();
             recordTime = threeLevelWardStructureMap.get("查房日期");
             Date recordDate = StringUtil.parseDateTime(recordTime);
@@ -92,20 +92,12 @@ public class THR0602 extends QCCatalogue {
         dateRecord.entrySet().stream().sorted(Map.Entry.comparingByKey()).forEachOrdered(
                 x -> sortRecord.add(x.getValue())
         );
-        //按时间排好序查房记录的第一条主医师查房记录存进doctorRecord
+        //按时间排好序查房记录的第一条主医师查房记录存进doctorRecord
         for (String record : sortRecord) {
-            if (!CatalogueUtil.subTitle(record).contains(Content.attend)) {
+            if (!CatalogueUtil.subTitle(record).contains("主刀")) {
                 continue;
             }
-            doctorRecord.put(Content.attend, record);
-            break;
-        }
-        //按时间排好序查房记录的第一条主任医师/副主任医师查房记录存进doctorRecord
-        for (String record : sortRecord) {
-            if (!CatalogueUtil.subTitle(record).contains(Content.director)) {
-                continue;
-            }
-            doctorRecord.put(Content.director, record);
+            doctorRecord.put("主刀", record);
             break;
         }
         return doctorRecord;

+ 17 - 11
kernel/src/main/java/com/lantone/qc/kernel/util/CacheFileManager.java

@@ -27,14 +27,18 @@ public class CacheFileManager {
     private String password;
     private String url;
 
-    private String hospitalId = "1";
+    private static String hospitalId = "3";
 
     private String path = "";
 
     public static void main(String[] args) {
         CacheFileManager cacheFileManager = new CacheFileManager();
         String p = cacheFileManager.getClass().getResource("/").getPath();
-        p = p.substring(0, p.indexOf("/target/")) + "/src/main/resources/cache/";
+        p = p.substring(0, p.indexOf("/target/")) + "/src/main/resources/cache/"+ hospitalId + "/";
+        File file = new File(p);
+        if (!file.exists()) {
+            file.mkdir();
+        }
         cacheFileManager.createCacheFile(p);
     }
 
@@ -45,9 +49,9 @@ public class CacheFileManager {
 //            user = encrypDES.decryptor(propertiesUtil.getProperty("mysql.redis.user"));
 //            password = encrypDES.decryptor(propertiesUtil.getProperty("mysql.redis.password"));
 //            url = encrypDES.decryptor(propertiesUtil.getProperty("mysql.redis.url"));
-            user = propertiesUtil.getProperty("mysql.test.user");
-            password = propertiesUtil.getProperty("mysql.test.password");
-            url = propertiesUtil.getProperty("mysql.test.url");
+            user = propertiesUtil.getProperty("mysql.redis.user");
+            password = propertiesUtil.getProperty("mysql.redis.password");
+            url = propertiesUtil.getProperty("mysql.redis.url");
         } catch (Exception e) {
             logger.info("数据库连接信息出错...." + e.getMessage());
         }
@@ -74,7 +78,7 @@ public class CacheFileManager {
             }
 
             //所有词典库 不能用concat_group 大小写不区分
-            sql = "select dis.name, dis.is_chronic, dis.is_infections, dis.name group_name from kl_disease dis  order by name";
+            sql = "select dis.name, dis.is_chronic, dis.is_infections, dis.name group_name from kl_disease dis where hospital_id = " + hospitalId + " order by name";
 
             FileWriter fw = new FileWriter(path + "concept_diag_properties.dict");
             rs = st.executeQuery(sql);
@@ -113,7 +117,7 @@ public class CacheFileManager {
             fw.close();
 
             //医院疾病信息
-            sql = "select name from kl_disease";
+            sql = "select name from kl_disease where hospital_id = " + hospitalId;
 
             fw = new FileWriter(path + "hospital_diag_info.dict");
             rs = st.executeQuery(sql);
@@ -128,14 +132,15 @@ public class CacheFileManager {
             fw.close();
 
             //医院医生信息
-            sql = "select doctor_id, doctor_name, dept_id, dept_name, professor from qc_doctor_info where hospital_id = " + hospitalId;
+            sql = "select doctor_id, name, dept_id, professor, occup from bas_doctor_info where hospital_id = " + hospitalId;
 
             fw = new FileWriter(path + "hospital_doctor_info.dict");
             rs = st.executeQuery(sql);
             while (rs.next()) {
                 r1 = rs.getString(2);
-                r2 = rs.getString(4);
-                r3 = rs.getString(5);
+                r2 = rs.getString(3);
+                r3 = rs.getString(4);
+                r4 = rs.getString(5);
 //                r1 = CryptUtil.decrypt_char(r1==null?"":r1);
                 if (StringUtils.isEmpty(r1)) {
                     continue;
@@ -143,8 +148,9 @@ public class CacheFileManager {
                 r1 = r1==null?"":r1;
                 r2 = r2==null?"":r2;
                 r3 = r3==null?"":r3;
+                r4 = r4==null?"":r4;
 
-                fw.write(encrypDES.encrytor(r1+ "|" + r2 + "|" + r3));
+                fw.write(encrypDES.encrytor(r1+ "|" + r2 + "|" + r3 + "|" + r4));
                 fw.write("\n");
             }
             fw.close();

+ 2 - 1
kernel/src/main/java/com/lantone/qc/kernel/util/CacheUtil.java

@@ -84,11 +84,12 @@ public class CacheUtil implements ApplicationRunner {
         Map<String, Map<String, Object>> hospitalDoctorMap = new HashMap<>();
         for (String line : lines) {
             String[] line_arr = line.split("\\|", -1);
-            if (line_arr.length == 3) {
+            if (line_arr.length == 4) {
                 Map<String, Object> map = new HashMap<>();
                 map.put("doctorName", line_arr[0]);
                 map.put("deptName", line_arr[1]);
                 map.put("professor", line_arr[2]);
+                map.put("occup", line_arr[3]);
                 hospitalDoctorMap.put(line_arr[0], map);
             }
         }

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/util/CatalogueUtil.java

@@ -234,7 +234,7 @@ public class CatalogueUtil {
      */
     public static String subTitle(String srcText) {
         if (StringUtil.isNotBlank(srcText) && srcText.contains("代")) {
-            srcText = srcText.substring(srcText.indexOf("代") + 1);
+            srcText = srcText.substring(srcText.lastIndexOf("代") + 1);
         }
         return srcText;
     }

+ 84 - 0
kernel/src/main/resources/cache/3/concept_clinic_bodypart_properties.dict

@@ -0,0 +1,84 @@
+sjwPlFuzwYtdGy/Xru8l0w==
+sjwPlFuzwYuOwjk+wlafMb496h/s94Lp
+GaEOqMDeIR/A3JPjaU/OYQ==
+KUZ84E/l6BtIxYdpVp2d2udw4JKVz6fxOAPHyqzXUMY=
+ClvKDL868eyBa0I3oBBXTiLG5UIUjigm
+cpVuhYfN0V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Hlnbz5ig==
+pGzYL5VYctXxzUrAtKDMFg==
+J47wTSKVIotWP8N6Zu8teQ==
+hnOhzeqPs7c=
+FpNKk6eB+A60ivUVDCQonmb0NA6xAPvZ
+6eB67p+u3VA=
+38rBhrBd2ZA=
+WlxWJO1bvWM=
+/UTzDiOxLWpNfh/SNay22g==
+PLBt3Oha1AAOSE8k2YZYMw==
+cA6kPjEpsoKKXDwNc4sbZv9VC/9mRBPm
+ubvY7WEHsf0HjnX6dZF4Ew==
+NI9su0Z8kvY=
+z5dpaPXQysM+03JbZpPE8K74oEbqwDfN
+e7OvqkV6Qx5DhU/YuJZA4A==
+vnSKQ0o1HZO5fhcvExqbXw==
+5j32mrEC41Q=
+teXiWF5i95089VmH6nOntT26Q3FauFTq
+C5DNXPfJ3MsXUKrj9yaJVQ==
+aBDrcQGdFjgXTO+Ia0kzAA==
+EyuDTtt1Nh1c5OTNuAf37Q==
+0NhZqdATkZ4=
+1IKx7GtShHg=
+h/OwYNYyciw=
+kGg6y+QB2f8=
+et0S9LyTiS4MhEBuylTk2g==
+goFZ0v8zcPc=
+cA6kPjEpsoJc5OTNuAf37Q==
+BZNVMNz30Z00iPLsFnfW9Q==
+FUNtEl6WjOUfVJH7s8MZNQ==
+1boew8BvzsDzIpTnzy5Qnw==
+/CIzubCbNzzkzFf+CBlT64JiFWxfW6DV
+teXiWF5i953EeSAoaVSW+wBBqlZ1ciHqSmARnfpRl/s=
+CTNjqF5g7EIfVJH7s8MZNQ==
+OOQuqjL/h5M16D9aZjbrRw==
+ZfWBQ/To1p1p84i3DCFu/g==
+Q449MTqnm/c=
+xmHl5DY7FyM=
+hV3gMCbT8x+fXEA0j/uq7Q==

File diff suppressed because it is too large
+ 25358 - 0
kernel/src/main/resources/cache/3/concept_diag_properties.dict


File diff suppressed because it is too large
+ 25358 - 0
kernel/src/main/resources/cache/3/hospital_diag_info.dict


File diff suppressed because it is too large
+ 3123 - 0
kernel/src/main/resources/cache/3/hospital_doctor_info.dict


File diff suppressed because it is too large
+ 25357 - 49447
kernel/src/main/resources/cache/concept_diag_properties.dict


File diff suppressed because it is too large
+ 25357 - 49447
kernel/src/main/resources/cache/hospital_diag_info.dict


File diff suppressed because it is too large
+ 3123 - 0
kernel/src/main/resources/cache/hospital_doctor_info.dict


+ 3 - 4
trans/src/main/java/com/lantone/qc/trans/taizhou/TaiZhouThreeLevelWardDocTrans.java

@@ -43,17 +43,16 @@ public class TaiZhouThreeLevelWardDocTrans extends ModelDocTrans {
         if (StringUtils.isEmpty(structureMap.get("查房日期"))) {
             return;
         }
-
         //不能简单的标准转化,如果有查房标题,优先使用
         if (StringUtils.isEmpty(structureMap.get("查房标题")) && StringUtils.isNotEmpty(structureMap.get("查房备注"))) {
             structureMap.put("查房标题", structureMap.get("查房备注"));
         }
-        if (StringUtils.isEmpty(structureMap.get("查房标题")) && StringUtils.isNotEmpty(structureMap.get("上级查房医生职称"))) {
-            structureMap.put("查房标题", structureMap.get("上级查房医生职称"));
-        }
         if (StringUtils.isEmpty(structureMap.get("查房标题")) && StringUtils.isNotEmpty(structureMap.get("查房类别"))) {
             structureMap.put("查房标题", structureMap.get("查房类别"));
         }
+        if (StringUtils.isEmpty(structureMap.get("查房标题")) && StringUtils.isNotEmpty(structureMap.get("上级查房医生职称"))) {
+            structureMap.put("查房标题", structureMap.get("上级查房医生职称"));
+        }
         //总的查房记录 汇总
         ThreeLevelWardDoc allDoctorWradDoc = new ThreeLevelWardDoc();
         allDoctorWradDoc.setStructureMap(structureMap);