Pārlūkot izejas kodu

1.添加空值判断

hujing 5 gadi atpakaļ
vecāks
revīzija
5c43ebb168

+ 8 - 4
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0024.java

@@ -4,6 +4,7 @@ import com.lantone.qc.kernel.catalogue.QCCatalogue;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.entity.Wound;
+import com.lantone.qc.pub.model.label.PastLabel;
 import com.lantone.qc.pub.util.ListUtil;
 import com.lantone.qc.pub.util.StringUtil;
 import org.apache.commons.lang3.StringUtils;
@@ -34,15 +35,18 @@ public class BEH0024 extends QCCatalogue {
             }
         }
         //硬规则匹配
-        if (inputInfo.getBeHospitalizedDoc().getPastLabel().getText().contains("外伤")) {
-            status.set("0");
-            return;
+        PastLabel pastLabel = inputInfo.getBeHospitalizedDoc().getPastLabel();
+        if (pastLabel != null){
+            String pastLabelText = pastLabel.getText();
+            if (StringUtil.isNotBlank(pastLabelText) && pastLabelText.contains("外伤")){
+                status.set("0");
+                return;
+            }
         }
         //台州结构化
         Map<String, String> structureMap_beh = inputInfo.getBeHospitalizedDoc().getStructureMap();
         if(StringUtils.isNotEmpty(structureMap_beh.get("手术外伤史"))){
             status.set("0");
-            return;
         }
 
     }

+ 8 - 4
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0025.java

@@ -4,6 +4,7 @@ import com.lantone.qc.kernel.catalogue.QCCatalogue;
 import com.lantone.qc.pub.model.InputInfo;
 import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.entity.Operation;
+import com.lantone.qc.pub.model.label.PastLabel;
 import com.lantone.qc.pub.util.ListUtil;
 import com.lantone.qc.pub.util.StringUtil;
 import org.apache.commons.lang3.StringUtils;
@@ -34,15 +35,18 @@ public class BEH0025 extends QCCatalogue {
             }
         }
         //规则硬匹配
-        if (inputInfo.getBeHospitalizedDoc().getPastLabel().getText().contains("手术")) {
-            status.set("0");
-            return;
+        PastLabel pastLabel = inputInfo.getBeHospitalizedDoc().getPastLabel();
+        if (pastLabel != null){
+            String pastLabelText = pastLabel.getText();
+            if (StringUtil.isNotBlank(pastLabelText) && pastLabelText.contains("手术")){
+                status.set("0");
+                return;
+            }
         }
         //台州结构化
         Map<String, String> structureMap_beh = inputInfo.getBeHospitalizedDoc().getStructureMap();
         if(StringUtils.isNotEmpty(structureMap_beh.get("手术外伤史"))){
             status.set("0");
-            return;
         }
     }
 

+ 8 - 4
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0073.java

@@ -6,6 +6,7 @@ import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.entity.Diag;
 import com.lantone.qc.pub.model.entity.Family;
 import com.lantone.qc.pub.model.label.FamilyLabel;
+import com.lantone.qc.pub.model.label.PastLabel;
 import com.lantone.qc.pub.util.StringUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Component;
@@ -50,10 +51,13 @@ public class BEH0073 extends QCCatalogue {
                 }
             }
         }
-        if (inputInfo.getBeHospitalizedDoc().getPastLabel() != null &&
-                (inputInfo.getBeHospitalizedDoc().getPastLabel().getText().contains("肝炎")
-                        || inputInfo.getBeHospitalizedDoc().getPastLabel().getText().contains("结核"))) {
-            status.set("0");
+        //规则硬匹配
+        PastLabel pastLabel = inputInfo.getBeHospitalizedDoc().getPastLabel();
+        if (pastLabel != null){
+            String pastLabelText = pastLabel.getText();
+            if (StringUtil.isNotBlank(pastLabelText) && (pastLabelText.contains("肝炎") || pastLabelText.contains("结核"))){
+                status.set("0");
+            }
         }
     }
 }