|
@@ -14,7 +14,6 @@ import com.diagbot.dto.GetModuleTypeDTO;
|
|
|
import com.diagbot.dto.GetQuestiongAndModuleRelationsDTO;
|
|
|
import com.diagbot.dto.ModuleInfoListDTO;
|
|
|
import com.diagbot.dto.RespDTO;
|
|
|
-import com.diagbot.entity.DictionaryInfo;
|
|
|
import com.diagbot.entity.ModuleDetail;
|
|
|
import com.diagbot.entity.ModuleInfo;
|
|
|
import com.diagbot.entity.QuestionInfo;
|
|
@@ -22,6 +21,7 @@ import com.diagbot.enums.IsDeleteEnum;
|
|
|
import com.diagbot.enums.ModuleInfoTypeEnum;
|
|
|
import com.diagbot.enums.ModuleTypeEnum;
|
|
|
import com.diagbot.enums.QuestionTypeEnum;
|
|
|
+import com.diagbot.enums.TagTypeEnum;
|
|
|
import com.diagbot.service.impl.ModuleInfoServiceImpl;
|
|
|
import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.DateUtil;
|
|
@@ -279,7 +279,6 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
|
|
|
public GetModuleInfoOneDTO getModuleInfoOne(GetModuleInfoOneVO getModuleInfoOneVO) {
|
|
|
GetModuleInfoOneDTO getModuleInfoOneDTO = new GetModuleInfoOneDTO();
|
|
|
List<Long> deptId = new ArrayList<>();
|
|
|
- List<Long> disId = new ArrayList<>();
|
|
|
//获取模板信息
|
|
|
QueryWrapper<ModuleInfo> moduleInfoQueryWrapper = new QueryWrapper<>();
|
|
|
moduleInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
@@ -289,43 +288,24 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
|
|
|
if(moduleInfo.getModuleType().intValue() == 1){
|
|
|
deptId.add(moduleInfo.getRelationId());
|
|
|
}
|
|
|
- if(moduleInfo.getModuleType().intValue() == 2){
|
|
|
- disId.add(moduleInfo.getRelationId());
|
|
|
- }
|
|
|
//获取科室名称
|
|
|
ConceptTypeVO conceptTypeVO = new ConceptTypeVO();
|
|
|
conceptTypeVO.setType(1);
|
|
|
RespDTO<List<ConceptBaseDTO>> deptInfoList = knowledgemanServiceClient.getConceptListByType(conceptTypeVO);
|
|
|
RespDTOUtil.respNGDeal(deptInfoList,"获取科室信息失败");
|
|
|
Map<Long, ConceptBaseDTO> deptInfoMap = deptInfoList.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));
|
|
|
BeanUtil.copyProperties(moduleInfo, getModuleInfoOneDTO);
|
|
|
- getModuleInfoOneDTO.setAscriptionName(dictionaryInfoMap.get(String.valueOf(moduleInfo.getType())).getName());
|
|
|
+ getModuleInfoOneDTO.setAscriptionName(ModuleTypeEnum.getName(Integer.parseInt(moduleInfo.getType())));
|
|
|
getModuleInfoOneDTO.setModuleTypeName(ModuleInfoTypeEnum.getName(getModuleInfoOneDTO.getModuleType().intValue()));
|
|
|
if(getModuleInfoOneDTO.getModuleType().intValue() == 1){
|
|
|
getModuleInfoOneDTO.setRelationName(deptInfoMap.get(getModuleInfoOneDTO.getRelationId()).getName());
|
|
|
}
|
|
|
- if(getModuleInfoOneDTO.getModuleType().intValue() == 2){
|
|
|
- getModuleInfoOneDTO.setRelationName(questionInfoMap.get(getModuleInfoOneDTO.getRelationId()).getName());
|
|
|
- }
|
|
|
return getModuleInfoOneDTO;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 获取模板类型(从主诉到诊断)
|
|
|
+ * 获取模板类型(从症状情况到补充内容)
|
|
|
*
|
|
|
* @param getModuleTypeVO
|
|
|
* @return
|
|
@@ -428,8 +408,7 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
|
|
|
StringBuffer questionMsg = new StringBuffer();
|
|
|
List<QuestionInfo> info = questionFacade.getParentQuestion(getQuestiongAndModuleRelationsVO.getQuestionId());
|
|
|
for (QuestionInfo bean : info) {
|
|
|
- //TODO
|
|
|
- if (bean.getTagType() != null /*&& bean.getTagType() == TagTypeEnum.T10.getKey()*/) {
|
|
|
+ if (bean.getTagType() != null && bean.getTagType() == TagTypeEnum.T10.getKey()) {
|
|
|
List<QuestionInfo> info2 = questionFacade.getParentQuestion(bean.getId());
|
|
|
List<String> msg = info2.stream().map(row -> "【" + row.getTagName() + "】").collect(Collectors.toList());
|
|
|
questionMsg.append(String.join("", msg));
|