Ver código fonte

辅检测试

zhoutg 4 anos atrás
pai
commit
04b7b73552

+ 8 - 8
src/main/java/com/diagbot/aggregate/IndicationAggregate.java

@@ -86,8 +86,8 @@ public class IndicationAggregate {
             } catch (Exception e) {
                 String errMsg = StringUtil.isNotBlank(indicationPushVO.getIdNum()) ?
                         "行号【" + indicationPushVO.getIdNum() + "】" : "";
-                log.error("【开单规则出错】" + errMsg + e.getMessage());
-                CoreUtil.getDebugStr("【开单规则出错】", errMsg + e.getMessage(), res.getDebug());
+                log.error("【开单规则出错】" + errMsg, e);
+                CoreUtil.getDebugStr("【开单规则出错】", errMsg + e, res.getDebug());
             }
             return res;
         }
@@ -112,8 +112,8 @@ public class IndicationAggregate {
                 highRiskFacade.highRiskFac(indicationPushVO, wordCrfDTO, res);
                 CoreUtil.getDebugStr(start, "高风险提示耗时", res.getDebug());
             } catch (Exception e) {
-                log.error("【高风险提示出错】" + e.getMessage());
-                CoreUtil.getDebugStr("【高风险提示出错】", e.getMessage(), res.getDebug());
+                log.error("【高风险提示出错】", e);
+                CoreUtil.getDebugStr("【高风险提示出错】", e, res.getDebug());
             }
             return res;
         }
@@ -139,8 +139,8 @@ public class IndicationAggregate {
                 CoreUtil.getDebugStr(start, "危急值提示耗时", res.getDebug());
                 return res;
             } catch (Exception e) {
-                log.error("【危急值提示出错】" + e.getMessage());
-                CoreUtil.getDebugStr("【危急值提示出错】", e.getMessage(), res.getDebug());
+                log.error("【危急值提示出错】", e);
+                CoreUtil.getDebugStr("【危急值提示出错】", e, res.getDebug());
             }
         }
         return null;
@@ -165,8 +165,8 @@ public class IndicationAggregate {
                 CoreUtil.getDebugStr(start, "其他值提示耗时", res.getDebug());
                 return res;
             } catch (Exception e) {
-                log.error("【其他值提示出错】" + e.getMessage());
-                CoreUtil.getDebugStr("【其他值提示出错】", e.getMessage(), res.getDebug());
+                log.error("【其他值提示出错】", e);
+                CoreUtil.getDebugStr("【其他值提示出错】", e, res.getDebug());
             }
         }
         return null;

+ 85 - 0
src/main/java/com/diagbot/facade/TestFacade.java

@@ -387,6 +387,91 @@ public class TestFacade {
         return map;
     }
 
