Ver código fonte

Merge remote-tracking branch 'origin/dev/nurseRule20220329' into dev/nurseRule20220329

wangfeng 3 anos atrás
pai
commit
a90d6f42e4

+ 8 - 0
cdssman-service/src/main/java/com/diagbot/client/CdssCoreClient.java

@@ -1,10 +1,12 @@
 package com.diagbot.client;
 
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.diagbot.annotation.SysLogger;
 import com.diagbot.client.hystrix.CdssCoreHystrix;
 import com.diagbot.dto.*;
 import com.diagbot.entity.KlRuleMenuWrapper;
 import com.diagbot.vo.*;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -74,6 +76,12 @@ public interface CdssCoreClient {
     @PostMapping("/kl/conceptStatic/getStaticKnowledge")
     RespDTO<StaticKnowledgeDTO> getStaticKnowledge(@Valid @RequestBody StaticKnowledgeVO staticKnowledgeVO);
 
+    /**
+     * 批量校验静态知识是否存在
+     */
+    @PostMapping("/kl/conceptStatic/getStaticKnowledgeList")
+    RespDTO<List<StaticKnowledgeDTO>> getStaticKnowledgeList(@Valid @RequestBody StaticKnowledgeListVO staticKnowledgeListVO);
+
     /**
      * 分页查询
      *

+ 10 - 0
cdssman-service/src/main/java/com/diagbot/client/hystrix/CdssCoreHystrix.java

@@ -7,6 +7,7 @@ import com.diagbot.entity.KlRuleMenuWrapper;
 import com.diagbot.vo.*;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 
 import javax.validation.Valid;
@@ -93,6 +94,15 @@ public class CdssCoreHystrix implements CdssCoreClient {
         return null;
     }
 
+    /**
+     * 批量校验静态知识是否存在
+     */
+    @Override
+    public RespDTO<List<StaticKnowledgeDTO>> getStaticKnowledgeList(@Valid @RequestBody StaticKnowledgeListVO staticKnowledgeListVO){
+        log.error("【hystrix】调用{}异常", "getStaticKnowledgeList");
+        return null;
+    }
+
     /**
      * 分页查询
      *

+ 3 - 1
cdssman-service/src/main/java/com/diagbot/enums/StaticKnowledgeEnum.java

@@ -13,7 +13,9 @@ public enum StaticKnowledgeEnum implements KeyedNamed {
     Lis(2, "检验"),
     Pacs(3, "检查"),
     Drug(4, "药品"),
-    Operation(5, "手术/操作");
+    Operation(5, "手术/操作"),
+    Scale(6, "量表"),
+    Nurse(7, "护理");
 
     @Setter
     private int key;

+ 423 - 120
cdssman-service/src/main/java/com/diagbot/facade/ResultStaticKnowledgeNeoFacade.java

@@ -13,10 +13,12 @@ import com.diagbot.dto.StaticKnowledgeDTO;
 import com.diagbot.entity.DiseaseConfig;
 import com.diagbot.entity.DrugConfig;
 import com.diagbot.entity.LisConfig;
+import com.diagbot.entity.NurseConfig;
 import com.diagbot.entity.OperationConfig;
 import com.diagbot.entity.PacsConfig;
 import com.diagbot.entity.ResultStaticInfo;
 import com.diagbot.entity.ResultStaticKnowledge;
+import com.diagbot.entity.ScaleConfig;
 import com.diagbot.enums.ConceptTypeEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.enums.MatchSourceEnum;
@@ -35,8 +37,8 @@ import com.diagbot.util.StringUtil;
 import com.diagbot.vo.ConceptVO;
 import com.diagbot.vo.ResultStaticPageVO;
 import com.diagbot.vo.RunningInfoVO;
+import com.diagbot.vo.StaticKnowledgeListVO;
 import com.diagbot.vo.StaticKnowledgeTestVO;
-import com.diagbot.vo.StaticKnowledgeVO;
 import com.google.common.collect.Lists;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
@@ -47,6 +49,7 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.servlet.http.HttpServletResponse;
 import java.util.Arrays;
 import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -210,30 +213,44 @@ public class ResultStaticKnowledgeNeoFacade extends ResultStaticKnowledgeService
         }
 
         //验证静态知识
+        Map<String, List<StaticKnowledgeDTO>> staticMap = new HashMap<>();
+        List<String> conceptNames = mappingList.stream()
+                .filter(i -> i.getHasStandName() != null && i.getHasStandName().equals(1))
+                .filter(i -> StringUtil.isBlank(i.getHisDetailName()))
+                .map(ResultStaticKnowledge::getName)
+                .distinct()
+                .collect(Collectors.toList());
+        StaticKnowledgeListVO staticKnowledgeListVO = new StaticKnowledgeListVO();
+        staticKnowledgeListVO.setType(3);
+        staticKnowledgeListVO.setContentTypes(Arrays.asList(new Integer[] { 1, 2 }));
+        staticKnowledgeListVO.setNames(conceptNames);
+        RespDTO<List<StaticKnowledgeDTO>> checkRespDTO = cdssCoreClient.getStaticKnowledgeList(staticKnowledgeListVO);
+        if (RespDTOUtil.respIsOK(checkRespDTO)) {
+            staticMap = checkRespDTO.data.stream().collect(Collectors.groupingBy(StaticKnowledgeDTO::getName));
+        }
+        Map<String, List<StaticKnowledgeDTO>> staticMap_detail = new HashMap<>();
+        List<String> conceptNames_details = mappingList.stream()
+                .filter(i -> i.getHasStandName() != null && i.getHasStandName().equals(1))
+                .filter(i -> StringUtil.isNotBlank(i.getHisDetailName()))
+                .map(ResultStaticKnowledge::getName)
+                .distinct()
+                .collect(Collectors.toList());
+        staticKnowledgeListVO.setType(4);
+        staticKnowledgeListVO.setNames(conceptNames_details);
+        RespDTO<List<StaticKnowledgeDTO>> checkRespDTO_detail = cdssCoreClient.getStaticKnowledgeList(staticKnowledgeListVO);
+        if (RespDTOUtil.respIsOK(checkRespDTO_detail)) {
+            staticMap_detail = checkRespDTO_detail.data.stream().collect(Collectors.groupingBy(StaticKnowledgeDTO::getName));
+        }
         for (ResultStaticKnowledge result : mappingList) {
+            //静态知识是否存在
             if (result.getHasStandName() != null && result.getHasStandName().equals(1)) {
-                StaticKnowledgeVO staticKnowledgeVO = new StaticKnowledgeVO();
-                staticKnowledgeVO.setName(result.getName());
-                if (StringUtil.isBlank(result.getHisDetailName())) {
-                    staticKnowledgeVO.setType(3);
+                if (StringUtil.isBlank(result.getHisDetailName())
+                        && staticMap.containsKey(result.getName())) {
+                    result.setHasStaticKnowledge(1);
+                } else if (StringUtil.isNotBlank(result.getHisDetailName())
+                        && staticMap_detail.containsKey(result.getName())) {
+                    result.setHasStaticKnowledge(1);
                 } else {
-                    staticKnowledgeVO.setType(4);
-                }
-                staticKnowledgeVO.setContentTypes(Arrays.asList(new Integer[] { 1, 2 }));
-                try {
-                    StaticKnowledgeDTO staticKnowledgeDTO = klConceptStaticFacade.getStaticKnowledge(staticKnowledgeVO);
-                    if (null != staticKnowledgeDTO
-                            && null != staticKnowledgeDTO.getDetails()
-                            && staticKnowledgeDTO.getDetails().size() > 0) {
-                        result.setHasStaticKnowledge(1);
-                    } else {
-                        result.setHasStaticKnowledge(0);
-                        result.setMessage(result.getMessage() + "缺少静态知识;");
-                    }
-                } catch (CommonException e) {
-                    result.setHasStaticKnowledge(0);
-                    result.setMessage(result.getMessage() + "缺少静态知识;");
-                } catch (Exception e) {
                     result.setHasStaticKnowledge(0);
                     result.setMessage(result.getMessage() + "缺少静态知识;");
                 }
@@ -299,13 +316,6 @@ public class ResultStaticKnowledgeNeoFacade extends ResultStaticKnowledgeService
             }
         }
 
-        //重复数据过滤
-        /*pacsConfigList = pacsConfigList
-                .stream()
-                .distinct()
-                .collect(Collectors.toList());*/
-
-
         // 已存在数据
         Map<String, Map<String, Map<String, List<String>>>> hisConfigMap
                 = mappingConfigFacade.groupByHisNameWithName(null, ConceptTypeEnum.Pacs.getKey(), Long.valueOf(hospitalId), StatusEnum.Enable.getKey());
@@ -375,27 +385,26 @@ public class ResultStaticKnowledgeNeoFacade extends ResultStaticKnowledgeService
         }
 
         //验证静态知识
