Explorar o código

判断主诉是否有主症状

kongwz %!s(int64=5) %!d(string=hai) anos
pai
achega
4c7613a01b

+ 17 - 2
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0009.java

@@ -7,7 +7,9 @@ import com.lantone.qc.pub.model.entity.Clinical;
 import com.lantone.qc.pub.model.label.ChiefLabel;
 import org.springframework.stereotype.Component;
 
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 
 /**
@@ -19,12 +21,25 @@ import java.util.List;
 @Component
 public class BEH0009 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        Map<String,Integer> indexMap = new HashMap<>();
 
         ChiefLabel chiefLabel = inputInfo.getBeHospitalizedDoc().getChiefLabel();
+        String chiefLabelText = chiefLabel.getText();
         List<Clinical> clinicals = chiefLabel.getClinicals();
         if(clinicals.size()>0){
-            status = "0";
+            for (Clinical clinical:clinicals) {
+                indexMap.put(clinical.getName(),chiefLabelText.indexOf(clinical.getName()));
+            }
+        }
+        int index_ban = chiefLabelText.indexOf("伴");
+        if(indexMap.size()>0){
+            for (Map.Entry<String,Integer> s:indexMap.entrySet()) {
+                Integer value = s.getValue();
+                if(value<index_ban){
+                   status = "0";
+                   break;
+                }
+            }
         }
-
     }
 }

+ 2 - 0
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/BeHospitalizedAI.java

@@ -91,6 +91,8 @@ public class BeHospitalizedAI {
         putMensesCrfData(midData.getJSONObject(Content.menses), inputInfo);
         //处理家族史
         putFamilyCrfData(midData.getJSONObject(Content.family), inputInfo);
+        //处理婚育史
+        putMaritalCrfData(midData.getJSONObject(Content.marriage), inputInfo);
 
 
         //        //存放CRF模型既往史、家族史返回数据