|
@@ -163,6 +163,18 @@ public class NeoFacade {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public void symptomVitalCache() {
|
|
|
|
+ List<String> diseaseProperty = nodeRepository.getSymptomClass();
|
|
|
|
+ if (ListUtil.isNotEmpty(diseaseProperty)) {
|
|
|
|
+ Map map = diseaseProperty.stream().collect(Collectors.toMap(
|
|
|
|
+ k -> RedisEnum.symptomVitalType.getName() + k,
|
|
|
|
+ v -> v,
|
|
|
|
+ (v1, v2) -> (v2)
|
|
|
|
+ ));
|
|
|
|
+ redisTemplate.opsForValue().multiSet(map);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 返回图谱中所有症状缓存信息
|
|
* 返回图谱中所有症状缓存信息
|
|
*
|
|
*
|
|
@@ -476,12 +488,11 @@ public class NeoFacade {
|
|
}
|
|
}
|
|
|
|
|
|
public List<String> getDisBySymptom(List<String> symptoms) {
|
|
public List<String> getDisBySymptom(List<String> symptoms) {
|
|
- List<String> symptomCache = getSymptomCache();
|
|
|
|
- //取交集
|
|
|
|
- symptoms.retainAll(symptomCache);
|
|
|
|
- long start = System.currentTimeMillis();
|
|
|
|
- List<String> allDis_bySymptom = pushDisBySymptom(symptomRepository, symptoms);
|
|
|
|
- long end = System.currentTimeMillis();
|
|
|
|
|
|
+ List<String> sv = redisUtil.getSv(symptoms);
|
|
|
|
+// List<String> symptomCache = getSymptomCache();
|
|
|
|
+// //取交集
|
|
|
|
+// symptoms.retainAll(symptomCache);
|
|
|
|
+ List<String> allDis_bySymptom = pushDisBySymptom(symptomRepository, sv);
|
|
return allDis_bySymptom;
|
|
return allDis_bySymptom;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -505,11 +516,8 @@ public class NeoFacade {
|
|
*/
|
|
*/
|
|
public List<String> pushDisBySymptom(SymptomNameRepository symptomNameRepository, List<String> symptoms) {
|
|
public List<String> pushDisBySymptom(SymptomNameRepository symptomNameRepository, List<String> symptoms) {
|
|
List<String> allDis = Lists.newArrayList();
|
|
List<String> allDis = Lists.newArrayList();
|
|
- /*List<Symptom> byNameIn = symptomNameRepository.findByNameIn(symptoms);
|
|
|
|
- allDis = byNameIn.parallelStream()
|
|
|
|
- .map(z -> z.getDisease().stream().filter(o -> NeoUtil.matchBasic(o,sex,age)).map(y -> y.getName()).collect(Collectors.toList())).flatMap(List::stream)
|
|
|
|
- .collect(Collectors.toList());*/
|
|
|
|
- allDis = symptomNameRepository.getDisBySymptoms(symptoms);
|
|
|
|
|
|
+// allDis = symptomNameRepository.getDisBySymptoms(symptoms);
|
|
|
|
+ allDis = symptomNameRepository.getDisBySymptoms_1(symptoms);
|
|
return allDis;
|
|
return allDis;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1012,7 +1020,7 @@ public class NeoFacade {
|
|
getConvertMap(crfMap, StandConvertEnum.operation.toString(), operationConList, standConvert.getOperationList(), map);
|
|
getConvertMap(crfMap, StandConvertEnum.operation.toString(), operationConList, standConvert.getOperationList(), map);
|
|
getConvertMap(crfMap, StandConvertEnum.drug.toString(), drugConList, standConvert.getDrugList(), map);
|
|
getConvertMap(crfMap, StandConvertEnum.drug.toString(), drugConList, standConvert.getDrugList(), map);
|
|
getConvertMap(crfMap, StandConvertEnum.vital.toString(), vitallConList, standConvert.getVitalList(), map);
|
|
getConvertMap(crfMap, StandConvertEnum.vital.toString(), vitallConList, standConvert.getVitalList(), map);
|
|
- getConvertMap(crfMap, StandConvertEnum.disease.toString(), diseaseConList, standConvert.getDiaglList(), map);
|
|
|
|
|
|
+ getConvertMapDisease(crfMap, StandConvertEnum.disease.toString(), diseaseConList, standConvert.getDiaglList(), map);
|
|
getConvertMap(crfMap, StandConvertEnum.pacs.toString(), pacsConList, standConvert.getPacsList(), map);
|
|
getConvertMap(crfMap, StandConvertEnum.pacs.toString(), pacsConList, standConvert.getPacsList(), map);
|
|
getConvertMap(crfMap, StandConvertEnum.lis.toString(), lisConList, standConvert.getLisList(), map);
|
|
getConvertMap(crfMap, StandConvertEnum.lis.toString(), lisConList, standConvert.getLisList(), map);
|
|
getConvertMap(crfMap, StandConvertEnum.transfusion.toString(), transfusionConList, standConvert.getTransfusionList(), map);
|
|
getConvertMap(crfMap, StandConvertEnum.transfusion.toString(), transfusionConList, standConvert.getTransfusionList(), map);
|
|
@@ -1107,4 +1115,69 @@ public class NeoFacade {
|
|
}
|
|
}
|
|
map.put(type, typeMap);
|
|
map.put(type, typeMap);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取标准词转换map结果,并更新redis
|
|
|
|
+ *
|
|
|
|
+ * @param crfDTO
|
|
|
|
+ * @param type
|
|
|
|
+ * @param convertList
|
|
|
|
+ * @param map
|
|
|
|
+ */
|
|
|
|
+ public void getConvertMapDisease(Map<String, Map<String, StandConvertCrfDTO>> crfDTO, String type, List<String> convertList,
|
|
|
|
+ List<String> originList, Map<String, Map<String, String>> map) {
|
|
|
|
+ Map<String, String> typeMap = new LinkedHashMap<>();
|
|
|
|
+
|
|
|
|
+ if (ListUtil.isNotEmpty(convertList)) {
|
|
|
|
+ Map<String, StandConvertCrfDTO> crfMap = crfDTO.get(type);
|
|
|
|
+ for (String s : convertList) {
|
|
|
|
+ boolean convertFlag = false;
|
|
|
|
+ String lastS = s;
|
|
|
|
+ if (StringUtil.isBlank(s)) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ 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, "");
|
|
|
|
+ } else {
|
|
|
|
+ String rateStr = standConvertCrfDTO.getStandard_words().get(0).get("rate");
|
|
|
|
+ if (StringUtil.isBlank(rateStr)) {
|
|
|
|
+ redisUtil.updateValue(type + "Conv:" + s, "");
|
|
|
|
+ } else {
|
|
|
|
+ BigDecimal rate = new BigDecimal(rateStr);
|
|
|
|
+ int flag = rate.compareTo(new BigDecimal(standConvertRate));
|
|
|
|
+ if (flag < 0) {
|
|
|
|
+ redisUtil.updateValue(type + "Conv:" + s, "");
|
|
|
|
+ } else {
|
|
|
|
+ redisUtil.updateValue(type + "Conv:" + s, standConvertCrfDTO.getStandard_words().get(0).get("standard_word"));
|
|
|
|
+ lastS = standConvertCrfDTO.getStandard_words().get(0).get("standard_word");
|
|
|
|
+ convertFlag = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ redisUtil.updateValue(type + "Conv:" + s, "");
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ redisUtil.updateValue(type + "Conv:" + s, "");
|
|
|
|
+ }
|
|
|
|
+ if (convertFlag) {
|
|
|
|
+ typeMap.put(s, lastS);
|
|
|
|
+ } else {
|
|
|
|
+ typeMap.put(s, "");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // 将所有的词放入typeMap中
|
|
|
|
+ for (String s : originList) {
|
|
|
|
+ if (!typeMap.containsKey(s)) {
|
|
|
|
+ typeMap.put(s, s);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ map.put(type, typeMap);
|
|
|
|
+ }
|
|
}
|
|
}
|