|
@@ -142,6 +142,7 @@ public class PushFacade {
|
|
|
List<ConceptPushDTO> lisDTO = getConceptDTOList(nameList, LexiconTypeEnum.LIS_TABLES.getKey());
|
|
|
if (isConnect) {
|
|
|
lisDTO = addClientName(lisDTO, searchVo.getHosCode(), ConceptTypeEnum.Lis.getKey());
|
|
|
+ lisDTO = removeLisDetail(lisDTO);
|
|
|
}
|
|
|
pushDTO.setLab(lisDTO);
|
|
|
}
|
|
@@ -457,4 +458,36 @@ public class PushFacade {
|
|
|
}
|
|
|
return concepts;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 外部化验返回时,公表匹配出套餐,保留套餐,删除细项;否则保留公表
|
|
|
+ *
|
|
|
+ * @param lisDTO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<ConceptPushDTO> removeLisDetail(List<ConceptPushDTO> lisDTO) {
|
|
|
+ List<ConceptPushDTO> retLisDTO = Lists.newLinkedList();
|
|
|
+ if (ListUtil.isEmpty(lisDTO)) {
|
|
|
+ return retLisDTO;
|
|
|
+ }
|
|
|
+ List<String> mealNameList = lisDTO.stream().map(lis -> lis.getClientName()).filter(mealName -> mealName != null && mealName != "").distinct().collect(Collectors.toList());
|
|
|
+ List<ConceptPushDTO> mealConceptList = getConceptDTOList(mealNameList, LexiconTypeEnum.LIS_TABLES.getKey());
|
|
|
+ Map<String, ConceptPushDTO> mealConceptMap = EntityUtil.makeEntityMap(mealConceptList, "name");
|
|
|
+ List<String> addedName = Lists.newLinkedList();
|
|
|
+ for (ConceptPushDTO conceptPushDTO : lisDTO) {
|
|
|
+ if (addedName.contains(conceptPushDTO.getName())) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (StringUtil.isBlank(conceptPushDTO.getClientName()) || conceptPushDTO.getClientName().equals(conceptPushDTO.getName())) {
|
|
|
+ addedName.add(conceptPushDTO.getName());
|
|
|
+ retLisDTO.add(conceptPushDTO);
|
|
|
+ } else {
|
|
|
+ ConceptPushDTO conceptPushDTOConvert = mealConceptMap.get(conceptPushDTO.getClientName());
|
|
|
+ conceptPushDTOConvert.setClientName(conceptPushDTO.getClientName());
|
|
|
+ addedName.add(conceptPushDTOConvert.getName());
|
|
|
+ retLisDTO.add(conceptPushDTOConvert);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return retLisDTO;
|
|
|
+ }
|
|
|
}
|