123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187 |
- package com.diagbot.process;
- import com.diagbot.biz.push.entity.Lis;
- import com.diagbot.biz.push.entity.Pacs;
- import com.diagbot.dto.BillMsg;
- import com.diagbot.dto.BillNeoDTO;
- import com.diagbot.dto.BillNeoMaxDTO;
- import com.diagbot.dto.IndicationDTO;
- import com.diagbot.dto.WordCrfDTO;
- import com.diagbot.model.entity.Clinical;
- import com.diagbot.model.entity.Diag;
- import com.diagbot.model.label.ChiefLabel;
- import com.diagbot.model.label.DiagLabel;
- import com.diagbot.model.label.PresentLabel;
- import com.diagbot.rule.*;
- import com.diagbot.util.BeanUtil;
- import com.diagbot.util.CoreUtil;
- import com.diagbot.util.ListUtil;
- import org.springframework.stereotype.Component;
- import java.util.ArrayList;
- import java.util.List;
- /**
- * @Description: 开单总入口
- * @author: zhoutg
- * @time: 2018/8/6 9:11
- */
- @Component
- public class BillProcess {
- public void process(List<BillNeoDTO> billNeoDTOList, WordCrfDTO wordCrfDTO, IndicationDTO res) {
- // 合并图谱数据到同一个对象中
- List<BillNeoMaxDTO> billNeoMaxDTOList = new ArrayList<>();
- for (BillNeoDTO billNeoDTO : billNeoDTOList) {
- BillNeoMaxDTO billNeoMaxDTO = new BillNeoMaxDTO();
- if (billNeoDTO.getDrugBillNeoDTO() != null) {
- BeanUtil.copyProperties(billNeoDTO.getDrugBillNeoDTO(), billNeoMaxDTO);
- } else if (billNeoDTO.getLisBillNeoDTO() != null) {
- BeanUtil.copyProperties(billNeoDTO.getLisBillNeoDTO(), billNeoMaxDTO);
- } else if (billNeoDTO.getPacsBillNeoDTO() != null) {
- BeanUtil.copyProperties(billNeoDTO.getPacsBillNeoDTO(), billNeoMaxDTO);
- }
- billNeoMaxDTO.setOrderName(billNeoDTO.getName()); // 开单名称
- billNeoMaxDTO.setOrderStandName(billNeoDTO.getStandname()); // 开单标准名称
- // 测试数据开始
- // billNeoMaxDTO.setGender("男");
- // billNeoMaxDTO.getAgeNeoDTO().setMax(new BigDecimal(30));
- // billNeoMaxDTO.getAgeNeoDTO().setMin(new BigDecimal(25));
- // 测试数据结束
- System.out.println(billNeoMaxDTO);
- billNeoMaxDTOList.add(billNeoMaxDTO);
- }
- processRule(billNeoMaxDTOList, wordCrfDTO, res);
- }
- // 规则处理
- public void processRule(List<BillNeoMaxDTO> billNeoMaxDTOList, WordCrfDTO wordCrfDTO, IndicationDTO indicationDTO) {
- DiagLabel diagLabel = wordCrfDTO.getDiagLabel();
- ChiefLabel chiefLabel = wordCrfDTO.getChiefLabel();
- PresentLabel presentLabel = wordCrfDTO.getPresentLabel();
- List<Diag> diags = new ArrayList<>();
- List<Clinical> clinicals = new ArrayList<>();
- if(diagLabel != null){
- diags = diagLabel.getDiags();
- }
- if(chiefLabel != null && ListUtil.isNotEmpty(chiefLabel.getClinicals())){
- clinicals.addAll(chiefLabel.getClinicals());
- }
- // 现病史临床表现数据先不用
- if(presentLabel != null && ListUtil.isNotEmpty(presentLabel.getClinicals())){
- clinicals.addAll(presentLabel.getClinicals());
- }
- List<Lis> lis = wordCrfDTO.getLis();
- List<Pacs> pacs = wordCrfDTO.getPacs();
- List<BillMsg> billMsgList = new ArrayList<>();
- for (BillNeoMaxDTO bill : billNeoMaxDTOList) {
- // 性别
- BillMsg sexMsg = SexRule.compareSexWithBill(bill.getGender(), wordCrfDTO, bill);
- CoreUtil.addBeanToList(billMsgList, sexMsg);
- // 诊断
- BillMsg billMsg_disease = DiagRule.compareDiseaseWithBill(bill.getDisease(), diags, bill);
- CoreUtil.addBeanToList(billMsgList, billMsg_disease);
- //化验
- BillMsg lisMsg = LisRule.compareLisWithBill(bill.getLis(), lis, bill);
- CoreUtil.addBeanToList(billMsgList, lisMsg);
- //辅检
- BillMsg pacsMsg = PacsRule.comparePacsWithBill(bill.getPacs(), pacs, bill);
- CoreUtil.addBeanToList(billMsgList, pacsMsg);
- //临床表现
- BillMsg clinicalMsg = DiagRule.compareDiseaseWithBill(bill.getClinicfindings(), clinicals, bill);
- CoreUtil.addBeanToList(billMsgList, clinicalMsg);
- // 年龄
- BillMsg ageMsg = AgeRule.compareAgeWithBill(bill.getAgeNeoDTO(), wordCrfDTO, bill);
- CoreUtil.addBeanToList(billMsgList, ageMsg);
- }
- indicationDTO.setBillMsgList(billMsgList);
- }
- //
- // /**
- // * 化验规则处理
- // *
- // * @param billNeoDTOList
- // * @param wordCrfDTO
- // * @param indicationDTO
- // */
- // public void processBillWithLis(List<BillNeoDTO> billNeoDTOList, WordCrfDTO wordCrfDTO, IndicationDTO indicationDTO) {
- //
- // }
- //
- // /**
- // * 辅检规则处理
- // *
- // * @param billNeoDTOList
- // * @param wordCrfDTO
- // * @param indicationDTO
- // */
- // public void processBillWithPacs(List<BillNeoDTO> billNeoDTOList, WordCrfDTO wordCrfDTO, IndicationDTO indicationDTO) {
- //
- // }
- //
- // /**
- // * 药品规则处理
- // *
- // * @param billNeoDTOList
- // * @param wordCrfDTO
- // * @param indicationDTO
- // */
- // public void processBillWithDrug(List<BillNeoDTO> billNeoDTOList, WordCrfDTO wordCrfDTO, IndicationDTO indicationDTO) {
- // DiagLabel diagLabel = wordCrfDTO.getDiagLabel();
- // ChiefLabel chiefLabel = wordCrfDTO.getChiefLabel();
- // PresentLabel presentLabel = wordCrfDTO.getPresentLabel();
- // List<Diag> diags = new ArrayList<>();
- // List<Clinical> clinicals = new ArrayList<>();
- // if(diagLabel != null){
- // diags = diagLabel.getDiags();
- // }
- // if(chiefLabel != null && ListUtil.isNotEmpty(chiefLabel.getClinicals())){
- // clinicals.addAll(chiefLabel.getClinicals());
- // }
- // // 现病史临床表现数据先不用
- // if(presentLabel != null && ListUtil.isNotEmpty(presentLabel.getClinicals())){
- // clinicals.addAll(presentLabel.getClinicals());
- // }
- // List<Lis> lis = wordCrfDTO.getLis();
- // List<Pacs> pacs = wordCrfDTO.getPacs();
- //
- // List<BillMsg> drugBill = new ArrayList<>();
- // for (BillNeoDTO bill : billNeoDTOList) {
- // DrugBillNeoDTO drug = bill.getDrugBillNeoDTO();
- // // 性别
- // BillMsg sexMsg = SexRule.compareSexWithBill(drug.getGender(), wordCrfDTO, bill.getName());
- // CoreUtil.addBeanToList(drugBill, sexMsg);
- //
- // // 诊断
- // BillMsg billMsg_disease = DiagRule.compareDiseaseWithBill(drug.getDisease(), diags, bill.getName());
- // CoreUtil.addBeanToList(drugBill, billMsg_disease);
- //
- // // //化验
- // // BillMsg lisMsg = LisPacsRule.compareLisPacsWithBill(drug.getLis(), lis, bill.getName());
- // // CoreUtil.addBeanToList(drugBill, lisMsg);
- // //
- // // //辅检
- // // BillMsg pacsMsg = LisPacsRule.compareLisPacsWithBill(drug.getPacs(), pacs, bill.getName());
- // // CoreUtil.addBeanToList(drugBill, pacsMsg);
- // //
- // // //临床表现
- // // BillMsg clinicalMsg = DiagRule.compareDiseaseWithBill(drug.getClinicfindings(), clinicals, bill.getName());
- // // CoreUtil.addBeanToList(drugBill, clinicalMsg);
- //
- // // 年龄
- // BillMsg ageMsg = AgeRule.compareAgeWithBill(drug.getAgeNeoDTO(), wordCrfDTO, bill.getName());
- // CoreUtil.addBeanToList(drugBill, ageMsg);
- //
- // }
- // indicationDTO.setDrugBill(drugBill);
- // }
- }
|