|
@@ -1,8 +1,10 @@
|
|
package com.diagbot.facade;
|
|
package com.diagbot.facade;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
-import com.diagbot.dto.EMRIntroduceDTO;
|
|
|
|
|
|
+import com.diagbot.client.TranServiceClient;
|
|
|
|
+import com.diagbot.dto.EMRIntroduceDetailDTO;
|
|
import com.diagbot.dto.IntroduceDTO;
|
|
import com.diagbot.dto.IntroduceDTO;
|
|
|
|
+import com.diagbot.dto.RespDTO;
|
|
import com.diagbot.entity.IntroduceDetail;
|
|
import com.diagbot.entity.IntroduceDetail;
|
|
import com.diagbot.entity.IntroduceInfo;
|
|
import com.diagbot.entity.IntroduceInfo;
|
|
import com.diagbot.entity.IntroduceMap;
|
|
import com.diagbot.entity.IntroduceMap;
|
|
@@ -15,12 +17,14 @@ import com.diagbot.service.impl.IntroduceInfoServiceImpl;
|
|
import com.diagbot.util.BeanUtil;
|
|
import com.diagbot.util.BeanUtil;
|
|
import com.diagbot.util.StringUtil;
|
|
import com.diagbot.util.StringUtil;
|
|
import com.diagbot.vo.EMRIntroduceVO;
|
|
import com.diagbot.vo.EMRIntroduceVO;
|
|
|
|
+import com.diagbot.vo.HosCodeVO;
|
|
import com.diagbot.vo.IntroduceByQuestionVO;
|
|
import com.diagbot.vo.IntroduceByQuestionVO;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @Description:
|
|
* @Description:
|
|
@@ -35,6 +39,8 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
|
|
IntroduceDetailFacade introduceDetailFacade;
|
|
IntroduceDetailFacade introduceDetailFacade;
|
|
@Autowired
|
|
@Autowired
|
|
QuestionFacade questionFacade;
|
|
QuestionFacade questionFacade;
|
|
|
|
+ @Autowired
|
|
|
|
+ TranServiceClient tranServiceClient;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 根据标签id获取提示信息
|
|
* 根据标签id获取提示信息
|
|
@@ -145,20 +151,61 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
|
|
* @param emrIntroduceVO
|
|
* @param emrIntroduceVO
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public List<EMRIntroduceDTO> getIntroduceByEMR(EMRIntroduceVO emrIntroduceVO) {
|
|
|
|
|
|
+ public List<EMRIntroduceDetailDTO> getIntroduceByEMR(EMRIntroduceVO emrIntroduceVO) {
|
|
|
|
+ //入参处理
|
|
|
|
+ HosCodeVO hosCodeVO = new HosCodeVO();
|
|
|
|
+ hosCodeVO.setHosCode(emrIntroduceVO.getHosCode());
|
|
|
|
+ //公表转换
|
|
|
|
+ String uniqueName = "";
|
|
|
|
+ Integer type = emrIntroduceVO.getType();
|
|
|
|
+ if (type.equals(QuestionTypeEnum.Lis.getKey())) {
|
|
|
|
+ if (StringUtil.isNotBlank(emrIntroduceVO.getMealName()))
|
|
|
|
+ if (StringUtil.isNotBlank(emrIntroduceVO.getItemName())) {
|
|
|
|
+ RespDTO<Map<String, Map<String, String>>> respLisConfigMap = tranServiceClient.getLisConfigByHosCode_NotEmptyItemName(hosCodeVO);
|
|
|
|
+ Map<String, Map<String, String>> lisConfigMap = respLisConfigMap.data;
|
|
|
|
+ uniqueName = lisConfigMap.get(emrIntroduceVO.getMealName()).get(emrIntroduceVO.getItemName());
|
|
|
|
+ } else {
|
|
|
|
+ RespDTO<Map<String, String>> respLisConfigMap_emptyItemName = tranServiceClient.getLisConfigByHosCode_EmptyItemName(hosCodeVO);
|
|
|
|
+ Map<String, String> lisConfigMap_emptyItemName = respLisConfigMap_emptyItemName.data;
|
|
|
|
+ uniqueName = lisConfigMap_emptyItemName.get(emrIntroduceVO.getMealName());
|
|
|
|
+ }
|
|
|
|
+ } else if (type.equals(QuestionTypeEnum.Pacs.getKey())) {
|
|
|
|
+ RespDTO<Map<String, String>> respPacsConfigMap = tranServiceClient.getPacsConfigByHosCode(hosCodeVO);
|
|
|
|
+ Map<String, String> pacsConfigMap = respPacsConfigMap.data;
|
|
|
|
+ uniqueName = pacsConfigMap.get(emrIntroduceVO.getMealName());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //未找到公表映射项目
|
|
|
|
+ if (uniqueName == null || StringUtil.isBlank(uniqueName)) {
|
|
|
|
+ throw new CommonException(CommonErrorCode.NOT_EXISTS, "项目未找到");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ RespDTO<Map<String, String>> respTitleMappingMap = tranServiceClient.getTitleMappingHosCode(hosCodeVO);
|
|
|
|
+ Map<String, String> titleMappingMap = respTitleMappingMap.data;
|
|
|
|
+ String[] titles = emrIntroduceVO.getTitles();
|
|
|
|
+ List<String> uniqueTitleList = Lists.newLinkedList();
|
|
|
|
+ if (titles.length > 0) {
|
|
|
|
+ for (String title : titles) {
|
|
|
|
+ String uniqueTitle = titleMappingMap.get(title);
|
|
|
|
+ if (StringUtil.isNotBlank(uniqueTitle)) {
|
|
|
|
+ uniqueTitleList.add(uniqueTitle);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<QuestionInfo> questionInfoQueryWrapper = new QueryWrapper<>();
|
|
questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
questionInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
- .eq("tag_name", emrIntroduceVO.getName())
|
|
|
|
- .eq("type", emrIntroduceVO.getType());
|
|
|
|
|
|
+ .eq("tag_name", uniqueName)
|
|
|
|
+ .eq("type", type);
|
|
QuestionInfo questionInfo = questionFacade.getOne(questionInfoQueryWrapper);
|
|
QuestionInfo questionInfo = questionFacade.getOne(questionInfoQueryWrapper);
|
|
if (questionInfo == null) {
|
|
if (questionInfo == null) {
|
|
- throw new CommonException(CommonErrorCode.NOT_EXISTS, "标签不存在");
|
|
|
|
|
|
+ throw new CommonException(CommonErrorCode.NOT_EXISTS, "公表标签不存在");
|
|
}
|
|
}
|
|
|
|
|
|
QueryWrapper<IntroduceMap> introduceMapQueryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<IntroduceMap> introduceMapQueryWrapper = new QueryWrapper<>();
|
|
introduceMapQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).
|
|
introduceMapQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).
|
|
eq("question_id", questionInfo.getId()).
|
|
eq("question_id", questionInfo.getId()).
|
|
- eq("type", emrIntroduceVO.getType());
|
|
|
|
|
|
+ eq("type", type);
|
|
IntroduceMap introduceMap = introduceMapFacade.getOne(introduceMapQueryWrapper);
|
|
IntroduceMap introduceMap = introduceMapFacade.getOne(introduceMapQueryWrapper);
|
|
if (introduceMap == null) {
|
|
if (introduceMap == null) {
|
|
throw new CommonException(CommonErrorCode.NOT_EXISTS, "提示信息未维护");
|
|
throw new CommonException(CommonErrorCode.NOT_EXISTS, "提示信息未维护");
|
|
@@ -168,11 +215,11 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
|
|
introduceDetailQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).
|
|
introduceDetailQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).
|
|
eq("introduce_id", introduceMap.getIntroduceId()).orderByAsc("order_no");
|
|
eq("introduce_id", introduceMap.getIntroduceId()).orderByAsc("order_no");
|
|
//如果标题不为空,按标题返回,否则,全部返回
|
|
//如果标题不为空,按标题返回,否则,全部返回
|
|
- if (emrIntroduceVO.getTitles().length > 0) {
|
|
|
|
- introduceDetailQueryWrapper.in("title", emrIntroduceVO.getTitles());
|
|
|
|
|
|
+ if (uniqueTitleList.size() > 0) {
|
|
|
|
+ introduceDetailQueryWrapper.in("title", uniqueTitleList);
|
|
}
|
|
}
|
|
List<IntroduceDetail> introduceDetailList = introduceDetailFacade.list(introduceDetailQueryWrapper);
|
|
List<IntroduceDetail> introduceDetailList = introduceDetailFacade.list(introduceDetailQueryWrapper);
|
|
- List<EMRIntroduceDTO> emrIntroduceDTOList = BeanUtil.listCopyTo(introduceDetailList, EMRIntroduceDTO.class);
|
|
|
|
- return emrIntroduceDTOList;
|
|
|
|
|
|
+ List<EMRIntroduceDetailDTO> emrDetailList = BeanUtil.listCopyTo(introduceDetailList, EMRIntroduceDetailDTO.class);
|
|
|
|
+ return emrDetailList;
|
|
}
|
|
}
|
|
}
|
|
}
|