|
@@ -5,6 +5,9 @@ import com.diagbot.dto.WordBillCrfDTO;
|
|
|
import com.diagbot.model.ai.AIAnalyze;
|
|
|
import com.diagbot.model.entity.Clinical;
|
|
|
import com.diagbot.model.label.ChiefLabel;
|
|
|
+import com.diagbot.model.label.DiagLabel;
|
|
|
+import com.diagbot.model.label.PastLabel;
|
|
|
+import com.diagbot.model.label.PresentLabel;
|
|
|
import com.diagbot.util.CoreUtil;
|
|
|
import com.diagbot.vo.IndicationPushVO;
|
|
|
import com.diagbot.vo.StandConvert;
|
|
@@ -26,36 +29,45 @@ public class CommonFacade {
|
|
|
@Autowired
|
|
|
CRFServiceClient crfServiceClient;
|
|
|
|
|
|
+ //组装好的label
|
|
|
public WordBillCrfDTO crf_process(IndicationPushVO indicationPushVO){
|
|
|
AIAnalyze aiAnalyze = new AIAnalyze(crfServiceClient);
|
|
|
WordBillCrfDTO wordBillCrfDTO = new WordBillCrfDTO();
|
|
|
aiAnalyze.aiProcess(indicationPushVO,wordBillCrfDTO);
|
|
|
return wordBillCrfDTO;
|
|
|
}
|
|
|
-
|
|
|
+ //返回给图谱的词,这些词需要转换成标准词
|
|
|
public StandConvert dataTypeGet(WordBillCrfDTO wordBillCrfDTO){
|
|
|
StandConvert standConvert = new StandConvert();
|
|
|
- List<String> clinicalList = new ArrayList<>();
|
|
|
|
|
|
+ //所有的症状(主诉、现病史)
|
|
|
+ List<String> clinicalList = new ArrayList<>();
|
|
|
ChiefLabel chiefLabel = wordBillCrfDTO.getChiefLabel();
|
|
|
clinicalList.addAll(CoreUtil.getPropertyList(chiefLabel.getClinicals()));
|
|
|
+ PresentLabel presentLabel = wordBillCrfDTO.getPresentLabel();
|
|
|
+ clinicalList.addAll(CoreUtil.getPropertyList(presentLabel.getClinicals()));
|
|
|
+
|
|
|
+ //所有的疾病(主诉、现病史,诊断列表,过去史)
|
|
|
+ DiagLabel diagLabel = wordBillCrfDTO.getDiagLabel();
|
|
|
+ PastLabel pastLabel = wordBillCrfDTO.getPastLabel();
|
|
|
+ List<String> diagList = new ArrayList<>();
|
|
|
+ diagList.addAll(CoreUtil.getPropertyList(chiefLabel.getDiags()));
|
|
|
+ diagList.addAll(CoreUtil.getPropertyList(presentLabel.getDiags()));
|
|
|
+ diagList.addAll(CoreUtil.getPropertyList(diagLabel.getDiags()));
|
|
|
+ diagList.addAll(CoreUtil.getPropertyList(pastLabel.getDiags()));
|
|
|
|
|
|
standConvert.setClinicalList(clinicalList);
|
|
|
+ standConvert.setDiaglList(diagList);
|
|
|
return standConvert;
|
|
|
}
|
|
|
-
|
|
|
+ //把图谱返回的标准词set到label中
|
|
|
public StandConvert dataTypeSet(WordBillCrfDTO wordBillCrfDTO, Map<String, Map<String, String>> map){
|
|
|
StandConvert standConvert = new StandConvert();
|
|
|
List<String> clinicalList = new ArrayList<>();
|
|
|
|
|
|
- Map<String, String> clinicMap = map.get("clinicalList");
|
|
|
ChiefLabel chiefLabel = wordBillCrfDTO.getChiefLabel();
|
|
|
- List<Clinical> clinicals = chiefLabel.getClinicals();
|
|
|
- for (Clinical c : clinicals) {
|
|
|
- if (clinicMap != null && clinicMap.get(c.getName()) != null) {
|
|
|
- c.setStandName(clinicMap.get(c.getName()));
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
+ CoreUtil.setPropertyList(chiefLabel.getClinicals(),map.get("clinicalList"));
|
|
|
|
|
|
standConvert.setClinicalList(clinicalList);
|
|
|
return standConvert;
|