zhoutg 4 vuotta sitten
vanhempi
commit
171376a486

+ 84 - 6
src/main/java/com/diagbot/facade/TestFacade.java

@@ -239,6 +239,70 @@ public class TestFacade {
         return map;
     }
 
+    /**
+     * 其他值提醒测试——化验
+     *
+     * @param file
+     */
+    public Map<String, Object> testOtherTipLis(MultipartFile file, TestLineVO testLineVO) {
+        List<IndicationPushVO> indicationPushVOList = new ArrayList<>();
+        List<TestIndicationVO> data = ExcelUtils.importExcelMultiSheets(file, 0, 1, testLineVO.getSheetIndex(), TestIndicationVO.class);
+        for (TestIndicationVO bean : data) {
+            if (StringUtil.isNotEmpty(testLineVO.getIdNum()) && !testLineVO.getIdNum().equals(bean.getIdNum())) {
+                continue;
+            }
+            IndicationPushVO indicationPushVO = new IndicationPushVO();
+            indicationPushVO.setRuleType("4");
+            indicationPushVO.setIdNum(bean.getIdNum());
+
+            if ("药品通用名称".equals(bean.getOtherTipNodeType())) {
+                List<Drug> drug = new ArrayList<>();
+                Drug item = new Drug();
+                item.setUniqueName(bean.getOtherTipNodeName());
+                item.setName(bean.getOtherTipNodeName());
+                drug.add(item);
+                indicationPushVO.setDrug(drug);
+            } else if("医保疾病名称".equals(bean.getOtherTipNodeType())) {
+                List<Item> diag = new ArrayList<>();
+                Item item = new Item();
+                item.setUniqueName(bean.getOtherTipNodeName());
+                item.setName(bean.getOtherTipNodeName());
+                diag.add(item);
+                indicationPushVO.setDiag(diag);
+            }
+            List<Lis> lisList = new ArrayList<>();
+            Lis lis = new Lis();
+            lis.setName("套餐");
+            lis.setDetailName("明细");
+            lis.setUniqueName(bean.getOtherTipLisName());
+            lis.setValue(getValue(bean.getOtherTipLisSymbol(), bean.getOtherTipLisValue()));
+            lisList.add(lis);
+            indicationPushVO.setLis(lisList);
+            indicationPushVOList.add(indicationPushVO);
+        }
+
+        Map<String, Object> map = new LinkedHashMap<>();
+
+        List<String> msg = new ArrayList<>();
+        List<String> errMsg = new ArrayList<>();
+        for (IndicationPushVO indicationPushVO : indicationPushVOList) {
+            try {
+                IndicationDTO indicationDTO = indicationFacade.indicationFac(indicationPushVO);
+                if (ListUtil.isEmpty(indicationDTO.getOtherList())) {
+                    msg.add("第【" + indicationPushVO.getIdNum() + "】行未匹配");
+                }
+            } catch (Exception e) {
+                System.out.println(e.getMessage());
+                errMsg.add(indicationPushVO.getIdNum() + "行出错了");
+            }
+        }
+        map.put("总条数", indicationPushVOList.size() + "条");
+        map.put("出错条数", msg.size() + "条");
+        map.put("出错信息", msg);
+        map.put("程序报错", errMsg);
+        return map;
+    }
+
 
     /**
      * 高危药品测试API
@@ -258,13 +322,13 @@ public class TestFacade {
             IndicationPushVO indicationPushVO = new IndicationPushVO();
             indicationPushVO.setRuleType("3");
             indicationPushVO.setIdNum(bean.getIdNum());
-            List<Drug> drugOrder = new ArrayList<>();
+            List<Drug> drug = new ArrayList<>();
             Drug item = new Drug();
             item.setUniqueName(bean.getDrugHighRisk());
             item.setName(bean.getDrugHighRisk());
             item.setForm(bean.getDrugForm());
-            drugOrder.add(item);
-            indicationPushVO.setDrugOrder(drugOrder);
+            drug.add(item);
+            indicationPushVO.setDrug(drug);
             indicationPushVOList.add(indicationPushVO);
         }
 
@@ -357,7 +421,6 @@ public class TestFacade {
         return map;
     }
 
-
     /**
      * 返回数值
      *
@@ -366,9 +429,24 @@ public class TestFacade {
      */
     public double getValue(String[] arr) {
         if ("<".equals(arr[1]) || "≤".equals(arr[1])) {
-            return Double.parseDouble(arr[2])-1;
+            return Double.parseDouble(arr[2]) - 0.1;
         } else if (">".equals(arr[1]) || "≥".equals(arr[1])) {
-            return Double.parseDouble(arr[2])+1;
+            return Double.parseDouble(arr[2]) + 0.1;
+        }
+        return 0.0;
+    }
+
+    /**
+     * 返回数值
+     *
+     * @param dou
+     * @return
+     */
+    public double getValue(String symbol, Double dou) {
+        if ("<".equals(symbol) || "≤".equals(symbol)) {
+            return dou - 0.1;
+        } else if (">".equals(symbol) || "≥".equals(symbol)) {
+            return dou + 0.1;
         }
         return 0.0;
     }

+ 13 - 1
src/main/java/com/diagbot/vo/TestIndicationVO.java

@@ -192,7 +192,7 @@ public class TestIndicationVO implements Serializable {
     private Double criticalMax;
     @Excel(name="参考对象")
     private String criticalAge;
-    /************************************************高危药品和手术***********************/
+    /************************************************高危药品和手术****************************************/
     @Excel(name="手术级别")
     private String operationLevel;
     @Excel(name="医保手术和操作名称")
@@ -203,4 +203,16 @@ public class TestIndicationVO implements Serializable {
     private String drugHighRisk;
     @Excel(name="注册剂型")
     private String drugForm;
+    /************************************************其他值提醒——化验****************************************/
+    @Excel(name="实验室检查名称")
+    private String otherTipLisName;
+    @Excel(name="比较符号")
+    private String otherTipLisSymbol;
+    @Excel(name="数值")
+    private Double otherTipLisValue;
+    @Excel(name="标签")
+    private String otherTipNodeType;
+    @Excel(name="名称")
+    private String otherTipNodeName;
+
 }

+ 8 - 0
src/main/java/com/diagbot/web/TestController.java

@@ -65,6 +65,14 @@ public class TestController {
         return RespDTO.onSuc(testFacade.testHighRiskDrugExcel(file, testLineVO));
     }
 
+    @ApiOperation(value = "特殊值提醒测试——化验API[zhoutg]",
+            notes = "idNum:指定行测试<br>" +
+                    "sheetIndex:sheet的下标,默认为0,表示第一个sheet")
+    @PostMapping("/testOtherTipLis")
+    public RespDTO<Map<String, Object>> testOtherTipLis(@RequestParam("file") MultipartFile file, TestLineVO testLineVO) {
+        return RespDTO.onSuc(testFacade.testOtherTipLis(file, testLineVO));
+    }
+
     @ApiOperation(value = "标准词转换API[zhoutg]", notes = "类型,疾病: disease,症状: symptom,手术和操作:operation,药品: drug,实验室检查:lis,辅助检查:pacs, 辅助检查:vital")
     @PostMapping("/testStandConvert")
     public RespDTO<StandConvertCrfDTO> testStandConvert(@RequestBody StandConvertCrfVO standConvertCrfVO) {