|
@@ -188,6 +188,106 @@ public class TestFacade {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 高危手术测试API
|
|
|
+ *
|
|
|
+ * @param file
|
|
|
+ */
|
|
|
+ public Map<String, Object> testHighRiskOperationExcel(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;
|
|
|
+ }
|
|
|
+ // 3,4是高危手术
|
|
|
+ if ("0".equals(bean.getOperationLevel()) || "1".equals(bean.getOperationLevel()) || "2".equals(bean.getOperationLevel())) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ IndicationPushVO indicationPushVO = new IndicationPushVO();
|
|
|
+ indicationPushVO.setRuleType("3");
|
|
|
+ indicationPushVO.setIdNum(bean.getIdNum());
|
|
|
+ List<Item> operationOrder = new ArrayList<>();
|
|
|
+ Item item = new Item();
|
|
|
+ item.setUniqueName(bean.getOperationHighRisk());
|
|
|
+ item.setName(bean.getOperationHighRisk());
|
|
|
+ operationOrder.add(item);
|
|
|
+ indicationPushVO.setOperationOrder(operationOrder);
|
|
|
+ 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.getHighRiskList())) {
|
|
|
+ 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
|
|
|
+ *
|
|
|
+ * @param file
|
|
|
+ */
|
|
|
+ public Map<String, Object> testHighRiskDrugExcel(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;
|
|
|
+ }
|
|
|
+ if (StringUtil.isEmpty(bean.getDrugLevel())) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ IndicationPushVO indicationPushVO = new IndicationPushVO();
|
|
|
+ indicationPushVO.setRuleType("3");
|
|
|
+ indicationPushVO.setIdNum(bean.getIdNum());
|
|
|
+ List<Item> drugOrder = new ArrayList<>();
|
|
|
+ Item item = new Item();
|
|
|
+ item.setUniqueName(bean.getDrugHighRisk());
|
|
|
+ item.setName(bean.getDrugHighRisk());
|
|
|
+ drugOrder.add(item);
|
|
|
+ indicationPushVO.setDrugOrder(drugOrder);
|
|
|
+ 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.getHighRiskList())) {
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 危急值数据测试
|
|
|
*
|