Sfoglia il codice sorgente

开单合理性输血

gaodm 4 anni fa
parent
commit
632035dc71
1 ha cambiato i file con 67 aggiunte e 1 eliminazioni
  1. 67 1
      src/main/java/com/diagbot/facade/ExportFacade.java

+ 67 - 1
src/main/java/com/diagbot/facade/ExportFacade.java

@@ -473,6 +473,8 @@ public class ExportFacade {
         );
         Map<String, KlConcept> map
                 = EntityUtil.makeEntityMapByKeys(klConcepts, "_", "libName", "libType");
+        //开单合理性_输血
+        transfusionOrder(mapPath, map);
         //高危药品
         //drugHighRisk(mapPath, map);
         //高危手术
@@ -486,10 +488,74 @@ public class ExportFacade {
         //其他值提醒_辅检
         //pacsOtherValues(mapPath, map);
         //其他值提醒_输血
-        transfusionOtherValues(mapPath, map);
+        //transfusionOtherValues(mapPath, map);
         return null;
     }
 
+    private void transfusionOrder(Map<String, String> mapPath, Map<String, KlConcept> map) {
+        MultipartFile file = null;
+        file = testFacade.getMulFileByPath(mapPath.get("【开单合理性_输血】"));
+        List<ImportDataVO> data = ExcelUtils.importExcel(file, 0, 1, ImportDataVO.class);
+        for (ImportDataVO importDataVO : data) {
+            if (null != map.get(importDataVO.getTransfusionName() + "_113")
+                    && StringUtil.isNotBlank(importDataVO.getTransfusionNodeName())
+                    && StringUtil.isNotBlank(importDataVO.getStandName())) {
+                KlRule klRule = new KlRule();
+                klRule.setConceptId(map.get(importDataVO.getTransfusionName() + "_113").getId());
+                klRule.setDescription("开单合理性_输血_" + importDataVO.getTransfusionName().trim());
+                klRule.setRuleType(1);
+                klRule.setHasSubCond(1);
+                klRuleService.save(klRule);
+                if (StringUtil.isNotBlank(importDataVO.getTransfusionNodeName())
+                        && StringUtil.isNotBlank(importDataVO.getStandName())) {
+                    KlRuleBase klRuleBase = new KlRuleBase();
+                    if (importDataVO.getTransfusionNodeName().equals("实验室检查")) {
+                        klRuleBase.setConceptId(map.get(importDataVO.getStandName() + "_108").getId());
+                        if (operator_lt.contains(importDataVO.getSymbol())) {
+                            klRuleBase.setType(2);
+                            klRuleBase.setMinOperator("<");
+                            klRuleBase.setMinValue(importDataVO.getValue().toString());
+                            if (StringUtil.isNotBlank(importDataVO.getUnit())) {
+                                klRuleBase.setMinUnit(importDataVO.getUnit().trim());
+                            }
+                        }
+                        if (operator_gt.contains(importDataVO.getSymbol())) {
+                            klRuleBase.setType(2);
+                            klRuleBase.setMaxOperator(">");
+                            klRuleBase.setMaxValue(importDataVO.getValue().toString());
+                            if (StringUtil.isNotBlank(importDataVO.getUnit())) {
+                                klRuleBase.setMaxUnit(importDataVO.getUnit().trim());
+                            }
+                        }
+                        if (StringUtil.isNotBlank(importDataVO.getUnit())) {
+                            klRuleBase.setDescription("检验_" + importDataVO.getStandName() + importDataVO.getSymbol()
+                                    + importDataVO.getValue() + " " + importDataVO.getUnit());
+                        } else {
+                            klRuleBase.setDescription("检验_" + importDataVO.getStandName() + importDataVO.getSymbol()
+                                    + importDataVO.getValue());
+                        }
+                    } else if (importDataVO.getTransfusionNodeName().equals("医保疾病名称")) {
+                        klRuleBase.setConceptId(map.get(importDataVO.getStandName() + "_100").getId());
+                        klRuleBase.setType(1);
+                        klRuleBase.setDescription("疾病_" + importDataVO.getStandName());
+                    } else if (importDataVO.getTransfusionNodeName().equals("手术和操作")) {
+                        klRuleBase.setConceptId(map.get(importDataVO.getStandName() + "_106").getId());
+                        klRuleBase.setType(1);
+                        klRuleBase.setDescription("手术和操作_" + importDataVO.getStandName());
+                    } else {
+
+                    }
+                    klRuleBaseService.save(klRuleBase);
+                    KlRuleCondition klRuleCondition = new KlRuleCondition();
+                    klRuleCondition.setGroupType(1);
+                    klRuleCondition.setRuleId(klRule.getId());
+                    klRuleCondition.setRuleBaseId(klRuleBase.getId());
+                    klRuleConditionService.save(klRuleCondition);
+                }
+            }
+        }
+    }
+
     private void lisCriticalValues(Map<String, String> mapPath, Map<String, KlConcept> map) {
         MultipartFile file = null;
         file = testFacade.getMulFileByPath(mapPath.get("【危急值_化验】"));