|
@@ -9,7 +9,10 @@ import com.diagbot.dto.HighRiskNeoDTO;
|
|
|
import com.diagbot.dto.NeoPushDTO;
|
|
|
import com.diagbot.dto.StandConvertCrfBatchDTO;
|
|
|
import com.diagbot.dto.StandConvertCrfDTO;
|
|
|
-import com.diagbot.entity.node.*;
|
|
|
+import com.diagbot.entity.node.ICDDisease;
|
|
|
+import com.diagbot.entity.node.Medicine;
|
|
|
+import com.diagbot.entity.node.Medicine_Anatomy;
|
|
|
+import com.diagbot.entity.node.Medicine_Code;
|
|
|
import com.diagbot.enums.StandConvertEnum;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
@@ -37,7 +40,6 @@ import com.diagbot.vo.NeoPushVO;
|
|
|
import com.diagbot.vo.StandConvert;
|
|
|
import com.diagbot.vo.StandConvertCrfVO;
|
|
|
import com.diagbot.vo.neoPushEntity.Diag;
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
@@ -390,6 +392,7 @@ public class NeoFacade {
|
|
|
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);
|
|
|
|
|
|
StandConvertCrfBatchDTO standConvertCrfBatchDTO = null;
|
|
|
try {
|
|
@@ -405,6 +408,7 @@ public class NeoFacade {
|
|
|
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);
|
|
|
|
|
|
return map;
|
|
|
}
|
|
@@ -456,53 +460,44 @@ public class NeoFacade {
|
|
|
List<String> orginList, Map<String, Map<String, String>> map) {
|
|
|
Map<String, StandConvertCrfDTO> crfMap = crfDTO.get(type);
|
|
|
Map<String, String> typeMap = new LinkedHashMap<>();
|
|
|
- // 从redis获取对应的内容
|
|
|
- Map<String, String> redisMap = null;
|
|
|
- redisMap = redisUtil.getValueByType(type);
|
|
|
- if (ListUtil.isEmpty(convertList) || crfMap == null) {
|
|
|
- for (String orgS : orginList) {
|
|
|
- String standWord = redisMap.get(orgS);
|
|
|
- if(StringUtils.isBlank(standWord)){
|
|
|
- standWord = orgS;
|
|
|
- }
|
|
|
- typeMap.put(orgS, standWord);
|
|
|
- }
|
|
|
- } else {
|
|
|
-
|
|
|
- if (redisMap == null) {
|
|
|
- redisMap = new LinkedHashMap<>();
|
|
|
- }
|
|
|
+ Boolean updateRedis = false;
|
|
|
|
|
|
- for (String s : convertList) {
|
|
|
+ // 从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) {
|
|
|
StandConvertCrfDTO standConvertCrfDTO = crfMap.get(s);
|
|
|
if (standConvertCrfDTO != null) {
|
|
|
String rateStr = standConvertCrfDTO.getStandard_words().get(0).get("rate");
|
|
|
- if (StringUtil.isBlank(rateStr)) {
|
|
|
- redisMap.put(s, s); // 没有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);
|
|
|
} else {
|
|
|
- BigDecimal rate = new BigDecimal(rateStr);
|
|
|
- int flag = rate.compareTo(new BigDecimal(standConvertRate));
|
|
|
- if (flag < 0) {
|
|
|
- redisMap.put(s, s); // rate 小于阈值
|
|
|
- } else {
|
|
|
- redisMap.put(s, standConvertCrfDTO.getStandard_words().get(0).get("standard_word"));
|
|
|
- }
|
|
|
+ redisMap.put(s, standConvertCrfDTO.getStandard_words().get(0).get("standard_word"));
|
|
|
+ typeMap.put(s, standConvertCrfDTO.getStandard_words().get(0).get("standard_word"));
|
|
|
}
|
|
|
} else {
|
|
|
redisMap.put(s, s); // 找不到就认为是标准词
|
|
|
+ typeMap.put(s, s); // 找不到就认为是标准词
|
|
|
}
|
|
|
+ updateRedis = true;
|
|
|
+ } else {
|
|
|
+ redisMap.put(s, s); // 找不到就认为是标准词
|
|
|
+ typeMap.put(s, s); // 找不到就认为是标准词
|
|
|
+ updateRedis = true;
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- // 更新redis
|
|
|
+ // 更新redis
|
|
|
+ if (updateRedis) {
|
|
|
redisUtil.updateValueByType(redisMap, type);
|
|
|
-
|
|
|
- for (String orgS : orginList) {
|
|
|
- if (StringUtil.isNotBlank(redisMap.get(orgS))) {
|
|
|
- typeMap.put(orgS, redisMap.get(orgS));
|
|
|
- } else {
|
|
|
- typeMap.put(orgS, orgS);
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
map.put(type, typeMap);
|
|
|
}
|