Преглед изворни кода

湘雅:处理出院小结解析切词问题 && 手术名称未标引号 && 食物过敏史未描述

zhanghang пре 3 година
родитељ
комит
f3427d798f

+ 2 - 1
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH0026.java

@@ -40,7 +40,8 @@ public class BEH0026 extends QCCatalogue {
         }
         String pastText = pastLabel.getText();
         if (pastText.contains("食物过敏史") || pastText.contains("食物、药物过敏") || pastText.contains("详见") ||
-                pastText.contains("见旧病历") || pastText.contains("见既往病历")) {
+                pastText.contains("见旧病历") || pastText.contains("见既往病历") || pastText.contains("食物药物过敏史")
+                || pastText.contains("食物及药物过敏史")) {
             status.set("0");
             return;
         }

+ 71 - 0
kernel/src/main/java/com/lantone/qc/kernel/catalogue/hospital/changshaxy/behospitalized/BEH0034.java

@@ -0,0 +1,71 @@
+package com.lantone.qc.kernel.catalogue.hospital.changshaxy.behospitalized;
+
+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.entity.Operation;
+import com.lantone.qc.pub.model.label.PastLabel;
+import com.lantone.qc.pub.util.ListUtil;
+import com.lantone.qc.pub.util.StringUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * @Description: 手术名称未标引号
+ * @author: rengb
+ * @time: 2020/3/10 14:02
+ */
+@Component
+public class BEH0034 extends QCCatalogue {
+
+    @Override
+    public void start(InputInfo inputInfo, OutputInfo outputInfo) {
+        status.set("0");
+        if (inputInfo.getBeHospitalizedDoc() == null) {
+            return;
+        }
+        PastLabel pastLabel = inputInfo.getBeHospitalizedDoc().getPastLabel();
+        List<Operation> operations = pastLabel.getOperations();
+        if (ListUtil.isEmpty(operations)) {
+            return;
+        }
+        List<String> wtOperationNames = CatalogueUtil.noInQuotes(
+                operations.stream()
+                        .filter(i ->
+                                i != null && StringUtil.isNotBlank(i.getName()) && i.getNegative() == null
+                                        && !"手术史".equals(i.getName()) && !"手术".equals(i.getName()) && !"手术治疗".equals(i.getName())
+                                        && !"手术无手术史".equals(i.getName()) && !"手术处理".equals(i.getName())
+                        )
+                        .map(i -> i.getName())
+                        .distinct()
+                        .collect(Collectors.toList()),
+                pastLabel.getText().replace("“", "\"").replace("”", "\"")
+        );
+        if (ListUtil.isNotEmpty(wtOperationNames)) {
+            String pastLabelText = pastLabel.getText();
+            for (String wtOperationName : wtOperationNames) {
+                if (isASMark(pastLabelText, wtOperationName)) {
+                    continue;
+                }
+                status.set("-1");
+                info.set(info.get() + wtOperationName + " ");
+            }
+        }
+    }
+
+    private boolean isASMark(String pastLabelText, String wtOperationName) {
+        String operName = wtOperationName.replace("手术", "");
+        int index = pastLabelText.indexOf(operName);
+        if (index != -1 && index + operName.length() != pastLabelText.length()) {
+            String substring = pastLabelText.substring(index + operName.length(), index + operName.length() + 1);
+            if (substring.equals("\"") || substring.equals("”")) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+}

+ 13 - 0
trans/src/main/java/com/lantone/qc/trans/changshaxy/util/XyLeaveHospitalHtmlAnalysis.java

@@ -67,6 +67,19 @@ public class XyLeaveHospitalHtmlAnalysis implements XyHtmlAnalysis {
             if (StringUtils.isNotEmpty(structureMap.get("出院日期"))){
                 structureMap.put("出院日期",structureMap.get("出院日期").replace(","," ").replace(","," "));
             }
+            //处理主诉和入院诊断被切割到住院天数的情况情况
+            if (StringUtils.isNotEmpty(structureMap.get("住院天数"))) {
+                String diagString = structureMap.get("住院天数");
+                    if(diagString.contains("入院诊断")) {
+                        structureMap.put("住院天数", diagString.substring(0, diagString.indexOf("入院诊断")));
+                        if ((diagString.indexOf("入院诊断")+4) < diagString.length()) {
+                            structureMap.put("入院诊断", diagString.substring(diagString.lastIndexOf("入院诊断") + 4, diagString.length()));
+                        }else {
+                            structureMap.put("入院诊断", diagString.substring(diagString.lastIndexOf("入院诊断"), diagString.length()));
+                        }
+                    }
+            }
+            //处理主诉被切割到入院诊断的情况
             if (StringUtils.isNotEmpty(structureMap.get("入院诊断"))) {
                 String diagString = structureMap.get("入院诊断");
                 if (diagString.contains("。")) {