|
@@ -60,11 +60,7 @@ public class KlConceptFacade extends KlConceptServiceImpl {
|
|
|
* @return
|
|
|
*/
|
|
|
public List<IndexBatchDTO> getConceptNames(ConceptVO conceptVO) {
|
|
|
- /*if (ListUtil.isEmpty(conceptVO.getNames()) && ListUtil.isEmpty(conceptVO.getIds())) {
|
|
|
- return new ArrayList<>();
|
|
|
- }*/
|
|
|
List<IndexBatchDTO> retList = Lists.newLinkedList();
|
|
|
- //type: 类型:1-化验大项、2-化验小项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候
|
|
|
Integer type = convertType(conceptVO.getType(), false);
|
|
|
|
|
|
if (conceptVO.getSource().equals(-1)) {
|
|
@@ -227,56 +223,54 @@ public class KlConceptFacade extends KlConceptServiceImpl {
|
|
|
}
|
|
|
//关联编码
|
|
|
List<Long> conceptIds = retList.stream().map(IndexBatchDTO::getId).collect(Collectors.toList());
|
|
|
- if (type.equals(LexiconEnum.Disease.getKey())) {
|
|
|
- List<KlDisease> diseases = klDiseaseFacade.list(new QueryWrapper<KlDisease>()
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .in("concept_id", conceptIds));
|
|
|
- if (ListUtil.isNotEmpty(diseases)) {
|
|
|
- Map<Long, KlDisease> idMap = diseases.stream().collect(Collectors.toMap(KlDisease::getConceptId, v -> v));
|
|
|
- for (IndexBatchDTO dto : retList) {
|
|
|
- if (idMap.containsKey(dto.getId())) {
|
|
|
- dto.setCode(idMap.get(dto.getId()).getIcd10Code());
|
|
|
- }
|
|
|
+ //诊断关联编码
|
|
|
+ List<KlDisease> diseases = klDiseaseFacade.list(new QueryWrapper<KlDisease>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .in("concept_id", conceptIds));
|
|
|
+ if (ListUtil.isNotEmpty(diseases)) {
|
|
|
+ Map<Long, KlDisease> idMap = diseases.stream().collect(Collectors.toMap(KlDisease::getConceptId, v -> v));
|
|
|
+ for (IndexBatchDTO dto : retList) {
|
|
|
+ if (idMap.containsKey(dto.getId())) {
|
|
|
+ dto.setCode(idMap.get(dto.getId()).getIcd10Code());
|
|
|
}
|
|
|
}
|
|
|
- } else if (type.equals(LexiconEnum.Operation.getKey())) {
|
|
|
- List<KlOperation> operations = klOperationFacade.list(new QueryWrapper<KlOperation>()
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .in("concept_id", conceptIds));
|
|
|
- if (ListUtil.isNotEmpty(operations)) {
|
|
|
- Map<Long, KlOperation> idMap = operations.stream().collect(Collectors.toMap(KlOperation::getConceptId, v -> v));
|
|
|
- for (IndexBatchDTO dto : retList) {
|
|
|
- if (idMap.containsKey(dto.getId())) {
|
|
|
- dto.setCode(idMap.get(dto.getId()).getOperationCode());
|
|
|
- }
|
|
|
+ }
|
|
|
+ //手术关联编码
|
|
|
+ List<KlOperation> operations = klOperationFacade.list(new QueryWrapper<KlOperation>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .in("concept_id", conceptIds));
|
|
|
+ if (ListUtil.isNotEmpty(operations)) {
|
|
|
+ Map<Long, KlOperation> idMap = operations.stream().collect(Collectors.toMap(KlOperation::getConceptId, v -> v));
|
|
|
+ for (IndexBatchDTO dto : retList) {
|
|
|
+ if (idMap.containsKey(dto.getId())) {
|
|
|
+ dto.setCode(idMap.get(dto.getId()).getOperationCode());
|
|
|
}
|
|
|
}
|
|
|
- } else if (type.equals(LexiconEnum.Tcmdisease.getKey())) {
|
|
|
- List<TcmDisease> tcmDiseases = tcmDiseaseFacade.list(new QueryWrapper<TcmDisease>()
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .in("concept_id", conceptIds));
|
|
|
- if (ListUtil.isNotEmpty(tcmDiseases)) {
|
|
|
- Map<Long, TcmDisease> idMap = tcmDiseases.stream().collect(Collectors.toMap(TcmDisease::getConceptId, v -> v));
|
|
|
- for (IndexBatchDTO dto : retList) {
|
|
|
- if (idMap.containsKey(dto.getId())) {
|
|
|
- dto.setCode(idMap.get(dto.getId()).getCode());
|
|
|
- }
|
|
|
+ }
|
|
|
+ //中医疾病关联编码
|
|
|
+ List<TcmDisease> tcmDiseases = tcmDiseaseFacade.list(new QueryWrapper<TcmDisease>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .in("concept_id", conceptIds));
|
|
|
+ if (ListUtil.isNotEmpty(tcmDiseases)) {
|
|
|
+ Map<Long, TcmDisease> idMap = tcmDiseases.stream().collect(Collectors.toMap(TcmDisease::getConceptId, v -> v));
|
|
|
+ for (IndexBatchDTO dto : retList) {
|
|
|
+ if (idMap.containsKey(dto.getId())) {
|
|
|
+ dto.setCode(idMap.get(dto.getId()).getCode());
|
|
|
}
|
|
|
}
|
|
|
- } else if (type.equals(LexiconEnum.Tcmsyndrome.getKey())) {
|
|
|
- List<TcmSyndrome> tcmSyndromes = tcmSyndromeFacade.list(new QueryWrapper<TcmSyndrome>()
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .in("concept_id", conceptIds));
|
|
|
- if (ListUtil.isNotEmpty(tcmSyndromes)) {
|
|
|
- Map<Long, TcmSyndrome> idMap = tcmSyndromes.stream().collect(Collectors.toMap(TcmSyndrome::getConceptId, v -> v));
|
|
|
- for (IndexBatchDTO dto : retList) {
|
|
|
- if (idMap.containsKey(dto.getId())) {
|
|
|
- dto.setCode(idMap.get(dto.getId()).getCode());
|
|
|
- }
|
|
|
+ }
|
|
|
+ //中医证候关联编码
|
|
|
+ List<TcmSyndrome> tcmSyndromes = tcmSyndromeFacade.list(new QueryWrapper<TcmSyndrome>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .in("concept_id", conceptIds));
|
|
|
+ if (ListUtil.isNotEmpty(tcmSyndromes)) {
|
|
|
+ Map<Long, TcmSyndrome> idMap = tcmSyndromes.stream().collect(Collectors.toMap(TcmSyndrome::getConceptId, v -> v));
|
|
|
+ for (IndexBatchDTO dto : retList) {
|
|
|
+ if (idMap.containsKey(dto.getId())) {
|
|
|
+ dto.setCode(idMap.get(dto.getId()).getCode());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
return retList;
|
|
|
}
|
|
|
|
|
@@ -315,7 +309,9 @@ public class KlConceptFacade extends KlConceptServiceImpl {
|
|
|
*/
|
|
|
public Integer convertType(Integer type, Boolean reverse) {
|
|
|
Integer retType = null;
|
|
|
- //type: 类型:1-化验大项、2-化验小项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候
|
|
|
+ if (type == null) {
|
|
|
+ return retType;
|
|
|
+ }
|
|
|
if (reverse) {
|
|
|
if (type.equals(LexiconEnum.LisName.getKey())
|
|
|
|| type.equals(LexiconEnum.LisSubName.getKey())) {
|