|
@@ -1,16 +1,21 @@
|
|
|
package com.diagbot.facade;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.diagbot.client.AiptServiceClient;
|
|
|
import com.diagbot.dto.ModuleDetailDTO;
|
|
|
import com.diagbot.dto.ModuleInfoDTO;
|
|
|
import com.diagbot.dto.QuestionDTO;
|
|
|
+import com.diagbot.dto.RespDTO;
|
|
|
import com.diagbot.entity.ModuleDetail;
|
|
|
import com.diagbot.entity.ModuleInfo;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
+import com.diagbot.enums.QuestionTypeEnum;
|
|
|
import com.diagbot.service.impl.ModuleInfoServiceImpl;
|
|
|
import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.EntityUtil;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
+import com.diagbot.util.RespDTOUtil;
|
|
|
+import com.diagbot.vo.ConceptSearchVO;
|
|
|
import com.diagbot.vo.ModuleVO;
|
|
|
import com.diagbot.vo.QuestionVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -35,6 +40,8 @@ public class ModuleFacade extends ModuleInfoServiceImpl {
|
|
|
ModuleDetailFacade moduleDetailFacade;
|
|
|
@Autowired
|
|
|
QuestionFacade questionFacade;
|
|
|
+ @Autowired
|
|
|
+ AiptServiceClient aiptServiceClient;
|
|
|
|
|
|
/**
|
|
|
* 返回所有的模型结构
|
|
@@ -42,10 +49,13 @@ public class ModuleFacade extends ModuleInfoServiceImpl {
|
|
|
* @return 模型结构
|
|
|
*/
|
|
|
public List<ModuleInfoDTO> getAll(ModuleVO moduleVO) {
|
|
|
+ ConceptSearchVO conceptSearchVO = new ConceptSearchVO();
|
|
|
List<ModuleInfoDTO> data = new ArrayList<>();
|
|
|
//取到所有模板信息
|
|
|
List<ModuleInfo> list = new ArrayList<>();
|
|
|
List<Long> ids = new ArrayList<>();
|
|
|
+ List<Long> lisConceptIds = new ArrayList<>();//化验名称列表
|
|
|
+ List<Long> pacsConceptIds = new ArrayList<>();//辅检名称列表
|
|
|
Boolean isDefault = false;
|
|
|
if (moduleVO.getMouduleType().intValue() == 1) {
|
|
|
//根据科室筛选如果没有,返回通用模板
|
|
@@ -60,13 +70,9 @@ public class ModuleFacade extends ModuleInfoServiceImpl {
|
|
|
} else if (moduleVO.getMouduleType().intValue() == 2) {
|
|
|
//根据慢病筛选如果没有返回通用模板
|
|
|
list = getModuleInfoByDisType(moduleVO.getMouduleType(), moduleVO.getRelationId());
|
|
|
- //if (ListUtil.isNotEmpty(list)) {
|
|
|
ids = list.stream()
|
|
|
.map(moduleDeptMapping -> moduleDeptMapping.getId())
|
|
|
.collect(Collectors.toList());
|
|
|
- //} else {
|
|
|
- //isDefault = true;
|
|
|
- //}
|
|
|
} else {
|
|
|
isDefault = true;
|
|
|
}
|
|
@@ -96,11 +102,16 @@ public class ModuleFacade extends ModuleInfoServiceImpl {
|
|
|
|
|
|
}
|
|
|
//循环放入模板明细
|
|
|
+ List<ModuleDetailDTO> moduleDetailDTOList = new ArrayList<>();
|
|
|
for (ModuleInfoDTO bean : data) {
|
|
|
if (moduleDetailMap.get(bean.getId()) != null) {
|
|
|
- List<ModuleDetailDTO> moduleDetailDTOList = BeanUtil.listCopyTo(moduleDetailMap.get(bean.getId()), ModuleDetailDTO.class);
|
|
|
+ moduleDetailDTOList = BeanUtil.listCopyTo(moduleDetailMap.get(bean.getId()), ModuleDetailDTO.class);
|
|
|
for (ModuleDetailDTO detailDTO : moduleDetailDTOList) {
|
|
|
- if (null != detailDTO.getQuestionId()) {
|
|
|
+ if(Integer.parseInt(bean.getType()) == 5){
|
|
|
+ lisConceptIds.add(detailDTO.getQuestionId());
|
|
|
+ }else if(Integer.parseInt(bean.getType()) == 6){
|
|
|
+ pacsConceptIds.add(detailDTO.getQuestionId());
|
|
|
+ }else if (null != detailDTO.getQuestionId()) {
|
|
|
QuestionVO questionVO = new QuestionVO();
|
|
|
questionVO.setId(detailDTO.getQuestionId());
|
|
|
questionVO.setSexType(moduleVO.getSexType());
|
|
@@ -115,6 +126,36 @@ public class ModuleFacade extends ModuleInfoServiceImpl {
|
|
|
bean.setModuleDetailDTOList(moduleDetailDTOList);
|
|
|
}
|
|
|
}
|
|
|
+ RespDTO<Map<Long,String>> lisRespDTO = null;
|
|
|
+ RespDTO<Map<Long,String>> pacsRespDTO = null;
|
|
|
+ //化验
|
|
|
+ if(ListUtil.isNotEmpty(lisConceptIds)){
|
|
|
+ conceptSearchVO = new ConceptSearchVO();
|
|
|
+ conceptSearchVO.setConceptIds(lisConceptIds);
|
|
|
+ lisRespDTO = aiptServiceClient.getConceptMap(conceptSearchVO);
|
|
|
+ RespDTOUtil.respNGDeal(lisRespDTO,"获取化验标签失败");
|
|
|
+ }
|
|
|
+ //辅检
|
|
|
+ if(ListUtil.isNotEmpty(pacsConceptIds)){
|
|
|
+ conceptSearchVO = new ConceptSearchVO();
|
|
|
+ conceptSearchVO.setConceptIds(pacsConceptIds);
|
|
|
+ pacsRespDTO = aiptServiceClient.getConceptMap(conceptSearchVO);
|
|
|
+ RespDTOUtil.respNGDeal(pacsRespDTO,"获取辅检标签失败");
|
|
|
+ }
|
|
|
+ //将化验辅检标签放入出参
|
|
|
+ for (ModuleInfoDTO bean : data) {
|
|
|
+ if (moduleDetailMap.get(bean.getId()) != null) {
|
|
|
+ for (ModuleDetailDTO detailDTO : moduleDetailDTOList) {
|
|
|
+ if (Integer.parseInt(bean.getType()) == QuestionTypeEnum.Lis.getKey() && lisRespDTO.data != null) {
|
|
|
+ detailDTO.setName(lisRespDTO.data.get(detailDTO.getQuestionId()));
|
|
|
+ }
|
|
|
+ if (Integer.parseInt(bean.getType()) == QuestionTypeEnum.Pacs.getKey() && pacsRespDTO.data != null) {
|
|
|
+ detailDTO.setName(pacsRespDTO.data.get(detailDTO.getQuestionId()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ bean.setModuleDetailDTOList(moduleDetailDTOList);
|
|
|
+ }
|
|
|
+ }
|
|
|
return data;
|
|
|
}
|
|
|
|