|
@@ -661,32 +661,39 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
|
|
|
//国药准字匹配:药品
|
|
|
if (type.equals(ConceptTypeEnum.Drug.getKey())) {
|
|
|
dataList = matchWithApproval(dataList, type);
|
|
|
+ dataList = checkStatus(dataList, type);
|
|
|
}
|
|
|
|
|
|
//标准词匹配
|
|
|
dataList = matchWithStandWord(dataList, type);
|
|
|
+ dataList = checkStatus(dataList, type);
|
|
|
|
|
|
//同义词匹配
|
|
|
dataList = matchWithSynonymsWord(dataList, type);
|
|
|
+ dataList = checkStatus(dataList, type);
|
|
|
|
|
|
//编码匹配:手术、中医疾病、中医证候
|
|
|
if (type.equals(ConceptTypeEnum.Operation.getKey())
|
|
|
|| type.equals(ConceptTypeEnum.Tcmdisease.getKey())
|
|
|
|| type.equals(ConceptTypeEnum.Tcmsyndrome.getKey())) {
|
|
|
dataList = matchWithCode(dataList, type);
|
|
|
+ dataList = checkStatus(dataList, type);
|
|
|
}
|
|
|
|
|
|
//历史匹配
|
|
|
dataList = matchWithHistory(dataList, type);
|
|
|
+ dataList = checkStatus(dataList, type);
|
|
|
|
|
|
//编码匹配:诊断
|
|
|
if (type.equals(ConceptTypeEnum.Disease.getKey())) {
|
|
|
dataList = matchWithCode(dataList, type);
|
|
|
+ dataList = checkStatus(dataList, type);
|
|
|
}
|
|
|
|
|
|
//药品关联国药准字、标准词、同义词匹配数据增加历史数据剂型
|
|
|
if (type.equals(ConceptTypeEnum.Drug.getKey())) {
|
|
|
dataList = addDrugForm(dataList, type);
|
|
|
+ dataList = checkStatus(dataList, type);
|
|
|
}
|
|
|
|
|
|
retList = BeanUtil.listCopyTo(dataList, MappingConfigWrapper.class);
|
|
@@ -698,10 +705,6 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
|
|
|
|
|
|
//添加编码
|
|
|
retList = addCodes(retList, type, StatusEnum.Enable.getKey());
|
|
|
-
|
|
|
- //校验标准词启用禁用状态
|
|
|
- retList = checkStatus(retList, type);
|
|
|
-
|
|
|
retList = retList.stream().distinct().collect(Collectors.toList());
|
|
|
return retList;
|
|
|
}
|
|
@@ -733,6 +736,7 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
|
|
|
|
|
|
ConceptVO conceptVO = new ConceptVO();
|
|
|
conceptVO.setSource(MatchSourceEnum.StandWord.getKey());
|
|
|
+ conceptVO.setStatus(StatusEnum.Enable.getKey());
|
|
|
conceptVO.setType(type);
|
|
|
conceptVO.setNames(nameList);
|
|
|
RespDTO<List<IndexBatchDTO>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
|
|
@@ -808,6 +812,7 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
|
|
|
.collect(Collectors.toList());
|
|
|
ConceptVO conceptVO = new ConceptVO();
|
|
|
conceptVO.setSource(MatchSourceEnum.SynonymsWord.getKey());
|
|
|
+ conceptVO.setStatus(StatusEnum.Enable.getKey());
|
|
|
conceptVO.setType(type);
|
|
|
conceptVO.setNames(synonymsNameList);
|
|
|
RespDTO<List<IndexBatchDTO>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
|
|
@@ -888,6 +893,7 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
|
|
|
} else {
|
|
|
ConceptVO conceptVO = new ConceptVO();
|
|
|
conceptVO.setSource(MatchSourceEnum.Code.getKey());
|
|
|
+ conceptVO.setStatus(StatusEnum.Enable.getKey());
|
|
|
conceptVO.setType(type);
|
|
|
conceptVO.setNames(codes);
|
|
|
RespDTO<List<IndexBatchDTO>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
|
|
@@ -1074,37 +1080,28 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
|
|
|
.filter(i -> i.getIsMatch() != null
|
|
|
&& i.getIsMatch().equals(1)
|
|
|
&& i.getSource() != null
|
|
|
- && (i.getSource().equals(MatchSourceEnum.StandWord.getKey())))
|
|
|
+ && (i.getSource().equals(MatchSourceEnum.StandWord.getKey())
|
|
|
+ || i.getSource().equals(MatchSourceEnum.Approval.getKey())
|
|
|
+ || i.getSource().equals(MatchSourceEnum.SynonymsWord.getKey())))
|
|
|
.map(MappingConfigWrapper::getHisName)
|
|
|
.distinct()
|
|
|
.collect(Collectors.toList());
|
|
|
- hisDrugNames.addAll(list.stream()
|
|
|
- .filter(i -> i.getIsMatch() != null
|
|
|
- && i.getIsMatch().equals(1)
|
|
|
- && i.getSource() != null
|
|
|
- && i.getSource().equals(MatchSourceEnum.SynonymsWord.getKey()))
|
|
|
- .map(MappingConfigWrapper::getUniqueName)
|
|
|
- .distinct()
|
|
|
- .collect(Collectors.toList()));
|
|
|
if (ListUtil.isNotEmpty(hisDrugNames)) {
|
|
|
- Map<String, Map<String, Map<String, List<String>>>> configMap = groupByHisNameWithName(hisDrugNames, type, null, null);
|
|
|
+ Map<String, Map<String, Map<String, List<String>>>> configMap
|
|
|
+ = groupByHisNameWithName(hisDrugNames, type, null, StatusEnum.Enable.getKey());
|
|
|
for (MappingConfigWrapper item : list) {
|
|
|
if (item.getIsMatch() != null && item.getIsMatch().equals(1)
|
|
|
&& item.getSource() != null
|
|
|
- && (item.getSource().equals(MatchSourceEnum.StandWord.getKey())
|
|
|
+ && (item.getSource().equals(MatchSourceEnum.Approval.getKey())
|
|
|
+ || item.getSource().equals(MatchSourceEnum.StandWord.getKey())
|
|
|
|| item.getSource().equals(MatchSourceEnum.SynonymsWord.getKey()))) {
|
|
|
if (item.getFormConceptId() != null && StringUtils.isNotBlank(item.getForm())) {
|
|
|
retList.add(item);
|
|
|
continue;
|
|
|
}
|
|
|
- if ((item.getSource().equals(MatchSourceEnum.StandWord.getKey())
|
|
|
- && configMap.containsKey(item.getHisName()))
|
|
|
- || (item.getSource().equals(MatchSourceEnum.SynonymsWord.getKey())
|
|
|
- && configMap.containsKey(item.getUniqueName()))) {
|
|
|
+ if (configMap.containsKey(item.getHisName())) {
|
|
|
Map<String, Map<String, List<String>>> subMap
|
|
|
- = configMap.get(item.getSource().equals(MatchSourceEnum.StandWord.getKey())
|
|
|
- ? item.getHisName()
|
|
|
- : item.getUniqueName());
|
|
|
+ = configMap.get(item.getHisName());
|
|
|
if (subMap != null && subMap.size() > 0) {
|
|
|
Map<String, List<String>> thirdMap = subMap.get(item.getHisDetailName());
|
|
|
if (thirdMap == null || thirdMap.size() == 0) {
|
|
@@ -1134,7 +1131,6 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
|
|
|
retList = BeanUtil.listCopyTo(list, MappingConfigWrapper.class);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
return retList;
|
|
|
}
|
|
|
|
|
@@ -1146,17 +1142,16 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
|
|
|
* @return
|
|
|
*/
|
|
|
public List<MappingConfigWrapper> checkStatus(List<MappingConfigWrapper> list, Integer type) {
|
|
|
-
|
|
|
//校验标准词是否启用
|
|
|
ConceptVO conceptVO = new ConceptVO();
|
|
|
conceptVO.setSource(MatchSourceEnum.StandWord.getKey());
|
|
|
+ conceptVO.setStatus(StatusEnum.Enable.getKey());
|
|
|
List<String> uniqueNames = list.stream()
|
|
|
.filter(i -> StringUtil.isNotBlank(i.getUniqueName()))
|
|
|
.map(MappingConfigWrapper::getUniqueName)
|
|
|
.distinct()
|
|
|
.collect(Collectors.toList());
|
|
|
conceptVO.setType(type);
|
|
|
- conceptVO.setStatus(StatusEnum.Enable.getKey());
|
|
|
RespDTO<List<IndexBatchDTO>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
|
|
|
if (RespDTOUtil.respIsOK(respDTO)) {
|
|
|
Map<String, IndexBatchDTO> dtoMap = respDTO.data.stream().collect(Collectors.toMap(IndexBatchDTO::getName, v -> v));
|