|
@@ -36,13 +36,14 @@ import com.diagbot.vo.BillNeoVO;
|
|
|
import com.diagbot.vo.CriticalNeoVO;
|
|
|
import com.diagbot.vo.HighRiskNeoVO;
|
|
|
import com.diagbot.vo.NeoPushVO;
|
|
|
-import com.diagbot.vo.PushNeoVO;
|
|
|
import com.diagbot.vo.StandConvert;
|
|
|
import com.diagbot.vo.StandConvertCrfVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.HashMap;
|
|
@@ -81,6 +82,8 @@ public class NeoFacade {
|
|
|
StandConvertServiceClient standConvertServiceClient;
|
|
|
@Autowired
|
|
|
RedisUtil redisUtil;
|
|
|
+ @Value("StandConvert.rate")
|
|
|
+ String standConvertRate;
|
|
|
|
|
|
/**
|
|
|
* 返回药品缓存信息
|
|
@@ -117,32 +120,6 @@ public class NeoFacade {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 返回文本相似度匹配需要的词性列表
|
|
|
- *
|
|
|
- * @return
|
|
|
- */
|
|
|
- @Cacheable(value = "cache", key = "'similarCache'")
|
|
|
- public Map<String, List<String>> getSimilarCache() {
|
|
|
- Map<String, List<String>> res = new HashMap<>();
|
|
|
- // 临床表现,诊断,化验,辅检,药品,查体,手术
|
|
|
- // TODO 测试数据
|
|
|
- res.put(StandConvertEnum.symptom.getName(), Arrays.asList("胸痛","咳嗽"));
|
|
|
- res.put(StandConvertEnum.disease.getName(), Arrays.asList("高血压", "糖尿病"));
|
|
|
- return res;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 通过诊断反推
|
|
|
- *
|
|
|
- * @return
|
|
|
- */
|
|
|
- public Map<String, PushDTO> getInverse(PushNeoVO pushNeoVO) {
|
|
|
- Map<String, PushDTO> map = getDiag(pushNeoVO.getDiags());
|
|
|
-
|
|
|
- return map;
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 图谱推送出来的数据
|
|
|
* @param pushVO
|
|
@@ -353,7 +330,7 @@ public class NeoFacade {
|
|
|
try {
|
|
|
standConvertCrfBatchDTO = standConvertServiceClient.similarityBatch(standConvertCrfVOList);
|
|
|
} catch (Exception e) {
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "标准词转换服务出错!【找毕金良】" + e.getMessage());
|
|
|
+ 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);
|
|
@@ -429,7 +406,18 @@ public class NeoFacade {
|
|
|
for (String s : convertList) {
|
|
|
StandConvertCrfDTO standConvertCrfDTO = crfMap.get(s);
|
|
|
if (standConvertCrfDTO != null) {
|
|
|
- redisMap.put(s, standConvertCrfDTO.getStandard_words().get(0).get("standard_word"));
|
|
|
+ String rateStr = standConvertCrfDTO.getStandard_words().get(0).get("rate");
|
|
|
+ if (StringUtil.isBlank(rateStr)) {
|
|
|
+ redisMap.put(s, s); // 没有rate就用原词
|
|
|
+ } 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"));
|
|
|
+ }
|
|
|
+ }
|
|
|
} else {
|
|
|
redisMap.put(s, s); // 找不到就认为是标准词
|
|
|
}
|