|
@@ -15,11 +15,7 @@ import org.apache.commons.collections4.MapUtils;
|
|
|
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;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -42,6 +38,7 @@ public class AssemblePushAggregate {
|
|
|
@DataConsumer("retDiagMap") Map<String, List<PushBaseDTO>> retDiagMap,
|
|
|
@DataConsumer("retOperation") List<PushBaseDTO> retOperation,
|
|
|
@DataConsumer("retDrug") List<PushBaseDTO> retDrug,
|
|
|
+ @DataConsumer("retDrugs") Map<String, List<PushBaseDTO>> retDrugs,
|
|
|
@DataConsumer("retScale") List<PushScaleDTO> retScale,
|
|
|
@DataConsumer("retNurse") List<PushBaseDTO> retNurse) {
|
|
|
//检验
|
|
@@ -64,6 +61,10 @@ public class AssemblePushAggregate {
|
|
|
if (ListUtil.isNotEmpty(retDrug)) {
|
|
|
data.setMedicines(retDrug);
|
|
|
}
|
|
|
+ //分类药品
|
|
|
+ if (MapUtils.isNotEmpty(retDrugs)) {
|
|
|
+ data.setMedicine(retDrugs);
|
|
|
+ }
|
|
|
//量表
|
|
|
if (ListUtil.isNotEmpty(retScale)) {
|
|
|
data.setScale(retScale);
|
|
@@ -223,6 +224,36 @@ public class AssemblePushAggregate {
|
|
|
return retDrug;
|
|
|
}
|
|
|
|
|
|
+ @DataProvider("retDrugs")
|
|
|
+ public Map<String, List<PushBaseDTO>> retDrugs(@InvokeParameter("pushDTO") PushDTO data,
|
|
|
+ @InvokeParameter("hospitalId") Long hospitalId) {
|
|
|
+ //药品
|
|
|
+ Map<String, List<PushBaseDTO>> retDrugs = new LinkedHashMap<>();
|
|
|
+ if(MapUtils.isNotEmpty(data.getMedicine())) {
|
|
|
+ retDrugs = data.getMedicine();
|
|
|
+ for(Map.Entry<String, List<PushBaseDTO>> entry : retDrugs.entrySet()) {
|
|
|
+ List<String> uniqueNameList = entry.getValue().stream()
|
|
|
+ .map(i -> i.getName())
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ Map<String, Map<String, Map<String, List<String>>>> uniqueNameMap
|
|
|
+ = mappingConfigFacade.groupByUniqueNameWithName(uniqueNameList, ConceptTypeEnum.Drug.getKey(), hospitalId, StatusEnum.Enable.getKey());
|
|
|
+
|
|
|
+ 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 retDrugs;
|
|
|
+ }
|
|
|
+
|
|
|
@DataProvider("retScale")
|
|
|
public List<PushScaleDTO> retScale(@InvokeParameter("pushDTO") PushDTO data,
|
|
|
@InvokeParameter("hospitalId") Long hospitalId) {
|