+        Map<String, List<StaticKnowledgeDTO>> staticMap = new HashMap<>();
+        List<String> conceptNames = mappingList.stream()
+                .filter(i -> i.getHasStandName() != null && i.getHasStandName().equals(1))
+                .map(ResultStaticKnowledge::getName)
+                .distinct()
+                .collect(Collectors.toList());
+        StaticKnowledgeListVO staticKnowledgeListVO = new StaticKnowledgeListVO();
+        staticKnowledgeListVO.setType(5);
+        staticKnowledgeListVO.setContentTypes(Arrays.asList(new Integer[] { 1, 2 }));
+        staticKnowledgeListVO.setNames(conceptNames);
+        RespDTO<List<StaticKnowledgeDTO>> checkRespDTO = cdssCoreClient.getStaticKnowledgeList(staticKnowledgeListVO);
+        if (RespDTOUtil.respIsOK(checkRespDTO)) {
+            staticMap = checkRespDTO.data.stream().collect(Collectors.groupingBy(StaticKnowledgeDTO::getName));
+        }
         for (ResultStaticKnowledge result : mappingList) {
             //静态知识是否存在
             if (result.getHasStandName() != null && result.getHasStandName().equals(1)) {
-                StaticKnowledgeVO staticKnowledgeVO = new StaticKnowledgeVO();
-                staticKnowledgeVO.setName(result.getName());
-                staticKnowledgeVO.setType(5);
-                staticKnowledgeVO.setContentTypes(Arrays.asList(new Integer[] { 1, 2 }));
-                try {
-                    StaticKnowledgeDTO staticKnowledgeDTO = klConceptStaticFacade.getStaticKnowledge(staticKnowledgeVO);
-                    if (null != staticKnowledgeDTO
-                            && null != staticKnowledgeDTO.getDetails()
-                            && staticKnowledgeDTO.getDetails().size() > 0) {
-                        result.setHasStaticKnowledge(1);
-                    } else {
-                        result.setHasStaticKnowledge(0);
-                        result.setMessage(result.getMessage() + "缺少静态知识;");
-                    }
-                } catch (CommonException e) {
-                    result.setHasStaticKnowledge(0);
-                    result.setMessage(result.getMessage() + "缺少静态知识;");
-                } catch (Exception e) {
+                if (staticMap.containsKey(result.getName())) {
+                    result.setHasStaticKnowledge(1);
+                } else {
                     result.setHasStaticKnowledge(0);
                     result.setMessage(result.getMessage() + "缺少静态知识;");
                 }
@@ -461,13 +470,6 @@ public class ResultStaticKnowledgeNeoFacade extends ResultStaticKnowledgeService
             }
         }
 
-        //重复数据过滤
-        /*drugConfigList = drugConfigList
-                .stream()
-                .distinct()
-                .collect(Collectors.toList());*/
-
-
         // 已存在数据
         Map<String, Map<String, Map<String, List<String>>>> hisConfigMap
                 = mappingConfigFacade.groupByHisNameWithName(null, ConceptTypeEnum.Drug.getKey(), Long.valueOf(hospitalId), StatusEnum.Enable.getKey());
@@ -538,27 +540,26 @@ public class ResultStaticKnowledgeNeoFacade extends ResultStaticKnowledgeService
         }
 
         //验证静态知识
