|
@@ -7,6 +7,7 @@ import com.diagbot.dto.ConceptDetailDTO;
|
|
import com.diagbot.dto.DictionaryInfoDTO;
|
|
import com.diagbot.dto.DictionaryInfoDTO;
|
|
import com.diagbot.dto.KlConceptDetailDTO;
|
|
import com.diagbot.dto.KlConceptDetailDTO;
|
|
import com.diagbot.dto.KlConceptStaticDTO;
|
|
import com.diagbot.dto.KlConceptStaticDTO;
|
|
|
|
+import com.diagbot.dto.KlScaleByIdDTO;
|
|
import com.diagbot.dto.StaticKnowledgeDTO;
|
|
import com.diagbot.dto.StaticKnowledgeDTO;
|
|
import com.diagbot.dto.StaticKnowledgeDetailDTO;
|
|
import com.diagbot.dto.StaticKnowledgeDetailDTO;
|
|
import com.diagbot.dto.StaticKnowledgeIndexPageDTO;
|
|
import com.diagbot.dto.StaticKnowledgeIndexPageDTO;
|
|
@@ -32,6 +33,7 @@ import com.diagbot.vo.GetDetailVO;
|
|
import com.diagbot.vo.IdVO;
|
|
import com.diagbot.vo.IdVO;
|
|
import com.diagbot.vo.KlConceptStaticPageVO;
|
|
import com.diagbot.vo.KlConceptStaticPageVO;
|
|
import com.diagbot.vo.KlConceptStaticVO;
|
|
import com.diagbot.vo.KlConceptStaticVO;
|
|
|
|
+import com.diagbot.vo.KlScaleByIdVO;
|
|
import com.diagbot.vo.StaticKnowledgeIndexPageVO;
|
|
import com.diagbot.vo.StaticKnowledgeIndexPageVO;
|
|
import com.diagbot.vo.StaticKnowledgeVO;
|
|
import com.diagbot.vo.StaticKnowledgeVO;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
@@ -63,6 +65,8 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
|
|
@Autowired
|
|
@Autowired
|
|
private KlConceptScaleFacade klConceptScaleFacade;
|
|
private KlConceptScaleFacade klConceptScaleFacade;
|
|
@Autowired
|
|
@Autowired
|
|
|
|
+ private KlScaleFacade klScaleFacade;
|
|
|
|
+ @Autowired
|
|
private KlDictionaryInfoFacade klDictionaryInfoFacade;
|
|
private KlDictionaryInfoFacade klDictionaryInfoFacade;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
@@ -91,8 +95,9 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
.eq("lib_name", staticKnowledgeVO.getName())
|
|
.eq("lib_name", staticKnowledgeVO.getName())
|
|
.eq("lib_type", type), false);
|
|
.eq("lib_type", type), false);
|
|
|
|
+
|
|
Integer sameType = null;
|
|
Integer sameType = null;
|
|
- //标准词不存在,同名的是否存在
|
|
|
|
|
|
+ //标准词不存在,同名的是否存在,仅检验检查
|
|
if (concept == null) {
|
|
if (concept == null) {
|
|
//同名静态知识互取
|
|
//同名静态知识互取
|
|
if (type.equals(LexiconEnum.LisName.getKey())) {
|
|
if (type.equals(LexiconEnum.LisName.getKey())) {
|
|
@@ -123,7 +128,7 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
|
|
staticKnowledgeVO.setType(sameType);
|
|
staticKnowledgeVO.setType(sameType);
|
|
}
|
|
}
|
|
|
|
|
|
- //标准术语存在静态知识不存在,取同名静态知识
|
|
|
|
|
|
+ //标准术语存在静态知识不存在,取同名静态知识,仅检验检查
|
|
if (concept != null && staticInfo == null && sameType == null) {
|
|
if (concept != null && staticInfo == null && sameType == null) {
|
|
//同名静态知识互取
|
|
//同名静态知识互取
|
|
if (type.equals(LexiconEnum.LisName.getKey())) {
|
|
if (type.equals(LexiconEnum.LisName.getKey())) {
|
|
@@ -168,95 +173,115 @@ public class KlConceptStaticFacade extends KlConceptStaticServiceImpl {
|
|
.in("concept_id", relations.stream().map(i -> i.getStartId()).collect(Collectors.toList()))
|
|
.in("concept_id", relations.stream().map(i -> i.getStartId()).collect(Collectors.toList()))
|
|
.eq("status", StatusEnum.Enable.getKey()), false);
|
|
.eq("status", StatusEnum.Enable.getKey()), false);
|
|
if (staticInfo == null) {
|
|
if (staticInfo == null) {
|
|
- throw new CommonException(CommonErrorCode.NOT_EXISTS, "缺少静态信息");
|
|
|
|
|
|
+ throw new CommonException(CommonErrorCode.NOT_EXISTS, "缺少" +
|
|
|
|
+ (type.equals(LexiconEnum.Scale.getKey()) ? "量表" : "静态") +
|
|
|
|
+ "信息");
|
|
}
|
|
}
|
|
concept = klConceptFacade.getById(staticInfo.getConceptId());
|
|
concept = klConceptFacade.getById(staticInfo.getConceptId());
|
|
} else {
|
|
} else {
|
|
- throw new CommonException(CommonErrorCode.NOT_EXISTS, "缺少静态信息");
|
|
|
|
|
|
+ throw new CommonException(CommonErrorCode.NOT_EXISTS, "缺少" +
|
|
|
|
+ (type.equals(LexiconEnum.Scale.getKey()) ? "量表" : "静态") +
|
|
|
|
+ "信息");
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- throw new CommonException(CommonErrorCode.NOT_EXISTS, "缺少静态信息");
|
|
|
|
|
|
+ throw new CommonException(CommonErrorCode.NOT_EXISTS, "缺少" +
|
|
|
|
+ (type.equals(LexiconEnum.Scale.getKey()) ? "量表" : "静态") +
|
|
|
|
+ "信息");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- //详情信息
|
|
|
|
- String sql = "";
|
|
|
|
- if (ListUtil.isNotEmpty(staticKnowledgeVO.getContentTypes())) {
|
|
|
|
-
|
|
|
|
- for (Integer contentType : staticKnowledgeVO.getContentTypes()) {
|
|
|
|
- if (contentType.equals(0)) {
|
|
|
|
- sql = "";
|
|
|
|
- break;
|
|
|
|
|
|
+ if (type.equals(LexiconEnum.Scale.getKey())) {
|
|
|
|
+ //量表详情
|
|
|
|
+ KlScaleByIdVO klScaleByIdVO = new KlScaleByIdVO();
|
|
|
|
+ //klScaleByIdVO.setId(staticInfo.getId());
|
|
|
|
+ klScaleByIdVO.setName(concept.getLibName());
|
|
|
|
+ List<KlScaleByIdDTO> scales = klScaleFacade.getKlScaleById(klScaleByIdVO);
|
|
|
|
+ if (ListUtil.isNotEmpty(scales)) {
|
|
|
|
+ staticKnowledgeDTO.setScale(scales.get(0));
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ //医学知识详情
|
|
|
|
+ String sql = "";
|
|
|
|
+ if (ListUtil.isNotEmpty(staticKnowledgeVO.getContentTypes())) {
|
|
|
|
+
|
|
|
|
+ for (Integer contentType : staticKnowledgeVO.getContentTypes()) {
|
|
|
|
+ if (contentType.equals(0)) {
|
|
|
|
+ sql = "";
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ if (StringUtil.isNotBlank(sql)) {
|
|
|
|
+ sql += " or ";
|
|
|
|
+ }
|
|
|
|
+ sql += "find_in_set(" + contentType + ",content_type)";
|
|
}
|
|
}
|
|
if (StringUtil.isNotBlank(sql)) {
|
|
if (StringUtil.isNotBlank(sql)) {
|
|
- sql += " or ";
|
|
|
|
|
|
+ sql = "(" + sql + ")";
|
|
}
|
|
}
|
|
- sql += "find_in_set(" + contentType + ",content_type)";
|
|
|
|
}
|
|
}
|
|
- if (StringUtil.isNotBlank(sql)) {
|
|
|
|
- sql = "(" + sql + ")";
|
|
|
|
|
|
+ List<KlConceptDetail> details = klConceptDetailFacade.list(new QueryWrapper<KlConceptDetail>()
|
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
+ .eq("concept_id", concept.getId())
|
|
|
|
+ .apply(sql)
|
|
|
|
+ .orderByAsc("order_no"));
|
|
|
|
+
|
|
|
|
+ List<StaticKnowledgeDetailDTO> detailList
|
|
|
|
+ = BeanUtil.listCopyTo(details, StaticKnowledgeDetailDTO.class);
|
|
|
|
+ List<StaticKnowledgeDetailDTO> introduceList = detailList
|
|
|
|
+ .stream()
|
|
|
|
+ .filter(i -> Arrays.asList(i.getContentType().split(",")).contains("1"))
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+ List<StaticKnowledgeDetailDTO> noticeList = detailList
|
|
|
|
+ .stream()
|
|
|
|
+ .filter(i -> Arrays.asList(i.getContentType().split(",")).contains("2"))
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+ List<StaticKnowledgeDetailDTO> clinicalPathwayList = detailList
|
|
|
|
+ .stream()
|
|
|
|
+ .filter(i -> Arrays.asList(i.getContentType().split(",")).contains("3"))
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+ List<StaticKnowledgeDetailDTO> treatInfoList = detailList
|
|
|
|
+ .stream()
|
|
|
|
+ .filter(i -> Arrays.asList(i.getContentType().split(",")).contains("4"))
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+ Map<String, List<StaticKnowledgeDetailDTO>> detailMap = new HashMap<>();
|
|
|
|
+ if (ListUtil.isEmpty(staticKnowledgeVO.getContentTypes()) || staticKnowledgeVO.getContentTypes().contains(0)) {
|
|
|
|
+ if (ListUtil.isNotEmpty(introduceList)) {
|
|
|
|
+ detailMap.put("静态知识", introduceList);
|
|
|
|
+ }
|
|
|
|
+ if (ListUtil.isNotEmpty(noticeList)) {
|
|
|
|
+ detailMap.put("注意事项", noticeList);
|
|
|
|
+ }
|
|
|
|
+ if (ListUtil.isNotEmpty(clinicalPathwayList)) {
|
|
|
|
+ detailMap.put("临床路径", clinicalPathwayList);
|
|
|
|
+ }
|
|
|
|
+ if (ListUtil.isNotEmpty(treatInfoList)) {
|
|
|
|
+ detailMap.put("治疗方案", treatInfoList);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ if (ListUtil.isNotEmpty(introduceList) && staticKnowledgeVO.getContentTypes().contains(1)) {
|
|
|
|
+ detailMap.put("静态知识", introduceList);
|
|
|
|
+ }
|
|
|
|
+ if (ListUtil.isNotEmpty(noticeList) && staticKnowledgeVO.getContentTypes().contains(2)) {
|
|
|
|
+ detailMap.put("注意事项", noticeList);
|
|
|
|
+ }
|
|
|
|
+ if (ListUtil.isNotEmpty(clinicalPathwayList) && staticKnowledgeVO.getContentTypes().contains(3)) {
|
|
|
|
+ detailMap.put("临床路径", clinicalPathwayList);
|
|
|
|
+ }
|
|
|
|
+ if (ListUtil.isNotEmpty(treatInfoList) && staticKnowledgeVO.getContentTypes().contains(4)) {
|
|
|
|
+ detailMap.put("治疗方案", treatInfoList);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ staticKnowledgeDTO.setClinicalPathwayName(staticInfo.getClinicalPathwayName());
|
|
|
|
+ staticKnowledgeDTO.setNoticeName(staticInfo.getNoticeName());
|
|
|
|
+ staticKnowledgeDTO.setDetails(detailMap);
|
|
}
|
|
}
|
|
- List<KlConceptDetail> details = klConceptDetailFacade.list(new QueryWrapper<KlConceptDetail>()
|
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
|
- .eq("concept_id", concept.getId())
|
|
|
|
- .apply(sql)
|
|
|
|
- .orderByAsc("order_no"));
|
|
|
|
|
|
|
|
- List<StaticKnowledgeDetailDTO> detailList
|
|
|
|
- = BeanUtil.listCopyTo(details, StaticKnowledgeDetailDTO.class);
|
|
|
|
- List<StaticKnowledgeDetailDTO> introduceList = detailList
|
|
|
|
- .stream()
|
|
|
|
- .filter(i -> Arrays.asList(i.getContentType().split(",")).contains("1"))
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
- List<StaticKnowledgeDetailDTO> noticeList = detailList
|
|
|
|
- .stream()
|
|
|
|
- .filter(i -> Arrays.asList(i.getContentType().split(",")).contains("2"))
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
- List<StaticKnowledgeDetailDTO> clinicalPathwayList = detailList
|
|
|
|
- .stream()
|
|
|
|
- .filter(i -> Arrays.asList(i.getContentType().split(",")).contains("3"))
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
- List<StaticKnowledgeDetailDTO> treatInfoList = detailList
|
|
|
|
- .stream()
|
|
|
|
- .filter(i -> Arrays.asList(i.getContentType().split(",")).contains("4"))
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
- Map<String, List<StaticKnowledgeDetailDTO>> detailMap = new HashMap<>();
|
|
|
|
- if (ListUtil.isEmpty(staticKnowledgeVO.getContentTypes()) || staticKnowledgeVO.getContentTypes().contains(0)) {
|
|
|
|
- if (ListUtil.isNotEmpty(introduceList)) {
|
|
|
|
- detailMap.put("静态知识", introduceList);
|
|
|
|
- }
|
|
|
|
- if (ListUtil.isNotEmpty(noticeList)) {
|
|
|
|
- detailMap.put("注意事项", noticeList);
|
|
|
|
- }
|
|
|
|
- if (ListUtil.isNotEmpty(clinicalPathwayList)) {
|
|
|
|
- detailMap.put("临床路径", clinicalPathwayList);
|
|
|
|
- }
|
|
|
|
- if (ListUtil.isNotEmpty(treatInfoList)) {
|
|
|
|
- detailMap.put("治疗方案", treatInfoList);
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- if (ListUtil.isNotEmpty(introduceList) && staticKnowledgeVO.getContentTypes().contains(1)) {
|
|
|
|
- detailMap.put("静态知识", introduceList);
|
|
|
|
- }
|
|
|
|
- if (ListUtil.isNotEmpty(noticeList) && staticKnowledgeVO.getContentTypes().contains(2)) {
|
|
|
|
- detailMap.put("注意事项", noticeList);
|
|
|
|
- }
|
|
|
|
- if (ListUtil.isNotEmpty(clinicalPathwayList) && staticKnowledgeVO.getContentTypes().contains(3)) {
|
|
|
|
- detailMap.put("临床路径", clinicalPathwayList);
|
|
|
|
- }
|
|
|
|
- if (ListUtil.isNotEmpty(treatInfoList) && staticKnowledgeVO.getContentTypes().contains(4)) {
|
|
|
|
- detailMap.put("治疗方案", treatInfoList);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
|
|
staticKnowledgeDTO.setId(concept.getId());
|
|
staticKnowledgeDTO.setId(concept.getId());
|
|
staticKnowledgeDTO.setName(concept.getLibName());
|
|
staticKnowledgeDTO.setName(concept.getLibName());
|
|
Integer retType = convertType(concept.getLibType(), 2);
|
|
Integer retType = convertType(concept.getLibType(), 2);
|
|
staticKnowledgeDTO.setType(retType == null ? "" : retType.toString());
|
|
staticKnowledgeDTO.setType(retType == null ? "" : retType.toString());
|
|
- staticKnowledgeDTO.setClinicalPathwayName(staticInfo.getClinicalPathwayName());
|
|
|
|
- staticKnowledgeDTO.setNoticeName(staticInfo.getNoticeName());
|
|
|
|
- staticKnowledgeDTO.setDetails(detailMap);
|
|
|
|
|
|
+
|
|
|
|
+
|
|
return staticKnowledgeDTO;
|
|
return staticKnowledgeDTO;
|
|
}
|
|
}
|
|
|
|
|