+    /**
+     * 其他值提醒测试——辅检
+     *
+     * @param file
+     */
+    public Map<String, Object> testOtherTipPacs(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.getSexStr())) {
+                indicationPushVO.setSex(1);
+            } else if ("女性".equals(bean.getSexStr())) {
+                indicationPushVO.setSex(2);
+            }
+            if (StringUtil.isNotBlank(bean.getDisName())) {
+                List<Item> diag = new ArrayList<>();
+                Item item = new Item();
+                item.setUniqueName(bean.getDisName());
+                item.setName(bean.getDisName());
+                diag.add(item);
+                indicationPushVO.setDiag(diag);
+            }
+            if (bean.getAgeRange() != null) {
+                if (bean.getAgeRange() == 0) {
+                    if (bean.getAgeMin() != null) {
+                        indicationPushVO.setAge(bean.getAgeMin() + 1);
+                    } else if (bean.getAgeMax() != null) {
+                        indicationPushVO.setAge(bean.getAgeMin() - 1);
+                    }
+                } else if (bean.getAgeRange() == 1) {
+                    if (bean.getAgeMin() != null) {
+                        indicationPushVO.setAge(bean.getAgeMin() - 1);
+                    } else if (bean.getAgeMax() != null) {
+                        indicationPushVO.setAge(bean.getAgeMax() + 1);
+                    }
+                }
+            }
+            if (StringUtil.isNotBlank(bean.getPacsDesc())) {
+                Pacs pacs = new Pacs();
+                pacs.setName("胸部CT");
+                pacs.setUniqueName("胸部CT");
+                pacs.setResult(bean.getPacsDesc());
+                indicationPushVO.getPacs().add(pacs);
+            }
+
+            if (StringUtil.isNotBlank(bean.getPacsDescHas())) {
+                Pacs pacs = new Pacs();
+                pacs.setName("CT");
+                pacs.setUniqueName("CT");
+                pacs.setResult(bean.getPacsDescHas());
+                indicationPushVO.getPacs().add(pacs);
+            }
+
+            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;
+    }
+
     /**
      * 其他值提醒测试——输血
      *

+ 4 - 3
src/main/java/com/diagbot/model/entity/PacsNew.java

@@ -2,6 +2,7 @@ package com.diagbot.model.entity;
 
 import lombok.Data;
 
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -14,7 +15,7 @@ public class PacsNew  {
     private String name;
     private String uniqueName;
     private String result;
-    private List<Pacs> pacsResults; // 辅检提取的描述信息
-    private List<Pacs> disease; // 辅检提取的诊断
-    private List<Pacs> matchRes; // 辅检匹配的结果
+    private List<Pacs> pacsResults = new ArrayList<>(); // 辅检提取的描述信息
+    private List<Pacs> disease = new ArrayList<>(); // 辅检提取的诊断
+    private List<Pacs> matchRes = new ArrayList<>(); // 辅检匹配的结果
 }

+ 1 - 3
src/main/java/com/diagbot/repository/PacsRemindNode.java

@@ -5,15 +5,13 @@ import com.diagbot.biz.push.entity.Item;
 import com.diagbot.dto.OtherTipPacsNeoDTO;
 import com.diagbot.dto.WordCrfDTO;
 import com.diagbot.entity.node.PacsRemind;
-import com.diagbot.model.entity.PacsNew;
 import com.diagbot.model.entity.Pacs;
+import com.diagbot.model.entity.PacsNew;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.StringUtil;
 
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 public class PacsRemindNode {
 

+ 1 - 1
src/main/java/com/diagbot/util/CoreUtil.java

@@ -620,7 +620,7 @@ public class CoreUtil {
      * @param error
      * @param debugMap
      */
-    public static void getDebugStr(String msg, String error, Map<String, Object> debugMap) {
+    public static void getDebugStr(String msg, Object error, Map<String, Object> debugMap) {
         debugMap.put(msg,  error);
     }
 }

+ 12 - 7
src/main/java/com/diagbot/vo/TestIndicationVO.java

@@ -220,11 +220,16 @@ public class TestIndicationVO implements Serializable {
     private String itemName;
     @Excel(name="指标标签")
     private String itemNodeName;
-    // @Excel(name="数值")
-    // private Double otherTipLisValue;
-    // @Excel(name="标签")
-    // private String otherTipNodeType;
-    // @Excel(name="名称")
-    // private String otherTipNodeName;
-
+    @Excel(name="年龄最大值")
+    private Integer ageMax;
+    @Excel(name="年龄最小值")
+    private Integer ageMin;
+    @Excel(name="年龄范围")
+    private Integer ageRange;
+    @Excel(name="检查结果")
+    private String pacsDesc;
+    @Excel(name="检查结论有")
+    private String pacsDescHas;
+    @Excel(name="性别")
+    private String sexStr;
 }

+ 10 - 1
src/main/java/com/diagbot/web/TestController.java

@@ -73,7 +73,7 @@ public class TestController {
         return RespDTO.onSuc(testFacade.testHighRiskDrugExcel(file, testLineVO));
     }
 
-    @ApiOperation(value = "其他值提醒测试——化验API[zhoutg]",
+    @ApiOperation(value = "其他值提醒测试——化验[zhoutg]",
             notes = "idNum:指定行测试<br>" +
                     "sheetIndex:sheet的下标,默认为0,表示第一个sheet")
     @PostMapping("/testOtherTipLis")
@@ -81,6 +81,15 @@ public class TestController {
         return RespDTO.onSuc(testFacade.testOtherTipLis(file, testLineVO));
     }
 
+    @ApiOperation(value = "其他值提醒测试——辅检[zhoutg]",
+            notes = "idNum:指定行测试<br>" +
+                    "sheetIndex:sheet的下标,默认为0,表示第一个sheet")
+    @PostMapping("/testOtherTipPacs")
+    public RespDTO<Map<String, Object>> testOtherTipPacs(@RequestParam("file") MultipartFile file, TestLineVO testLineVO) {
+        return RespDTO.onSuc(testFacade.testOtherTipPacs(file, testLineVO));
+    }
+
+
     @ApiOperation(value = "其他值提醒测试——输血API[zhoutg]",
             notes = "idNum:指定行测试<br>" +
                     "sheetIndex:sheet的下标,默认为0,表示第一个sheet")