Browse Source

修改提示语

zhoutg 4 years ago
parent
commit
83fd15dec7

+ 4 - 4
src/main/java/com/diagbot/process/BillProcess.java

@@ -69,7 +69,7 @@ public class BillProcess {
         // 合并图谱数据到同一个对象中
         List<BillNeoMaxDTO> billNeoMaxDTOList = new ArrayList<>();
         for (BillNeoDTO billNeoDTO : billNeoDTOList) {
-            BillNeoMaxDTO billNeoMaxDTO =  new BillNeoMaxDTO();
+            BillNeoMaxDTO billNeoMaxDTO = new BillNeoMaxDTO();
             if (billNeoDTO.getDrugBillNeoDTO() != null) {
                 BeanUtil.copyProperties(billNeoDTO.getDrugBillNeoDTO(), billNeoMaxDTO);
                 billNeoMaxDTO.setType(TypeEnum.drug.getName());
@@ -175,7 +175,7 @@ public class BillProcess {
         List<Medicine> takeMedicine = presentLabel.getTakeMedicine();
         List<Medicine> allergyDrug = new ArrayList<>();
         List<Drug> drug = wordCrfDTO.getDrug();
-        for(Item item:drug){
+        for (Item item : drug) {
             Medicine operaData = new Medicine();
             operaData.setName(item.getName());
             operaData.setStandName(item.getUniqueName());
@@ -217,7 +217,7 @@ public class BillProcess {
         List<Operation> operations_past = pastLabel.getOperations();
         List<Item> operation = wordCrfDTO.getOperation();
         List<Operation> operationsItem = new ArrayList<>();
-        for(Item item:operation){
+        for (Item item : operation) {
             Operation operaData = new Operation();
             operaData.setName(item.getName());
             operaData.setStandName(item.getUniqueName());
@@ -229,7 +229,7 @@ public class BillProcess {
 
         // 临床表现数据
         List<Clinical> clinicals = new ArrayList<>();
-        if(chiefLabel != null && ListUtil.isNotEmpty(chiefLabel.getClinicals())){
+        if (chiefLabel != null && ListUtil.isNotEmpty(chiefLabel.getClinicals())) {
             clinicals.addAll(chiefLabel.getClinicals());
         }
         // 现病史临床表现数据先不用

+ 13 - 12
src/main/java/com/diagbot/rule/CommonRule.java

@@ -61,10 +61,17 @@ public class CommonRule {
             }
             if (old_stand.size() > 0) {
                 for (Map.Entry<String, String> d : old_stand.entrySet()) {
-                    BillMsg commonBillMsg = MsgUtil.getCommonSurgeryMsg(
-                            billNeoMaxDTO.getOrderName(), billNeoMaxDTO.getOrderStandName(),
-                            d.getKey(), type, billNeoMaxDTO.getType());
-                    billMsgList.add(commonBillMsg);
+                    if ("禁忌手术".equals(type)) {
+                        BillMsg commonBillMsg = MsgUtil.getCommonSurgeryMsg(
+                                billNeoMaxDTO.getOrderName(), billNeoMaxDTO.getOrderStandName(),
+                                d.getKey(), type, billNeoMaxDTO.getType());
+                        billMsgList.add(commonBillMsg);
+                    } else {
+                        BillMsg commonBillMsg = MsgUtil.getCommonBillMsg(
+                                billNeoMaxDTO.getOrderName(), billNeoMaxDTO.getOrderStandName(),
+                                d.getKey(), type, billNeoMaxDTO.getType());
+                        billMsgList.add(commonBillMsg);
+                    }
                 }
             }
         }
@@ -85,14 +92,8 @@ public class CommonRule {
                 String c = (String) CoreUtil.getFieldValue(d, "uniqueName");
                 String c_name = (String) CoreUtil.getFieldValue(d, "name");
                 for (NodeNeoDTO nodeNeoDTO : neoList) {
-                    if (nodeNeoDTO.getExactMatch() == 0) { // 精确匹配
-                        if (StringUtils.isNotBlank(c) && c.equals(nodeNeoDTO.getName())) {
-                            old_stand.put(c_name, c);
-                        }
-                    } else { // 模糊匹配
-                        if (StringUtils.isNotBlank(c) && c.contains(nodeNeoDTO.getName())) {
-                            old_stand.put(c_name, c);
-                        }
+                    if (CoreUtil.compareNodeName(nodeNeoDTO, c)) {
+                        old_stand.put(c_name, c);
                     }
                 }
             }

+ 23 - 0
src/main/java/com/diagbot/util/CoreUtil.java

@@ -759,6 +759,29 @@ public class CoreUtil {
         return str;
     }
 
+    /**
+     * 比较node名称是否匹配
+     *
+     * @param nodeNeoDTO
+     * @param input
+     * @return
+     */
+    public static Boolean compareNodeName(NodeNeoDTO nodeNeoDTO, String input) {
+        if (StringUtil.isBlank(input) || nodeNeoDTO == null || StringUtil.isBlank(nodeNeoDTO.getName())) {
+            return false;
+        }
+        if (nodeNeoDTO.getExactMatch() == 0) { // 精确匹配
+            if (input.equals(nodeNeoDTO.getName())) {
+                return true;
+            }
+        } else { // 模糊匹配
+            if (input.contains(nodeNeoDTO.getName())) {
+                return true;
+            }
+        }
+        return false;
+    }
+
     public static void main(String[] args) {
         String ageStr = ".545458";
         System.out.println(Double.parseDouble(ageStr));