|
@@ -8,6 +8,9 @@ import com.diagbot.client.ChiefPresentSimilarityServiceClient;
|
|
|
import com.diagbot.client.StandConvertServiceClient;
|
|
|
import com.diagbot.dto.BillNeoDTO;
|
|
|
import com.diagbot.dto.CriticalNeoDTO;
|
|
|
+import com.diagbot.dto.DrugNameDTO;
|
|
|
+import com.diagbot.dto.DrugTypeCacheDTO;
|
|
|
+import com.diagbot.dto.DrugTypeDTO;
|
|
|
import com.diagbot.dto.HighRiskNeoDTO;
|
|
|
import com.diagbot.dto.NeoPushDTO;
|
|
|
import com.diagbot.dto.NodeNeoDTO;
|
|
@@ -152,6 +155,8 @@ public class NeoFacade {
|
|
|
|
|
|
@Autowired
|
|
|
private KlRuleFacade klRuleFacade;
|
|
|
+ @Autowired
|
|
|
+ private KlRelationFacade klRelationFacade;
|
|
|
|
|
|
/**
|
|
|
* 返回药品缓存信息
|
|
@@ -159,38 +164,43 @@ public class NeoFacade {
|
|
|
* @return
|
|
|
*/
|
|
|
// @Cacheable(value = "cache", key = "'drugCache'")
|
|
|
- public Map<String, List<String>> getDrugCache() {
|
|
|
- Map<String, List<String>> res = new HashMap<>();
|
|
|
-
|
|
|
- String med_type;
|
|
|
- String med_name;
|
|
|
- String comma = "::";
|
|
|
-
|
|
|
- List<String> medClass = nodeRepository.getMedHuaXueClass();
|
|
|
- medClass.addAll(nodeRepository.getMedYaoLiClass());
|
|
|
- medClass.addAll(nodeRepository.getMedZhiLiaoClass());
|
|
|
- medClass.addAll(nodeRepository.getMedJiePouClass());
|
|
|
-
|
|
|
-
|
|
|
- for (String medcls : medClass) {
|
|
|
- String[] spres = medcls.split(comma);
|
|
|
- med_type = spres[1];
|
|
|
- med_name = spres[0];
|
|
|
-
|
|
|
- if (res.get(med_type) == null) {
|
|
|
- res.put(med_type, new ArrayList<>());
|
|
|
- }
|
|
|
- if (res.get(med_type).indexOf(med_name) == -1) {
|
|
|
- res.get(med_type).add(med_name);
|
|
|
- }
|
|
|
+ public void getDrugCache() {
|
|
|
+ List<DrugTypeDTO> list = klRelationFacade.getDrugType();
|
|
|
+ List<DrugTypeCacheDTO> cacheDTOList = new ArrayList<>();
|
|
|
+ for (DrugTypeDTO drugTypeDTO : list) {
|
|
|
+ DrugTypeCacheDTO drugTypeCacheDTO = new DrugTypeCacheDTO();
|
|
|
+ drugTypeCacheDTO.setDrugType(drugTypeDTO.getDrugType());
|
|
|
+ drugTypeCacheDTO.setDrugs(drugTypeDTO.getDrugs().stream().map(DrugNameDTO::getDrug).collect(Collectors.toList()));
|
|
|
+ cacheDTOList.add(drugTypeCacheDTO);
|
|
|
}
|
|
|
- Map redisMap = res.entrySet().stream().collect(
|
|
|
- Collectors.toMap(k -> RedisEnum.drugType.getName() + k.getKey(),
|
|
|
- v -> v.getValue(), (v1, v2) -> (v2)));
|
|
|
+ // String med_type;
|
|
|
+ // String med_name;
|
|
|
+ // String comma = "::";
|
|
|
+ //
|
|
|
+ // List<String> medClass = nodeRepository.getMedHuaXueClass();
|
|
|
+ // medClass.addAll(nodeRepository.getMedYaoLiClass());
|
|
|
+ // medClass.addAll(nodeRepository.getMedZhiLiaoClass());
|
|
|
+ // medClass.addAll(nodeRepository.getMedJiePouClass());
|
|
|
+ //
|
|
|
+ //
|
|
|
+ // for (String medcls : medClass) {
|
|
|
+ // String[] spres = medcls.split(comma);
|
|
|
+ // med_type = spres[1];
|
|
|
+ // med_name = spres[0];
|
|
|
+ //
|
|
|
+ // if (res.get(med_type) == null) {
|
|
|
+ // res.put(med_type, new ArrayList<>());
|
|
|
+ // }
|
|
|
+ // if (res.get(med_type).indexOf(med_name) == -1) {
|
|
|
+ // res.get(med_type).add(med_name);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ Map redisMap = cacheDTOList.stream().collect(
|
|
|
+ Collectors.toMap(k -> RedisEnum.drugType.getName() + k.getDrugType(),
|
|
|
+ v -> v.getDrugs(), (v1, v2) -> (v2)));
|
|
|
if (redisMap != null && redisMap.size() > 0) {
|
|
|
redisTemplate.opsForValue().multiSet(redisMap);
|
|
|
}
|
|
|
- return res;
|
|
|
}
|
|
|
|
|
|
public void diseasePropertyCache() {
|
|
@@ -1383,7 +1393,7 @@ public class NeoFacade {
|
|
|
* 类型,疾病: disease,症状: symptom,手术和操作:operation,药品: drug,实验室检查:lis,辅助检查:pacs, 辅助检查:vital"
|
|
|
*
|
|
|
* @param standConvert
|
|
|
- * @return Map<String , Map < String , String>> -->Map<类型, Map<原始词, 标准词>>
|
|
|
+ * @return Map<String , Map < String , String>> -->Map<类型, Map<原始词, 标准词>>
|
|
|
*/
|
|
|
public Map<String, Map<String, String>> standConvertCrf(StandConvert standConvert) {
|
|
|
Map<String, Map<String, String>> map = new LinkedHashMap<>();
|