Browse Source

起搏器规则调整

zhoutg 4 years ago
parent
commit
5d45f2832c

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

@@ -276,7 +276,7 @@ public class BillProcess {
             commonRule.compareItemWithBill(bill.getPacsDesc(), pacsDescList, bill, billMsgList, NeoEnum.pacsDesc.getName());
 
             // 禁忌医疗器械及物品
-            medEquRule.bill(wordCrfDTO.getPastLabel().getText(), bill, billMsgList, NeoEnum.medEqu.getName());
+            medEquRule.bill(wordCrfDTO, bill, billMsgList, NeoEnum.medEqu.getName());
         }
 
         // 24小时重复开单项

+ 26 - 12
src/main/java/com/diagbot/rule/MedEquRule.java

@@ -3,9 +3,9 @@ package com.diagbot.rule;
 import com.diagbot.dto.BillMsg;
 import com.diagbot.dto.BillNeoMaxDTO;
 import com.diagbot.dto.NodeNeoDTO;
+import com.diagbot.dto.WordCrfDTO;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.MsgUtil;
-import com.diagbot.util.StringUtil;
 import org.springframework.stereotype.Component;
 
 import java.util.List;
@@ -21,24 +21,38 @@ public class MedEquRule {
     /**
      * 比较文本内容是否存在
      *
-     * @param text
+     * @param wordCrfDTO
      * @param billNeoMaxDTO
      * @param billMsgList
      * @param type
      */
-    public void bill(String text, BillNeoMaxDTO billNeoMaxDTO, List<BillMsg> billMsgList, String type) {
-        if (StringUtil.isNotBlank(text)) {
-            List<NodeNeoDTO> medEquList = billNeoMaxDTO.getMeddevice();
-            if (ListUtil.isNotEmpty(medEquList)) {
-                for (NodeNeoDTO node : medEquList) {
-                    if (text.contains(node.getName())) {
-                        BillMsg billMsg = MsgUtil.getBillMedEquMsg(billNeoMaxDTO.getOrderName(), billNeoMaxDTO.getOrderStandName(),
-                                node.getName(), type, billNeoMaxDTO.getType());
-                        billMsgList.add(billMsg);
+    public void bill(WordCrfDTO wordCrfDTO, BillNeoMaxDTO billNeoMaxDTO, List<BillMsg> billMsgList, String type) {
+        String chief = wordCrfDTO.getChief();
+        String symptom = wordCrfDTO.getSymptom();
+        String pasts = wordCrfDTO.getPasts();
+
+        List<NodeNeoDTO> medEquList = billNeoMaxDTO.getMeddevice();
+        if (ListUtil.isNotEmpty(medEquList)) {
+            for (NodeNeoDTO node : medEquList) {
+                boolean flag = false;
+                if ("起搏器".equals(node.getName())) {
+                    if (chief.contains("起搏器") || symptom.contains("起搏器") || pasts.contains("起搏器") ||
+                            chief.contains("起 搏器") || symptom.contains("起 搏器") || pasts.contains("起 搏器") ||
+                            chief.contains("起搏 器") || symptom.contains("起搏 器") || pasts.contains("起搏 器") ||
+                            chief.contains("起博器") || symptom.contains("起博器") || pasts.contains("起博器") ||
+                            chief.contains("起博 器") || symptom.contains("起博 器") || pasts.contains("起博 器") ||
+                            chief.contains("起 博器") || symptom.contains("起 博器") || pasts.contains("起 博器")) {
+                        flag = true;
                     }
+                } else if (chief.contains(node.getName()) || symptom.contains(node.getName()) || pasts.contains(node.getName())) {
+                    flag = true;
+                }
+                if (flag) {
+                    BillMsg billMsg = MsgUtil.getBillMedEquMsg(billNeoMaxDTO.getOrderName(), billNeoMaxDTO.getOrderStandName(),
+                            node.getName(), type, billNeoMaxDTO.getType());
+                    billMsgList.add(billMsg);
                 }
             }
         }
     }
-
 }