zhoutg 4 anni fa
parent
commit
d5ea2997db

+ 6 - 5
src/main/java/com/diagbot/process/BillProcess.java

@@ -1,5 +1,6 @@
 package com.diagbot.process;
 
+import com.diagbot.biz.push.entity.Item;
 import com.diagbot.dto.BillMsg;
 import com.diagbot.dto.BillNeoDTO;
 import com.diagbot.dto.BillNeoMaxDTO;
@@ -8,7 +9,6 @@ import com.diagbot.dto.WordCrfDTO;
 import com.diagbot.enums.NeoEnum;
 import com.diagbot.facade.NeoFacade;
 import com.diagbot.model.entity.Clinical;
-import com.diagbot.model.entity.Diag;
 import com.diagbot.model.entity.GeneralDesc;
 import com.diagbot.model.entity.Medicine;
 import com.diagbot.model.entity.Operation;
@@ -114,7 +114,7 @@ public class BillProcess {
             // }
             // 测试数据结束
 
-            // System.out.println(billNeoMaxDTO);
+            System.out.println(billNeoMaxDTO);
             billNeoMaxDTOList.add(billNeoMaxDTO);
         }
         processRule(billNeoMaxDTOList, wordCrfDTO, res);
@@ -133,7 +133,7 @@ public class BillProcess {
         List<Vital> vitals = wordCrfDTO.getVitalLabel().getVitals();
 
         // 诊断数据
-        List<Diag> diags = diagLabel.getDiags();
+        List<Item> diags = wordCrfDTO.getDiag();
 
         // 手术数据
         List<Operation> operations_present = presentLabel.getOperations();
@@ -159,7 +159,7 @@ public class BillProcess {
             AgeRule.compareAgeWithBill(wordCrfDTO, bill, billMsgList, NeoEnum.ageNeoDTO.getName());
 
             // 诊断
-            CommonRule.compareNameWithBill(bill.getDisease(), diags, bill, billMsgList, NeoEnum.disease.getName());
+            CommonRule.compareItemWithBill(bill.getDisease(), diags, bill, billMsgList, NeoEnum.disease.getName());
 
             // 化验
             LisRule.compareLisWithBill(wordCrfDTO.getLis(), bill, billMsgList, NeoEnum.lis.getName());
@@ -182,7 +182,8 @@ public class BillProcess {
             // 服用药品(现病史一般情况后的药品)
             DrugRule.compareDrugWithBill(bill.getOralmeds(), takeMedicine(presentLabel), bill, billMsgList, drugMap, NeoEnum.oralmeds.getName());
 
-            // 禁用人群 TODO
+            // 禁用人群
+            // GroupRule.compareGroupWithBill(wordCrfDTO, bill, billMsgList, NeoEnum.group.getName());
         }
 
         // 24小时重复开单项

+ 31 - 0
src/main/java/com/diagbot/rule/CommonRule.java

@@ -37,6 +37,7 @@ public class CommonRule {
      *
      * @param neoList 图谱结构
      * @param inputLises 界面元素
+     * @param billNeoMaxDTO 开单项名称,开单项标准名称
      * @return
      */
     public static <T> void compareNameWithBill(List<NodeNeoDTO> neoList, List<T> inputLises, BillNeoMaxDTO billNeoMaxDTO, List<BillMsg> billMsgList, String type) {
@@ -64,6 +65,36 @@ public class CommonRule {
         }
     }
 
+    /**
+     * 比较界面元素是否在图谱中存在(匹配名称)
+     *
+     * @param neoList 图谱结构
+     * @param input 界面元素
+     * @param billNeoMaxDTO 开单项名称,开单项标准名称
+     * @return
+     */
+    public static <T> void compareItemWithBill(List<NodeNeoDTO> neoList, List<T> input, BillNeoMaxDTO billNeoMaxDTO, List<BillMsg> billMsgList, String type) {
+        Map<String, String> old_stand = new HashMap<>();
+        if (ListUtil.isNotEmpty(neoList) && ListUtil.isNotEmpty(input)) {
+            List<String> dl = neoList.stream().map(x -> x.getName()).collect(Collectors.toList());
+            for (T d : input) {
+                String c = (String) CoreUtil.getFieldValue(d, "uniqueName");
+                String c_name = (String) CoreUtil.getFieldValue(d, "name");
+                if (StringUtils.isNotBlank(c) && dl.contains(c)) {
+                    old_stand.put(c_name, c);
+                }
+            }
+            if (old_stand.size() > 0) {
+                for (String key : old_stand.keySet()) {
+                    BillMsg commonBillMsg = CoreUtil.getCommonBillMsg(
+                            billNeoMaxDTO.getOrderName(), billNeoMaxDTO.getOrderStandName(),
+                            key, type);
+                    billMsgList.add(commonBillMsg);
+                }
+            }
+        }
+    }
+
     /**
      * 24小时重复开单总入口
      *