+        Map<String, List<StaticKnowledgeDTO>> staticMap = new HashMap<>();
+        List<String> conceptNames = mappingList.stream()
+                .filter(i -> i.getHasStandName() != null && i.getHasStandName().equals(1))
+                .map(ResultStaticKnowledge::getName)
+                .distinct()
+                .collect(Collectors.toList());
+        StaticKnowledgeListVO staticKnowledgeListVO = new StaticKnowledgeListVO();
+        staticKnowledgeListVO.setType(2);
+        staticKnowledgeListVO.setContentTypes(Arrays.asList(new Integer[] { 1 }));
+        staticKnowledgeListVO.setNames(conceptNames);
+        RespDTO<List<StaticKnowledgeDTO>> checkRespDTO = cdssCoreClient.getStaticKnowledgeList(staticKnowledgeListVO);
+        if (RespDTOUtil.respIsOK(checkRespDTO)) {
+            staticMap = checkRespDTO.data.stream().collect(Collectors.groupingBy(StaticKnowledgeDTO::getName));
+        }
         for (ResultStaticKnowledge result : mappingList) {
             //静态知识是否存在
             if (result.getHasStandName() != null && result.getHasStandName().equals(1)) {
-                StaticKnowledgeVO staticKnowledgeVO = new StaticKnowledgeVO();
-                staticKnowledgeVO.setName(result.getName());
-                staticKnowledgeVO.setType(2);
-                staticKnowledgeVO.setContentTypes(Arrays.asList(new Integer[] { 1 }));
-                try {
-                    StaticKnowledgeDTO staticKnowledgeDTO = klConceptStaticFacade.getStaticKnowledge(staticKnowledgeVO);
-                    if (null != staticKnowledgeDTO
-                            && null != staticKnowledgeDTO.getDetails()
-                            && staticKnowledgeDTO.getDetails().size() > 0) {
-                        result.setHasStaticKnowledge(1);
-                    } else {
-                        result.setHasStaticKnowledge(0);
-                        result.setMessage(result.getMessage() + "缺少静态知识;");
-                    }
-                } catch (CommonException e) {
-                    result.setHasStaticKnowledge(0);
-                    result.setMessage(result.getMessage() + "缺少静态知识;");
-                } catch (Exception e) {
+                if (staticMap.containsKey(result.getName())) {
+                    result.setHasStaticKnowledge(1);
+                } else {
                     result.setHasStaticKnowledge(0);
                     result.setMessage(result.getMessage() + "缺少静态知识;");
                 }
@@ -597,6 +598,8 @@ public class ResultStaticKnowledgeNeoFacade extends ResultStaticKnowledgeService
         Long hospitalId = testVO.getHospitalId();
         Date now = DateUtil.now();
 
+        System.out.println("读取excel文件开始时间:" + DateUtil.now());
+
         //从Excel读取数据
         List<DiseaseConfig> diseaseConfigList = Lists.newLinkedList();
         try {
@@ -609,6 +612,7 @@ public class ResultStaticKnowledgeNeoFacade extends ResultStaticKnowledgeService
                 throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请导入正确的文件格式");
             }
         }
+        System.out.println("读取excel文件结束时间:" + DateUtil.now());
 
         Integer totleNum = 0;
         if (ListUtil.isNotEmpty(diseaseConfigList)) {
@@ -624,17 +628,11 @@ public class ResultStaticKnowledgeNeoFacade extends ResultStaticKnowledgeService
             }
         }
 
-        //重复数据过滤
-        /*diseaseConfigList = diseaseConfigList
-                .stream()
-                .distinct()
-                .collect(Collectors.toList());*/
-
-
         // 已存在数据
         Map<String, Map<String, Map<String, List<String>>>> hisConfigMap
                 = mappingConfigFacade.groupByHisNameWithName(null, ConceptTypeEnum.Disease.getKey(), Long.valueOf(hospitalId), StatusEnum.Enable.getKey());
 
+        System.out.println("术语映射开始时间:" + DateUtil.now());
         //术语映射
         for (DiseaseConfig config : diseaseConfigList) {
             ResultStaticKnowledge result = new ResultStaticKnowledge();
@@ -670,6 +668,8 @@ public class ResultStaticKnowledgeNeoFacade extends ResultStaticKnowledgeService
                 mappingList.add(result);
             }
         }
