Selaa lähdekoodia

现病史症状缺少伴随症状

weixuanhuang 5 vuotta sitten
vanhempi
commit
da4d77c7bc

+ 56 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0448.java

@@ -0,0 +1,56 @@
+package com.lantone.qc.kernel.catalogue.behospitalized;
+
+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.doc.BeHospitalizedDoc;
+import com.lantone.qc.pub.model.entity.Clinical;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * @ClassName : BEH0448
+ * @Description : 现病史症状缺少伴随症状
+ * @Author : Mark
+ * @Date: 2020-04-05 10:58
+ */
+@Component
+public class BEH0448 extends QCCatalogue {
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
+        if(beHospitalizedDoc != null){
+            int cnt = 0;
+
+            List<Clinical> clinicals_present = beHospitalizedDoc.getPresentLabel().getClinicals();
+
+            String present_txt = beHospitalizedDoc.getPresentLabel().getText();
+            String present_chief_txt = present_txt.split("伴")[0];
+
+            List<String> present_symp = new ArrayList<>();
+
+            for (Clinical clinical:clinicals_present) {
+                if (clinical.getNegative()==null) {
+                    if (present_symp.indexOf(clinical.getName()) == -1) {
+                        present_symp.add(clinical.getName());
+                    }
+                }
+                else {
+                    break;
+                }
+            }
+            for (String symp:present_symp) {
+                if (present_chief_txt.contains(symp)) {
+                    cnt += 1;
+                }
+            }
+
+            if(cnt==0){
+                status.set("-1");
+            }
+        }
+    }
+}