فهرست منبع

转换标准词

kwzbigdata 4 سال پیش
والد
کامیت
016395922e

+ 2 - 1
src/main/java/com/diagbot/facade/BillFacade.java

@@ -5,6 +5,7 @@ import com.diagbot.dto.BillNeoDTO;
 import com.diagbot.dto.WordBillCrfDTO;
 import com.diagbot.vo.BillNeoVO;
 import com.diagbot.vo.IndicationPushVO;
+import com.diagbot.vo.StandConvert;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -31,7 +32,7 @@ public class BillFacade {
     public BillDTO billFac(IndicationPushVO indicationPushVO) {
         // 模型处理数据 TODO
         WordBillCrfDTO wordBillCrfDTO = commonFacade.crf_process(indicationPushVO);
-        commonFacade.dataTypeConvert(wordBillCrfDTO);
+        StandConvert standConvert = commonFacade.dataTypeGet(wordBillCrfDTO);
 
         // 标准词转换 TODO
 

+ 22 - 10
src/main/java/com/diagbot/facade/CommonFacade.java

@@ -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;

+ 2 - 1
src/main/java/com/diagbot/facade/NeoFacade.java

@@ -45,7 +45,8 @@ public class NeoFacade {
      * 标准词转换
      *
      * @param standConvert
-     * @return
+     *
+     * @return  Map<String, Map<String, String>> -->Map<类型, Map<原始词, 标准词>>
      */
     public Map<String, Map<String, String>> standConvert(StandConvert standConvert) {
         // TODO 待处理业务

+ 1 - 0
src/main/java/com/diagbot/vo/StandConvert.java

@@ -15,4 +15,5 @@ import java.util.List;
 @Data
 public class StandConvert {
     private List<String> clinicalList;
+    private List<String> diaglList;
 }