+        System.out.println("术语映射结束时间:" + DateUtil.now());
+        System.out.println("标准术语校验开始时间:" + DateUtil.now());
 
         //标准术语校验
         List<String> uniqueNames = mappingList.stream()
@@ -699,29 +699,32 @@ public class ResultStaticKnowledgeNeoFacade extends ResultStaticKnowledgeService
                 }
             }
         }
+        System.out.println("标准术语校验结束时间:" + DateUtil.now());
+
 
         //验证静态知识
+        Map<String, List<StaticKnowledgeDTO>> staticMap = new HashMap<>();
+        List<String> conceptNames = mappingList.stream()
+                .filter(i -> i.getHasStandName() != null && i.getHasStandName().equals(1))
+                .map(ResultStaticKnowledge::getName)
+                .distinct()
+                .collect(Collectors.toList());
+        StaticKnowledgeListVO staticKnowledgeListVO = new StaticKnowledgeListVO();
+        staticKnowledgeListVO.setType(1);
+        staticKnowledgeListVO.setContentTypes(Arrays.asList(new Integer[] { 1, 3 }));
+        staticKnowledgeListVO.setNames(conceptNames);
+        System.out.println("关联静态信息开始时间:" + DateUtil.now());
+        RespDTO<List<StaticKnowledgeDTO>> checkRespDTO = cdssCoreClient.getStaticKnowledgeList(staticKnowledgeListVO);
+        System.out.println("关联静态信息结束时间:" + DateUtil.now());
+        if (RespDTOUtil.respIsOK(checkRespDTO)) {
+            staticMap = checkRespDTO.data.stream().collect(Collectors.groupingBy(StaticKnowledgeDTO::getName));
+        }
         for (ResultStaticKnowledge result : mappingList) {
             //静态知识是否存在
             if (result.getHasStandName() != null && result.getHasStandName().equals(1)) {
-                StaticKnowledgeVO staticKnowledgeVO = new StaticKnowledgeVO();
-                staticKnowledgeVO.setName(result.getName());
-                staticKnowledgeVO.setType(1);
-                staticKnowledgeVO.setContentTypes(Arrays.asList(new Integer[] { 1, 3 }));
-                try {
-                    StaticKnowledgeDTO staticKnowledgeDTO = klConceptStaticFacade.getStaticKnowledge(staticKnowledgeVO);
-                    if (null != staticKnowledgeDTO
-                            && null != staticKnowledgeDTO.getDetails()
-                            && staticKnowledgeDTO.getDetails().size() > 0) {
-                        result.setHasStaticKnowledge(1);
-                    } else {
-                        result.setHasStaticKnowledge(0);
-                        result.setMessage(result.getMessage() + "缺少静态知识;");
-                    }
-                } catch (CommonException e) {
-                    result.setHasStaticKnowledge(0);
-                    result.setMessage(result.getMessage() + "缺少静态知识;");
-                } catch (Exception e) {
+                if (staticMap.containsKey(result.getName())) {
+                    result.setHasStaticKnowledge(1);
+                } else {
                     result.setHasStaticKnowledge(0);
                     result.setMessage(result.getMessage() + "缺少静态知识;");
                 }
@@ -729,6 +732,7 @@ public class ResultStaticKnowledgeNeoFacade extends ResultStaticKnowledgeService
             saveList.add(result);
         }
 
+
         //保存
         saveResult(saveList, testVO, totleNum);
         return true;
@@ -788,13 +792,6 @@ public class ResultStaticKnowledgeNeoFacade extends ResultStaticKnowledgeService
             }
         }
 
-        //重复数据过滤
-       /* operationConfigList = operationConfigList
-                .stream()
-                .distinct()
-                .collect(Collectors.toList());*/
-
-
         // 已存在数据
         Map<String, Map<String, Map<String, List<String>>>> hisConfigMap
                 = mappingConfigFacade.groupByHisNameWithName(null, ConceptTypeEnum.Operation.getKey(), Long.valueOf(hospitalId), StatusEnum.Enable.getKey());
@@ -865,27 +862,180 @@ public class ResultStaticKnowledgeNeoFacade extends ResultStaticKnowledgeService
         }
 
         //验证静态知识
