Преглед на файлове

Merge remote-tracking branch 'origin/master'

zhoutg преди 4 години
родител
ревизия
e6c39c06c4

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

@@ -31,6 +31,7 @@ public class BillFacade {
     public BillDTO billFac(IndicationPushVO indicationPushVO) {
         // 模型处理数据 TODO
         WordBillCrfDTO wordBillCrfDTO = commonFacade.crf_process(indicationPushVO);
+        commonFacade.dataTypeConvert(wordBillCrfDTO);
 
         // 标准词转换 TODO
 

+ 37 - 0
src/main/java/com/diagbot/facade/CommonFacade.java

@@ -3,10 +3,19 @@ package com.diagbot.facade;
 import com.diagbot.client.CRFServiceClient;
 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.util.CoreUtil;
 import com.diagbot.vo.IndicationPushVO;
+import com.diagbot.vo.StandConvert;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
 /**
  * @Description: 通过业务facade
  * @author: zhoutg
@@ -24,4 +33,32 @@ public class CommonFacade {
         return wordBillCrfDTO;
     }
 
+    public StandConvert dataTypeGet(WordBillCrfDTO wordBillCrfDTO){
+        StandConvert standConvert = new StandConvert();
+        List<String> clinicalList = new ArrayList<>();
+
+        ChiefLabel chiefLabel = wordBillCrfDTO.getChiefLabel();
+        clinicalList.addAll(CoreUtil.getPropertyList(chiefLabel.getClinicals()));
+
+        standConvert.setClinicalList(clinicalList);
+        return standConvert;
+    }
+
+    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()));
+            }
+        }
+
+        standConvert.setClinicalList(clinicalList);
+        return standConvert;
+    }
+
 }

+ 13 - 0
src/main/java/com/diagbot/facade/NeoFacade.java

@@ -2,6 +2,7 @@ package com.diagbot.facade;
 
 import com.diagbot.dto.BillNeoDTO;
 import com.diagbot.vo.BillNeoVO;
+import com.diagbot.vo.StandConvert;
 import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Component;
 
@@ -39,4 +40,16 @@ public class NeoFacade {
         res.put("ddd", new ArrayList<>());
         return res;
     }
+
+    /**
+     * 标准词转换
+     *
+     * @param standConvert
+     * @return
+     */
+    public Map<String, Map<String, String>> standConvert(StandConvert standConvert) {
+        // TODO 待处理业务
+        return null;
+    }
+
 }

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

@@ -0,0 +1,18 @@
+package com.diagbot.vo;
+
+import com.diagbot.model.entity.Clinical;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 标准词转换类
+ *
+ * @author kwz (zjlantone)
+ * @create 07 30, 2020
+ * @since 1.0.0
+ */
+@Data
+public class StandConvert {
+    private List<String> clinicalList;
+}