12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- 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
- * @time: 2018/8/6 9:11
- */
- @Component
- public class CommonFacade {
- @Autowired
- CRFServiceClient crfServiceClient;
- 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<>();
- 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;
- }
- }
|