Explorar el Código

主诉与现病史发病部位不一致修改逻辑

hujing hace 5 años
padre
commit
a42317923e

+ 21 - 3
kernel/src/main/java/com/lantone/qc/kernel/catalogue/behospitalized/BEH03050.java

@@ -7,9 +7,11 @@ import com.lantone.qc.pub.model.OutputInfo;
 import com.lantone.qc.pub.model.doc.BeHospitalizedDoc;
 import com.lantone.qc.pub.model.label.ChiefLabel;
 import com.lantone.qc.pub.model.label.PresentLabel;
+import com.lantone.qc.pub.util.StringUtil;
 import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -21,6 +23,8 @@ import java.util.List;
 @Component
 public class BEH03050 extends QCCatalogue {
     private List<String> positions = Lists.newArrayList("左上", "左下", "右上", "右下", "上", "下", "左", "右");
+    private List<String> containList = Arrays.asList("检查", "术后", "药物", "发现", "误服", "确诊", "经", "异常", "诊断"
+            , "示", "超", "伤", "术", "复查", "体检", "血透", "血液透析");
 
     public void start(InputInfo inputInfo, OutputInfo outputInfo) {
         status.set("0");
@@ -38,8 +42,20 @@ public class BEH03050 extends QCCatalogue {
         List<String> chiefPosition = new ArrayList<>();
         List<String> presentPosition = new ArrayList<>();
 
-        //取主诉有方位词的症状
+
         String chiefText = chiefLabel.getText();
+        String presentText = presentLabel.getText();
+        if (StringUtil.isBlank(chiefText) || StringUtil.isBlank(presentText)) {
+            return;
+        }
+        //主诉如果包括相关词,不报错
+        for (String word : containList) {
+            if (chiefText.contains(word)) {
+                return;
+            }
+        }
+
+        //取主诉的方位词
         for (String position : positions) {
             if (chiefText.contains(position)) {
                 chiefPosition.add(position);
@@ -47,8 +63,10 @@ public class BEH03050 extends QCCatalogue {
             }
         }
 
-        //取现病史有方位词的症状
-        String presentText = presentLabel.getText();
+        //取现病史的方位词,只取现病史前20个字
+        if (presentText.length() > 20) {
+            presentText = presentText.substring(0, 20);
+        }
         for (String position : positions) {
             if (presentText.contains(position)) {
                 presentPosition.add(position);