|
@@ -1,79 +1,79 @@
|
|
|
-// package com.diagbot.facade;
|
|
|
-//
|
|
|
-// import com.diagbot.biz.push.entity.Item;
|
|
|
-// import com.diagbot.dto.IndicationDTO;
|
|
|
-// import com.diagbot.dto.BillNeoDTO;
|
|
|
-// import com.diagbot.dto.WordCrfDTO;
|
|
|
-// import com.diagbot.process.BillProcess;
|
|
|
-// import com.diagbot.vo.BillNeoVO;
|
|
|
-// import com.diagbot.vo.IndicationPushVO;
|
|
|
-// import com.diagbot.vo.PushVO;
|
|
|
-// import com.diagbot.vo.StandConvert;
|
|
|
-// import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-// import org.springframework.stereotype.Component;
|
|
|
-//
|
|
|
-// import java.util.List;
|
|
|
-// import java.util.Map;
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * @Description: 推送facade
|
|
|
-// * @author: zhoutg
|
|
|
-// * @time: 2018/8/6 9:11
|
|
|
-// */
|
|
|
-// @Component
|
|
|
-// public class PushFacade {
|
|
|
-//
|
|
|
-// @Autowired
|
|
|
-// NeoFacade neoFacade;
|
|
|
-// @Autowired
|
|
|
-// BillProcess billProcess;
|
|
|
-// @Autowired
|
|
|
-// CommonFacade commonFacade;
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 开单合理性业务
|
|
|
-// * @param
|
|
|
-// * @return
|
|
|
-// */
|
|
|
-// public IndicationDTO billFac(IndicationPushVO indicationPushVO) {
|
|
|
-// // 模型处理数据 TODO
|
|
|
-// WordCrfDTO wordCrfDTO = commonFacade.crf_process(indicationPushVO);
|
|
|
-// StandConvert standConvert = commonFacade.dataTypeGet(wordCrfDTO);
|
|
|
-//
|
|
|
-// // 标准词转换 TODO
|
|
|
-// Map<Integer, Map<String, String>> typeStand = neoFacade.standConvert(standConvert);
|
|
|
-// commonFacade.dataTypeSet(wordCrfDTO, typeStand);
|
|
|
-//
|
|
|
-// // 图谱接口调用
|
|
|
-// BillNeoVO billNeoVO = fillBillNeo(indicationPushVO);
|
|
|
-//
|
|
|
-// List<BillNeoDTO> billNeoDTOs = neoFacade.getBillNeo(billNeoVO);
|
|
|
-//
|
|
|
-// // 规则开发 TODO
|
|
|
-// neoFacade.getDrugCache();
|
|
|
-//
|
|
|
-// // TODO
|
|
|
-// return null;
|
|
|
-// }
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 推送业务
|
|
|
-// * @param
|
|
|
-// * @return
|
|
|
-// */
|
|
|
-// public IndicationDTO pushFac(PushVO pushVo) {
|
|
|
-// return null;
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-// public BillNeoVO fillBillNeo(IndicationPushVO indicationPushVO) {
|
|
|
-// BillNeoVO billNeoVO = new BillNeoVO();
|
|
|
-//
|
|
|
-// List<Item> items = indicationPushVO.getDrug();
|
|
|
-// for (Item item : items) {
|
|
|
-// billNeoVO.getDrugList().put(item.getName(), item.getUniqueName());
|
|
|
-// }
|
|
|
-//
|
|
|
-// return billNeoVO;
|
|
|
-// }
|
|
|
-// }
|
|
|
+package com.diagbot.facade;
|
|
|
+
|
|
|
+import com.diagbot.biz.push.entity.Item;
|
|
|
+import com.diagbot.dto.PushDTO;
|
|
|
+import com.diagbot.dto.WordCrfDTO;
|
|
|
+import com.diagbot.util.ListUtil;
|
|
|
+import com.diagbot.vo.BillNeoVO;
|
|
|
+import com.diagbot.vo.IndicationPushVO;
|
|
|
+import com.diagbot.vo.PushNeoVO;
|
|
|
+import com.diagbot.vo.PushVO;
|
|
|
+import com.diagbot.vo.StandConvert;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @Description: 推送facade
|
|
|
+ * @author: zhoutg
|
|
|
+ * @time: 2018/8/6 9:11
|
|
|
+ */
|
|
|
+@Component
|
|
|
+public class PushFacade {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ NeoFacade neoFacade;
|
|
|
+ @Autowired
|
|
|
+ CommonFacade commonFacade;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 推送业务
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public PushDTO pushFac(PushVO pushVo) {
|
|
|
+ PushDTO pushDTO = new PushDTO();
|
|
|
+ // 模型处理数据
|
|
|
+ WordCrfDTO wordCrfDTO = commonFacade.crf_process(pushVo);
|
|
|
+
|
|
|
+ // 标准词转换
|
|
|
+ StandConvert standConvert = commonFacade.dataTypeGet(wordCrfDTO);
|
|
|
+ Map<Integer, Map<String, String>> standConvertMap = neoFacade.standConvert(standConvert);
|
|
|
+ commonFacade.dataTypeSet(wordCrfDTO, standConvertMap);
|
|
|
+
|
|
|
+ List<String> ruleTypeList = Arrays.asList(pushVo.getFeatureType().split(","));
|
|
|
+
|
|
|
+ if (wordCrfDTO.getDiagLabel() != null && ListUtil.isNotEmpty(wordCrfDTO.getDiagLabel().getDiags())) { // 有诊断
|
|
|
+ List<String> diags = wordCrfDTO.getDiagLabel().getDiags().stream().map(r -> r.getStandName()).collect(Collectors.toList());
|
|
|
+ PushNeoVO pushNeoVO = new PushNeoVO();
|
|
|
+ pushNeoVO.setSex(pushVo.getSex());
|
|
|
+ pushNeoVO.setAge(pushVo.getAge());
|
|
|
+ pushNeoVO.setDiags(diags);
|
|
|
+ Map<String, Object> map = neoFacade.getInverse(pushNeoVO);
|
|
|
+ if (ruleTypeList.contains("5")) {
|
|
|
+ // TODO 存放化验
|
|
|
+ }
|
|
|
+
|
|
|
+ if (ruleTypeList.contains("6")) {
|
|
|
+ // TODO 存放辅检
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return pushDTO;
|
|
|
+ }
|
|
|
+
|
|
|
+ public BillNeoVO fillBillNeo(IndicationPushVO indicationPushVO) {
|
|
|
+ BillNeoVO billNeoVO = new BillNeoVO();
|
|
|
+
|
|
|
+ List<Item> items = indicationPushVO.getDrug();
|
|
|
+ for (Item item : items) {
|
|
|
+ billNeoVO.getDrugList().put(item.getName(), item.getUniqueName());
|
|
|
+ }
|
|
|
+
|
|
|
+ return billNeoVO;
|
|
|
+ }
|
|
|
+}
|