|
@@ -44,18 +44,26 @@ public class AssemblePushAggregate {
|
|
//检验
|
|
//检验
|
|
if (ListUtil.isNotEmpty(retLis)) {
|
|
if (ListUtil.isNotEmpty(retLis)) {
|
|
data.setLis(retLis);
|
|
data.setLis(retLis);
|
|
|
|
+ } else {
|
|
|
|
+ data.setOperations(null);
|
|
}
|
|
}
|
|
//检查
|
|
//检查
|
|
if (ListUtil.isNotEmpty(retPacs)) {
|
|
if (ListUtil.isNotEmpty(retPacs)) {
|
|
data.setPacs(retPacs);
|
|
data.setPacs(retPacs);
|
|
|
|
+ } else {
|
|
|
|
+ data.setOperations(null);
|
|
}
|
|
}
|
|
//诊断
|
|
//诊断
|
|
if (MapUtils.isNotEmpty(retDiagMap)) {
|
|
if (MapUtils.isNotEmpty(retDiagMap)) {
|
|
data.setDis(retDiagMap);
|
|
data.setDis(retDiagMap);
|
|
|
|
+ } else {
|
|
|
|
+ data.setOperations(null);
|
|
}
|
|
}
|
|
//手术
|
|
//手术
|
|
if (ListUtil.isNotEmpty(retOperation)) {
|
|
if (ListUtil.isNotEmpty(retOperation)) {
|
|
data.setOperations(retOperation);
|
|
data.setOperations(retOperation);
|
|
|
|
+ } else {
|
|
|
|
+ data.setOperations(null);
|
|
}
|
|
}
|
|
//药品
|
|
//药品
|
|
if (ListUtil.isNotEmpty(retDrug)) {
|
|
if (ListUtil.isNotEmpty(retDrug)) {
|
|
@@ -64,6 +72,8 @@ public class AssemblePushAggregate {
|
|
//分类药品
|
|
//分类药品
|
|
if (MapUtils.isNotEmpty(retDrugs)) {
|
|
if (MapUtils.isNotEmpty(retDrugs)) {
|
|
data.setMedicine(retDrugs);
|
|
data.setMedicine(retDrugs);
|
|
|
|
+ } else {
|
|
|
|
+ data.setOperations(null);
|
|
}
|
|
}
|
|
//量表
|
|
//量表
|
|
if (ListUtil.isNotEmpty(retScale)) {
|
|
if (ListUtil.isNotEmpty(retScale)) {
|
|
@@ -81,6 +91,9 @@ public class AssemblePushAggregate {
|
|
@InvokeParameter("hospitalId") Long hospitalId) {
|
|
@InvokeParameter("hospitalId") Long hospitalId) {
|
|
//检验
|
|
//检验
|
|
List<PushBaseDTO> retLis = new ArrayList<>();
|
|
List<PushBaseDTO> retLis = new ArrayList<>();
|
|
|
|
+ //检验出参
|
|
|
|
+ List<PushBaseDTO> retOutLis = new ArrayList<>();
|
|
|
|
+ Map<String, String> stringMap = new HashMap<>();
|
|
if (ListUtil.isNotEmpty(data.getLis())) {
|
|
if (ListUtil.isNotEmpty(data.getLis())) {
|
|
retLis = data.getLis();
|
|
retLis = data.getLis();
|
|
List<String> uniqueNameList = retLis.stream()
|
|
List<String> uniqueNameList = retLis.stream()
|
|
@@ -89,19 +102,42 @@ public class AssemblePushAggregate {
|
|
Map<String, Map<String, Map<String, List<String>>>> uniqueNameMap
|
|
Map<String, Map<String, Map<String, List<String>>>> uniqueNameMap
|
|
= mappingConfigFacade.groupByUniqueNameWithName(uniqueNameList, ConceptTypeEnum.LisPack.getKey(), hospitalId, StatusEnum.Enable.getKey());
|
|
= mappingConfigFacade.groupByUniqueNameWithName(uniqueNameList, ConceptTypeEnum.LisPack.getKey(), hospitalId, StatusEnum.Enable.getKey());
|
|
|
|
|
|
|
|
+ if (hospitalId == -1) {
|
|
|
|
+ return retLis;
|
|
|
|
+ }
|
|
|
|
+
|
|
if (uniqueNameMap != null && uniqueNameMap.size() > 0) {
|
|
if (uniqueNameMap != null && uniqueNameMap.size() > 0) {
|
|
- retLis.forEach(item -> {
|
|
|
|
- if (uniqueNameMap.get(item.getName()) != null) {
|
|
|
|
- item.setHisNameList(uniqueNameMap.get(item.getName())
|
|
|
|
- .values().stream()
|
|
|
|
- .map(i -> i.keySet())
|
|
|
|
- .flatMap(Collection::stream)
|
|
|
|
- .collect(Collectors.toList()));
|
|
|
|
|
|
+
|
|
|
|
+ for (Map.Entry<String, Map<String, Map<String, List<String>>>> uniqueNameMapEntry : uniqueNameMap.entrySet()) {
|
|
|
|
+ if (uniqueNameMapEntry.getValue() != null) {
|
|
|
|
+ for (Map.Entry<String, Map<String, List<String>>> entry : uniqueNameMapEntry.getValue().entrySet()) {
|
|
|
|
+ stringMap.put(uniqueNameMapEntry.getKey(), entry.getKey());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- });
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for(PushBaseDTO pushDto : retLis){
|
|
|
|
+ for (Map.Entry<String, String> stringEntry : stringMap.entrySet()) {
|
|
|
|
+ if (stringEntry.getValue().equals(pushDto.getName())) {
|
|
|
|
+ PushBaseDTO pushBaseDTO = new PushBaseDTO();
|
|
|
|
+ pushBaseDTO.setName(stringEntry.getKey());
|
|
|
|
+ retOutLis.add(pushBaseDTO);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+// retLis.forEach(item -> {
|
|
|
|
+// if (uniqueNameMap.get(item.getName()) != null) {
|
|
|
|
+// item.setHisNameList(uniqueNameMap.get(item.getName())
|
|
|
|
+// .values().stream()
|
|
|
|
+// .map(i -> i.keySet())
|
|
|
|
+// .flatMap(Collection::stream)
|
|
|
|
+// .collect(Collectors.toList()));
|
|
|
|
+// }
|
|
|
|
+// });
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return retLis;
|
|
|
|
|
|
+ return retOutLis;
|
|
}
|
|
}
|
|
|
|
|
|
@DataProvider("retPacs")
|
|
@DataProvider("retPacs")
|
|
@@ -109,6 +145,9 @@ public class AssemblePushAggregate {
|
|
@InvokeParameter("hospitalId") Long hospitalId) {
|
|
@InvokeParameter("hospitalId") Long hospitalId) {
|
|
//检查
|
|
//检查
|
|
List<PushBaseDTO> retPacs = new ArrayList<>();
|
|
List<PushBaseDTO> retPacs = new ArrayList<>();
|
|
|
|
+ //检查出参
|
|
|
|
+ List<PushBaseDTO> retOutPacs = new ArrayList<>();
|
|
|
|
+ Map<String, String> stringMap = new HashMap<>();
|
|
if (ListUtil.isNotEmpty(data.getPacs())) {
|
|
if (ListUtil.isNotEmpty(data.getPacs())) {
|
|
retPacs = data.getPacs();
|
|
retPacs = data.getPacs();
|
|
List<String> uniqueNameList = retPacs.stream()
|
|
List<String> uniqueNameList = retPacs.stream()
|
|
@@ -117,25 +156,55 @@ public class AssemblePushAggregate {
|
|
Map<String, Map<String, Map<String, List<String>>>> uniqueNameMap
|
|
Map<String, Map<String, Map<String, List<String>>>> uniqueNameMap
|
|
= mappingConfigFacade.groupByUniqueNameWithName(uniqueNameList, ConceptTypeEnum.Pacs.getKey(), hospitalId, StatusEnum.Enable.getKey());
|
|
= mappingConfigFacade.groupByUniqueNameWithName(uniqueNameList, ConceptTypeEnum.Pacs.getKey(), hospitalId, StatusEnum.Enable.getKey());
|
|
|
|
|
|
|
|
+ if (hospitalId == -1) {
|
|
|
|
+ return retPacs;
|
|
|
|
+ }
|
|
|
|
+
|
|
if (uniqueNameMap != null && uniqueNameMap.size() > 0) {
|
|
if (uniqueNameMap != null && uniqueNameMap.size() > 0) {
|
|
- retPacs.forEach(item -> {
|
|
|
|
- if (uniqueNameMap.get(item.getName()) != null) {
|
|
|
|
- item.setHisNameList(uniqueNameMap.get(item.getName())
|
|
|
|
- .values().stream()
|
|
|
|
- .map(i -> i.keySet())
|
|
|
|
- .flatMap(Collection::stream)
|
|
|
|
- .collect(Collectors.toList()));
|
|
|
|
|
|
+// // 遍历外层 Map
|
|
|
|
+// for (String key : uniqueNameMap.keySet()) {
|
|
|
|
+// // 创建 PushBaseDTO 对象并设置 name 字段
|
|
|
|
+// PushBaseDTO pushBaseDTO = new PushBaseDTO();
|
|
|
|
+// pushBaseDTO.setName(key);
|
|
|
|
+// retOutPacs.add(pushBaseDTO);
|
|
|
|
+// }
|
|
|
|
+ for (Map.Entry<String, Map<String, Map<String, List<String>>>> uniqueNameMapEntry : uniqueNameMap.entrySet()) {
|
|
|
|
+ if (uniqueNameMapEntry.getValue() != null) {
|
|
|
|
+ for (Map.Entry<String, Map<String, List<String>>> entry : uniqueNameMapEntry.getValue().entrySet()) {
|
|
|
|
+ stringMap.put(uniqueNameMapEntry.getKey(), entry.getKey());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- });
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for(PushBaseDTO pushDto : retPacs){
|
|
|
|
+ for (Map.Entry<String, String> stringEntry : stringMap.entrySet()) {
|
|
|
|
+ if (stringEntry.getValue().equals(pushDto.getName())) {
|
|
|
|
+ PushBaseDTO pushBaseDTO = new PushBaseDTO();
|
|
|
|
+ pushBaseDTO.setName(stringEntry.getKey());
|
|
|
|
+ retOutPacs.add(pushBaseDTO);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+// retPacs.forEach(item -> {
|
|
|
|
+// if (uniqueNameMap.get(item.getName()) != null) {
|
|
|
|
+// item.setHisNameList(uniqueNameMap.get(item.getName())
|
|
|
|
+// .values().stream()
|
|
|
|
+// .map(i -> i.keySet())
|
|
|
|
+// .flatMap(Collection::stream)
|
|
|
|
+// .collect(Collectors.toList()));
|
|
|
|
+// }
|
|
|
|
+// });
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return retPacs;
|
|
|
|
|
|
+ return retOutPacs;
|
|
}
|
|
}
|
|
|
|
|
|
@DataProvider("retDiagMap")
|
|
@DataProvider("retDiagMap")
|
|
public Map<String, List<PushBaseDTO>> retDiagMap(@InvokeParameter("pushDTO") PushDTO data,
|
|
public Map<String, List<PushBaseDTO>> retDiagMap(@InvokeParameter("pushDTO") PushDTO data,
|
|
@InvokeParameter("hospitalId") Long hospitalId) {
|
|
@InvokeParameter("hospitalId") Long hospitalId) {
|
|
Map<String, List<PushBaseDTO>> retMap = new HashMap<>();
|
|
Map<String, List<PushBaseDTO>> retMap = new HashMap<>();
|
|
|
|
+ //出参
|
|
|
|
+ Map<String, List<PushBaseDTO>> retOutDiags = new LinkedHashMap<>();
|
|
if (data.getDis() != null && data.getDis().size() > 0) {
|
|
if (data.getDis() != null && data.getDis().size() > 0) {
|
|
retMap = data.getDis();
|
|
retMap = data.getDis();
|
|
List<String> uniqueNameList = Lists.newLinkedList();
|
|
List<String> uniqueNameList = Lists.newLinkedList();
|
|
@@ -150,22 +219,39 @@ public class AssemblePushAggregate {
|
|
Map<String, Map<String, Map<String, List<String>>>> uniqueNameMap
|
|
Map<String, Map<String, Map<String, List<String>>>> uniqueNameMap
|
|
= mappingConfigFacade.groupByUniqueNameWithName(uniqueNameList, ConceptTypeEnum.Disease.getKey(), hospitalId, StatusEnum.Enable.getKey());
|
|
= mappingConfigFacade.groupByUniqueNameWithName(uniqueNameList, ConceptTypeEnum.Disease.getKey(), hospitalId, StatusEnum.Enable.getKey());
|
|
|
|
|
|
|
|
+ if (hospitalId == -1) {
|
|
|
|
+ return retMap;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ List<PushBaseDTO> diagList = new ArrayList<>();
|
|
for (Map.Entry<String, List<PushBaseDTO>> entry : retMap.entrySet()) {
|
|
for (Map.Entry<String, List<PushBaseDTO>> entry : retMap.entrySet()) {
|
|
if (uniqueNameMap != null && uniqueNameMap.size() > 0) {
|
|
if (uniqueNameMap != null && uniqueNameMap.size() > 0) {
|
|
- entry.getValue().forEach(item -> {
|
|
|
|
- if (uniqueNameMap.get(item.getName()) != null) {
|
|
|
|
- item.setHisNameList(uniqueNameMap.get(item.getName())
|
|
|
|
- .values().stream()
|
|
|
|
- .map(i -> i.keySet())
|
|
|
|
- .flatMap(Collection::stream)
|
|
|
|
- .collect(Collectors.toList()));
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ // 遍历外层 Map
|
|
|
|
+ for (String key : uniqueNameMap.keySet()) {
|
|
|
|
+ // 创建 PushBaseDTO 对象并设置 name 字段
|
|
|
|
+ PushBaseDTO pushBaseDTO = new PushBaseDTO();
|
|
|
|
+ pushBaseDTO.setName(key);
|
|
|
|
+ diagList.add(pushBaseDTO);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ retOutDiags.put(entry.getKey(), diagList);
|
|
}
|
|
}
|
|
|
|
+// 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(uniqueNameMap.get(item.getName())
|
|
|
|
+// .values().stream()
|
|
|
|
+// .map(i -> i.keySet())
|
|
|
|
+// .flatMap(Collection::stream)
|
|
|
|
+// .collect(Collectors.toList()));
|
|
|
|
+// }
|
|
|
|
+// });
|
|
|
|
+// }
|
|
|
|
+// }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return retMap;
|
|
|
|
|
|
+ return retOutDiags;
|
|
}
|
|
}
|
|
|
|
|
|
@DataProvider("retOperation")
|
|
@DataProvider("retOperation")
|
|
@@ -173,6 +259,8 @@ public class AssemblePushAggregate {
|
|
@InvokeParameter("hospitalId") Long hospitalId) {
|
|
@InvokeParameter("hospitalId") Long hospitalId) {
|
|
//手术
|
|
//手术
|
|
List<PushBaseDTO> retOperation = new ArrayList<>();
|
|
List<PushBaseDTO> retOperation = new ArrayList<>();
|
|
|
|
+ //手术出参
|
|
|
|
+ List<PushBaseDTO> retOutOperation = new ArrayList<>();
|
|
if (ListUtil.isNotEmpty(data.getOperations())) {
|
|
if (ListUtil.isNotEmpty(data.getOperations())) {
|
|
retOperation = data.getOperations();
|
|
retOperation = data.getOperations();
|
|
List<String> uniqueNameList = retOperation.stream()
|
|
List<String> uniqueNameList = retOperation.stream()
|
|
@@ -181,19 +269,29 @@ public class AssemblePushAggregate {
|
|
Map<String, Map<String, Map<String, List<String>>>> uniqueNameMap
|
|
Map<String, Map<String, Map<String, List<String>>>> uniqueNameMap
|
|
= mappingConfigFacade.groupByUniqueNameWithName(uniqueNameList, ConceptTypeEnum.Operation.getKey(), hospitalId, StatusEnum.Enable.getKey());
|
|
= mappingConfigFacade.groupByUniqueNameWithName(uniqueNameList, ConceptTypeEnum.Operation.getKey(), hospitalId, StatusEnum.Enable.getKey());
|
|
|
|
|
|
|
|
+ if (hospitalId == -1) {
|
|
|
|
+ return retOperation;
|
|
|
|
+ }
|
|
if (uniqueNameMap != null && uniqueNameMap.size() > 0) {
|
|
if (uniqueNameMap != null && uniqueNameMap.size() > 0) {
|
|
- retOperation.forEach(item -> {
|
|
|
|
- if (uniqueNameMap.get(item.getName()) != null) {
|
|
|
|
- item.setHisNameList(uniqueNameMap.get(item.getName())
|
|
|
|
- .values().stream()
|
|
|
|
- .map(i -> i.keySet())
|
|
|
|
- .flatMap(Collection::stream)
|
|
|
|
- .collect(Collectors.toList()));
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ // 遍历外层 Map
|
|
|
|
+ for (String key : uniqueNameMap.keySet()) {
|
|
|
|
+ // 创建 PushBaseDTO 对象并设置 name 字段
|
|
|
|
+ PushBaseDTO pushBaseDTO = new PushBaseDTO();
|
|
|
|
+ pushBaseDTO.setName(key);
|
|
|
|
+ retOutOperation.add(pushBaseDTO);
|
|
|
|
+ }
|
|
|
|
+// retOperation.forEach(item -> {
|
|
|
|
+// if (uniqueNameMap.get(item.getName()) != null) {
|
|
|
|
+// item.setHisNameList(uniqueNameMap.get(item.getName())
|
|
|
|
+// .values().stream()
|
|
|
|
+// .map(i -> i.keySet())
|
|
|
|
+// .flatMap(Collection::stream)
|
|
|
|
+// .collect(Collectors.toList()));
|
|
|
|
+// }
|
|
|
|
+// });
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return retOperation;
|
|
|
|
|
|
+ return retOutOperation;
|
|
}
|
|
}
|
|
|
|
|
|
@DataProvider("retDrug")
|
|
@DataProvider("retDrug")
|
|
@@ -226,32 +324,47 @@ public class AssemblePushAggregate {
|
|
|
|
|
|
@DataProvider("retDrugs")
|
|
@DataProvider("retDrugs")
|
|
public Map<String, List<PushBaseDTO>> retDrugs(@InvokeParameter("pushDTO") PushDTO data,
|
|
public Map<String, List<PushBaseDTO>> retDrugs(@InvokeParameter("pushDTO") PushDTO data,
|
|
- @InvokeParameter("hospitalId") Long hospitalId) {
|
|
|
|
|
|
+ @InvokeParameter("hospitalId") Long hospitalId) {
|
|
//药品
|
|
//药品
|
|
Map<String, List<PushBaseDTO>> retDrugs = new LinkedHashMap<>();
|
|
Map<String, List<PushBaseDTO>> retDrugs = new LinkedHashMap<>();
|
|
- if(MapUtils.isNotEmpty(data.getMedicine())) {
|
|
|
|
|
|
+ //出参
|
|
|
|
+ Map<String, List<PushBaseDTO>> retOutDrugs = new LinkedHashMap<>();
|
|
|
|
+ if (MapUtils.isNotEmpty(data.getMedicine())) {
|
|
retDrugs = data.getMedicine();
|
|
retDrugs = data.getMedicine();
|
|
- for(Map.Entry<String, List<PushBaseDTO>> entry : retDrugs.entrySet()) {
|
|
|
|
|
|
+ for (Map.Entry<String, List<PushBaseDTO>> entry : retDrugs.entrySet()) {
|
|
List<String> uniqueNameList = entry.getValue().stream()
|
|
List<String> uniqueNameList = entry.getValue().stream()
|
|
.map(i -> i.getName())
|
|
.map(i -> i.getName())
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
Map<String, Map<String, Map<String, List<String>>>> uniqueNameMap
|
|
Map<String, Map<String, Map<String, List<String>>>> uniqueNameMap
|
|
= mappingConfigFacade.groupByUniqueNameWithName(uniqueNameList, ConceptTypeEnum.Drug.getKey(), hospitalId, StatusEnum.Enable.getKey());
|
|
= mappingConfigFacade.groupByUniqueNameWithName(uniqueNameList, ConceptTypeEnum.Drug.getKey(), hospitalId, StatusEnum.Enable.getKey());
|
|
|
|
|
|
|
|
+ if (hospitalId == -1) {
|
|
|
|
+ return retDrugs;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ List<PushBaseDTO> drugList = new ArrayList<>();
|
|
if (uniqueNameMap != null && uniqueNameMap.size() > 0) {
|
|
if (uniqueNameMap != null && uniqueNameMap.size() > 0) {
|
|
- entry.getValue().forEach(item -> {
|
|
|
|
- if (uniqueNameMap.get(item.getName()) != null) {
|
|
|
|
- item.setHisNameList(uniqueNameMap.get(item.getName())
|
|
|
|
- .values().stream()
|
|
|
|
- .map(i -> i.keySet())
|
|
|
|
- .flatMap(Collection::stream)
|
|
|
|
- .collect(Collectors.toList()));
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ // 遍历外层 Map
|
|
|
|
+ for (String key : uniqueNameMap.keySet()) {
|
|
|
|
+ // 创建 PushBaseDTO 对象并设置 name 字段
|
|
|
|
+ PushBaseDTO pushBaseDTO = new PushBaseDTO();
|
|
|
|
+ pushBaseDTO.setName(key);
|
|
|
|
+ drugList.add(pushBaseDTO);
|
|
|
|
+ }
|
|
|
|
+ retOutDrugs.put(entry.getKey(), drugList);
|
|
|
|
+// entry.getValue().forEach(item -> {
|
|
|
|
+// if (uniqueNameMap.get(item.getName()) != null) {
|
|
|
|
+// item.setHisNameList(uniqueNameMap.get(item.getName())
|
|
|
|
+// .values().stream()
|
|
|
|
+// .map(i -> i.keySet())
|
|
|
|
+// .flatMap(Collection::stream)
|
|
|
|
+// .collect(Collectors.toList()));
|
|
|
|
+// }
|
|
|
|
+// });
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return retDrugs;
|
|
|
|
|
|
+ return retOutDrugs;
|
|
}
|
|
}
|
|
|
|
|
|
@DataProvider("retScale")
|
|
@DataProvider("retScale")
|