Browse Source

Merge branch 'master' into innerDevelop

zhoutg 4 năm trước cách đây
mục cha
commit
a52663e7a6

+ 6 - 0
src/main/java/com/diagbot/dto/WordCrfDTO.java

@@ -94,6 +94,12 @@ public class WordCrfDTO {
     // 辅检
     private PacsLabel pacsLabel = new PacsLabel();
 
+    // 主诉
+    private String chief = "";
     // 现病史
     private String symptom = "";
+    // 既往史
+    private String pasts = "";
+    // 月经史
+    private String menstrual = "";
 }

+ 9 - 0
src/main/java/com/diagbot/facade/CommonFacade.java

@@ -104,6 +104,15 @@ public class CommonFacade {
         if (StringUtil.isNotBlank(searchData.getSymptom())) {
             wordCrfDTO.setSymptom(searchData.getSymptom());
         }
+        if (StringUtil.isNotBlank(searchData.getChief())) {
+            wordCrfDTO.setChief(searchData.getChief());
+        }
+        if (StringUtil.isNotBlank(searchData.getPasts())) {
+            wordCrfDTO.setPasts(searchData.getPasts());
+        }
+        if (StringUtil.isNotBlank(searchData.getMenstrual())) {
+            wordCrfDTO.setMenstrual(searchData.getMenstrual());
+        }
 
         //模型处理数据
         aiAnalyze.aiProcess(searchData, wordCrfDTO);

+ 30 - 21
src/main/java/com/diagbot/rule/GroupRule.java

@@ -33,40 +33,49 @@ public class GroupRule {
         for (NodeNeoDTO node : group) {
             // 妊娠目前从诊断里判断,包含“妊娠”
             String symptom = wordCrfDTO.getSymptom(); // 现病史内容
+            String chief = wordCrfDTO.getChief(); // 主诉
+            String menstrual = wordCrfDTO.getMenstrual(); // 月经史
+
             switch (node.getName()) {
                 case "妊娠":
-                    // 现病史包含“孕妇”
-                    if (symptom.contains("孕妇")) {
+                    // 主诉、现病史、诊断包含“孕妇”,“妊娠”
+                    boolean flag = false;
+                    if (symptom.contains("孕妇") || chief.contains("孕妇")
+                            || symptom.contains("妊娠") || chief.contains("妊娠")) {
+                        flag = true;
+                    } else {
+                        // 主诉、现病史出现孕几周
+                        String regex = ".*孕.{1,4}周.*"; // 孕xx周
+                        if (symptom.matches(regex) || chief.matches(regex)) {
+                            flag = true;
+                        } else {
+                            List<Item> diag = wordCrfDTO.getDiag();
+                            for (Item item : diag) {
+                                // 诊断出现“孕几周”,孕字必须是第一个
+                                String regex1 = "孕.{1,4}周.*"; // 孕xx周
+                                if (item.getUniqueName().matches(regex1) || item.getUniqueName().contains("孕妇")
+                                        || item.getUniqueName().contains("妊娠")) {
+                                    flag = true;
+                                    break;
+                                }
+                            }
+                        }
+                    }
+                    if (flag) {
                         BillMsg commonBillMsg = MsgUtil.getCommonBillMsg(
                                 billNeoMaxDTO.getOrderName(), billNeoMaxDTO.getOrderStandName(),
                                 "妊娠", type, billNeoMaxDTO.getType());
                         billMsgList.add(commonBillMsg);
                     }
-                    // 诊断里包含“妊娠” 或者 包含“孕几周”
-                    List<Item> diag = wordCrfDTO.getDiag();
-                    for (Item item : diag) {
-                        if (item.getUniqueName().contains("妊娠")) {
-                            BillMsg commonBillMsg = MsgUtil.getCommonBillMsg(
-                                    billNeoMaxDTO.getOrderName(), billNeoMaxDTO.getOrderStandName(),
-                                    item.getUniqueName(), type, billNeoMaxDTO.getType());
-                            billMsgList.add(commonBillMsg);
-                        } else {
-                            String regex = "孕.{1,4}周.*"; // 孕xx周
-                            if (item.getUniqueName().matches(regex)) {
-                                BillMsg commonBillMsg = MsgUtil.getCommonBillMsg(
-                                        billNeoMaxDTO.getOrderName(), billNeoMaxDTO.getOrderStandName(),
-                                        item.getUniqueName(), type, billNeoMaxDTO.getType());
-                                billMsgList.add(commonBillMsg);
-                            }
-                        }
-                    }
                     break;
                 case "月经期":
                     String regex = "月经第(([零一二三四五六七八九十]{0,3})||([0-9]{0,2}))天";
                     Pattern pattern = Pattern.compile(regex);
                     Matcher matcher = pattern.matcher(symptom);
                     boolean rs = matcher.find();
-                    if (rs) {
+                    Matcher matcher1 = pattern.matcher(menstrual);
+                    boolean rs1 = matcher1.find();
+                    if (rs || rs1 || symptom.contains("经期") || menstrual.contains("经期")) {
                         BillMsg commonBillMsg = MsgUtil.getCommonBillMsg(
                                 billNeoMaxDTO.getOrderName(), billNeoMaxDTO.getOrderStandName(),
                                 "月经期", type, billNeoMaxDTO.getType());