|
@@ -1,22 +1,35 @@
|
|
|
package com.diagbot.process;
|
|
|
|
|
|
import com.diagbot.biz.push.entity.Item;
|
|
|
-import com.diagbot.dto.*;
|
|
|
+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.enums.NeoEnum;
|
|
|
import com.diagbot.facade.NeoFacade;
|
|
|
import com.diagbot.model.entity.Clinical;
|
|
|
import com.diagbot.model.entity.Operation;
|
|
|
-import com.diagbot.model.label.*;
|
|
|
-import com.diagbot.rule.*;
|
|
|
+import com.diagbot.model.label.ChiefLabel;
|
|
|
+import com.diagbot.model.label.DiagLabel;
|
|
|
+import com.diagbot.model.label.PacsLabel;
|
|
|
+import com.diagbot.model.label.PastLabel;
|
|
|
+import com.diagbot.model.label.PresentLabel;
|
|
|
+import com.diagbot.rule.AgeRule;
|
|
|
+import com.diagbot.rule.CommonRule;
|
|
|
+import com.diagbot.rule.DrugRule;
|
|
|
+import com.diagbot.rule.GroupRule;
|
|
|
+import com.diagbot.rule.LisRule;
|
|
|
+import com.diagbot.rule.PacsRule;
|
|
|
+import com.diagbot.rule.SexRule;
|
|
|
+import com.diagbot.rule.VitalRule;
|
|
|
import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
-import java.util.LinkedHashMap;
|
|
|
import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -29,6 +42,23 @@ public class BillProcess {
|
|
|
|
|
|
@Autowired
|
|
|
NeoFacade neoFacade;
|
|
|
+ @Autowired
|
|
|
+ DrugRule drugRule;
|
|
|
+ @Autowired
|
|
|
+ SexRule sexRule;
|
|
|
+ @Autowired
|
|
|
+ AgeRule ageRule;
|
|
|
+ @Autowired
|
|
|
+ CommonRule commonRule;
|
|
|
+ @Autowired
|
|
|
+ LisRule lisRule;
|
|
|
+ @Autowired
|
|
|
+ PacsRule pacsRule;
|
|
|
+ @Autowired
|
|
|
+ VitalRule vitalRule;
|
|
|
+ @Autowired
|
|
|
+ GroupRule groupRule;
|
|
|
+
|
|
|
|
|
|
public void process(List<BillNeoDTO> billNeoDTOList, WordCrfDTO wordCrfDTO, IndicationDTO res) {
|
|
|
// 合并图谱数据到同一个对象中
|
|
@@ -109,8 +139,6 @@ public class BillProcess {
|
|
|
|
|
|
// 规则处理
|
|
|
public void processRule(List<BillNeoMaxDTO> billNeoMaxDTOList, WordCrfDTO wordCrfDTO, IndicationDTO indicationDTO) {
|
|
|
- // 获取药品缓存
|
|
|
- Map<String, List<String>> drugMap = new LinkedHashMap<>();
|
|
|
DiagLabel diagLabel = wordCrfDTO.getDiagLabel();
|
|
|
ChiefLabel chiefLabel = wordCrfDTO.getChiefLabel();
|
|
|
PresentLabel presentLabel = wordCrfDTO.getPresentLabel();
|
|
@@ -154,44 +182,44 @@ public class BillProcess {
|
|
|
List<BillMsg> billMsgList = new ArrayList<>();
|
|
|
for (BillNeoMaxDTO bill : billNeoMaxDTOList) {
|
|
|
// 性别
|
|
|
- SexRule.compareSexWithBill(wordCrfDTO, bill, billMsgList, NeoEnum.gender.getName());
|
|
|
+ sexRule.compareSexWithBill(wordCrfDTO, bill, billMsgList, NeoEnum.gender.getName());
|
|
|
|
|
|
// 年龄
|
|
|
- AgeRule.compareAgeWithBill(wordCrfDTO, bill, billMsgList, NeoEnum.ageNeoDTO.getName());
|
|
|
+ ageRule.compareAgeWithBill(wordCrfDTO, bill, billMsgList, NeoEnum.ageNeoDTO.getName());
|
|
|
|
|
|
// 诊断
|
|
|
- CommonRule.compareItemWithBill(bill.getDisease(), diags, bill, billMsgList, NeoEnum.disease.getName());
|
|
|
+ commonRule.compareItemWithBill(bill.getDisease(), diags, bill, billMsgList, NeoEnum.disease.getName());
|
|
|
|
|
|
// 化验
|
|
|
- LisRule.compareLisWithBill(wordCrfDTO.getLis(), bill, billMsgList, NeoEnum.lis.getName());
|
|
|
+ lisRule.compareLisWithBill(wordCrfDTO.getLis(), bill, billMsgList, NeoEnum.lis.getName());
|
|
|
|
|
|
// 体征
|
|
|
- VitalRule.compareVitalWithBill(wordCrfDTO.getVitalLabel(), bill, billMsgList, NeoEnum.vitals.getName());
|
|
|
+ vitalRule.compareVitalWithBill(wordCrfDTO.getVitalLabel(), bill, billMsgList, NeoEnum.vitals.getName());
|
|
|
|
|
|
// 辅检
|
|
|
- PacsRule.comparePacsWithBill(bill.getPacs(), wordCrfDTO.getPacs(), bill, billMsgList, NeoEnum.pacs.getName());
|
|
|
+ pacsRule.comparePacsWithBill(bill.getPacs(), wordCrfDTO.getPacs(), bill, billMsgList, NeoEnum.pacs.getName());
|
|
|
|
|
|
// 临床表现
|
|
|
- CommonRule.compareNameWithBill(bill.getClinicfindings(), clinicals, bill, billMsgList, NeoEnum.clinicfindings.getName());
|
|
|
+ commonRule.compareNameWithBill(bill.getClinicfindings(), clinicals, bill, billMsgList, NeoEnum.clinicfindings.getName());
|
|
|
|
|
|
// 手术(既往史、现病史)
|
|
|
- CommonRule.compareNameWithBill(bill.getOperations(), operations_present, bill, billMsgList, NeoEnum.operations.getName());
|
|
|
+ commonRule.compareNameWithBill(bill.getOperations(), operations_present, bill, billMsgList, NeoEnum.operations.getName());
|
|
|
|
|
|
// 禁忌过敏药品(既往史)
|
|
|
- DrugRule.compareDrugWithBill(bill.getAllergicmeds(), pastLabel.getAllergyMedicines(), bill, billMsgList, drugMap, NeoEnum.allergicmeds.getName());
|
|
|
+ drugRule.compareDrugWithBill(bill.getAllergicmeds(), pastLabel.getAllergyMedicines(), bill, billMsgList, NeoEnum.allergicmeds.getName());
|
|
|
|
|
|
// 服用药品(现病史一般情况后的药品)
|
|
|
- DrugRule.compareDrugWithBill(bill.getOralmeds(), presentLabel.getTakeMedicine(), bill, billMsgList, drugMap, NeoEnum.oralmeds.getName());
|
|
|
+ drugRule.compareDrugWithBill(bill.getOralmeds(), presentLabel.getTakeMedicine(), bill, billMsgList, NeoEnum.oralmeds.getName());
|
|
|
|
|
|
// 禁用人群
|
|
|
- GroupRule.compareGroupWithBill(wordCrfDTO, bill, billMsgList, NeoEnum.group.getName());
|
|
|
+ groupRule.compareGroupWithBill(wordCrfDTO, bill, billMsgList, NeoEnum.group.getName());
|
|
|
|
|
|
// 禁用辅助检查描述
|
|
|
- CommonRule.compareItemWithBill(bill.getPacsDesc(), pacsDescList, bill, billMsgList, NeoEnum.pacsDesc.getName());
|
|
|
+ commonRule.compareItemWithBill(bill.getPacsDesc(), pacsDescList, bill, billMsgList, NeoEnum.pacsDesc.getName());
|
|
|
}
|
|
|
|
|
|
// 24小时重复开单项
|
|
|
- CommonRule.repeat24Bill(wordCrfDTO, billMsgList);
|
|
|
+ commonRule.repeat24Bill(wordCrfDTO, billMsgList);
|
|
|
indicationDTO.setBillMsgList(billMsgList);
|
|
|
}
|
|
|
|