Sfoglia il codice sorgente

1、修改部分规则条目

louhr 5 anni fa
parent
commit
6968fc7358

+ 10 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0070.java

@@ -3,6 +3,7 @@ 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.entity.Diag;
 import com.lantone.qc.pub.model.entity.Family;
 import com.lantone.qc.pub.model.label.FamilyLabel;
 import com.lantone.qc.pub.util.ListUtil;
@@ -10,6 +11,7 @@ import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * @ClassName : BEH0070
@@ -36,6 +38,14 @@ public class BEH0070 extends QCCatalogue {
                 if (family.getDiagInfectious() != null && StringUtil.isNotBlank(family.getDiagInfectious().getName())) {
                     isFindDiagInfectious = true;
                 }
+                if (family.getDiags() != null) {
+                    List<Diag> diags = family.getDiags().stream().filter(diag ->
+                            (diag.getHospitalDiagName() != null && diag.getHospitalDiagName().contains("炎"))
+                                    || (diag.getHospitalDiagName() != null && diag.getHospitalDiagName().contains("核"))).collect(Collectors.toList());
+                    if (diags.size() > 0) {
+                        isFindDiagInfectious = true;
+                    }
+                }
                 if (isFindGeneticDiseaseKeyword && isFindDiagInfectious) {
                     status.set("0");
                     return;

+ 11 - 8
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0397.java

@@ -11,6 +11,7 @@ import org.springframework.stereotype.Component;
 
 import java.util.List;
 import java.util.regex.Pattern;
+import java.util.stream.Collectors;
 
 /**
  * @Description: 父母健康状况未描述
@@ -33,18 +34,20 @@ public class BEH0397 extends QCCatalogue {
         }
 
         Pattern p = Pattern.compile("[父母爸妈]");
-        long count = familyList
+        List<Family> filterFamilies = familyList
                 .stream()
                 .filter(
                         i -> i != null
                                 && StringUtil.isNotBlank(i.getName())
-                                && p.matcher(i.getName()).find()
-                                && i.getHealthCondition() != null
-                                && StringUtil.isNotBlank(i.getHealthCondition().getName())
-                )
-                .count();
-        if (count > 0) {
-            status.set("0");
+                                && p.matcher(i.getName()).find()).collect(Collectors.toList());
+        for (Family family : filterFamilies) {
+            if (family.getDead() != null) {
+                status.set("0");
+                return;
+            } else if (family.getHealthCondition() != null && StringUtil.isNotBlank(family.getHealthCondition().getName())) {
+                status.set("0");
+                return;
+            }
         }
     }
 

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/consultation/CON0280.java

@@ -16,6 +16,6 @@ import java.util.Map;
 @Component
 public class CON0280 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
-        if (inputInfo.getConsultationDocs() == null) status.set("0");
+        if (inputInfo.getConsultationDocs() == null || inputInfo.getConsultationDocs().size() == 0) status.set("0");
     }
 }

+ 3 - 4
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstcourserecord/FIRC0092.java

@@ -16,13 +16,12 @@ import org.springframework.stereotype.Component;
 @Component
 public class FIRC0092 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
-        status.set("0");
         FirstCourseRecordDoc firstCourseRecordDoc = inputInfo.getFirstCourseRecordDoc();
         if (firstCourseRecordDoc != null) {
             TreatPlanLabel treatPlanLabel = firstCourseRecordDoc.getTreatPlanLabel();
-            if (!(treatPlanLabel.getNursingLevel() != null &&
-                    (treatPlanLabel.getMedicine() != null || treatPlanLabel.getTreat().size() > 0))) {
-                status.set("-1");
+            if (treatPlanLabel.getNursingLevel() != null &&
+                    (treatPlanLabel.getMedicine() != null || treatPlanLabel.getTreat().size() > 0)) {
+                status.set("0");
             }
         }
     }

+ 6 - 6
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0132.java

@@ -7,6 +7,7 @@ import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
 import com.lantone.qc.pub.model.label.ThreeLevelWardLabel;
 import com.lantone.qc.pub.util.StringUtil;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Component;
 
 import java.util.List;
@@ -20,7 +21,6 @@ import java.util.List;
 @Component
 public class THR0132 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
-        status.set("0");
         if (inputInfo.getThreeLevelWardDocs().size() > 0) {
             List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
             for (ThreeLevelWardDoc threeLevelWardDoc : threeLevelWardDocs) {
@@ -30,11 +30,11 @@ public class THR0132 extends QCCatalogue {
                         || !Content.indications.equals(threeLevelWardLabel.getTitle())) {
                     continue;
                 }
-                if (threeLevelWardLabel.getDiags().size() == 0
-                        || StringUtil.isNotBlank(threeLevelWardLabel.getDiagBasisText()) && threeLevelWardLabel.getDiagBasisText().length() < 30
-                        || threeLevelWardLabel.getDiffDiag().size() == 0 && StringUtil.isBlank(threeLevelWardLabel.getDiffDiagText())
-                        || threeLevelWardLabel.getTreatmentPlans().size() == 0) {
-                    status.set("-1");
+                if (threeLevelWardLabel.getDiags().size() > 0
+                        && StringUtil.isNotBlank(threeLevelWardLabel.getDiagBasisText())
+                        && (threeLevelWardLabel.getDiffDiag().size() > 0 || StringUtils.isNotEmpty(threeLevelWardLabel.getDiffDiagText()))
+                        && threeLevelWardLabel.getTreatmentPlans().size() > 0) {
+                    status.set("0");
                     return;
                 }
             }

+ 6 - 6
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR0137.java

@@ -7,6 +7,7 @@ import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.doc.ThreeLevelWardDoc;
 import com.lantone.qc.pub.model.label.ThreeLevelWardLabel;
 import com.lantone.qc.pub.util.StringUtil;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Component;
 
 import java.util.List;
@@ -20,7 +21,6 @@ import java.util.List;
 @Component
 public class THR0137 extends QCCatalogue {
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
-        status.set("0");
         if (inputInfo.getThreeLevelWardDocs().size() > 0) {
             List<ThreeLevelWardDoc> threeLevelWardDocs = inputInfo.getThreeLevelWardDocs();
             for (ThreeLevelWardDoc threeLevelWardDoc : threeLevelWardDocs) {
@@ -30,11 +30,11 @@ public class THR0137 extends QCCatalogue {
                         || !Content.director.equals(threeLevelWardLabel.getTitle())) {
                     continue;
                 }
-                if (threeLevelWardLabel.getDiags().size() == 0
-                        || StringUtil.isNotBlank(threeLevelWardLabel.getDiagBasisText()) && threeLevelWardLabel.getDiagBasisText().length() < 30
-                        || threeLevelWardLabel.getDiffDiag().size() == 0 && StringUtil.isBlank(threeLevelWardLabel.getDiffDiagText())
-                        || threeLevelWardLabel.getTreatmentPlans().size() == 0) {
-                    status.set("-1");
+                if (threeLevelWardLabel.getDiags().size() > 0
+                        && StringUtil.isNotBlank(threeLevelWardLabel.getDiagBasisText())
+                        && (threeLevelWardLabel.getDiffDiag().size() > 0 || StringUtils.isNotEmpty(threeLevelWardLabel.getDiffDiagText()))
+                        && threeLevelWardLabel.getTreatmentPlans().size() > 0) {
+                    status.set("0");
                     return;
                 }
             }

+ 19 - 11
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/FirstCourseRecordAI.java

@@ -39,16 +39,24 @@ public class FirstCourseRecordAI extends ModelAI {
         JSONArray similarContent = new JSONArray();
         FirstCourseRecordDoc firstCourseRecordDoc = inputInfo.getFirstCourseRecordDoc();
         if (firstCourseRecordDoc != null && StringUtils.isNotEmpty(firstCourseRecordDoc.getText())) {
-            //病历特点
-            putContent(crfContent, medicalTextType.get(0), firstCourseRecordDoc.getCaseCharacteristicLabel().getText(), Content.case_feature);
+//            //病历特点
+//            putContent(crfContent, medicalTextType.get(0), firstCourseRecordDoc.getCaseCharacteristicLabel().getText(), Content.case_feature);
             //初步诊断
             putContent(crfContent, medicalTextType.get(1), firstCourseRecordDoc.getInitialDiagLabel().getText(), Content.initial_diag);
-            //诊断依据
-            putContent(crfContent, medicalTextType.get(0), firstCourseRecordDoc.getDiagnosisLabel().getText(), Content.diag_basis);
+//            //诊断依据
+//            putContent(crfContent, medicalTextType.get(0), firstCourseRecordDoc.getDiagnosisLabel().getText(), Content.diag_basis);
             //鉴别诊断
             putContent(crfContent, medicalTextType.get(1), firstCourseRecordDoc.getDifferentialDiagLabel().getText(), Content.differential_diag_basis);
             //诊疗计划
-            putContent(crfContent, medicalTextType.get(2), firstCourseRecordDoc.getTreatPlanLabel().getText(), Content.treat_plan);
+            if (StringUtils.isNotEmpty(firstCourseRecordDoc.getStructureMap().get("诊疗计划")) && StringUtils.isNotEmpty(firstCourseRecordDoc.getStructureMap().get("需求评估"))) {
+                putContent(crfContent, medicalTextType.get(2), firstCourseRecordDoc.getStructureMap().get("需求评估") + StringUtils.isNotEmpty(firstCourseRecordDoc.getStructureMap().get("诊疗计划")), Content.treat_plan);
+            } else if (StringUtils.isNotEmpty(firstCourseRecordDoc.getStructureMap().get("诊疗计划"))) {
+                putContent(crfContent, medicalTextType.get(2), firstCourseRecordDoc.getStructureMap().get("诊疗计划"), Content.treat_plan);
+            } else if (StringUtils.isNotEmpty(firstCourseRecordDoc.getStructureMap().get("需求评估"))) {
+                putContent(crfContent, medicalTextType.get(2), firstCourseRecordDoc.getStructureMap().get("需求评估"), Content.treat_plan);
+            } else {
+                putContent(crfContent, medicalTextType.get(2), firstCourseRecordDoc.getTreatPlanLabel().getText(), Content.treat_plan);
+            }
 
             //病历特点与现病史比较相似度
             if (inputInfo.getBeHospitalizedDoc() != null && StringUtil.isNotBlank(inputInfo.getBeHospitalizedDoc().getPresentLabel().getText())) {
@@ -56,15 +64,15 @@ public class FirstCourseRecordAI extends ModelAI {
             }
 
             JSONObject midData = loadAI(crfContent, crfServiceClient);//crf返回数据
-            if (midData.containsKey(Content.case_feature)) {
-                putCaseCharacteristicCrfData(midData.getJSONObject(Content.case_feature), inputInfo);//处理病历特点
-            }
+//            if (midData.containsKey(Content.case_feature)) {
+//                putCaseCharacteristicCrfData(midData.getJSONObject(Content.case_feature), inputInfo);//处理病历特点
+//            }
             if (midData.containsKey(Content.initial_diag)) {
                 putInitialDiagCrfData(midData.getJSONObject(Content.initial_diag), inputInfo);//处理初步诊断
             }
-            if (midData.containsKey(Content.diag_basis)) {
-                putDiagnosisCrfData(midData.getJSONObject(Content.diag_basis), inputInfo);//处理诊断依据
-            }
+//            if (midData.containsKey(Content.diag_basis)) {
+//                putDiagnosisCrfData(midData.getJSONObject(Content.diag_basis), inputInfo);//处理诊断依据
+//            }
             if (midData.containsKey(Content.differential_diag_basis)) {
                 putDifferentialDiagCrfData(midData.getJSONObject(Content.differential_diag_basis), inputInfo);//处理鉴别诊断
             }

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/model/EntityEnum.java

@@ -15,7 +15,7 @@ public enum EntityEnum {
     OPERATION_KEYWORD("手术史"), OPERATION_RESULT("手术结果"), INJURY("外伤史"), ALLERGY("过敏"),
     FOOD_ALLERGY("食物过敏原"), DRUG_ALLERGY("药物过敏原"), ALLERGY_SYMPTOM("过敏表现"), BLOOD_TRANSFUSION("输血史"),
     TRANSFUSION_REACTION("输血反应"), VACCINATION("预防接种史"), DISEASE_KEYWORD("疾病史"), INFECTIOUS_KEYWORD("传染病史"),
-    UNKNOWN("情况不详"), HEALTH("健康况"), AGE("年龄"), SMOKING_HISTORY("吸烟史"),
+    UNKNOWN("情况不详"), HEALTH("健康况"), AGE("年龄"), SMOKING_HISTORY("吸烟史"),
     HISTORY_OF_ALCOHOL_INTAKE("饮酒史"), USAGE("用量"), MENSES("月经"), LEUKORRHEA("白带"),
     BIRTH_HIS("生育情况"), CONJUGAL_RELATION("夫妻关系"), RELATIVES("家属"), GROUP_CONSULTATION("会诊"), ORGANISM("生物体"),
     OCCUPATION("职业"), LOCATION("地点"), DEAD("死亡"), DEAD_REASON("死亡原因"),