Bläddra i källkod

1.长兴添加查体与性别不匹配规则
2.修改bug

hujing 5 år sedan
förälder
incheckning
a18f6e0c2e

+ 60 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH02966.java

@@ -0,0 +1,60 @@
+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.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : BEH02966
+ * @Description :  入院记录查体与性别不匹配
+ * @Author : 胡敬
+ * @Date: 2020-06-13 15:51
+ */
+@Component
+public class BEH02966 extends QCCatalogue {
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            return;
+        }
+
+        Map<String, String> beHospitalStructureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        String gender = beHospitalStructureMap.get("性别");
+        if (StringUtil.isBlank(gender)) {
+            return;
+        }
+        List<String> noMatchWords = null;
+        if (gender.contains("男")) {
+            /* 男性不合理词 */
+            noMatchWords = Lists.newArrayList("阴道", "宫颈", "子宫", "附件", "宫底", "胎位", "胎数", "胎心",
+                    "宫缩", "宫口", "胎膜", "输卵管", "卵巢", "输卵管", "阴唇", "阴蒂", "阴道前庭", "前庭大腺", "处女膜");
+        } else if (gender.contains("女")) {
+            /* 女性不合理词 */
+            noMatchWords = Lists.newArrayList("睾丸", "阴囊", "阴茎", "精索", "包皮", "附睾", "输精管",
+                    "射精管", "尿道海绵体", "冠状沟", "前列腺", "精阜", "精囊腺");
+        }
+        if (noMatchWords == null || noMatchWords.size() == 0) {
+            return;
+        }
+
+        List<String> keys = Lists.newArrayList("主诉", "现病史", "既往史", "个人史", "体格检查", "一般情况"
+                , "初步诊断", "专科体格检查", "神经系统检查");
+        String text = CatalogueUtil.structureMapJoin(beHospitalStructureMap, keys);
+
+        for (String noMatchWord : noMatchWords) {
+            if (text.contains(noMatchWord)) {
+                status.set("-1");
+                info.set(noMatchWord);
+                return;
+            }
+        }
+    }
+}

+ 1 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/firstcourserecord/FIRC0088.java

@@ -28,7 +28,7 @@ public class FIRC0088 extends QCCatalogue {
         }
         Map<String, String> firstCourseStructureMap = firstCourseRecordDoc.getStructureMap();
         String diffDiag = firstCourseStructureMap.get("鉴别诊断");
-        if (StringUtil.isBlank(diffDiag)) {
+        if (StringUtil.isBlank(diffDiag) || diffDiag.contains("诊断明确") || diffDiag.contains("无需鉴别")) {
             return;
         }
         DiagLabel differentialDiagLabel = firstCourseRecordDoc.getDifferentialDiagLabel();

+ 60 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/leavehospital/LEA02968.java

@@ -0,0 +1,60 @@
+package com.lantone.qc.kernel.catalogue.leavehospital;
+
+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.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : LEA02968
+ * @Description :  出院小结查体与性别不匹配
+ * @Author : 胡敬
+ * @Date: 2020-06-13 16:25
+ */
+@Component
+public class LEA02968 extends QCCatalogue {
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getLeaveHospitalDoc() == null) {
+            return;
+        }
+
+        Map<String, String> structureMap = inputInfo.getLeaveHospitalDoc().getStructureMap();
+        String gender = structureMap.get("性别");
+        if (StringUtil.isBlank(gender)) {
+            return;
+        }
+        List<String> noMatchWords = null;
+        if (gender.contains("男")) {
+            /* 男性不合理词 */
+            noMatchWords = Lists.newArrayList("阴道", "宫颈", "子宫", "附件", "宫底", "胎位", "胎数", "胎心",
+                    "宫缩", "宫口", "胎膜", "输卵管", "卵巢", "输卵管", "阴唇", "阴蒂", "阴道前庭", "前庭大腺", "处女膜");
+        } else if (gender.contains("女")) {
+            /* 女性不合理词 */
+            noMatchWords = Lists.newArrayList("睾丸", "阴囊", "阴茎", "精索", "包皮", "附睾", "输精管",
+                    "射精管", "尿道海绵体", "冠状沟", "前列腺", "精阜", "精囊腺");
+        }
+
+        if (noMatchWords == null || noMatchWords.size() == 0) {
+            return;
+        }
+        List<String> keys = Lists.newArrayList("入院诊断", "出院诊断", "入院情况", "诊治经过", "出院情况", "出院医嘱"
+                , "随访计划", "主诉", "专科检查", "健康教育");
+        String text = CatalogueUtil.structureMapJoin(structureMap, keys);
+
+        for (String noMatchWord : noMatchWords) {
+            if (text.contains(noMatchWord)) {
+                status.set("-1");
+                info.set(noMatchWord);
+                return;
+            }
+        }
+    }
+}