+        Map<String, List<StaticKnowledgeDTO>> staticMap = new HashMap<>();
+        List<String> conceptNames = mappingList.stream()
+                .filter(i -> i.getHasStandName() != null && i.getHasStandName().equals(1))
+                .map(ResultStaticKnowledge::getName)
+                .distinct()
+                .collect(Collectors.toList());
+        StaticKnowledgeListVO staticKnowledgeListVO = new StaticKnowledgeListVO();
+        staticKnowledgeListVO.setType(7);
+        staticKnowledgeListVO.setContentTypes(Arrays.asList(new Integer[] { 1 }));
+        staticKnowledgeListVO.setNames(conceptNames);
+        RespDTO<List<StaticKnowledgeDTO>> checkRespDTO = cdssCoreClient.getStaticKnowledgeList(staticKnowledgeListVO);
+        if (RespDTOUtil.respIsOK(checkRespDTO)) {
+            staticMap = checkRespDTO.data.stream().collect(Collectors.groupingBy(StaticKnowledgeDTO::getName));
+        }
         for (ResultStaticKnowledge result : mappingList) {
             //静态知识是否存在
             if (result.getHasStandName() != null && result.getHasStandName().equals(1)) {
-                StaticKnowledgeVO staticKnowledgeVO = new StaticKnowledgeVO();
-                staticKnowledgeVO.setName(result.getName());
-                staticKnowledgeVO.setType(7);
-                staticKnowledgeVO.setContentTypes(Arrays.asList(new Integer[] { 1 }));
-                try {
-                    StaticKnowledgeDTO staticKnowledgeDTO = klConceptStaticFacade.getStaticKnowledge(staticKnowledgeVO);
-                    if (null != staticKnowledgeDTO
-                            && null != staticKnowledgeDTO.getDetails()
-                            && staticKnowledgeDTO.getDetails().size() > 0) {
-                        result.setHasStaticKnowledge(1);
-                    } else {
-                        result.setHasStaticKnowledge(0);
-                        result.setMessage(result.getMessage() + "缺少静态知识;");
-                    }
-                } catch (CommonException e) {
+                if (staticMap.containsKey(result.getName())) {
+                    result.setHasStaticKnowledge(1);
+                } else {
                     result.setHasStaticKnowledge(0);
                     result.setMessage(result.getMessage() + "缺少静态知识;");
-                } catch (Exception e) {
+                }
+            }
+            saveList.add(result);
+        }
+
+        //保存
+        saveResult(saveList, testVO, totleNum);
+        return true;
+    }
+
+    /**
+     * 量表静态知识测试
+     *
+     * @param file
+     * @param testVO
+     * @return
+     */
+    public Boolean scaleTest(MultipartFile file, StaticKnowledgeTestVO testVO) {
+        RunningInfoVO runningInfoVO = new RunningInfoVO();
+        runningInfoVO.setCaseId(testVO.getCaseId());
+        runningInfoVO.setHospitalId(testVO.getHospitalId());
+
+        String fileName = file.getOriginalFilename();
+        if (!(fileName.endsWith(".xls") || fileName.endsWith(".xlsx"))) {
+            //终止运行
+            runningInfoVO.setStatus(0);
+            runningInfoFacade.updateStatus(runningInfoVO);
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请导入正确的文件类型");
+        }
+
+        List<ResultStaticKnowledge> mappingList = Lists.newLinkedList();
+        List<ResultStaticKnowledge> saveList = Lists.newLinkedList();
+        Long hospitalId = testVO.getHospitalId();
+        Date now = DateUtil.now();
+
+        //从Excel读取数据
+        List<ScaleConfig> scaleConfigList = Lists.newLinkedList();
+        try {
+            scaleConfigList = ExcelUtils.importExcel(file, 0, 1, ScaleConfig.class);
+        } catch (CommonException e) {
+            if (!e.getErrorCode().equals(CommonErrorCode.OK)) {
+                //终止运行
+                runningInfoVO.setStatus(0);
+                runningInfoFacade.updateStatus(runningInfoVO);
+                throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请导入正确的文件格式");
+            }
+        }
+
+        Integer totleNum = 0;
+        if (ListUtil.isNotEmpty(scaleConfigList)) {
+            totleNum = scaleConfigList.size();
+        } else {
+            scaleConfigList = Lists.newLinkedList();
+        }
+
+        //数据预处理
+        for (ScaleConfig config : scaleConfigList) {
+            if (StringUtil.isNotBlank(config.getHisName())) {
+                config.setHisName(config.getHisName().trim());
+            }
+        }
+
+        // 已存在数据
+        Map<String, Map<String, Map<String, List<String>>>> hisConfigMap
+                = mappingConfigFacade.groupByHisNameWithName(null, ConceptTypeEnum.Scale.getKey(), Long.valueOf(hospitalId), StatusEnum.Enable.getKey());
+
+        //术语映射
+        for (ScaleConfig config : scaleConfigList) {
+            ResultStaticKnowledge result = new ResultStaticKnowledge();
+            result.setGmtCreate(now);
+            result.setGmtModified(now);
+            result.setMessage("");
+
+            if (StringUtil.isBlank(config.getHisName())) {
+                result.setMessage(result.getMessage() + "医院术语不允许为空;");
+                mappingList.add(result);
+                continue;
+            }
+            result.setHisName(config.getHisName());
+
+            if (hisConfigMap.containsKey(result.getHisName())) {
+                Map<String, List<String>> subMap = hisConfigMap.get(result.getHisName()).get("");
+                if (subMap != null && subMap.size() > 0) {
+                    for (String subKey : subMap.keySet()) {
+                        ResultStaticKnowledge subResult = new ResultStaticKnowledge();
+                        BeanUtil.copyProperties(result, subResult);
+                        subResult.setName(subKey);
+                        subResult.setHasStandName(1);
+                        mappingList.add(subResult);
+                    }
+                } else {
+                    result.setHasStandName(0);
+                    result.setMessage(result.getMessage() + "标准术语不存在;");
+                    mappingList.add(result);
+                }
+            } else {
+                result.setHasStandName(0);
+                result.setMessage(result.getMessage() + "标准术语不存在;");
+                mappingList.add(result);
+            }
+        }
+
+        //标准术语校验
+        List<String> uniqueNames = mappingList.stream()
+                .filter(i -> StringUtil.isNotBlank(i.getName()))
+                .map(i -> i.getName())
+                .distinct()
+                .collect(Collectors.toList());
+        ConceptVO conceptVO = new ConceptVO();
+        conceptVO.setSource(MatchSourceEnum.StandWord.getKey());
+        conceptVO.setStatus(StatusEnum.Enable.getKey());
+        conceptVO.setNames(uniqueNames);
+        conceptVO.setType(ConceptTypeEnum.Scale.getKey());
+        RespDTO<List<IndexBatchDTO>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
+        List<String> names = Lists.newLinkedList();
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            names = respDTO.data.stream().map(IndexBatchDTO::getName).collect(Collectors.toList());
+        }
+        for (ResultStaticKnowledge result : mappingList) {
+            if (result.getHasStandName() == null || result.getHasStandName().equals(0)) {
+                continue;
+            } else {
+                if (names.contains(result.getName())) {
+                    result.setHasStandName(1);
+                } else {
+                    result.setHasStandName(0);
+                    result.setMessage(result.getMessage() + "标准术语不存在;");
+                }
+            }
+        }
+
+        //验证静态知识
+        Map<String, List<StaticKnowledgeDTO>> staticMap = new HashMap<>();
+        List<String> conceptNames = mappingList.stream()
+                .filter(i -> i.getHasStandName() != null && i.getHasStandName().equals(1))
+                .map(ResultStaticKnowledge::getName)
+                .distinct()
+                .collect(Collectors.toList());
+        StaticKnowledgeListVO staticKnowledgeListVO = new StaticKnowledgeListVO();
+        staticKnowledgeListVO.setType(8);
+        staticKnowledgeListVO.setContentTypes(Arrays.asList(new Integer[] { 1 }));
+        staticKnowledgeListVO.setNames(conceptNames);
+        RespDTO<List<StaticKnowledgeDTO>> checkRespDTO = cdssCoreClient.getStaticKnowledgeList(staticKnowledgeListVO);
+        if (RespDTOUtil.respIsOK(checkRespDTO)) {
+            staticMap = checkRespDTO.data.stream().collect(Collectors.groupingBy(StaticKnowledgeDTO::getName));
+        }
+        for (ResultStaticKnowledge result : mappingList) {
+            //静态知识是否存在
+            if (result.getHasStandName() != null && result.getHasStandName().equals(1)) {
+                if (staticMap.containsKey(result.getName())) {
+                    result.setHasStaticKnowledge(1);
+                } else {
                     result.setHasStaticKnowledge(0);
                     result.setMessage(result.getMessage() + "缺少静态知识;");
                 }
@@ -898,6 +1048,159 @@ public class ResultStaticKnowledgeNeoFacade extends ResultStaticKnowledgeService
         return true;
     }
 
+    /**
+     * 护理静态知识测试
+     *
+     * @param file
+     * @param testVO
+     * @return
+     */
+    public Boolean nurseTest(MultipartFile file, StaticKnowledgeTestVO testVO) {
+        RunningInfoVO runningInfoVO = new RunningInfoVO();
+        runningInfoVO.setCaseId(testVO.getCaseId());
+        runningInfoVO.setHospitalId(testVO.getHospitalId());
+
+        String fileName = file.getOriginalFilename();
+        if (!(fileName.endsWith(".xls") || fileName.endsWith(".xlsx"))) {
+            //终止运行
+            runningInfoVO.setStatus(0);
+            runningInfoFacade.updateStatus(runningInfoVO);
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请导入正确的文件类型");
+        }
+
+        List<ResultStaticKnowledge> mappingList = Lists.newLinkedList();
+        List<ResultStaticKnowledge> saveList = Lists.newLinkedList();
+        Long hospitalId = testVO.getHospitalId();
+        Date now = DateUtil.now();
+
+        //从Excel读取数据
+        List<NurseConfig> nurseConfigList = Lists.newLinkedList();
+        try {
+            nurseConfigList = ExcelUtils.importExcel(file, 0, 1, NurseConfig.class);
+        } catch (CommonException e) {
+            if (!e.getErrorCode().equals(CommonErrorCode.OK)) {
+                //终止运行
+                runningInfoVO.setStatus(0);
+                runningInfoFacade.updateStatus(runningInfoVO);
+                throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请导入正确的文件格式");
+            }
+        }
+
+        Integer totleNum = 0;
+        if (ListUtil.isNotEmpty(nurseConfigList)) {
+            totleNum = nurseConfigList.size();
+        } else {
+            nurseConfigList = Lists.newLinkedList();
+        }
+
+        //数据预处理
+        for (NurseConfig config : nurseConfigList) {
+            if (StringUtil.isNotBlank(config.getHisName())) {
+                config.setHisName(config.getHisName().trim());
+            }
+        }
+
+        // 已存在数据
+        Map<String, Map<String, Map<String, List<String>>>> hisConfigMap
+                = mappingConfigFacade.groupByHisNameWithName(null, ConceptTypeEnum.Nurse.getKey(), Long.valueOf(hospitalId), StatusEnum.Enable.getKey());
+
+        //术语映射
+        for (NurseConfig config : nurseConfigList) {
+            ResultStaticKnowledge result = new ResultStaticKnowledge();
+            result.setGmtCreate(now);
+            result.setGmtModified(now);
+            result.setMessage("");
+
+            if (StringUtil.isBlank(config.getHisName())) {
+                result.setMessage(result.getMessage() + "医院术语不允许为空;");
+                mappingList.add(result);
+                continue;
+            }
+            result.setHisName(config.getHisName());
+
+            if (hisConfigMap.containsKey(result.getHisName())) {
+                Map<String, List<String>> subMap = hisConfigMap.get(result.getHisName()).get("");
+                if (subMap != null && subMap.size() > 0) {
+                    for (String subKey : subMap.keySet()) {
+                        ResultStaticKnowledge subResult = new ResultStaticKnowledge();
+                        BeanUtil.copyProperties(result, subResult);
+                        subResult.setName(subKey);
+                        subResult.setHasStandName(1);
+                        mappingList.add(subResult);
+                    }
+                } else {
+                    result.setHasStandName(0);
+                    result.setMessage(result.getMessage() + "标准术语不存在;");
+                    mappingList.add(result);
+                }
+            } else {
+                result.setHasStandName(0);
+                result.setMessage(result.getMessage() + "标准术语不存在;");
+                mappingList.add(result);
+            }
+        }
+
+        //标准术语校验
+        List<String> uniqueNames = mappingList.stream()
+                .filter(i -> StringUtil.isNotBlank(i.getName()))
+                .map(i -> i.getName())
+                .distinct()
+                .collect(Collectors.toList());
+        ConceptVO conceptVO = new ConceptVO();
+        conceptVO.setSource(MatchSourceEnum.StandWord.getKey());
+        conceptVO.setStatus(StatusEnum.Enable.getKey());
+        conceptVO.setNames(uniqueNames);
+        conceptVO.setType(ConceptTypeEnum.Nurse.getKey());
+        RespDTO<List<IndexBatchDTO>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
+        List<String> names = Lists.newLinkedList();
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            names = respDTO.data.stream().map(IndexBatchDTO::getName).collect(Collectors.toList());
+        }
+        for (ResultStaticKnowledge result : mappingList) {
+            if (result.getHasStandName() == null || result.getHasStandName().equals(0)) {
+                continue;
+            } else {
+                if (names.contains(result.getName())) {
+                    result.setHasStandName(1);
+                } else {
+                    result.setHasStandName(0);
+                    result.setMessage(result.getMessage() + "标准术语不存在;");
+                }
+            }
+        }
+
+        //验证静态知识
+        Map<String, List<StaticKnowledgeDTO>> staticMap = new HashMap<>();
+        List<String> conceptNames = mappingList.stream()
+                .filter(i -> i.getHasStandName() != null && i.getHasStandName().equals(1))
+                .map(ResultStaticKnowledge::getName)
+                .distinct()
+                .collect(Collectors.toList());
+        StaticKnowledgeListVO staticKnowledgeListVO = new StaticKnowledgeListVO();
+        staticKnowledgeListVO.setType(9);
+        staticKnowledgeListVO.setContentTypes(Arrays.asList(new Integer[] { 1 }));
+        staticKnowledgeListVO.setNames(conceptNames);
+        RespDTO<List<StaticKnowledgeDTO>> checkRespDTO = cdssCoreClient.getStaticKnowledgeList(staticKnowledgeListVO);
+        if (RespDTOUtil.respIsOK(checkRespDTO)) {
+            staticMap = checkRespDTO.data.stream().collect(Collectors.groupingBy(StaticKnowledgeDTO::getName));
+        }
+        for (ResultStaticKnowledge result : mappingList) {
+            //静态知识是否存在
+            if (result.getHasStandName() != null && result.getHasStandName().equals(1)) {
+                if (staticMap.containsKey(result.getName())) {
+                    result.setHasStaticKnowledge(1);
+                } else {
+                    result.setHasStaticKnowledge(0);
+                    result.setMessage(result.getMessage() + "缺少静态知识;");
+                }
+            }
+            saveList.add(result);
+        }
+
+        //保存
+        saveResult(saveList, testVO, totleNum);
+        return true;
+    }
 
     /**
      * 保存静态知识测试结果

+ 28 - 0
cdssman-service/src/main/java/com/diagbot/vo/StaticKnowledgeListVO.java

@@ -0,0 +1,28 @@
+package com.diagbot.vo;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2022/3/30 13:47
+ */
+@Data
+public class StaticKnowledgeListVO {
+    /**
+     * 标准术语名称
+     */
+    private List<String> names;
+    /**
+     * 术语类型
+     */
+    @NotNull(message = "请输入术语类型:1-诊断、2-药品、3-检验套餐、4-检验细项、5-检查、6-检查子项、7-手术和操作")
+    private Integer type;
+    /**
+     * 内容类型:1-化验、辅检、手术和操作、诊断、药品静态信息,2-注意事项,3-临床路径,4-治疗方案
+     */
+    private List<Integer> contentTypes;
+}

