瀏覽代碼

重复开单项、辅检互斥规则调整

zhoutg 4 年之前
父節點
當前提交
b236aae282
共有 1 個文件被更改,包括 15 次插入11 次删除
  1. 15 11
      src/main/java/com/diagbot/rule/CommonRule.java

+ 15 - 11
src/main/java/com/diagbot/rule/CommonRule.java

@@ -125,21 +125,25 @@ public class CommonRule {
         List<Pacs> pacsOrder = wordCrfDTO.getPacsOrder();
         Set<String> set = new LinkedHashSet<>();    // A与B不宜同时进行, B与A不宜同时进行 只能提示一个
         if (ListUtil.isNotEmpty(pacsOrder) && pacsOrder.size() > 1) {
-            Map<String, String> map = pacsOrder.stream().collect(Collectors.toMap(k -> k.getUniqueName(), v -> v.getName()));
+            // 不同的辅检项目可能对应同一个uniqueName,提示显示多条
+            Map<String, List<Pacs>> map = EntityUtil.makeEntityListMap(pacsOrder, "uniqueName");
             for (BillNeoMaxDTO billNeoMaxDTO : billNeoMaxDTOList) {
                 List<NodeNeoDTO> nodeList = billNeoMaxDTO.getPacsOrder();
                 if (ListUtil.isNotEmpty(nodeList)) {
                     for (NodeNeoDTO nodeNeoDTO : nodeList) {
-                        String orginName = map.get(nodeNeoDTO.getName());
+                        List<Pacs> orginNameList = map.get(nodeNeoDTO.getName());
                         if (map.get(nodeNeoDTO.getName()) != null) {
-                            if (!set.contains(billNeoMaxDTO.getOrderName() + "******" + orginName)) {
-                                set.add(billNeoMaxDTO.getOrderName() + "******" + orginName);
-                                set.add(orginName + "******" + billNeoMaxDTO.getOrderName());
-                                BillMsg commonBillMsg = MsgUtil.getBillExclusionMsg(
-                                        billNeoMaxDTO.getOrderName(), orginName,
-                                        billNeoMaxDTO.getOrderName() + "," + orginName,
-                                        NeoEnum.exclusion.getName());
-                                billMsgList.add(commonBillMsg);
+                            for (Pacs pacs : orginNameList) {
+                                String orginName = pacs.getName();
+                                if (!set.contains(billNeoMaxDTO.getOrderName() + "******" + orginName)) {
+                                    set.add(billNeoMaxDTO.getOrderName() + "******" + orginName);
+                                    set.add(orginName + "******" + billNeoMaxDTO.getOrderName());
+                                    BillMsg commonBillMsg = MsgUtil.getBillExclusionMsg(
+                                            billNeoMaxDTO.getOrderName(), orginName,
+                                            billNeoMaxDTO.getOrderName() + "," + orginName,
+                                            NeoEnum.exclusion.getName());
+                                    billMsgList.add(commonBillMsg);
+                                }
                             }
                         }
                     }
@@ -159,7 +163,7 @@ public class CommonRule {
         if (ListUtil.isEmpty(itemList)) {
             return ;
         }
-        Map<String, List<T>> map = EntityUtil.makeEntityListMap(itemList, "uniqueName");
+        Map<String, List<T>> map = EntityUtil.makeEntityListMap(itemList, "name");
         for (String key : map.keySet()) {
             List<T> items = map.get(key);