+ 61 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/threelevelward/THR02967.java

@@ -0,0 +1,61 @@
+package com.lantone.qc.kernel.catalogue.threelevelward;
+
+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.doc.ThreeLevelWardDoc;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @ClassName : THR02967
+ * @Description :  查房记录中查体与性别不匹配
+ * @Author : 胡敬
+ * @Date: 2020-06-13 16:13
+ */
+@Component
+public class THR02967 extends QCCatalogue {
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() == null || inputInfo.getThreeLevelWardDocs().size() == 0) {
+            return;
+        }
+        Map<String, String> beHospitalStructureMap = inputInfo.getBeHospitalizedDoc().getStructureMap();
+        String gender = beHospitalStructureMap.get("性别");
+        if (StringUtil.isBlank(gender)) {
+            return;
+        }
+        List<String> noMatchWords = null;
+        if (gender.contains("男")) {
+            /* 男性不合理词 */
+            noMatchWords = Lists.newArrayList("阴道", "宫颈", "子宫", "附件", "宫底", "胎位", "胎数", "胎心",
+                    "宫缩", "宫口", "胎膜", "输卵管", "卵巢", "输卵管", "阴唇", "阴蒂", "阴道前庭", "前庭大腺", "处女膜");
+        } else if (gender.contains("女")) {
+            /* 女性不合理词 */
+            noMatchWords = Lists.newArrayList("睾丸", "阴囊", "阴茎", "精索", "包皮", "附睾", "输精管",
+                    "射精管", "尿道海绵体", "冠状沟", "前列腺", "精阜", "精囊腺");
+        }
+
+        if (noMatchWords == null || noMatchWords.size() == 0) {
+            return;
+        }
+        List<String> keys = Lists.newArrayList("病情记录");
+        for (ThreeLevelWardDoc threeLevelWardDoc : inputInfo.getThreeLevelWardDocs().get(0).getAllDoctorWradDocs()) {
+            Map<String, String> structureMap = threeLevelWardDoc.getStructureMap();
+            String text = CatalogueUtil.structureMapJoin(structureMap, keys);
+            for (String noMatchWord : noMatchWords) {
+                if (text.contains(noMatchWord)) {
+                    status.set("-1");
+                    info.set(noMatchWord);
+                    return;
+                }
+            }
+        }
+    }
+}

+ 2 - 2
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/process/EntityProcessPast.java

@@ -47,7 +47,7 @@ public class EntityProcessPast extends EntityProcess {
             List<Lemma> operationLemmas = createEntityTree(aiOut, EntityEnum.OPERATION.toString());
             for (Lemma lemma : operationLemmas) {
                 Operation operation = new Operation();
-                operation.setName(lemma.getText());
+                operation.setName(lemma.getText().replaceAll("[“”]",""));
                 if (lemma.isHaveChildren()) {
                     //阴性
                     operation.setNegative(findNegative(lemma));
@@ -75,7 +75,7 @@ public class EntityProcessPast extends EntityProcess {
             List<Lemma> operationHistoryLemmas = createEntityTree(aiOut, EntityEnum.OPERATION_KEYWORD.toString());
             for (Lemma lemma : operationHistoryLemmas) {
                 Operation operation = new Operation();
-                operation.setName(lemma.getText());
+                operation.setName(lemma.getText().replaceAll("[“”]",""));
                 if (lemma.isHaveChildren()) {
                     operation.setNegative(findNegative(lemma));//阴性
                 }

+ 13 - 0
kernel/src/main/java/com/lantone/qc/kernel/util/CatalogueUtil.java

@@ -462,4 +462,17 @@ public class CatalogueUtil {
         }
         return title;
     }
+
+    /**
+     * 拼接结构化数据
+     **/
+    public static String structureMapJoin(Map<String, String> structureMap, List<String> keys) {
+        String textJoin = "";
+        for (String key : keys) {
+            if (StringUtil.isNotBlank(structureMap.get(key))) {
+                textJoin += key + ":" + structureMap.get(key) + "\n";
+            }
+        }
+        return textJoin;
+    }
 }