|
@@ -2,6 +2,7 @@ package com.diagbot.aggregate;
|
|
|
|
|
|
import com.diagbot.dto.PushBaseDTO;
|
|
|
import com.diagbot.dto.PushDTO;
|
|
|
+import com.diagbot.enums.ConceptTypeEnum;
|
|
|
import com.diagbot.facade.DiseaseConfigFacade;
|
|
|
import com.diagbot.facade.DrugConfigFacade;
|
|
|
import com.diagbot.facade.LisConfigFacade;
|
|
@@ -20,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Collection;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -103,15 +105,19 @@ public class AssemblePushAggregate {
|
|
|
List<String> uniqueNameList = retLis.stream()
|
|
|
.map(i -> i.getName())
|
|
|
.collect(Collectors.toList());
|
|
|
- Map<String, Map<String, Long>> uniqueNameMap
|
|
|
- = lisConfigFacade.getUniqueNameConfigMap(hospitalId, null, uniqueNameList);
|
|
|
+ Map<String, Map<String, Map<String, List<String>>>> uniqueNameMap
|
|
|
+ = mappingConfigFacade.groupByUniqueNameWithName(uniqueNameList, ConceptTypeEnum.LisPack.getKey(), hospitalId);
|
|
|
+
|
|
|
if (uniqueNameMap != null && uniqueNameMap.size() > 0) {
|
|
|
retLis.forEach(item -> {
|
|
|
if (uniqueNameMap.get(item.getName()) != null) {
|
|
|
- item.setHisNameList(new ArrayList<>(uniqueNameMap.get(item.getName()).keySet()));
|
|
|
+ item.setHisNameList(uniqueNameMap.get(item.getName())
|
|
|
+ .values().stream()
|
|
|
+ .map(i -> i.keySet())
|
|
|
+ .flatMap(Collection::stream)
|
|
|
+ .collect(Collectors.toList()));
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
return retLis;
|
|
@@ -127,12 +133,17 @@ public class AssemblePushAggregate {
|
|
|
List<String> uniqueNameList = retPacs.stream()
|
|
|
.map(i -> i.getName())
|
|
|
.collect(Collectors.toList());
|
|
|
- Map<String, Map<String, Long>> uniqueNameMap
|
|
|
- = pacsConfigFacade.getUniqueNameConfigMap(hospitalId, null, uniqueNameList);
|
|
|
+ Map<String, Map<String, Map<String, List<String>>>> uniqueNameMap
|
|
|
+ = mappingConfigFacade.groupByUniqueNameWithName(uniqueNameList, ConceptTypeEnum.Pacs.getKey(), hospitalId);
|
|
|
+
|
|
|
if (uniqueNameMap != null && uniqueNameMap.size() > 0) {
|
|
|
retPacs.forEach(item -> {
|
|
|
if (uniqueNameMap.get(item.getName()) != null) {
|
|
|
- item.setHisNameList(new ArrayList<>(uniqueNameMap.get(item.getName()).keySet()));
|
|
|
+ item.setHisNameList(uniqueNameMap.get(item.getName())
|
|
|
+ .values().stream()
|
|
|
+ .map(i -> i.keySet())
|
|
|
+ .flatMap(Collection::stream)
|
|
|
+ .collect(Collectors.toList()));
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -155,13 +166,18 @@ public class AssemblePushAggregate {
|
|
|
}
|
|
|
}
|
|
|
if (ListUtil.isNotEmpty(uniqueNameList)) {
|
|
|
- Map<String, Map<String, Long>> uniqueNameMap
|
|
|
- = diseaseConfigFacade.getUniqueNameConfigMap(hospitalId, null, uniqueNameList);
|
|
|
+ Map<String, Map<String, Map<String, List<String>>>> uniqueNameMap
|
|
|
+ = mappingConfigFacade.groupByUniqueNameWithName(uniqueNameList, ConceptTypeEnum.Disease.getKey(), hospitalId);
|
|
|
+
|
|
|
for (Map.Entry<String, List<PushBaseDTO>> entry : retMap.entrySet()) {
|
|
|
if (uniqueNameMap != null && uniqueNameMap.size() > 0) {
|
|
|
entry.getValue().forEach(item -> {
|
|
|
if (uniqueNameMap.get(item.getName()) != null) {
|
|
|
- item.setHisNameList(new ArrayList<>(uniqueNameMap.get(item.getName()).keySet()));
|
|
|
+ item.setHisNameList(uniqueNameMap.get(item.getName())
|
|
|
+ .values().stream()
|
|
|
+ .map(i -> i.keySet())
|
|
|
+ .flatMap(Collection::stream)
|
|
|
+ .collect(Collectors.toList()));
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -181,12 +197,17 @@ public class AssemblePushAggregate {
|
|
|
List<String> uniqueNameList = retOperation.stream()
|
|
|
.map(i -> i.getName())
|
|
|
.collect(Collectors.toList());
|
|
|
- Map<String, Map<String, Long>> uniqueNameMap
|
|
|
- = operationConfigFacade.getUniqueNameConfigMap(hospitalId, null, uniqueNameList);
|
|
|
+ Map<String, Map<String, Map<String, List<String>>>> uniqueNameMap
|
|
|
+ = mappingConfigFacade.groupByUniqueNameWithName(uniqueNameList, ConceptTypeEnum.Operation.getKey(), hospitalId);
|
|
|
+
|
|
|
if (uniqueNameMap != null && uniqueNameMap.size() > 0) {
|
|
|
retOperation.forEach(item -> {
|
|
|
if (uniqueNameMap.get(item.getName()) != null) {
|
|
|
- item.setHisNameList(new ArrayList<>(uniqueNameMap.get(item.getName()).keySet()));
|
|
|
+ item.setHisNameList(uniqueNameMap.get(item.getName())
|
|
|
+ .values().stream()
|
|
|
+ .map(i -> i.keySet())
|
|
|
+ .flatMap(Collection::stream)
|
|
|
+ .collect(Collectors.toList()));
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -204,12 +225,17 @@ public class AssemblePushAggregate {
|
|
|
List<String> uniqueNameList = retDrug.stream()
|
|
|
.map(i -> i.getName())
|
|
|
.collect(Collectors.toList());
|
|
|
- Map<String, Map<String, Long>> uniqueNameMap
|
|
|
- = drugConfigFacade.getUniqueNameConfigMapWithoutForm(hospitalId, null, uniqueNameList);
|
|
|
+ Map<String, Map<String, Map<String, List<String>>>> uniqueNameMap
|
|
|
+ = mappingConfigFacade.groupByUniqueNameWithName(uniqueNameList, ConceptTypeEnum.Drug.getKey(), hospitalId);
|
|
|
+
|
|
|
if (uniqueNameMap != null && uniqueNameMap.size() > 0) {
|
|
|
retDrug.forEach(item -> {
|
|
|
if (uniqueNameMap.get(item.getName()) != null) {
|
|
|
- item.setHisNameList(new ArrayList<>(uniqueNameMap.get(item.getName()).keySet()));
|
|
|
+ item.setHisNameList(uniqueNameMap.get(item.getName())
|
|
|
+ .values().stream()
|
|
|
+ .map(i -> i.keySet())
|
|
|
+ .flatMap(Collection::stream)
|
|
|
+ .collect(Collectors.toList()));
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -227,12 +253,17 @@ public class AssemblePushAggregate {
|
|
|
List<String> uniqueNameList = retScale.stream()
|
|
|
.map(i -> i.getName())
|
|
|
.collect(Collectors.toList());
|
|
|
- Map<String, Map<String, Long>> uniqueNameMap
|
|
|
- = scaleConfigFacade.getUniqueNameConfigMap(hospitalId, null, uniqueNameList);
|
|
|
+ Map<String, Map<String, Map<String, List<String>>>> uniqueNameMap
|
|
|
+ = mappingConfigFacade.groupByUniqueNameWithName(uniqueNameList, ConceptTypeEnum.Scale.getKey(), hospitalId);
|
|
|
+
|
|
|
if (uniqueNameMap != null && uniqueNameMap.size() > 0) {
|
|
|
retScale.forEach(item -> {
|
|
|
if (uniqueNameMap.get(item.getName()) != null) {
|
|
|
- item.setHisNameList(new ArrayList<>(uniqueNameMap.get(item.getName()).keySet()));
|
|
|
+ item.setHisNameList(uniqueNameMap.get(item.getName())
|
|
|
+ .values().stream()
|
|
|
+ .map(i -> i.keySet())
|
|
|
+ .flatMap(Collection::stream)
|
|
|
+ .collect(Collectors.toList()));
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -250,12 +281,17 @@ public class AssemblePushAggregate {
|
|
|
List<String> uniqueNameList = retNurse.stream()
|
|
|
.map(i -> i.getName())
|
|
|
.collect(Collectors.toList());
|
|
|
- Map<String, Map<String, Long>> uniqueNameMap
|
|
|
- = nurseConfigFacade.getUniqueNameConfigMap(hospitalId, null, uniqueNameList);
|
|
|
+ Map<String, Map<String, Map<String, List<String>>>> uniqueNameMap
|
|
|
+ = mappingConfigFacade.groupByUniqueNameWithName(uniqueNameList, ConceptTypeEnum.Nurse.getKey(), hospitalId);
|
|
|
+
|
|
|
if (uniqueNameMap != null && uniqueNameMap.size() > 0) {
|
|
|
retNurse.forEach(item -> {
|
|
|
if (uniqueNameMap.get(item.getName()) != null) {
|
|
|
- item.setHisNameList(new ArrayList<>(uniqueNameMap.get(item.getName()).keySet()));
|
|
|
+ item.setHisNameList(uniqueNameMap.get(item.getName())
|
|
|
+ .values().stream()
|
|
|
+ .map(i -> i.keySet())
|
|
|
+ .flatMap(Collection::stream)
|
|
|
+ .collect(Collectors.toList()));
|
|
|
}
|
|
|
});
|
|
|
}
|