+ 5 - 1
cdssman-service/src/main/java/com/diagbot/web/StaticKnowledgeTestController.java

@@ -60,7 +60,7 @@ public class StaticKnowledgeTestController {
 
     @ApiOperation(value = "静态知识测试[zhaops]",
             notes = "hospitalId: 医院Id <br>" +
-                    " type:术语类型(1:诊断、2:检验、3:检查、4:药品、5:手术/操作)<br>" +
+                    " type:术语类型(1:诊断、2:检验、3:检查、4:药品、5:手术/操作、6:量表、7:护理)<br>" +
                     "caseId: 测试用例id<br>")
     @PostMapping("/staticKnowledgeTest")
     @SysLogger("staticKnowledgeTest")
@@ -89,6 +89,10 @@ public class StaticKnowledgeTestController {
             data = resultStaticKnowledgeNeoFacade.diseaseTest(file, testVO);
         } else if (type.equals(StaticKnowledgeEnum.Operation.getKey())) {
             data = resultStaticKnowledgeNeoFacade.operationTest(file, testVO);
+        } else if (type.equals(StaticKnowledgeEnum.Scale.getKey())) {
+            data = resultStaticKnowledgeNeoFacade.scaleTest(file, testVO);
+        } else if (type.equals(StaticKnowledgeEnum.Nurse.getKey())) {
+            data = resultStaticKnowledgeNeoFacade.nurseTest(file, testVO);
         }
         //结束运行
         runningInfoVO.setStatus(0);

+ 9 - 0
config-server/src/main/resources/shared/cdssman-service-dev.yml

@@ -133,6 +133,15 @@ hystrix.command.CdssClient#precDataMatch_remote(MultipartFile,Integer).execution
 hystrix.command.CdssClient#importExcelDataVerify(MultipartFile,Long,Integer,String).execution.isolation.thread.timeoutInMilliseconds: 3600000
 #远程调用导入接口时间加长
 hystrix.command.CdssClient#importExcel_remote(MultipartFile,Long,Integer,String).execution.isolation.thread.timeoutInMilliseconds: 3600000
+#远程调用批量校验静态信息是否存在接口时间加长
+hystrix.command.CdssCoreClient#getStaticKnowledgeList(StaticKnowledgeListVO).execution.isolation.thread.timeoutInMilliseconds: 3600000
+
+feign:
+  client:
+    config:
+      cdss-core:
+        connectTimeout: 500000
+        readTimeout: 400000
 
 io.github.lvyahui8.spring:
   base-packages: com.diagbot.aggregate

+ 8 - 0
config-server/src/main/resources/shared/cdssman-service-local.yml

@@ -132,7 +132,15 @@ hystrix.command.CdssClient#precDataMatch_remote(MultipartFile,Integer).execution
 hystrix.command.CdssClient#importExcelDataVerify(MultipartFile,Long,Integer,String).execution.isolation.thread.timeoutInMilliseconds: 3600000
 #远程调用导入接口时间加长
 hystrix.command.CdssClient#importExcel_remote(MultipartFile,Long,Integer,String).execution.isolation.thread.timeoutInMilliseconds: 3600000
+#远程调用批量校验静态信息是否存在接口时间加长
+hystrix.command.CdssCoreClient#getStaticKnowledgeList(StaticKnowledgeListVO).execution.isolation.thread.timeoutInMilliseconds: 3600000
 
+feign:
+  client:
+    config:
+      cdss-core:
+        connectTimeout: 500000
+        readTimeout: 400000
 
 io.github.lvyahui8.spring:
   base-packages: com.diagbot.aggregate

+ 9 - 0
config-server/src/main/resources/shared/cdssman-service-pre.yml

@@ -133,6 +133,15 @@ hystrix.command.CdssClient#precDataMatch_remote(MultipartFile,Integer).execution
 hystrix.command.CdssClient#importExcelDataVerify(MultipartFile,Long,Integer,String).execution.isolation.thread.timeoutInMilliseconds: 3600000
 #远程调用导入接口时间加长
 hystrix.command.CdssClient#importExcel_remote(MultipartFile,Long,Integer,String).execution.isolation.thread.timeoutInMilliseconds: 3600000
+#远程调用批量校验静态信息是否存在接口时间加长
+hystrix.command.CdssCoreClient#getStaticKnowledgeList(StaticKnowledgeListVO).execution.isolation.thread.timeoutInMilliseconds: 3600000
+
+feign:
+  client:
+    config:
+      cdss-core:
+        connectTimeout: 500000
+        readTimeout: 400000
 
 io.github.lvyahui8.spring:
   base-packages: com.diagbot.aggregate

+ 9 - 0
config-server/src/main/resources/shared/cdssman-service-pro.yml

@@ -133,6 +133,15 @@ hystrix.command.CdssClient#precDataMatch_remote(MultipartFile,Integer).execution
 hystrix.command.CdssClient#importExcelDataVerify(MultipartFile,Long,Integer,String).execution.isolation.thread.timeoutInMilliseconds: 3600000
 #远程调用导入接口时间加长
 hystrix.command.CdssClient#importExcel_remote(MultipartFile,Long,Integer,String).execution.isolation.thread.timeoutInMilliseconds: 3600000
+#远程调用批量校验静态信息是否存在接口时间加长
+hystrix.command.CdssCoreClient#getStaticKnowledgeList(StaticKnowledgeListVO).execution.isolation.thread.timeoutInMilliseconds: 3600000
+
+feign:
+  client:
+    config:
+      cdss-core:
+        connectTimeout: 500000
+        readTimeout: 400000
 
 io.github.lvyahui8.spring:
   base-packages: com.diagbot.aggregate

+ 9 - 0
config-server/src/main/resources/shared/cdssman-service-test.yml

@@ -133,6 +133,15 @@ hystrix.command.CdssClient#precDataMatch_remote(MultipartFile,Integer).execution
 hystrix.command.CdssClient#importExcelDataVerify(MultipartFile,Long,Integer,String).execution.isolation.thread.timeoutInMilliseconds: 3600000
 #远程调用导入接口时间加长
 hystrix.command.CdssClient#importExcel_remote(MultipartFile,Long,Integer,String).execution.isolation.thread.timeoutInMilliseconds: 3600000
+#远程调用批量校验静态信息是否存在接口时间加长
+hystrix.command.CdssCoreClient#getStaticKnowledgeList(StaticKnowledgeListVO).execution.isolation.thread.timeoutInMilliseconds: 3600000
+
+feign:
+  client:
+    config:
+      cdss-core:
+        connectTimeout: 500000
+        readTimeout: 400000
 
 io.github.lvyahui8.spring:
   base-packages: com.diagbot.aggregate