|
@@ -149,7 +149,7 @@ public class NeoFacade {
|
|
|
|
|
|
// 加载药品缓存
|
|
|
for (String key : res.keySet()) {
|
|
|
- redisUtil.updateValueByType(RedisEnum.drugType.getName() + key, res.get(key));
|
|
|
+ redisUtil.updateValue(RedisEnum.drugType.getName() + key, res.get(key));
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
@@ -797,14 +797,14 @@ public class NeoFacade {
|
|
|
Map<String, Map<String, String>> map = new LinkedHashMap<>();
|
|
|
|
|
|
List<StandConvertCrfVO> standConvertCrfVOList = new ArrayList<>();
|
|
|
- List<String> clinicalConList = getConvertList(standConvert.getClinicalList(), StandConvertEnum.symptom.getName(), standConvertCrfVOList);
|
|
|
- List<String> operationConList = getConvertList(standConvert.getOperationList(), StandConvertEnum.operation.getName(), standConvertCrfVOList);
|
|
|
- List<String> drugConList = getConvertList(standConvert.getDrugList(), StandConvertEnum.drug.getName(), standConvertCrfVOList);
|
|
|
- List<String> vitallConList = getConvertList(standConvert.getVitalList(), StandConvertEnum.vital.getName(), standConvertCrfVOList);
|
|
|
- List<String> diseaseConList = getConvertList(standConvert.getDiaglList(), StandConvertEnum.disease.getName(), standConvertCrfVOList);
|
|
|
- List<String> pacsConList = getConvertList(standConvert.getPacsList(), StandConvertEnum.pacs.getName(), standConvertCrfVOList);
|
|
|
- List<String> lisConList = getConvertList(standConvert.getLisList(), StandConvertEnum.lis.getName(), standConvertCrfVOList);
|
|
|
- List<String> transfusionConList = getConvertList(standConvert.getTransfusionList(), StandConvertEnum.transfusion.getName(), standConvertCrfVOList);
|
|
|
+ List<String> clinicalConList = getConvertList(standConvert.getClinicalList(), StandConvertEnum.symptom.toString(), standConvertCrfVOList);
|
|
|
+ List<String> operationConList = getConvertList(standConvert.getOperationList(), StandConvertEnum.operation.toString(), standConvertCrfVOList);
|
|
|
+ List<String> drugConList = getConvertList(standConvert.getDrugList(), StandConvertEnum.drug.toString(), standConvertCrfVOList);
|
|
|
+ List<String> vitallConList = getConvertList(standConvert.getVitalList(), StandConvertEnum.vital.toString(), standConvertCrfVOList);
|
|
|
+ List<String> diseaseConList = getConvertList(standConvert.getDiaglList(), StandConvertEnum.disease.toString(), standConvertCrfVOList);
|
|
|
+ List<String> pacsConList = getConvertList(standConvert.getPacsList(), StandConvertEnum.pacs.toString(), standConvertCrfVOList);
|
|
|
+ List<String> lisConList = getConvertList(standConvert.getLisList(), StandConvertEnum.lis.toString(), standConvertCrfVOList);
|
|
|
+ List<String> transfusionConList = getConvertList(standConvert.getTransfusionList(), StandConvertEnum.transfusion.toString(), standConvertCrfVOList);
|
|
|
|
|
|
StandConvertCrfBatchDTO standConvertCrfBatchDTO = null;
|
|
|
try {
|
|
@@ -813,14 +813,14 @@ public class NeoFacade {
|
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "标准词转换【服务器】挂了!" + e.getMessage());
|
|
|
}
|
|
|
Map<String, Map<String, StandConvertCrfDTO>> crfMap = standConvertCrfBatchDTO.getData();
|
|
|
- getConvertMap(crfMap, StandConvertEnum.symptom.getName(), clinicalConList, standConvert.getClinicalList(), map);
|
|
|
- getConvertMap(crfMap, StandConvertEnum.operation.getName(), operationConList, standConvert.getOperationList(), map);
|
|
|
- getConvertMap(crfMap, StandConvertEnum.drug.getName(), drugConList, standConvert.getDrugList(), map);
|
|
|
- getConvertMap(crfMap, StandConvertEnum.vital.getName(), vitallConList, standConvert.getVitalList(), map);
|
|
|
- getConvertMap(crfMap, StandConvertEnum.disease.getName(), diseaseConList, standConvert.getDiaglList(), map);
|
|
|
- getConvertMap(crfMap, StandConvertEnum.pacs.getName(), pacsConList, standConvert.getPacsList(), map);
|
|
|
- getConvertMap(crfMap, StandConvertEnum.lis.getName(), lisConList, standConvert.getLisList(), map);
|
|
|
- getConvertMap(crfMap, StandConvertEnum.transfusion.getName(), transfusionConList, standConvert.getTransfusionList(), map);
|
|
|
+ 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);
|
|
|
|
|
|
return map;
|
|
|
}
|
|
@@ -838,14 +838,10 @@ public class NeoFacade {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- // 从redis获取对应的内容
|
|
|
- Map<String, String> redisMap = redisUtil.getValueByType(type);
|
|
|
- if (redisMap == null) {
|
|
|
- redisMap = new LinkedHashMap<>();
|
|
|
- }
|
|
|
if (ListUtil.isNotEmpty(wordList)) {
|
|
|
for (String s : wordList) {
|
|
|
- if (StringUtil.isBlank(redisMap.get(s))) {
|
|
|
+ String value = redisUtil.getWithString(type + s);
|
|
|
+ if (StringUtil.isBlank(value)) {
|
|
|
StandConvertCrfVO standConvertCrfVO = new StandConvertCrfVO();
|
|
|
standConvertCrfVO.setWord_type(type);
|
|
|
standConvertCrfVO.setWord(s);
|
|
@@ -865,60 +861,40 @@ public class NeoFacade {
|
|
|
* @param crfDTO
|
|
|
* @param type
|
|
|
* @param convertList
|
|
|
- * @param orginList
|
|
|
* @param map
|
|
|
*/
|
|
|
public void getConvertMap(Map<String, Map<String, StandConvertCrfDTO>> crfDTO, String type, List<String> convertList,
|
|
|
- List<String> orginList, Map<String, Map<String, String>> map) {
|
|
|
- if (ListUtil.isEmpty(orginList)) {
|
|
|
+ Map<String, Map<String, String>> map) {
|
|
|
+ if (ListUtil.isEmpty(convertList)) {
|
|
|
return ;
|
|
|
}
|
|
|
Map<String, StandConvertCrfDTO> crfMap = crfDTO.get(type);
|
|
|
Map<String, String> typeMap = new LinkedHashMap<>();
|
|
|
- Boolean updateRedis = false;
|
|
|
|
|
|
- // 从redis获取对应的内容
|
|
|
- Map<String, String> redisMap = redisUtil.getValueByType(type);
|
|
|
- if (redisMap == null) {
|
|
|
- redisMap = new LinkedHashMap<>();
|
|
|
- }
|
|
|
- for (String s : orginList) {
|
|
|
- if (redisMap.containsKey(s)) {
|
|
|
- typeMap.put(s, redisMap.get(s));
|
|
|
- } else if (crfMap != null) {
|
|
|
+ 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();
|
|
|
+ List<Map<String, String>> list = standConvertCrfDTO.getStandard_words();
|
|
|
if (ListUtil.isEmpty(list)) {
|
|
|
- redisMap.put(s, s);
|
|
|
- typeMap.put(s, s);
|
|
|
+ redisUtil.updateValue(type + "Conv:" + s, s);
|
|
|
} else {
|
|
|
String rateStr = standConvertCrfDTO.getStandard_words().get(0).get("rate");
|
|
|
BigDecimal rate = new BigDecimal(rateStr);
|
|
|
int flag = rate.compareTo(new BigDecimal(standConvertRate));
|
|
|
if (flag < 0) {
|
|
|
- redisMap.put(s, s); // rate 小于阈值
|
|
|
- typeMap.put(s, s);
|
|
|
+ redisUtil.updateValue(type + "Conv:" + s, s);
|
|
|
} else {
|
|
|
- redisMap.put(s, standConvertCrfDTO.getStandard_words().get(0).get("standard_word"));
|
|
|
- typeMap.put(s, standConvertCrfDTO.getStandard_words().get(0).get("standard_word"));
|
|
|
+ redisUtil.updateValue(type + "Conv:" + s, standConvertCrfDTO.getStandard_words().get(0).get("standard_word"));
|
|
|
+ lastS = standConvertCrfDTO.getStandard_words().get(0).get("standard_word");
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- redisMap.put(s, s); // 找不到就认为是标准词
|
|
|
- typeMap.put(s, s); // 找不到就认为是标准词
|
|
|
+ redisUtil.updateValue(type + "Conv:" + s, s);
|
|
|
}
|
|
|
- updateRedis = true;
|
|
|
- } else {
|
|
|
- redisMap.put(s, s); // 找不到就认为是标准词
|
|
|
- typeMap.put(s, s); // 找不到就认为是标准词
|
|
|
- updateRedis = true;
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- // 更新redis
|
|
|
- if (updateRedis) {
|
|
|
- redisUtil.updateValueByType(redisMap, type);
|
|
|
+ typeMap.put(s, lastS);
|
|
|
}
|
|
|
map.put(type, typeMap);
|
|
|
}
|