hujing vor 5 Jahren
Ursprung
Commit
a879234175

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0049.java

@@ -28,7 +28,7 @@ public class BEH0049 extends QCCatalogue {
             return;
         }
         String personalText = personalLabel.getText();
-        if (personalText.contains("详见原病历")) {
+        if (personalText.contains("详见原病历") || personalText.contains("特殊嗜好")) {
             status.set("0");
             return;
         }

+ 8 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0072.java

@@ -25,6 +25,13 @@ public class BEH0072 extends QCCatalogue {
         status.set("0");
         if (inputInfo.getBeHospitalizedDoc() != null && inputInfo.getBeHospitalizedDoc().getFamilyLabel() != null) {
             FamilyLabel familyLabel = inputInfo.getBeHospitalizedDoc().getFamilyLabel();
+            if (familyLabel == null) {
+                return;
+            }
+            String familyText = familyLabel.getText();
+            if (StringUtil.isNotBlank(familyText) && familyText.contains("死因")) {
+                return;
+            }
             List<Family> families = familyLabel.getFamilies();
             if (ListUtil.isEmpty(families)) {
                 return;
@@ -32,7 +39,7 @@ public class BEH0072 extends QCCatalogue {
             for (Family family : families) {
                 if (family.getDead() != null) {
                     Dead dead = family.getDead();
-                    if(family.getName().contains("年迈")){
+                    if (family.getName().contains("年迈")) {
                         continue;
                     }
                     if (dead.getDeadReason() != null || dead.getUnknow() != null) {

+ 31 - 13
kernel/src/main/java/com/lantone/qc/kernel/catalogue/dutyshiftsystem/DUT0296.java

@@ -1,7 +1,6 @@
 package com.lantone.qc.kernel.catalogue.dutyshiftsystem;
 
 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.LeaveHospitalDoc;
@@ -39,6 +38,20 @@ public class DUT0296 extends QCCatalogue {
         Map<String, String> structureMap_leave = leaveHospitalDoc.getStructureMap();
         String beDate = structureMap_leave.get("入院时间"); //2019-12-07 08:48
         String leaveDate = structureMap_leave.get("出院时间");//2019-12-10 10:49
+        /* 住院天数小于30天不报错*/
+        int lengthOfStayNum = 0;
+        if (StringUtil.isNotBlank(beDate) || StringUtil.isNotBlank(leaveDate)) {
+            lengthOfStayNum = dateDifference(beDate, leaveDate);
+            if (lengthOfStayNum < 30) {
+                return;
+            }
+        }
+        lengthOfStayNum = getLengthOfStay(structureMap_leave);
+        if (lengthOfStayNum < 30) {
+            return;
+        }
+
+
         if (transferRecordDoc != null) {
             List<TransferRecordDoc> allTransferDocs = transferRecordDoc.getAllTransferDocs();
             String firstOutRecordDate = getFirstOutRecordDate(allTransferDocs);
@@ -75,30 +88,35 @@ public class DUT0296 extends QCCatalogue {
                 if (dateDifference > 30 && (stagesSummaryDocs == null || stagesSummaryDocs.size() == 0)) {
                     status.set("-1");
                 }
-                if (!checkDays(stagesSummaryDocs, dateDifference)) {
+                if (checkDays(stagesSummaryDocs, dateDifference)) {
                     status.set("-1");
                     return;
                 }
             }
 
-            String lengthOfStay = structureMap_leave.get("住院天数");
-            if (StringUtil.isNotBlank(lengthOfStay)) {
-                int lengthOfStayNum = onlyNum(lengthOfStay);
-                if (!checkDays(stagesSummaryDocs, lengthOfStayNum)) {
-                    status.set("-1");
-                }
+            int lengthOfStay = getLengthOfStay(structureMap_leave);
+            if (checkDays(stagesSummaryDocs, lengthOfStay)) {
+                status.set("-1");
             }
-
         }
 
     }
 
+    private int getLengthOfStay(Map<String, String> structureMap_leave) {
+        int lengthOfStayNum = 0;
+        String lengthOfStay = structureMap_leave.get("住院天数");
+        if (StringUtil.isNotBlank(lengthOfStay)) {
+            lengthOfStayNum = onlyNum(lengthOfStay);
+        }
+        return lengthOfStayNum;
+    }
+
     private boolean checkDays(List<StagesSummaryDoc> stagesSummaryDocs, int dateDifference) {
         if (stagesSummaryDocs != null && stagesSummaryDocs.size() > 0) {
             double sum = Math.floor(dateDifference / 30);
-            return sum == stagesSummaryDocs.size();
+            return sum != stagesSummaryDocs.size();
         }
-        return false;
+        return true;
     }
 
     /**
@@ -183,7 +201,7 @@ public class DUT0296 extends QCCatalogue {
         return day;
     }
 
-    private int onlyNum (String str){
-        return Integer.parseInt(str.replaceAll("[^0-9]",""));
+    private int onlyNum(String str) {
+        return Integer.parseInt(str.replaceAll("[^0-9]", ""));
     }
 }

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

@@ -91,8 +91,11 @@ public class CatalogueUtil {
                 index++;
             }
             for (String word : words) {
-                if (StringUtil.isNotBlank(word) && sections.stream().filter(section -> section.indexOf(word) != -1).count() == 0) {
-                    retWords.add(word);
+                if (StringUtil.isNotBlank(word)) {
+                    String newWord = word.replaceAll("[“”]", "");
+                    if (sections.stream().noneMatch(section -> section.contains(newWord))) {
+                        retWords.add(word);
+                    }
                 }
             }
         }
@@ -330,7 +333,7 @@ public class CatalogueUtil {
         StringBuffer sb = new StringBuffer();
         char[] contentArr = content.toCharArray();
         for (int i = 0; i < contentArr.length; i++) {
-            if (isNumeric(contentArr[i])){
+            if (isNumeric(contentArr[i])) {
                 int num = Integer.parseInt(String.valueOf(contentArr[i]));
                 sb.append(intMapString.get(num));
             } else {
@@ -348,8 +351,8 @@ public class CatalogueUtil {
         return true;
     }
 
-    public static Date parseStringDate(String dateStr){
-        if (StringUtil.isBlank(dateStr)){
+    public static Date parseStringDate(String dateStr) {
+        if (StringUtil.isBlank(dateStr)) {
             return null;
         }
         return StringUtil.parseDateTime(dateStr);