|
@@ -2,10 +2,10 @@ package com.diagbot.process;
|
|
|
|
|
|
import com.diagbot.biz.push.entity.Lis;
|
|
|
import com.diagbot.biz.push.entity.Pacs;
|
|
|
-import com.diagbot.dto.IndicationDTO;
|
|
|
import com.diagbot.dto.BillMsg;
|
|
|
import com.diagbot.dto.BillNeoDTO;
|
|
|
-import com.diagbot.dto.DrugBillNeoDTO;
|
|
|
+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;
|
|
@@ -15,6 +15,7 @@ import com.diagbot.model.label.PresentLabel;
|
|
|
import com.diagbot.rule.AgeRule;
|
|
|
import com.diagbot.rule.DiagRule;
|
|
|
import com.diagbot.rule.SexRule;
|
|
|
+import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.CoreUtil;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
import org.springframework.stereotype.Component;
|
|
@@ -31,44 +32,24 @@ import java.util.List;
|
|
|
public class BillProcess {
|
|
|
|
|
|
public void process(List<BillNeoDTO> billNeoDTOList, WordCrfDTO wordCrfDTO, IndicationDTO res) {
|
|
|
- // 化验规则处理
|
|
|
- processBillWithLis(billNeoDTOList, wordCrfDTO, res);
|
|
|
- // 辅检规则处理
|
|
|
- processBillWithPacs(billNeoDTOList, wordCrfDTO, res);
|
|
|
- // 药品规则处理
|
|
|
- processBillWithDrug(billNeoDTOList, wordCrfDTO, res);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 化验规则处理
|
|
|
- *
|
|
|
- * @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) {
|
|
|
-
|
|
|
+ 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.setName(billNeoDTO.getName());
|
|
|
+ billNeoMaxDTOList.add(billNeoMaxDTO);
|
|
|
+ }
|
|
|
+ processRule(billNeoMaxDTOList, wordCrfDTO, res);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 药品规则处理
|
|
|
- *
|
|
|
- * @param billNeoDTOList
|
|
|
- * @param wordCrfDTO
|
|
|
- * @param indicationDTO
|
|
|
- */
|
|
|
- public void processBillWithDrug(List<BillNeoDTO> billNeoDTOList, WordCrfDTO wordCrfDTO, IndicationDTO indicationDTO) {
|
|
|
+ // 规则处理
|
|
|
+ public void processRule(List<BillNeoMaxDTO> billNeoMaxDTOList, WordCrfDTO wordCrfDTO, IndicationDTO indicationDTO) {
|
|
|
DiagLabel diagLabel = wordCrfDTO.getDiagLabel();
|
|
|
ChiefLabel chiefLabel = wordCrfDTO.getChiefLabel();
|
|
|
PresentLabel presentLabel = wordCrfDTO.getPresentLabel();
|
|
@@ -88,14 +69,13 @@ public class BillProcess {
|
|
|
List<Pacs> pacs = wordCrfDTO.getPacs();
|
|
|
|
|
|
List<BillMsg> drugBill = new ArrayList<>();
|
|
|
- for (BillNeoDTO bill : billNeoDTOList) {
|
|
|
- DrugBillNeoDTO drug = bill.getDrugBillNeoDTO();
|
|
|
+ for (BillNeoMaxDTO bill : billNeoMaxDTOList) {
|
|
|
// 性别
|
|
|
- BillMsg sexMsg = SexRule.compareSexWithBill(drug.getGender(), wordCrfDTO, bill.getName());
|
|
|
+ BillMsg sexMsg = SexRule.compareSexWithBill(bill.getGender(), wordCrfDTO, bill.getName());
|
|
|
CoreUtil.addBeanToList(drugBill, sexMsg);
|
|
|
|
|
|
// 诊断
|
|
|
- BillMsg billMsg_disease = DiagRule.compareDiseaseWithBill(drug.getDisease(), diags, bill.getName());
|
|
|
+ BillMsg billMsg_disease = DiagRule.compareDiseaseWithBill(bill.getDisease(), diags, bill.getName());
|
|
|
CoreUtil.addBeanToList(drugBill, billMsg_disease);
|
|
|
|
|
|
// //化验
|
|
@@ -111,11 +91,90 @@ public class BillProcess {
|
|
|
// CoreUtil.addBeanToList(drugBill, clinicalMsg);
|
|
|
|
|
|
// 年龄
|
|
|
- BillMsg ageMsg = AgeRule.compareAgeWithBill(drug.getAgeNeoDTO(), wordCrfDTO, bill.getName());
|
|
|
+ BillMsg ageMsg = AgeRule.compareAgeWithBill(bill.getAgeNeoDTO(), wordCrfDTO, bill.getName());
|
|
|
CoreUtil.addBeanToList(drugBill, ageMsg);
|
|
|
|
|
|
}
|
|
|
indicationDTO.setDrugBill(drugBill);
|
|
|
}
|
|
|
+ //
|
|
|
+ // /**
|
|
|
+ // * 化验规则处理
|
|
|
+ // *
|
|
|
+ // * @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);
|
|
|
+ // }
|
|
|
|
|
|
}
|