|
@@ -813,21 +813,26 @@ public class NeoFacade {
|
|
|
List<String> lisConList = getConvertList(standConvert.getLisList(), StandConvertEnum.lis.toString(), standConvertCrfVOList);
|
|
|
List<String> transfusionConList = getConvertList(standConvert.getTransfusionList(), StandConvertEnum.transfusion.toString(), standConvertCrfVOList);
|
|
|
|
|
|
- StandConvertCrfBatchDTO standConvertCrfBatchDTO = null;
|
|
|
- try {
|
|
|
- standConvertCrfBatchDTO = standConvertServiceClient.similarityBatch(standConvertCrfVOList);
|
|
|
- } catch (Exception e) {
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "标准词转换【服务器】挂了!" + e.getMessage());
|
|
|
+ StandConvertCrfBatchDTO standConvertCrfBatchDTO = new StandConvertCrfBatchDTO();
|
|
|
+ if (!(ListUtil.isEmpty(clinicalConList) && ListUtil.isEmpty(operationConList) && ListUtil.isEmpty(drugConList)
|
|
|
+ && ListUtil.isEmpty(vitallConList) && ListUtil.isEmpty(diseaseConList) && ListUtil.isEmpty(pacsConList)
|
|
|
+ && ListUtil.isEmpty(lisConList) && ListUtil.isEmpty(transfusionConList))) {
|
|
|
+ try {
|
|
|
+ standConvertCrfBatchDTO = standConvertServiceClient.similarityBatch(standConvertCrfVOList);
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "标准词转换【服务器】挂了!" + e.getMessage());
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
Map<String, Map<String, StandConvertCrfDTO>> crfMap = standConvertCrfBatchDTO.getData();
|
|
|
- getConvertMap(crfMap, StandConvertEnum.symptom.toString(), clinicalConList, map);
|
|
|
- getConvertMap(crfMap, StandConvertEnum.operation.toString(), operationConList, map);
|
|
|
- getConvertMap(crfMap, StandConvertEnum.drug.toString(), drugConList, map);
|
|
|
- getConvertMap(crfMap, StandConvertEnum.vital.toString(), vitallConList, map);
|
|
|
- getConvertMap(crfMap, StandConvertEnum.disease.toString(), diseaseConList, map);
|
|
|
- getConvertMap(crfMap, StandConvertEnum.pacs.toString(), pacsConList, map);
|
|
|
- getConvertMap(crfMap, StandConvertEnum.lis.toString(), lisConList, map);
|
|
|
- getConvertMap(crfMap, StandConvertEnum.transfusion.toString(), transfusionConList, map);
|
|
|
+ getConvertMap(crfMap, StandConvertEnum.symptom.toString(), clinicalConList, standConvert.getClinicalList(), map);
|
|
|
+ getConvertMap(crfMap, StandConvertEnum.operation.toString(), operationConList, standConvert.getOperationList(), map);
|
|
|
+ getConvertMap(crfMap, StandConvertEnum.drug.toString(), drugConList, standConvert.getDrugList(), map);
|
|
|
+ getConvertMap(crfMap, StandConvertEnum.vital.toString(), vitallConList, standConvert.getVitalList(), map);
|
|
|
+ getConvertMap(crfMap, StandConvertEnum.disease.toString(), diseaseConList, standConvert.getDiaglList(), map);
|
|
|
+ getConvertMap(crfMap, StandConvertEnum.pacs.toString(), pacsConList, standConvert.getPacsList(), map);
|
|
|
+ getConvertMap(crfMap, StandConvertEnum.lis.toString(), lisConList, standConvert.getLisList(), map);
|
|
|
+ getConvertMap(crfMap, StandConvertEnum.transfusion.toString(), transfusionConList, standConvert.getTransfusionList(), map);
|
|
|
|
|
|
return map;
|
|
|
}
|
|
@@ -871,41 +876,46 @@ public class NeoFacade {
|
|
|
* @param map
|
|
|
*/
|
|
|
public void getConvertMap(Map<String, Map<String, StandConvertCrfDTO>> crfDTO, String type, List<String> convertList,
|
|
|
- Map<String, Map<String, String>> map) {
|
|
|
- if (ListUtil.isEmpty(convertList)) {
|
|
|
- return ;
|
|
|
- }
|
|
|
- Map<String, StandConvertCrfDTO> crfMap = crfDTO.get(type);
|
|
|
+ List<String> originList, Map<String, Map<String, String>> map) {
|
|
|
Map<String, String> typeMap = new LinkedHashMap<>();
|
|
|
|
|
|
- for (String s : convertList) {
|
|
|
- String lastS = s;
|
|
|
- if (crfMap != null) {
|
|
|
- StandConvertCrfDTO standConvertCrfDTO = crfMap.get(s);
|
|
|
- if (standConvertCrfDTO != null) {
|
|
|
- List<Map<String, String>> list = standConvertCrfDTO.getStandard_words();
|
|
|
- if (ListUtil.isEmpty(list)) {
|
|
|
- redisUtil.updateValue(type + "Conv:" + s, s);
|
|
|
- } else {
|
|
|
- String rateStr = standConvertCrfDTO.getStandard_words().get(0).get("rate");
|
|
|
- if (StringUtil.isBlank(rateStr)) {
|
|
|
+ if (ListUtil.isNotEmpty(convertList)) {
|
|
|
+ Map<String, StandConvertCrfDTO> crfMap = crfDTO.get(type);
|
|
|
+ for (String s : convertList) {
|
|
|
+ String lastS = s;
|
|
|
+ if (crfMap != null) {
|
|
|
+ StandConvertCrfDTO standConvertCrfDTO = crfMap.get(s);
|
|
|
+ if (standConvertCrfDTO != null) {
|
|
|
+ List<Map<String, String>> list = standConvertCrfDTO.getStandard_words();
|
|
|
+ if (ListUtil.isEmpty(list)) {
|
|
|
redisUtil.updateValue(type + "Conv:" + s, s);
|
|
|
} else {
|
|
|
- BigDecimal rate = new BigDecimal(rateStr);
|
|
|
- int flag = rate.compareTo(new BigDecimal(standConvertRate));
|
|
|
- if (flag < 0) {
|
|
|
+ String rateStr = standConvertCrfDTO.getStandard_words().get(0).get("rate");
|
|
|
+ if (StringUtil.isBlank(rateStr)) {
|
|
|
redisUtil.updateValue(type + "Conv:" + s, s);
|
|
|
} else {
|
|
|
- redisUtil.updateValue(type + "Conv:" + s, standConvertCrfDTO.getStandard_words().get(0).get("standard_word"));
|
|
|
- lastS = standConvertCrfDTO.getStandard_words().get(0).get("standard_word");
|
|
|
+ BigDecimal rate = new BigDecimal(rateStr);
|
|
|
+ int flag = rate.compareTo(new BigDecimal(standConvertRate));
|
|
|
+ if (flag < 0) {
|
|
|
+ redisUtil.updateValue(type + "Conv:" + s, s);
|
|
|
+ } else {
|
|
|
+ redisUtil.updateValue(type + "Conv:" + s, standConvertCrfDTO.getStandard_words().get(0).get("standard_word"));
|
|
|
+ lastS = standConvertCrfDTO.getStandard_words().get(0).get("standard_word");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ } else {
|
|
|
+ redisUtil.updateValue(type + "Conv:" + s, s);
|
|
|
}
|
|
|
- } else {
|
|
|
- redisUtil.updateValue(type + "Conv:" + s, s);
|
|
|
}
|
|
|
+ typeMap.put(s, lastS);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 将所有的词放入typeMap中
|
|
|
+ for (String s : originList) {
|
|
|
+ if (!typeMap.containsKey(s)) {
|
|
|
+ typeMap.put(s, s);
|
|
|
}
|
|
|
- typeMap.put(s, lastS);
|
|
|
}
|
|
|
map.put(type, typeMap);
|
|
|
}
|