|
@@ -2,7 +2,7 @@
|
|
|
package com.diagbot.facade;
|
|
|
|
|
|
import com.diagbot.dto.MedClassMedDTO;
|
|
|
-import com.diagbot.dto.RuleDTO;
|
|
|
+import com.diagbot.dto.RuleGetDTO;
|
|
|
import com.diagbot.enums.LexiconEnum;
|
|
|
import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.EntityUtil;
|
|
@@ -57,7 +57,7 @@ public class UnUsedMappingFacade {
|
|
|
* @param list
|
|
|
* @return
|
|
|
*/
|
|
|
- public Map<String, List<String>> usedNames(List<RuleDTO> list) {
|
|
|
+ public Map<String, List<String>> usedNames(List<RuleGetDTO> list) {
|
|
|
Map<String, List<String>> retMap = new HashMap<>();
|
|
|
|
|
|
if (ListUtil.isEmpty(list)) {
|
|
@@ -65,31 +65,31 @@ public class UnUsedMappingFacade {
|
|
|
}
|
|
|
List<String> lisNames = list.stream()
|
|
|
.filter(i -> i.getRuleLibType().equals(LexiconEnum.LisName.getKey()) || i.getRuleLibType().equals(LexiconEnum.LisSubName.getKey()))
|
|
|
- .map(RuleDTO::getRuleLibName)
|
|
|
+ .map(RuleGetDTO::getRuleLibName)
|
|
|
.collect(Collectors.toList());
|
|
|
lisNames.addAll(list.stream()
|
|
|
.filter(i -> i.getHasSubCond() != null && i.getHasSubCond().equals(1) && (i.getRuleBaseLibType().equals(LexiconEnum.LisName.getKey()) || i.getRuleBaseLibType().equals(LexiconEnum.LisSubName.getKey())))
|
|
|
- .map(RuleDTO::getRuleBaseLibName)
|
|
|
+ .map(RuleGetDTO::getRuleBaseLibName)
|
|
|
.collect(Collectors.toList()));
|
|
|
lisNames = lisNames.stream().distinct().collect(Collectors.toList());
|
|
|
|
|
|
List<String> pacsNames = list.stream()
|
|
|
.filter(i -> i.getRuleLibType().equals(LexiconEnum.PacsName.getKey()) || i.getRuleLibType().equals(LexiconEnum.PacsSubName.getKey()))
|
|
|
- .map(RuleDTO::getRuleLibName)
|
|
|
+ .map(RuleGetDTO::getRuleLibName)
|
|
|
.collect(Collectors.toList());
|
|
|
pacsNames.addAll(list.stream()
|
|
|
.filter(i -> i.getHasSubCond() != null && i.getHasSubCond().equals(1) && (i.getRuleBaseLibType().equals(LexiconEnum.PacsName.getKey()) || i.getRuleBaseLibType().equals(LexiconEnum.PacsSubName.getKey())))
|
|
|
- .map(RuleDTO::getRuleBaseLibName)
|
|
|
+ .map(RuleGetDTO::getRuleBaseLibName)
|
|
|
.collect(Collectors.toList()));
|
|
|
pacsNames = pacsNames.stream().distinct().collect(Collectors.toList());
|
|
|
|
|
|
List<String> diseaseNames = list.stream()
|
|
|
.filter(i -> i.getRuleLibType().equals(LexiconEnum.Disease.getKey()))
|
|
|
- .map(RuleDTO::getRuleLibName)
|
|
|
+ .map(RuleGetDTO::getRuleLibName)
|
|
|
.collect(Collectors.toList());
|
|
|
diseaseNames.addAll(list.stream()
|
|
|
.filter(i -> i.getHasSubCond() != null && i.getHasSubCond().equals(1) && (i.getRuleBaseLibType().equals(LexiconEnum.Disease.getKey())))
|
|
|
- .map(RuleDTO::getRuleBaseLibName)
|
|
|
+ .map(RuleGetDTO::getRuleBaseLibName)
|
|
|
.collect(Collectors.toList()));
|
|
|
diseaseNames = diseaseNames.stream().distinct().collect(Collectors.toList());
|
|
|
|
|
@@ -99,8 +99,8 @@ public class UnUsedMappingFacade {
|
|
|
medClassMedList.stream().collect(Collectors.groupingBy(MedClassMedDTO::getMedClassLibName,
|
|
|
HashMap::new,
|
|
|
Collectors.mapping(MedClassMedDTO::getMedLibName, Collectors.toList())));
|
|
|
- List<RuleDTO> medList = Lists.newLinkedList();
|
|
|
- for (RuleDTO result : list) {
|
|
|
+ List<RuleGetDTO> medList = Lists.newLinkedList();
|
|
|
+ for (RuleGetDTO result : list) {
|
|
|
if (result.getHasSubCond() != null && result.getHasSubCond().equals(1)) {
|
|
|
if (result.getRuleBaseLibType().equals(LexiconEnum.MedChemClass.getKey())
|
|
|
|| result.getRuleBaseLibType().equals(LexiconEnum.MedZhiLiaoClass.getKey())
|
|
@@ -108,7 +108,7 @@ public class UnUsedMappingFacade {
|
|
|
List<String> medicines = medClassMedMap.get(result.getRuleBaseLibName());
|
|
|
if (ListUtil.isNotEmpty(medicines)) {
|
|
|
for (String med : medicines) {
|
|
|
- RuleDTO medResult = new RuleDTO();
|
|
|
+ RuleGetDTO medResult = new RuleGetDTO();
|
|
|
BeanUtil.copyProperties(result, medResult);
|
|
|
medResult.setRuleBaseLibName(med);
|
|
|
medResult.setRuleBaseLibType(LexiconEnum.Medicine.getKey());
|
|
@@ -128,31 +128,31 @@ public class UnUsedMappingFacade {
|
|
|
|
|
|
List<String> drugNames = medList.stream()
|
|
|
.filter(i -> i.getRuleLibType().equals(LexiconEnum.Medicine.getKey()))
|
|
|
- .map(RuleDTO::getRuleLibName)
|
|
|
+ .map(RuleGetDTO::getRuleLibName)
|
|
|
.collect(Collectors.toList());
|
|
|
drugNames.addAll(medList.stream()
|
|
|
.filter(i -> i.getHasSubCond() != null && i.getHasSubCond().equals(1) && (i.getRuleBaseLibType().equals(LexiconEnum.Medicine.getKey())))
|
|
|
- .map(RuleDTO::getRuleBaseLibName)
|
|
|
+ .map(RuleGetDTO::getRuleBaseLibName)
|
|
|
.collect(Collectors.toList()));
|
|
|
drugNames = drugNames.stream().distinct().collect(Collectors.toList());
|
|
|
|
|
|
List<String> operationNames = list.stream()
|
|
|
.filter(i -> i.getRuleLibType().equals(LexiconEnum.Operation.getKey()))
|
|
|
- .map(RuleDTO::getRuleLibName)
|
|
|
+ .map(RuleGetDTO::getRuleLibName)
|
|
|
.collect(Collectors.toList());
|
|
|
operationNames.addAll(list.stream()
|
|
|
.filter(i -> i.getHasSubCond() != null && i.getHasSubCond().equals(1) && (i.getRuleBaseLibType().equals(LexiconEnum.Operation.getKey())))
|
|
|
- .map(RuleDTO::getRuleBaseLibName)
|
|
|
+ .map(RuleGetDTO::getRuleBaseLibName)
|
|
|
.collect(Collectors.toList()));
|
|
|
operationNames = operationNames.stream().distinct().collect(Collectors.toList());
|
|
|
|
|
|
List<String> transfusionNames = list.stream()
|
|
|
.filter(i -> i.getRuleLibType().equals(LexiconEnum.Transfusion.getKey()))
|
|
|
- .map(RuleDTO::getRuleLibName)
|
|
|
+ .map(RuleGetDTO::getRuleLibName)
|
|
|
.collect(Collectors.toList());
|
|
|
transfusionNames.addAll(list.stream()
|
|
|
.filter(i -> i.getHasSubCond() != null && i.getHasSubCond().equals(1) && (i.getRuleBaseLibType().equals(LexiconEnum.Transfusion.getKey())))
|
|
|
- .map(RuleDTO::getRuleBaseLibName)
|
|
|
+ .map(RuleGetDTO::getRuleBaseLibName)
|
|
|
.collect(Collectors.toList()));
|
|
|
transfusionNames = transfusionNames.stream().distinct().collect(Collectors.toList());
|
|
|
|
|
@@ -171,7 +171,7 @@ public class UnUsedMappingFacade {
|
|
|
* @param list
|
|
|
* @return
|
|
|
*/
|
|
|
- public Map<String, List<Long>> usedConceptIds(List<RuleDTO> list) {
|
|
|
+ public Map<String, List<Long>> usedConceptIds(List<RuleGetDTO> list) {
|
|
|
Map<String, List<Long>> retMap = new HashMap<>();
|
|
|
|
|
|
if (ListUtil.isEmpty(list)) {
|
|
@@ -179,31 +179,31 @@ public class UnUsedMappingFacade {
|
|
|
}
|
|
|
List<Long> lisIds = list.stream()
|
|
|
.filter(i -> i.getRuleLibType().equals(LexiconEnum.LisName.getKey()) || i.getRuleLibType().equals(LexiconEnum.LisSubName.getKey()))
|
|
|
- .map(RuleDTO::getRuleConceptId)
|
|
|
+ .map(RuleGetDTO::getRuleConceptId)
|
|
|
.collect(Collectors.toList());
|
|
|
lisIds.addAll(list.stream()
|
|
|
.filter(i -> i.getHasSubCond() != null && i.getHasSubCond().equals(1) && (i.getRuleBaseLibType().equals(LexiconEnum.LisName.getKey()) || i.getRuleBaseLibType().equals(LexiconEnum.LisSubName.getKey())))
|
|
|
- .map(RuleDTO::getRuleBaseConceptId)
|
|
|
+ .map(RuleGetDTO::getRuleBaseConceptId)
|
|
|
.collect(Collectors.toList()));
|
|
|
lisIds = lisIds.stream().distinct().collect(Collectors.toList());
|
|
|
|
|
|
List<Long> pacsIds = list.stream()
|
|
|
.filter(i -> i.getRuleLibType().equals(LexiconEnum.PacsName.getKey()) || i.getRuleLibType().equals(LexiconEnum.PacsSubName.getKey()))
|
|
|
- .map(RuleDTO::getRuleConceptId)
|
|
|
+ .map(RuleGetDTO::getRuleConceptId)
|
|
|
.collect(Collectors.toList());
|
|
|
pacsIds.addAll(list.stream()
|
|
|
.filter(i -> i.getHasSubCond() != null && i.getHasSubCond().equals(1) && (i.getRuleBaseLibType().equals(LexiconEnum.PacsName.getKey()) || i.getRuleBaseLibType().equals(LexiconEnum.PacsSubName.getKey())))
|
|
|
- .map(RuleDTO::getRuleBaseConceptId)
|
|
|
+ .map(RuleGetDTO::getRuleBaseConceptId)
|
|
|
.collect(Collectors.toList()));
|
|
|
pacsIds = pacsIds.stream().distinct().collect(Collectors.toList());
|
|
|
|
|
|
List<Long> diseaseIds = list.stream()
|
|
|
.filter(i -> i.getRuleLibType().equals(LexiconEnum.Disease.getKey()))
|
|
|
- .map(RuleDTO::getRuleConceptId)
|
|
|
+ .map(RuleGetDTO::getRuleConceptId)
|
|
|
.collect(Collectors.toList());
|
|
|
diseaseIds.addAll(list.stream()
|
|
|
.filter(i -> i.getHasSubCond() != null && i.getHasSubCond().equals(1) && (i.getRuleBaseLibType().equals(LexiconEnum.Disease.getKey())))
|
|
|
- .map(RuleDTO::getRuleBaseConceptId)
|
|
|
+ .map(RuleGetDTO::getRuleBaseConceptId)
|
|
|
.collect(Collectors.toList()));
|
|
|
diseaseIds = diseaseIds.stream().distinct().collect(Collectors.toList());
|
|
|
|
|
@@ -213,8 +213,8 @@ public class UnUsedMappingFacade {
|
|
|
medClassMedList.stream().collect(Collectors.groupingBy(MedClassMedDTO::getMedClassLibName,
|
|
|
HashMap::new,
|
|
|
Collectors.mapping(MedClassMedDTO::getMedLibName, Collectors.toList())));
|
|
|
- List<RuleDTO> medList = Lists.newLinkedList();
|
|
|
- for (RuleDTO result : list) {
|
|
|
+ List<RuleGetDTO> medList = Lists.newLinkedList();
|
|
|
+ for (RuleGetDTO result : list) {
|
|
|
if (result.getHasSubCond() != null && result.getHasSubCond().equals(1)) {
|
|
|
if (result.getRuleBaseLibType().equals(LexiconEnum.MedChemClass.getKey())
|
|
|
|| result.getRuleBaseLibType().equals(LexiconEnum.MedZhiLiaoClass.getKey())
|
|
@@ -222,7 +222,7 @@ public class UnUsedMappingFacade {
|
|
|
List<String> medicines = medClassMedMap.get(result.getRuleBaseLibName());
|
|
|
if (ListUtil.isNotEmpty(medicines)) {
|
|
|
for (String med : medicines) {
|
|
|
- RuleDTO medResult = new RuleDTO();
|
|
|
+ RuleGetDTO medResult = new RuleGetDTO();
|
|
|
BeanUtil.copyProperties(result, medResult);
|
|
|
medResult.setRuleBaseLibName(med);
|
|
|
medResult.setRuleBaseLibType(LexiconEnum.Medicine.getKey());
|
|
@@ -242,31 +242,31 @@ public class UnUsedMappingFacade {
|
|
|
|
|
|
List<Long> drugIds = medList.stream()
|
|
|
.filter(i -> i.getRuleLibType().equals(LexiconEnum.Medicine.getKey()))
|
|
|
- .map(RuleDTO::getRuleConceptId)
|
|
|
+ .map(RuleGetDTO::getRuleConceptId)
|
|
|
.collect(Collectors.toList());
|
|
|
drugIds.addAll(medList.stream()
|
|
|
.filter(i -> i.getHasSubCond() != null && i.getHasSubCond().equals(1) && (i.getRuleBaseLibType().equals(LexiconEnum.Medicine.getKey())))
|
|
|
- .map(RuleDTO::getRuleBaseConceptId)
|
|
|
+ .map(RuleGetDTO::getRuleBaseConceptId)
|
|
|
.collect(Collectors.toList()));
|
|
|
drugIds = drugIds.stream().distinct().collect(Collectors.toList());
|
|
|
|
|
|
List<Long> operationIds = list.stream()
|
|
|
.filter(i -> i.getRuleLibType().equals(LexiconEnum.Operation.getKey()))
|
|
|
- .map(RuleDTO::getRuleConceptId)
|
|
|
+ .map(RuleGetDTO::getRuleConceptId)
|
|
|
.collect(Collectors.toList());
|
|
|
operationIds.addAll(list.stream()
|
|
|
.filter(i -> i.getHasSubCond() != null && i.getHasSubCond().equals(1) && (i.getRuleBaseLibType().equals(LexiconEnum.Operation.getKey())))
|
|
|
- .map(RuleDTO::getRuleBaseConceptId)
|
|
|
+ .map(RuleGetDTO::getRuleBaseConceptId)
|
|
|
.collect(Collectors.toList()));
|
|
|
operationIds = operationIds.stream().distinct().collect(Collectors.toList());
|
|
|
|
|
|
List<Long> transfusionIds = list.stream()
|
|
|
.filter(i -> i.getRuleLibType().equals(LexiconEnum.Transfusion.getKey()))
|
|
|
- .map(RuleDTO::getRuleConceptId)
|
|
|
+ .map(RuleGetDTO::getRuleConceptId)
|
|
|
.collect(Collectors.toList());
|
|
|
transfusionIds.addAll(list.stream()
|
|
|
.filter(i -> i.getHasSubCond() != null && i.getHasSubCond().equals(1) && (i.getRuleBaseLibType().equals(LexiconEnum.Transfusion.getKey())))
|
|
|
- .map(RuleDTO::getRuleBaseConceptId)
|
|
|
+ .map(RuleGetDTO::getRuleBaseConceptId)
|
|
|
.collect(Collectors.toList()));
|
|
|
transfusionIds = transfusionIds.stream().distinct().collect(Collectors.toList());
|
|
|
|