Procházet zdrojové kódy

Merge branch 'dev-shaoyf' into dev

zhoutg před 5 roky
rodič
revize
df16b7a8f4

+ 3 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP0161.java

@@ -2,6 +2,7 @@ package com.lantone.qc.kernel.catalogue.firstpagerecord;
 
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
 import com.lantone.qc.kernel.util.CatalogueUtil;
+import com.lantone.qc.kernel.util.RegularUtil;
 import com.lantone.qc.pub.Content;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
@@ -55,6 +56,8 @@ public class FIRP0161 extends QCCatalogue {
         if (StringUtil.isNotBlank(admissionAge) && admissionAge.contains("岁")) {
             admissionAge = admissionAge.replaceAll("[岁天]", "");
         }
+        // 解决邵逸夫数据,年龄后跟着身份证号码
+        admissionAge = RegularUtil.ClearBracket(admissionAge);
         admissionAge = admissionAge.replaceAll("[^0-9]","");
         if (CatalogueUtil.numbersOnly(admissionAge)) {
             age = Integer.parseInt(admissionAge);

+ 7 - 3
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstpagerecord/FIRP02993.java

@@ -1,11 +1,10 @@
 package com.lantone.qc.kernel.catalogue.firstpagerecord;
 
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
-import com.lantone.qc.kernel.util.ClearBracketUtil;
+import com.lantone.qc.kernel.util.RegularUtil;
 import com.lantone.qc.pub.Content;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
-import com.lantone.qc.pub.model.doc.operation.OperationDiscussionDoc;
 import com.lantone.qc.pub.model.doc.operation.OperationDoc;
 import com.lantone.qc.pub.model.doc.operation.OperationRecordDoc;
 import org.springframework.stereotype.Component;
@@ -33,7 +32,7 @@ public class FIRP02993 extends QCCatalogue {
                 ) {
                     OperationRecordDoc operationRecordDoc = operationDoc.getOperationRecordDoc();//手术名称
                     if(operationRecordDoc!=null){
-                        String s = ClearBracketUtil.ClearBracket(operationRecordDoc.getStructureMap().get(Content.operative_name));
+                        String s = RegularUtil.ClearBracket(operationRecordDoc.getStructureMap().get(Content.operative_name));
                         String[] digitalSplit = s.split("[\\+|,|、|,]");
                         for (int i = 0; i < digitalSplit.length; i++) {
                             if (!digitalSplit[i].equals("")) {
@@ -52,6 +51,11 @@ public class FIRP02993 extends QCCatalogue {
                 Object operation = structureExtMap.get(Content.operative_information);//手术信息
                 List<String> operationNameList = new ArrayList<String>();
                 List<Map<String, String>> mapStrs = (List<Map<String, String>>) operation;
+                // 解决空指针,如果无数据,报错
+                if (mapStrs == null) {
+                    status.set("-1");
+                    return ;
+                }
                 if (mapStrs.size() > 0) {
                     for (Map<String, String> mapStr : mapStrs
                     ) {

+ 2 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/leavehospital/LEA0150.java

@@ -27,7 +27,8 @@ public class LEA0150 extends QCCatalogue {
         if (deathRecordDoc != null) {
             status.set("0");
         } else {
-            String message = leaveHospitalDoc.getStructureMap().get("主诉");
+            //已医学部任燕青确认, 只要出院小结里的入院情况有值即不报错
+            String message = leaveHospitalDoc.getStructureMap().get("入院情况");
             if (StringUtil.isNotBlank(message)) {
                 status.set("0");
             }

+ 3 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/leavehospital/LEA02901.java

@@ -2,6 +2,7 @@ package com.lantone.qc.kernel.catalogue.leavehospital;
 
 import com.google.common.collect.Lists;
 import com.lantone.qc.kernel.catalogue.QCCatalogue;
+import com.lantone.qc.kernel.util.RegularUtil;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.doc.DeathRecordDoc;
@@ -31,6 +32,8 @@ public class LEA02901 extends QCCatalogue {
         if (deathRecordDoc == null || deathRecordDoc.getText() == null) {
             Map<String, String> structureMap = leaveHospitalDoc.getStructureMap();
             String dischargeOrder = structureMap.get("出院医嘱");
+            //跟医学部任燕青确认过, 去除括号里的东西
+            dischargeOrder = RegularUtil.ClearBracket(dischargeOrder);
             if (StringUtil.isNotBlank(dischargeOrder)) {
                 List<String> words = Lists.newArrayList("qd","bid","tid","qid","qh","q2h","q4h","q6h","q8h",
                         "qn","q3w","qod","biw","qw","prn","sos","ad","lib","st","stat","hs","am","po","ID","IH","IM",

+ 63 - 47
kernel/src/main/java/com/lantone/qc/kernel/catalogue/operationdiscussion/OPE0587.java

@@ -27,7 +27,11 @@ public class OPE0587 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
         List<OperationDoc> operationDocs = inputInfo.getOperationDocs();
-        List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs().get(0).getAllDoctorWradDocs();
+        List<ThreeLevelWardDoc> threeLevelWardDocs1 = inputInfo.getThreeLevelWardDocs();
+        if (ListUtil.isEmpty(threeLevelWardDocs1)) {
+            return;
+        }
+        List<ThreeLevelWardDoc> threeLevelWardDocs = threeLevelWardDocs1.get(0).getAllDoctorWradDocs();
         if (ListUtil.isEmpty(operationDocs) || ListUtil.isEmpty(threeLevelWardDocs)) {
             return;
         }
@@ -42,60 +46,72 @@ public class OPE0587 extends QCCatalogue {
             roundsDate.add(formatter.format(threeLevelDate));
         }
 
-        //取出出院时间
-        Map<String, String> structureMaps = inputInfo.getFirstPageRecordDoc().getStructureMap();
-        String leaveHospitalDate = structureMaps.get("出院时间") == null ? null : structureMaps.get("出院时间");
-        Date leaveDate = StringUtil.parseDateTime(leaveHospitalDate);
+        //取出出院时间,先从病案首页取,若没有,再去出院小结取
+        String leaveHospitalDate = null;
+        if (inputInfo.getFirstPageRecordDoc() != null) {
+            Map<String, String> structureMaps = inputInfo.getFirstPageRecordDoc().getStructureMap();
+            leaveHospitalDate = structureMaps.get("出院时间");
+        }
+        if (leaveHospitalDate == null && inputInfo.getLeaveHospitalDoc() != null) {
+            leaveHospitalDate = inputInfo.getLeaveHospitalDoc().getStructureMap().get("出院时间");
+        }
         //没有出院时间, 直接退出
-        if (leaveHospitalDate != null) {
-            //取出病程信息里的手术信息的所有 手术日期
-            List<String> operDateList = new ArrayList<>();
-            for (OperationDoc opera : operationDocs) {
-                OperationRecordDoc operationRecordDoc = opera.getOperationRecordDoc();
-                if (operationRecordDoc != null) {
-                    String operDate = operationRecordDoc.getStructureMap().get("手术日期") == null ? null : operationRecordDoc.getStructureMap().get("手术日期");
-                    if (StringUtil.isNotBlank(operDate)) {
-                        operDateList.add(operDate);
-                    }
+        if (StringUtil.isBlank(leaveHospitalDate)) {
+            return;
+        }
+        Date leaveDate = StringUtil.parseDateTime(leaveHospitalDate);
+        if (leaveDate == null) {
+            return;
+        }
+
+        //取出病程信息里的手术信息的所有 手术日期
+        List<String> operDateList = new ArrayList<>();
+        for (OperationDoc opera : operationDocs) {
+            OperationRecordDoc operationRecordDoc = opera.getOperationRecordDoc();
+            if (operationRecordDoc != null) {
+                String operDate = operationRecordDoc.getStructureMap().get("手术日期") == null ? null : operationRecordDoc.getStructureMap().get("手术日期");
+                if (StringUtil.isNotBlank(operDate)) {
+                    operDateList.add(operDate);
                 }
+
             }
-            if (operDateList.size() > 0) {
-                for (String operDates : operDateList) {
-                    Date oper = StringUtil.parseDateTime(operDates);
-                    //手术时间 减去 出院时间
-                    long day = (leaveDate.getTime() - oper.getTime()) / (24 * 60 * 60 * 1000);
-                    //时间大于三天才能判断有没有连续三天查房
-                    if (day > 3) {
-                        List<String> operDatesNew = new ArrayList<>();
-                        //用手术时间加三天
-                        for (int i = 1; i < 4; i++) {
-                            Date firstTimeOfDay = DateUtil.getFirstTimeOfDay(DateUtil.addDay(oper, i));
-                            operDatesNew.add(formatter.format(firstTimeOfDay));
-                        }
-                        if (roundsDate.size() > 2) {//查房日期取出没有3天时间, 直接报错
-                            //去重
-                            List<String> listTemp = new ArrayList<String>();
-                            for (int i = 0; i < roundsDate.size(); i++) {
-                                if (!listTemp.contains(roundsDate.get(i))) {
-                                    listTemp.add(roundsDate.get(i));
-                                }
+        }
+        if (operDateList.size() > 0) {
+            for (String operDates : operDateList) {
+                Date oper = StringUtil.parseDateTime(operDates);
+                //手术时间 减去 出院时间
+                long day = (leaveDate.getTime() - oper.getTime()) / (24 * 60 * 60 * 1000);
+                //时间大于三天才能判断有没有连续三天查房
+                if (day > 3) {
+                    List<String> operDatesNew = new ArrayList<>();
+                    //用手术时间加三天
+                    for (int i = 1; i < 4; i++) {
+                        Date firstTimeOfDay = DateUtil.getFirstTimeOfDay(DateUtil.addDay(oper, i));
+                        operDatesNew.add(formatter.format(firstTimeOfDay));
+                    }
+                    if (roundsDate.size() > 2) {//查房日期取出没有3天时间, 直接报错
+                        //去重
+                        List<String> listTemp = new ArrayList<String>();
+                        for (int i = 0; i < roundsDate.size(); i++) {
+                            if (!listTemp.contains(roundsDate.get(i))) {
+                                listTemp.add(roundsDate.get(i));
                             }
-                            int i = 0;
-                            //循环两个时间List,
-                            for (String str : operDatesNew) {
-                                for (String s : listTemp) {
-                                    if (str.equals(s)) {
-                                        i++;
-                                    }
+                        }
+                        int i = 0;
+                        //循环两个时间List,
+                        for (String str : operDatesNew) {
+                            for (String s : listTemp) {
+                                if (str.equals(s)) {
+                                    i++;
                                 }
                             }
-                            if (i < 3) {
-                                status.set("-1");
-                            }
-                        } else {
+                        }
+                        if (i < 3) {
                             status.set("-1");
-                            return;
                         }
+                    } else {
+                        status.set("-1");
+                        return;
                     }
                 }
             }

+ 6 - 3
kernel/src/main/java/com/lantone/qc/kernel/util/ClearBracketUtil.java

@@ -5,14 +5,14 @@ package com.lantone.qc.kernel.util;
  * @Description:
  * @date 2020-06-29 10:33
  */
-public class ClearBracketUtil {
+public class RegularUtil {
     /**
      * 去除括号里的内容
      * @param context
      * @return
      */
     public static String ClearBracket(String context) {
-        //        String bracket = context.substring(context.indexOf("("), context.indexOf(")") + 1);
+      /*  //        String bracket = context.substring(context.indexOf("("), context.indexOf(")") + 1);
         //        context = context.replace(bracket, "");
         //
         //        context.substring(context.lastIndexOf())
@@ -43,6 +43,9 @@ public class ClearBracketUtil {
                 }
             } while (head != -1); // 如果在该段落中找不到左括号了,就终止循环
         }
-        return context; // 返回更新后的context
+        return context; // 返回更新后的context*/
+
+        return context.replaceAll("\\(.*?\\)|\\)|(.*?)|)", "");
     }
+
 }

+ 1 - 1
trans/src/main/java/com/lantone/qc/trans/shaoyf/ShaoyfOperationDocTrans.java

@@ -142,7 +142,7 @@ public class ShaoyfOperationDocTrans extends ModelDocTrans {
         sourceMap.put("rec_title=" + contentMap.get("recTitle").toString(), "");
         Map<String, String> structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, operationRecord_keyContrasts);
         OrdinaryAssistant.removeBlank(structureMap);
-        structureMap.put("主医师", structureMap.get("手术医师"));
+        structureMap.put("主医师", structureMap.get("手术医师"));
         ShaoyfOrdinaryAssistant.techTitleDocRemove(structureMap, "主刀医师签名");
         OperationRecordDoc operationRecordDoc = new OperationRecordDoc();
         operationRecordDoc.setStructureMap(structureMap);