Browse Source

入院记录婚姻未填写修改逻辑

huj 4 years atrás
parent
commit
e4b5ab3eeb

+ 20 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0407.java

@@ -1,11 +1,15 @@
 package com.lantone.qc.kernel.catalogue.behospitalized;
 
+import com.google.common.collect.Lists;
 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.label.MaritalLabel;
+import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
+import java.util.List;
 import java.util.Map;
 
 
@@ -17,18 +21,32 @@ import java.util.Map;
  */
 @Component
 public class BEH0407 extends QCCatalogue {
+    List<String> words = Lists.newArrayList("已婚", "离异", "离婚", "丧偶", "未婚", "结婚");
+
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
         if (inputInfo.getBeHospitalizedDoc() == null) {
             return;
         }
         Map<String, String> structureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
-        if(structureMap != null){
+        if (structureMap != null) {
             String name = structureMap.get("婚姻");
-            if(CatalogueUtil.isEmpty(name)){
+            if (CatalogueUtil.isEmpty(name)) {
                 status.set("-1");
             }
         }
+        MaritalLabel maritalLabel = inputInfo.getBeHospitalizedDoc().getMaritalLabel();
+        if (maritalLabel != null) {
+            String maritalText = maritalLabel.getText();
+            if (StringUtil.isNotBlank(maritalText)) {
+                for (String word : words) {
+                    if (maritalText.contains(word)) {
+                        status.set("0");
+                        return;
+                    }
+                }
+            }
+        }
 
     }
 }