|
@@ -9,11 +9,30 @@ import com.diagbot.dto.LisBillNeoDTO;
|
|
|
import com.diagbot.dto.PacsBillNeoDTO;
|
|
|
import com.diagbot.dto.PushDTO;
|
|
|
import com.diagbot.dto.StandConvertCrfDTO;
|
|
|
-import com.diagbot.entity.node.*;
|
|
|
+import com.diagbot.entity.node.Disease;
|
|
|
+import com.diagbot.entity.node.LIS;
|
|
|
+import com.diagbot.entity.node.LISPack;
|
|
|
+import com.diagbot.entity.node.Medicine;
|
|
|
+import com.diagbot.entity.node.Medicine_Code;
|
|
|
+import com.diagbot.entity.node.OralMedicine;
|
|
|
+import com.diagbot.entity.node.PACS;
|
|
|
import com.diagbot.enums.StandConvertEnum;
|
|
|
+import com.diagbot.exception.CommonErrorCode;
|
|
|
+import com.diagbot.exception.CommonException;
|
|
|
import com.diagbot.model.ai.ModelAI;
|
|
|
-import com.diagbot.repository.*;
|
|
|
+import com.diagbot.repository.DiseaseNode;
|
|
|
+import com.diagbot.repository.DiseaseRepository;
|
|
|
+import com.diagbot.repository.LISNode;
|
|
|
+import com.diagbot.repository.LISPackNode;
|
|
|
+import com.diagbot.repository.LisPackRepository;
|
|
|
+import com.diagbot.repository.LisRepository;
|
|
|
+import com.diagbot.repository.MedicineCodeRepository;
|
|
|
+import com.diagbot.repository.MedicineNode;
|
|
|
+import com.diagbot.repository.MedicineRepository;
|
|
|
+import com.diagbot.repository.PACSNode;
|
|
|
+import com.diagbot.repository.PacsRepository;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
+import com.diagbot.util.RedisUtil;
|
|
|
import com.diagbot.vo.BillNeoVO;
|
|
|
import com.diagbot.vo.PushNeoVO;
|
|
|
import com.diagbot.vo.StandConvert;
|
|
@@ -58,6 +77,8 @@ public class NeoFacade {
|
|
|
NeoFacade self;
|
|
|
@Autowired
|
|
|
StandConvertServiceClient standConvertServiceClient;
|
|
|
+ @Autowired
|
|
|
+ RedisUtil redisUtil;
|
|
|
|
|
|
/**
|
|
|
* 返回药品缓存信息
|
|
@@ -307,82 +328,89 @@ public class NeoFacade {
|
|
|
public Map<String, Map<String, String>> standConvertCrf(StandConvert standConvert) {
|
|
|
Map<String, Map<String, String>> map = new LinkedHashMap<>();
|
|
|
|
|
|
- Map<String, String> clinicalMap = new LinkedHashMap<>();
|
|
|
- List<String> clinicalList = standConvert.getClinicalList();
|
|
|
- for (String s : clinicalList) {
|
|
|
- StandConvertCrfVO standConvertCrfVO = new StandConvertCrfVO();
|
|
|
- standConvertCrfVO.setWord_type("symptom");
|
|
|
- standConvertCrfVO.setWord(s);
|
|
|
- StandConvertCrfDTO standConvertCrfDTO = standConvertServiceClient.similarity(standConvertCrfVO);
|
|
|
- System.out.println(standConvertCrfDTO);
|
|
|
- if(ListUtil.isEmpty(standConvertCrfDTO.getStandard_words())){
|
|
|
- clinicalMap.put(s, s);
|
|
|
+ try {
|
|
|
+ Map<String, String> clinicalMap = new LinkedHashMap<>();
|
|
|
+ List<String> clinicalList = standConvert.getClinicalList();
|
|
|
+ for (String s : clinicalList) {
|
|
|
+ StandConvertCrfVO standConvertCrfVO = new StandConvertCrfVO();
|
|
|
+ standConvertCrfVO.setWord_type("symptom");
|
|
|
+ standConvertCrfVO.setWord(s);
|
|
|
+ StandConvertCrfDTO standConvertCrfDTO = standConvertServiceClient.similarity(standConvertCrfVO);
|
|
|
+ if (ListUtil.isEmpty(standConvertCrfDTO.getStandard_words())) {
|
|
|
+ clinicalMap.put(s, s);
|
|
|
+ } else {
|
|
|
+ clinicalMap.put(s, standConvertCrfDTO.getStandard_words().get(0).get("standard_word"));
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
- clinicalMap.put(s, standConvertCrfDTO.getStandard_words().get(0).get("standard_word"));
|
|
|
- }
|
|
|
- map.put(StandConvertEnum.clinical.getName(), clinicalMap);
|
|
|
+ map.put(StandConvertEnum.clinical.getName(), clinicalMap);
|
|
|
+
|
|
|
+ Map<String, String> operationMap = new LinkedHashMap<>();
|
|
|
+ List<String> operationList = standConvert.getOperationList();
|
|
|
+ for (String s : operationList) {
|
|
|
+ StandConvertCrfVO standConvertCrfVO = new StandConvertCrfVO();
|
|
|
+ standConvertCrfVO.setWord_type("operation");
|
|
|
+ standConvertCrfVO.setWord(s);
|
|
|
+ StandConvertCrfDTO standConvertCrfDTO = standConvertServiceClient.similarity(standConvertCrfVO);
|
|
|
+ if (ListUtil.isEmpty(standConvertCrfDTO.getStandard_words())) {
|
|
|
+ operationMap.put(s, s);
|
|
|
+ } else {
|
|
|
+ operationMap.put(s, standConvertCrfDTO.getStandard_words().get(0).get("standard_word"));
|
|
|
+ }
|
|
|
|
|
|
- Map<String, String> operationMap = new LinkedHashMap<>();
|
|
|
- List<String> operationList = standConvert.getOperationList();
|
|
|
- for (String s : operationList) {
|
|
|
- StandConvertCrfVO standConvertCrfVO = new StandConvertCrfVO();
|
|
|
- standConvertCrfVO.setWord_type("operation");
|
|
|
- standConvertCrfVO.setWord(s);
|
|
|
- StandConvertCrfDTO standConvertCrfDTO = standConvertServiceClient.similarity(standConvertCrfVO);
|
|
|
- System.out.println(standConvertCrfDTO);
|
|
|
- if(ListUtil.isEmpty(standConvertCrfDTO.getStandard_words())){
|
|
|
- operationMap.put(s, s);
|
|
|
}
|
|
|
- operationMap.put(s, standConvertCrfDTO.getStandard_words().get(0).get("standard_word"));
|
|
|
- }
|
|
|
- map.put(StandConvertEnum.operation.getName(), operationMap);
|
|
|
+ map.put(StandConvertEnum.operation.getName(), operationMap);
|
|
|
+
|
|
|
+ Map<String, String> drugMap = new LinkedHashMap<>();
|
|
|
+ List<String> drugList = standConvert.getDrugList();
|
|
|
+ for (String s : drugList) {
|
|
|
+ StandConvertCrfVO standConvertCrfVO = new StandConvertCrfVO();
|
|
|
+ standConvertCrfVO.setWord_type("drug");
|
|
|
+ standConvertCrfVO.setWord(s);
|
|
|
+ StandConvertCrfDTO standConvertCrfDTO = standConvertServiceClient.similarity(standConvertCrfVO);
|
|
|
+ if (ListUtil.isEmpty(standConvertCrfDTO.getStandard_words())) {
|
|
|
+ drugMap.put(s, s);
|
|
|
+ } else {
|
|
|
+ drugMap.put(s, standConvertCrfDTO.getStandard_words().get(0).get("standard_word"));
|
|
|
+ }
|
|
|
|
|
|
- Map<String, String> drugMap = new LinkedHashMap<>();
|
|
|
- List<String> drugList = standConvert.getDrugList();
|
|
|
- for (String s : drugList) {
|
|
|
- StandConvertCrfVO standConvertCrfVO = new StandConvertCrfVO();
|
|
|
- standConvertCrfVO.setWord_type("drug");
|
|
|
- standConvertCrfVO.setWord(s);
|
|
|
- StandConvertCrfDTO standConvertCrfDTO = standConvertServiceClient.similarity(standConvertCrfVO);
|
|
|
- System.out.println(standConvertCrfDTO);
|
|
|
- if(ListUtil.isEmpty(standConvertCrfDTO.getStandard_words())){
|
|
|
- drugMap.put(s, s);
|
|
|
}
|
|
|
- drugMap.put(s, standConvertCrfDTO.getStandard_words().get(0).get("standard_word"));
|
|
|
- }
|
|
|
- map.put(StandConvertEnum.drug.getName(), drugMap);
|
|
|
-
|
|
|
- Map<String, String> vitalMap = new LinkedHashMap<>();
|
|
|
- List<String> vitalList = standConvert.getDrugList();
|
|
|
- for (String s : vitalList) {
|
|
|
- StandConvertCrfVO standConvertCrfVO = new StandConvertCrfVO();
|
|
|
- standConvertCrfVO.setWord_type("vital");
|
|
|
- standConvertCrfVO.setWord(s);
|
|
|
- StandConvertCrfDTO standConvertCrfDTO = standConvertServiceClient.similarity(standConvertCrfVO);
|
|
|
- System.out.println(standConvertCrfDTO);
|
|
|
- if(ListUtil.isEmpty(standConvertCrfDTO.getStandard_words())){
|
|
|
- vitalMap.put(s, s);
|
|
|
+ map.put(StandConvertEnum.drug.getName(), drugMap);
|
|
|
+
|
|
|
+ Map<String, String> vitalMap = new LinkedHashMap<>();
|
|
|
+ List<String> vitalList = standConvert.getDrugList();
|
|
|
+ for (String s : vitalList) {
|
|
|
+ StandConvertCrfVO standConvertCrfVO = new StandConvertCrfVO();
|
|
|
+ standConvertCrfVO.setWord_type("vital");
|
|
|
+ standConvertCrfVO.setWord(s);
|
|
|
+ StandConvertCrfDTO standConvertCrfDTO = standConvertServiceClient.similarity(standConvertCrfVO);
|
|
|
+ if (ListUtil.isEmpty(standConvertCrfDTO.getStandard_words())) {
|
|
|
+ vitalMap.put(s, s);
|
|
|
+ } else {
|
|
|
+ vitalMap.put(s, standConvertCrfDTO.getStandard_words().get(0).get("standard_word"));
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
- vitalMap.put(s, standConvertCrfDTO.getStandard_words().get(0).get("standard_word"));
|
|
|
- }
|
|
|
- map.put(StandConvertEnum.vital.getName(), vitalMap);
|
|
|
-
|
|
|
- Map<String, String> diseaseMap = new LinkedHashMap<>();
|
|
|
- List<String> diseaseList = standConvert.getDiaglList();
|
|
|
- for (String s : diseaseList) {
|
|
|
- StandConvertCrfVO standConvertCrfVO = new StandConvertCrfVO();
|
|
|
- standConvertCrfVO.setWord_type("disease");
|
|
|
- standConvertCrfVO.setWord(s);
|
|
|
- StandConvertCrfDTO standConvertCrfDTO = standConvertServiceClient.similarity(standConvertCrfVO);
|
|
|
- System.out.println(standConvertCrfDTO);
|
|
|
- if(ListUtil.isEmpty(standConvertCrfDTO.getStandard_words())){
|
|
|
- diseaseMap.put(s, s);
|
|
|
+ map.put(StandConvertEnum.vital.getName(), vitalMap);
|
|
|
+
|
|
|
+ Map<String, String> diseaseMap = new LinkedHashMap<>();
|
|
|
+ List<String> diseaseList = standConvert.getDiaglList();
|
|
|
+ for (String s : diseaseList) {
|
|
|
+ StandConvertCrfVO standConvertCrfVO = new StandConvertCrfVO();
|
|
|
+ standConvertCrfVO.setWord_type("disease");
|
|
|
+ standConvertCrfVO.setWord(s);
|
|
|
+ StandConvertCrfDTO standConvertCrfDTO = standConvertServiceClient.similarity(standConvertCrfVO);
|
|
|
+ if (ListUtil.isEmpty(standConvertCrfDTO.getStandard_words())) {
|
|
|
+ diseaseMap.put(s, s);
|
|
|
+ } else {
|
|
|
+ diseaseMap.put(s, standConvertCrfDTO.getStandard_words().get(0).get("standard_word"));
|
|
|
+ }
|
|
|
}
|
|
|
- diseaseMap.put(s, standConvertCrfDTO.getStandard_words().get(0).get("standard_word"));
|
|
|
- }
|
|
|
- map.put(StandConvertEnum.disease.getName(), diseaseMap);
|
|
|
+ map.put(StandConvertEnum.disease.getName(), diseaseMap);
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "标准词转换服务出错!【找毕金良】" + e.getMessage());
|
|
|
+ }
|
|
|
return map;
|
|
|
}
|
|
|
-
|
|
|
}
|