Browse Source

取诱因实体,判断现病史是否有诱因

kwzbigdata 5 years atrás
parent
commit
635ca972fe

+ 21 - 12
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0014.java

@@ -21,29 +21,38 @@ import java.util.List;
 @Component
 public class BEH0014 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
-        List<Clinical> clinicals = inputInfo.getBeHospitalizedDoc().getPresentLabel().getClinicals();
+        /*List<Clinical> clinicals = inputInfo.getBeHospitalizedDoc().getPresentLabel().getClinicals();
         if(clinicals.size()>0){
             Clinical clinical = clinicals.get(0);
             String clinicalName = clinical.getName();
             Cause cause = clinical.getCause();
             if(cause == null){
-//                int causeIndex = inputInfo.getBeHospitalizedDoc().getPresentLabel().getText().indexOf("因");
-//                if (causeIndex < 15 && causeIndex > -1) {
-//                    status.set("0");
-//                } else {
-                    info.set(clinicalName);
-//                }
+                info.set(clinicalName);
             }else {
                 status.set("0");
             }
-        }
+        }*/
         //硬规则匹配 前30个字有"体检"或"发现"或"检查"字样
-        String present = inputInfo.getBeHospitalizedDoc().getPresentLabel().getText();
-        if (StringUtils.isNotEmpty(present)) {
-            if (present.length() > 30) present = present.substring(0, 30);
-            if (present.contains("体检") || present.contains("发现") || present.contains("检查")) {
+        if(inputInfo.getBeHospitalizedDoc() != null){
+            String present = inputInfo.getBeHospitalizedDoc().getPresentLabel().getText();
+            if (StringUtils.isNotEmpty(present)) {
+                if (present.length() > 30) present = present.substring(0, 30);
+                if (present.contains("体检") || present.contains("发现") || present.contains("检查")) {
+                    status.set("0");
+                    return;
+                }
+            }
+            List<Cause> causes = inputInfo.getBeHospitalizedDoc().getPresentLabel().getCauses();
+            if(causes != null && causes.size()>0){
                 status.set("0");
+                return;
             }
+        }else {
+            status.set("0");
         }
+
+
+
+
     }
 }

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

@@ -24,7 +24,9 @@ public class BEH0409 extends QCCatalogue {
         if(structureMap != null){
             String name = structureMap.get("关系");
             String historyPresenter = structureMap.get("病史陈述者");
-            if(CatalogueUtil.isEmpty(name) && CatalogueUtil.isEmpty(historyPresenter)){
+            String historyreporter = structureMap.get("病史提供人");
+
+            if(CatalogueUtil.isEmpty(name) && CatalogueUtil.isEmpty(historyPresenter) && CatalogueUtil.isEmpty(historyreporter)){
                 status.set("-1");
             }
         }

+ 8 - 0
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/process/EntityProcessClinic.java

@@ -79,6 +79,14 @@ public class EntityProcessClinic extends EntityProcess {
                 general.setName(lemma.getText());
                 presentLabel.add(presentLabel.getGens(), general);
             }
+            List<Lemma> causeLemmas = createEntityTree(aiOut, EntityEnum.CAUSE.toString());
+            List<Cause> causes = new ArrayList<>();
+            for (Lemma lemma : causeLemmas) {
+                Cause cause = new Cause();
+                cause.setName(lemma.getText());
+                causes.add(cause);
+            }
+            presentLabel.setCauses(causes);
 
             //一般情况描述信息
             EntityProcessGenerals entityProcessGeneral = new EntityProcessGenerals();

+ 2 - 0
public/src/main/java/com/lantone/qc/pub/model/label/PresentLabel.java

@@ -30,6 +30,8 @@ public class PresentLabel extends GeneralLabel {
     private List<General> gens = new ArrayList<>();
     //一般情况描述
     private List<GeneralDesc> generals;
+    //诱因
+    private List<Cause> causes;
     //疾病信息
     private List<Diag> diags = new ArrayList<>();
     //手术信息