|
@@ -1,7 +1,5 @@
|
|
|
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;
|
|
@@ -9,23 +7,31 @@ import com.diagbot.dto.IndicationDTO;
|
|
|
import com.diagbot.dto.NodeNeoDTO;
|
|
|
import com.diagbot.dto.WordCrfDTO;
|
|
|
import com.diagbot.enums.NeoEnum;
|
|
|
-import com.diagbot.model.entity.*;
|
|
|
+import com.diagbot.facade.NeoFacade;
|
|
|
+import com.diagbot.model.entity.Clinical;
|
|
|
+import com.diagbot.model.entity.Diag;
|
|
|
+import com.diagbot.model.entity.GeneralDesc;
|
|
|
+import com.diagbot.model.entity.Medicine;
|
|
|
+import com.diagbot.model.entity.Operation;
|
|
|
import com.diagbot.model.label.ChiefLabel;
|
|
|
import com.diagbot.model.label.DiagLabel;
|
|
|
import com.diagbot.model.label.PastLabel;
|
|
|
import com.diagbot.model.label.PresentLabel;
|
|
|
import com.diagbot.rule.AgeRule;
|
|
|
-import com.diagbot.rule.DiagRule;
|
|
|
+import com.diagbot.rule.CommonRule;
|
|
|
+import com.diagbot.rule.DrugRule;
|
|
|
import com.diagbot.rule.LisRule;
|
|
|
import com.diagbot.rule.PacsRule;
|
|
|
import com.diagbot.rule.SexRule;
|
|
|
import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* @Description: 开单总入口
|
|
@@ -35,6 +41,9 @@ import java.util.List;
|
|
|
@Component
|
|
|
public class BillProcess {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ NeoFacade neoFacade;
|
|
|
+
|
|
|
public void process(List<BillNeoDTO> billNeoDTOList, WordCrfDTO wordCrfDTO, IndicationDTO res) {
|
|
|
// 合并图谱数据到同一个对象中
|
|
|
List<BillNeoMaxDTO> billNeoMaxDTOList = new ArrayList<>();
|
|
@@ -49,7 +58,7 @@ public class BillProcess {
|
|
|
}
|
|
|
billNeoMaxDTO.setOrderName(billNeoDTO.getName()); // 开单名称
|
|
|
billNeoMaxDTO.setOrderStandName(billNeoDTO.getStandname()); // 开单标准名称
|
|
|
- // 测试数据开始
|
|
|
+ // TODO 测试数据开始
|
|
|
if (billNeoDTO.getName().equals("普通胃镜检查")) {
|
|
|
NodeNeoDTO sexNeo = new NodeNeoDTO();
|
|
|
sexNeo.setName("男");
|
|
@@ -68,14 +77,11 @@ public class BillProcess {
|
|
|
billNeoDTO.getPacsBillNeoDTO().getOperations().add(opereat2);
|
|
|
|
|
|
NodeNeoDTO drug = new NodeNeoDTO();
|
|
|
- drug.setName("拜阿司匹林");
|
|
|
+ drug.setName("青霉素类");
|
|
|
billNeoDTO.getPacsBillNeoDTO().getAllergicmeds().add(drug);
|
|
|
- NodeNeoDTO drug2 = new NodeNeoDTO();
|
|
|
- drug2.setName("美多芭");
|
|
|
- billNeoDTO.getPacsBillNeoDTO().getAllergicmeds().add(drug2);
|
|
|
|
|
|
NodeNeoDTO drug3 = new NodeNeoDTO();
|
|
|
- drug3.setName("泰舒达");
|
|
|
+ drug3.setName("泰舒达类");
|
|
|
billNeoDTO.getPacsBillNeoDTO().getOralmeds().add(drug3);
|
|
|
|
|
|
}
|
|
@@ -89,18 +95,23 @@ public class BillProcess {
|
|
|
|
|
|
// 规则处理
|
|
|
public void processRule(List<BillNeoMaxDTO> billNeoMaxDTOList, WordCrfDTO wordCrfDTO, IndicationDTO indicationDTO) {
|
|
|
+ // 获取药品缓存
|
|
|
+ Map<String, List<String>> drugMap = neoFacade.getDrugCache();
|
|
|
DiagLabel diagLabel = wordCrfDTO.getDiagLabel();
|
|
|
ChiefLabel chiefLabel = wordCrfDTO.getChiefLabel();
|
|
|
PresentLabel presentLabel = wordCrfDTO.getPresentLabel();
|
|
|
PastLabel pastLabel = wordCrfDTO.getPastLabel();
|
|
|
- List<Diag> diags = new ArrayList<>();
|
|
|
- List<Clinical> clinicals = new ArrayList<>();
|
|
|
+
|
|
|
+ // 诊断数据
|
|
|
+ List<Diag> diags = diagLabel.getDiags();
|
|
|
+
|
|
|
+ // 手术数据
|
|
|
List<Operation> operations_present = presentLabel.getOperations();
|
|
|
List<Operation> operations_past = pastLabel.getOperations();
|
|
|
operations_present.addAll(operations_past);
|
|
|
- if(diagLabel != null){
|
|
|
- diags = diagLabel.getDiags();
|
|
|
- }
|
|
|
+
|
|
|
+ // 临床表现数据
|
|
|
+ List<Clinical> clinicals = new ArrayList<>();
|
|
|
if(chiefLabel != null && ListUtil.isNotEmpty(chiefLabel.getClinicals())){
|
|
|
clinicals.addAll(chiefLabel.getClinicals());
|
|
|
}
|
|
@@ -108,8 +119,6 @@ public class BillProcess {
|
|
|
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) {
|
|
@@ -120,25 +129,25 @@ public class BillProcess {
|
|
|
AgeRule.compareAgeWithBill(wordCrfDTO, bill, billMsgList, NeoEnum.ageNeoDTO.getName());
|
|
|
|
|
|
// 诊断
|
|
|
- DiagRule.compareDiseaseWithBill(bill.getDisease(), diags, bill, billMsgList, NeoEnum.disease.getName());
|
|
|
+ CommonRule.compareNameWithBill(bill.getDisease(), diags, bill, billMsgList, NeoEnum.disease.getName());
|
|
|
|
|
|
- //化验
|
|
|
- LisRule.compareLisWithBill(lis, bill, billMsgList, NeoEnum.lis.getName());
|
|
|
+ // 化验
|
|
|
+ LisRule.compareLisWithBill(wordCrfDTO.getLis(), bill, billMsgList, NeoEnum.lis.getName());
|
|
|
|
|
|
- //辅检
|
|
|
- PacsRule.comparePacsWithBill(bill.getPacs(), pacs, bill, billMsgList, NeoEnum.pacs.getName());
|
|
|
+ // 辅检
|
|
|
+ PacsRule.comparePacsWithBill(bill.getPacs(), wordCrfDTO.getPacs(), bill, billMsgList, NeoEnum.pacs.getName());
|
|
|
|
|
|
- //临床表现
|
|
|
- DiagRule.compareDiseaseWithBill(bill.getClinicfindings(), clinicals, bill, billMsgList, NeoEnum.clinicfindings.getName());
|
|
|
+ // 临床表现
|
|
|
+ CommonRule.compareNameWithBill(bill.getClinicfindings(), clinicals, bill, billMsgList, NeoEnum.clinicfindings.getName());
|
|
|
|
|
|
- //手术(既往史、现病史)
|
|
|
- DiagRule.compareDiseaseWithBill(bill.getOperations(), operations_present, bill, billMsgList, NeoEnum.operations.getName());
|
|
|
+ // 手术(既往史、现病史)
|
|
|
+ CommonRule.compareNameWithBill(bill.getOperations(), operations_present, bill, billMsgList, NeoEnum.operations.getName());
|
|
|
|
|
|
- //禁忌过敏药品(既往史)
|
|
|
- DiagRule.compareDiseaseWithBill(bill.getAllergicmeds(), pastLabel.getAllergyMedicines(), bill, billMsgList, NeoEnum.allergicmeds.getName());
|
|
|
+ // 禁忌过敏药品(既往史)
|
|
|
+ DrugRule.compareDrugWithBill(bill.getAllergicmeds(), pastLabel.getAllergyMedicines(), bill, billMsgList, drugMap, NeoEnum.allergicmeds.getName());
|
|
|
|
|
|
- //服用药品(现病史一般情况后的药品)
|
|
|
- DiagRule.compareDiseaseWithBill(bill.getOralmeds(), takeMedicine(presentLabel), bill, billMsgList, NeoEnum.oralmeds.getName());
|
|
|
+ // 服用药品(现病史一般情况后的药品)
|
|
|
+ DrugRule.compareDrugWithBill(bill.getOralmeds(), takeMedicine(presentLabel), bill, billMsgList, drugMap, NeoEnum.oralmeds.getName());
|
|
|
|
|
|
}
|
|
|
indicationDTO.setBillMsgList(billMsgList);
|
|
@@ -167,6 +176,5 @@ public class BillProcess {
|
|
|
}
|
|
|
}
|
|
|
return takems;
|
|
|
-
|
|
|
}
|
|
|
}
|