소스 검색

智能预问诊模板分页查询

wangyu 6 년 전
부모
커밋
70479abfe3

+ 51 - 0
precman-service/src/main/java/com/diagbot/enums/ModuleTypeEnum.java

@@ -0,0 +1,51 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * @Description: 
+ * @Author: wangyu
+ * @Date: 13:41 2019/3/28
+ */
+public enum ModuleTypeEnum implements KeyedNamed {
+    Symptoms(1, "症状情况"),
+    DiagnosisAndTreatment(2, "诊疗情况"),
+    OtherMedicalHistory(3, "其他病史"),
+    SupplementaryContents(4, "补充内容");
+
+    @Setter
+    private Integer key;
+
+    @Setter
+    private String name;
+
+    ModuleTypeEnum(Integer key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static ModuleTypeEnum getEnum(Integer key) {
+        for (ModuleTypeEnum item : ModuleTypeEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(Integer key) {
+        ModuleTypeEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}

+ 2 - 131
precman-service/src/main/java/com/diagbot/facade/ModuleInfoFacade.java

@@ -11,9 +11,7 @@ import com.diagbot.dto.GetAllDeptAndDisInfoDTO;
 import com.diagbot.dto.GetModuleDetailInfoDTO;
 import com.diagbot.dto.GetModuleInfoOneDTO;
 import com.diagbot.dto.GetModuleTypeDTO;
-import com.diagbot.dto.GetQuestionInfoDTO;
 import com.diagbot.dto.GetQuestiongAndModuleRelationsDTO;
-import com.diagbot.dto.ModuleInfoDTO;
 import com.diagbot.dto.ModuleInfoListDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.DictionaryInfo;
@@ -22,6 +20,7 @@ import com.diagbot.entity.ModuleInfo;
 import com.diagbot.entity.QuestionInfo;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.enums.ModuleInfoTypeEnum;
+import com.diagbot.enums.ModuleTypeEnum;
 import com.diagbot.enums.QuestionTypeEnum;
 import com.diagbot.service.impl.ModuleInfoServiceImpl;
 import com.diagbot.util.BeanUtil;
@@ -38,7 +37,6 @@ import com.diagbot.vo.GetModuleInfoOneVO;
 import com.diagbot.vo.GetModuleInfoVO;
 import com.diagbot.vo.GetModuleTypeVO;
 import com.diagbot.vo.GetQuestiongAndModuleRelationsVO;
-import com.diagbot.vo.ModuleGetQuestionInfoVO;
 import com.diagbot.vo.UpdateModuleInfoVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
@@ -166,99 +164,6 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
         return moduleDetailFacade.saveOrUpdateInfos(addModuleInfoVO, updateModuleInfoVO.getId());
     }
 
-    /**
-     * 获取标签池信息
-     *
-     * @param moduleGetQuestionInfoVO
-     * @return
-     */
-    public List<GetQuestionInfoDTO> getQuestionInfos(ModuleGetQuestionInfoVO moduleGetQuestionInfoVO) {
-        List<GetQuestionInfoDTO> getQuestionInfoDTOS = new ArrayList<>();
-        GetQuestionInfoDTO getQuestionInfoDTO = new GetQuestionInfoDTO();
-        //如果是辅检,调用aipt-获取概念信息
-        if(moduleGetQuestionInfoVO.getType().intValue() == QuestionTypeEnum.Pacs.getKey()){
-            getQuestionInfoDTOS = new ArrayList<>();
-            ConceptTypeVO conceptTypeVO = new ConceptTypeVO();
-            conceptTypeVO.setType(2);
-            RespDTO<List<ConceptBaseDTO>> conceptBaseDTOS = knowledgemanServiceClient.getConceptListByType(conceptTypeVO);
-            RespDTOUtil.respNGDeal(conceptBaseDTOS,"获取辅检标签失败");
-            if(ListUtil.isNotEmpty(moduleGetQuestionInfoVO.getNoIds())){
-                Iterator<ConceptBaseDTO> conceptBaseDTOIterator = conceptBaseDTOS.data.iterator();
-                while (conceptBaseDTOIterator.hasNext()){
-                    for (Long notId : moduleGetQuestionInfoVO.getNoIds()) {
-                        if(conceptBaseDTOIterator.next().getConceptId().intValue() == notId.intValue()){
-                            conceptBaseDTOIterator.remove();
-                        }
-                    }
-                }
-            }
-            for (ConceptBaseDTO conceptBaseDTO : conceptBaseDTOS.data) {
-                getQuestionInfoDTO = new GetQuestionInfoDTO();
-                getQuestionInfoDTO.setId(conceptBaseDTO.getConceptId());
-                getQuestionInfoDTO.setTagName(conceptBaseDTO.getName());
-                getQuestionInfoDTOS.add(getQuestionInfoDTO);
-            }
-        }else {//返回除辅检以外的questionInfo信息
-            getQuestionInfoDTOS = new ArrayList<>();
-            getQuestionInfoDTOS = questionFacade.moduleGetQuestiongInfoByName(moduleGetQuestionInfoVO);
-        }
-
-        return getQuestionInfoDTOS;
-    }
-
-    /**
-     * 获取子模板
-     *
-     * @param getModuleInfoVO
-     * @return
-     */
-    public List<ModuleInfoDTO> getModuleInfo(GetModuleInfoVO getModuleInfoVO) {
-        //获取模板信息
-        QueryWrapper<ModuleInfo> moduleInfoQueryWrapper = new QueryWrapper<>();
-        moduleInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
-        if (getModuleInfoVO.getModuleType() != null) {
-            moduleInfoQueryWrapper.eq("module_type", getModuleInfoVO.getModuleType());
-        }
-        if(getModuleInfoVO.getType() != null) {
-            moduleInfoQueryWrapper.eq("type", getModuleInfoVO.getType());
-        }
-        if(ListUtil.isNotEmpty(getModuleInfoVO.getNoIds())){
-            moduleInfoQueryWrapper.notIn("id", getModuleInfoVO.getNoIds());
-        }
-        if(getModuleInfoVO.getRelationId() != null) {
-            moduleInfoQueryWrapper.eq("relation_id", getModuleInfoVO.getRelationId());
-        }
-        List<ModuleInfo> moduleInfoList = this.list(moduleInfoQueryWrapper);
-        List<Long> moduleIdList = moduleInfoList.stream().map(m -> m.getId()).collect(Collectors.toList());
-        //获取模板明细信息
-        QueryWrapper<ModuleDetail> moduleDetailQueryWrapper = new QueryWrapper<>();
-        moduleDetailQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .in("module_id", moduleIdList);
-        List<ModuleDetail> moduleDetailList = moduleDetailFacade.list(moduleDetailQueryWrapper);
-        //将模板明细根据模板id放入map
-        Map<Long, List<ModuleDetail>> moduleDetailMap = new HashMap<>();
-        List<ModuleDetail> allModuleDetials = null;
-        for (ModuleInfo moduleInfo : moduleInfoList) {
-            allModuleDetials = new ArrayList<>();
-            for (ModuleDetail moduleDetail : moduleDetailList) {
-                if (moduleInfo.getId().longValue() == moduleDetail.getModuleId().longValue()) {
-                    allModuleDetials.add(moduleDetail);
-                }
-            }
-            moduleDetailMap.put(moduleInfo.getId(), allModuleDetials);
-        }
-        //给ModuleInfoDTO设值
-        List<ModuleInfoDTO> moduleInfoDTOList = new ArrayList<>();
-        ModuleInfoDTO moduleInfoDTO = null;
-        for (ModuleInfo moduleInfo : moduleInfoList) {
-            moduleInfoDTO = new ModuleInfoDTO();
-            moduleInfoDTO.setId(moduleInfo.getId());
-            moduleInfoDTO.setName(moduleInfo.getName());
-            moduleInfoDTO.setModuleDetails(moduleDetailMap.get(moduleInfoDTO.getId()));
-            moduleInfoDTOList.add(moduleInfoDTO);
-        }
-        return moduleInfoDTOList;
-    }
 
     /**
      * 模板维护页面获取模板列表
@@ -271,15 +176,11 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
         IPage<ModuleInfoListDTO> moduleInfoDTOIPage = this.getModuleInfoListByType(getModuleInfoVO);
         List<String> ids = new ArrayList<>();
         List<Long> deptId = new ArrayList<>();
-        List<Long> disId = new ArrayList<>();
         for (ModuleInfoListDTO moduleInfoListDTO : moduleInfoDTOIPage.getRecords()) {
             ids.add(moduleInfoListDTO.getModifier());
             if(moduleInfoListDTO.getModuleType().intValue() == 1){
                 deptId.add(moduleInfoListDTO.getRelationId());
             }
-            if(moduleInfoListDTO.getModuleType().intValue() == 2){
-                disId.add(moduleInfoListDTO.getRelationId());
-            }
         }
         //获取科室名称
         ConceptTypeVO conceptTypeVO = new ConceptTypeVO();
@@ -287,25 +188,6 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
         RespDTO<List<ConceptBaseDTO>> deptInfoList = knowledgemanServiceClient.getConceptListByType(conceptTypeVO);
         RespDTOUtil.respNGDeal(deptInfoList,"获取科室信息失败");
         Map<Long, ConceptBaseDTO> deptInfoMap = deptInfoList.data.stream().collect(Collectors.toMap(ConceptBaseDTO::getConceptId,conceptBaseDTO -> conceptBaseDTO));
-        //获取疾病名称
-        conceptTypeVO = new ConceptTypeVO();
-        conceptTypeVO.setType(3);
-        RespDTO<List<ConceptBaseDTO>> disInfoList = knowledgemanServiceClient.getConceptListByType(conceptTypeVO);
-        RespDTOUtil.respNGDeal(disInfoList,"获取疾病信息失败");
-        Map<Long, ConceptBaseDTO> disInfoMap = disInfoList.data.stream().collect(Collectors.toMap(ConceptBaseDTO::getConceptId,conceptBaseDTO -> conceptBaseDTO));
-        /*QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
-        questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .in("id", disId);
-        List<QuestionInfo> questionInfoList = questionFacade.list(questionInfoQueryWrapper);
-        Map<Long, QuestionInfo> questionInfoMap = questionInfoList.stream().collect(Collectors.toMap(QuestionInfo::getId,questionInfo -> questionInfo));*/
-        //获取模板类型名称
-        QueryWrapper<DictionaryInfo> dictionaryInfoQueryWrapper = new QueryWrapper<>();
-        dictionaryInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("group_type", 4)
-                .eq("return_type", 1)
-                .orderByDesc("order_no");
-        List<DictionaryInfo> dictionaryInfoList = dictionaryFacade.list(dictionaryInfoQueryWrapper);
-        Map<String, DictionaryInfo> dictionaryInfoMap = dictionaryInfoList.stream().collect(Collectors.toMap(DictionaryInfo::getVal,dictionaryInfo -> dictionaryInfo));
         if(ListUtil.isNotEmpty(moduleInfoDTOIPage.getRecords())){
             //获取用户信息
             RespDTO<Map<String, String>> respDTO = userServiceClient.getUserInfoByIds(ids);
@@ -313,9 +195,7 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
             //将用户信息放入实体
             for (ModuleInfoListDTO moduleInfoListDTO : moduleInfoDTOIPage.getRecords()) {
                 moduleInfoListDTO.setUserName(respDTO.data.get(moduleInfoListDTO.getModifier()));
-                if(dictionaryInfoMap.get(moduleInfoListDTO.getType()) != null ){
-                    moduleInfoListDTO.setAscriptionName(dictionaryInfoMap.get(moduleInfoListDTO.getType()).getName());
-                }
+                moduleInfoListDTO.setAscriptionName(ModuleTypeEnum.getName(Integer.parseInt(moduleInfoListDTO.getType())));
                 if(moduleInfoListDTO.getModuleType().intValue() == 1){//根据科室
                     if(moduleInfoListDTO.getRelationId().intValue() != -1){//判断是不是科室通用子模板
                         if(null != deptInfoMap.get(moduleInfoListDTO.getRelationId())){
@@ -325,15 +205,6 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
                         moduleInfoListDTO.setRelationName(ModuleInfoTypeEnum.Common.getName());
                     }
                 }
-                if(moduleInfoListDTO.getModuleType().intValue() == 2){//根据疾病
-                    if(moduleInfoListDTO.getRelationId().intValue() != -1){//判断是不是疾病通用子模板
-                        if(null != disInfoMap.get(moduleInfoListDTO.getRelationId())){
-                            moduleInfoListDTO.setRelationName(disInfoMap.get(moduleInfoListDTO.getRelationId()).getName());
-                        }
-                    }else {
-                        moduleInfoListDTO.setRelationName(ModuleInfoTypeEnum.Common.getName());
-                    }
-                }
                 moduleInfoListDTO.setModuleTypeName(ModuleInfoTypeEnum.getName(moduleInfoListDTO.getModuleType().intValue()));
             }
         }

+ 0 - 27
precman-service/src/main/java/com/diagbot/web/ModuleInfoController.java

@@ -7,9 +7,7 @@ import com.diagbot.dto.GetAllDeptAndDisInfoDTO;
 import com.diagbot.dto.GetModuleDetailInfoDTO;
 import com.diagbot.dto.GetModuleInfoOneDTO;
 import com.diagbot.dto.GetModuleTypeDTO;
-import com.diagbot.dto.GetQuestionInfoDTO;
 import com.diagbot.dto.GetQuestiongAndModuleRelationsDTO;
-import com.diagbot.dto.ModuleInfoDTO;
 import com.diagbot.dto.ModuleInfoListDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.facade.ModuleInfoFacade;
@@ -21,7 +19,6 @@ import com.diagbot.vo.GetModuleInfoOneVO;
 import com.diagbot.vo.GetModuleInfoVO;
 import com.diagbot.vo.GetModuleTypeVO;
 import com.diagbot.vo.GetQuestiongAndModuleRelationsVO;
-import com.diagbot.vo.ModuleGetQuestionInfoVO;
 import com.diagbot.vo.UpdateModuleInfoVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -98,30 +95,6 @@ public class ModuleInfoController {
         return RespDTO.onSuc(true);
     }
 
-    @ApiOperation(value = "获取标签池信息[by:wangyu]",
-            notes = "tagName: 标签名<br>" +
-                    "moduleId: 模板id,添加时不用填,修改时必填<br>" +
-                    "type: 标签归属类型,必填<br>" +
-                    "noIds: 要去重的id")
-    @PostMapping("/getQuestionInfos")
-    @SysLogger("getQuestionInfos")
-    public RespDTO<List<GetQuestionInfoDTO>> getQuestionInfos(@Valid @RequestBody ModuleGetQuestionInfoVO moduleGetQuestionInfoVO) {
-        List<GetQuestionInfoDTO> date = moduleInfoFacade.getQuestionInfos(moduleGetQuestionInfoVO);
-        return RespDTO.onSuc(date);
-    }
-
-    @ApiOperation(value = "2期-获取模板信息(作为子模板使用时传入type时需3+模板自己的type)[by:wangyu]",
-            notes = "moduleType: 模板类型,0.通用 1.根据科室划分 2.慢病<br>" +
-                    "type: 模板归属<br>" +
-                    "relationId: 关联id<br>" +
-                    "noIds: 要去重的子模板")
-    @PostMapping("/getModuleInfo")
-    @SysLogger("getModuleInfo")
-    public RespDTO<List<ModuleInfoDTO>> getModuleInfo(@Valid @RequestBody GetModuleInfoVO getModuleInfoVO) {
-        List<ModuleInfoDTO> date = moduleInfoFacade.getModuleInfo(getModuleInfoVO);
-        return RespDTO.onSuc(date);
-    }
-
     @ApiOperation(value = "2期-获取模板列表(主页面查询)[by:wangyu]",
             notes = "type: 模板类型,1.主诉 2.现病史 3.其他史 4.查体 5.化验 6.辅检 7.诊断 8.医嘱<br>" +
                     "moduleType: 模板类型,0.通用 1.根据科室划分 2.慢病<br>" +