|
@@ -1,14 +1,18 @@
|
|
package com.diagbot.process;
|
|
package com.diagbot.process;
|
|
|
|
|
|
import com.diagbot.biz.push.entity.Item;
|
|
import com.diagbot.biz.push.entity.Item;
|
|
-import com.diagbot.biz.push.entity.Pacs;
|
|
|
|
import com.diagbot.dto.BillMsg;
|
|
import com.diagbot.dto.BillMsg;
|
|
-import com.diagbot.dto.BillNeoDTO;
|
|
|
|
-import com.diagbot.dto.BillNeoMaxDTO;
|
|
|
|
import com.diagbot.dto.IndicationDTO;
|
|
import com.diagbot.dto.IndicationDTO;
|
|
|
|
+import com.diagbot.dto.RuleBaseDTO;
|
|
|
|
+import com.diagbot.dto.RuleConditionDTO;
|
|
|
|
+import com.diagbot.dto.RuleExtDTO;
|
|
|
|
+import com.diagbot.dto.RuleSimpleDTO;
|
|
import com.diagbot.dto.WordCrfDTO;
|
|
import com.diagbot.dto.WordCrfDTO;
|
|
-import com.diagbot.enums.NeoEnum;
|
|
|
|
-import com.diagbot.enums.TypeEnum;
|
|
|
|
|
|
+import com.diagbot.enums.BaseTypeEnum;
|
|
|
|
+import com.diagbot.enums.ConEnum;
|
|
|
|
+import com.diagbot.enums.LibTypeEnum;
|
|
|
|
+import com.diagbot.enums.RuleTypeEnum;
|
|
|
|
+import com.diagbot.facade.CommonFacade;
|
|
import com.diagbot.facade.NeoFacade;
|
|
import com.diagbot.facade.NeoFacade;
|
|
import com.diagbot.model.entity.Clinical;
|
|
import com.diagbot.model.entity.Clinical;
|
|
import com.diagbot.model.entity.Operation;
|
|
import com.diagbot.model.entity.Operation;
|
|
@@ -27,13 +31,14 @@ import com.diagbot.rule.SexRule;
|
|
import com.diagbot.rule.VitalRule;
|
|
import com.diagbot.rule.VitalRule;
|
|
import com.diagbot.util.BeanUtil;
|
|
import com.diagbot.util.BeanUtil;
|
|
import com.diagbot.util.CoreUtil;
|
|
import com.diagbot.util.CoreUtil;
|
|
-import com.diagbot.util.ListUtil;
|
|
|
|
-import com.diagbot.util.StringUtil;
|
|
|
|
|
|
+import com.diagbot.vo.RuleVO;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
+import java.util.LinkedHashSet;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Set;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @Description: 开单总入口
|
|
* @Description: 开单总入口
|
|
@@ -63,219 +68,360 @@ public class BillProcess {
|
|
GroupRule groupRule;
|
|
GroupRule groupRule;
|
|
@Autowired
|
|
@Autowired
|
|
MedEquRule medEquRule;
|
|
MedEquRule medEquRule;
|
|
-
|
|
|
|
- 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);
|
|
|
|
- billNeoMaxDTO.setType(TypeEnum.drug.getName());
|
|
|
|
- } else if (billNeoDTO.getLisBillNeoDTO() != null) {
|
|
|
|
- BeanUtil.copyProperties(billNeoDTO.getLisBillNeoDTO(), billNeoMaxDTO);
|
|
|
|
- billNeoMaxDTO.setType(TypeEnum.lis.getName());
|
|
|
|
- } else if (billNeoDTO.getPacsBillNeoDTO() != null) {
|
|
|
|
- BeanUtil.copyProperties(billNeoDTO.getPacsBillNeoDTO(), billNeoMaxDTO);
|
|
|
|
- billNeoMaxDTO.setType(TypeEnum.pacs.getName());
|
|
|
|
- } else if (billNeoDTO.getOperationBillNeoDTO() != null) {
|
|
|
|
- BeanUtil.copyProperties(billNeoDTO.getOperationBillNeoDTO(), billNeoMaxDTO);
|
|
|
|
- if (ListUtil.isNotEmpty(billNeoDTO.getOperationBillNeoDTO().getMedallegen())) {
|
|
|
|
- billNeoMaxDTO.getAllergicmeds().addAll(billNeoDTO.getOperationBillNeoDTO().getMedallegen());
|
|
|
|
- }
|
|
|
|
- billNeoMaxDTO.setType(TypeEnum.operation.getName());
|
|
|
|
- } else if (billNeoDTO.getTransfusionBillNeoDTO() != null) {
|
|
|
|
- BeanUtil.copyProperties(billNeoDTO.getTransfusionBillNeoDTO(), billNeoMaxDTO);
|
|
|
|
- billNeoMaxDTO.setType(TypeEnum.transfusion.getName());
|
|
|
|
- }
|
|
|
|
- billNeoMaxDTO.setOrderName(billNeoDTO.getName()); // 开单名称
|
|
|
|
- billNeoMaxDTO.setOrderStandName(billNeoDTO.getStandname()); // 开单标准名称
|
|
|
|
- // // TODO 测试数据开始
|
|
|
|
- // if (billNeoDTO.getStandname().equals("胸部CT")) {
|
|
|
|
- // NodeNeoDTO nodeNeoDTO = new NodeNeoDTO();
|
|
|
|
- // nodeNeoDTO.setName("幼儿");
|
|
|
|
- // billNeoMaxDTO.getGroup().add(nodeNeoDTO);
|
|
|
|
- // }
|
|
|
|
- // if (billNeoDTO.getStandname().equals("胸部CT")) {
|
|
|
|
- // NodeNeoDTO nodeNeoDTO = new NodeNeoDTO();
|
|
|
|
- // nodeNeoDTO.setName("心电图");
|
|
|
|
- // billNeoMaxDTO.getPacsOrder().add(nodeNeoDTO);
|
|
|
|
- // }
|
|
|
|
- // if (billNeoDTO.getStandname().equals("心电图")) {
|
|
|
|
- // NodeNeoDTO nodeNeoDTO = new NodeNeoDTO();
|
|
|
|
- // nodeNeoDTO.setName("胸部CT");
|
|
|
|
- // billNeoMaxDTO.getPacsOrder().add(nodeNeoDTO);
|
|
|
|
- // }
|
|
|
|
- // if (billNeoDTO.getName().equals("普通胃镜检查")) {
|
|
|
|
- // NodeNeoDTO sexNeo = new NodeNeoDTO();
|
|
|
|
- // sexNeo.setName("男");
|
|
|
|
- // billNeoMaxDTO.setGender(sexNeo);
|
|
|
|
- //
|
|
|
|
- // NodeNeoDTO nodeNeoDTO = new NodeNeoDTO();
|
|
|
|
- // nodeNeoDTO.setName("红细胞压积");
|
|
|
|
- // nodeNeoDTO.setVal("阳性");
|
|
|
|
- // billNeoDTO.getPacsBillNeoDTO().getLis().add(nodeNeoDTO);
|
|
|
|
- //
|
|
|
|
- // NodeNeoDTO nodepacsDTO = new NodeNeoDTO();
|
|
|
|
- // nodepacsDTO.setName("上腹部平扫");
|
|
|
|
- // billNeoDTO.getPacsBillNeoDTO().getPacs().add(nodepacsDTO);
|
|
|
|
- //
|
|
|
|
- // NodeNeoDTO opereat = new NodeNeoDTO();
|
|
|
|
- // opereat.setName("胸腔镜下左下肺叶切除术");
|
|
|
|
- // billNeoDTO.getPacsBillNeoDTO().getOperations().add(opereat);
|
|
|
|
- // NodeNeoDTO opereat2 = new NodeNeoDTO();
|
|
|
|
- // opereat2.setName("区域淋巴结清扫术");
|
|
|
|
- // billNeoDTO.getPacsBillNeoDTO().getOperations().add(opereat2);
|
|
|
|
- //
|
|
|
|
- // NodeNeoDTO drug = new NodeNeoDTO();
|
|
|
|
- // drug.setName("青霉素类");
|
|
|
|
- // billNeoDTO.getPacsBillNeoDTO().getAllergicmeds().add(drug);
|
|
|
|
- //
|
|
|
|
- // NodeNeoDTO drug3 = new NodeNeoDTO();
|
|
|
|
- // drug3.setName("泰舒达类");
|
|
|
|
- // billNeoDTO.getPacsBillNeoDTO().getOralmeds().add(drug3);
|
|
|
|
- //
|
|
|
|
- // // NodeNeoDTO vital = new NodeNeoDTO();
|
|
|
|
- // // vital.setName("体温");
|
|
|
|
- // // vital.setMax(new BigDecimal("39.1"));
|
|
|
|
- // // vital.setMin(new BigDecimal("35.1"));
|
|
|
|
- // // vital.setValType(1);
|
|
|
|
- // // billNeoDTO.getPacsBillNeoDTO().getVitals().add(vital);
|
|
|
|
- //
|
|
|
|
- // NodeNeoDTO vitalBp = new NodeNeoDTO();
|
|
|
|
- // vitalBp.setName("舒张压");
|
|
|
|
- // vitalBp.setMax(new BigDecimal("120"));
|
|
|
|
- // vitalBp.setMin(new BigDecimal("100"));
|
|
|
|
- // vitalBp.setValType(1);
|
|
|
|
- // billNeoDTO.getPacsBillNeoDTO().getVitals().add(vitalBp);
|
|
|
|
- //
|
|
|
|
- // NodeNeoDTO vitalBp2 = new NodeNeoDTO();
|
|
|
|
- // vitalBp2.setName("收缩压");
|
|
|
|
- // vitalBp2.setMax(new BigDecimal("120"));
|
|
|
|
- // vitalBp2.setMin(new BigDecimal("100"));
|
|
|
|
- // vitalBp2.setValType(1);
|
|
|
|
- // billNeoDTO.getPacsBillNeoDTO().getVitals().add(vitalBp2);
|
|
|
|
- // }
|
|
|
|
- // 测试数据结束
|
|
|
|
-
|
|
|
|
- System.out.println(billNeoMaxDTO);
|
|
|
|
- billNeoMaxDTOList.add(billNeoMaxDTO);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 辅检开单项时间赋值,用于规则【无需重复开单项】
|
|
|
|
- // 由于mark之前返回的billNeoDTOList没有时间字段,就用辅检开单的原始数据name和uniqueName两个字段相同时
|
|
|
|
- // 进行赋值。可能会存在多个相同的开单项,时间需要分别赋值:处理方式是时间只用一次,刚好可以对上
|
|
|
|
- if (ListUtil.isNotEmpty(billNeoMaxDTOList) && ListUtil.isNotEmpty(wordCrfDTO.getPacsOrder())) {
|
|
|
|
- List<Integer> useList = new ArrayList<>();
|
|
|
|
- for (int i = 0; i < billNeoMaxDTOList.size(); i++) {
|
|
|
|
- BillNeoMaxDTO billNeoMaxDTO = billNeoMaxDTOList.get(i);
|
|
|
|
- for (int j = 0; j < wordCrfDTO.getPacsOrder().size(); j++) {
|
|
|
|
- Pacs pacs = wordCrfDTO.getPacsOrder().get(j);
|
|
|
|
- if (StringUtil.isNotBlank(pacs.getName()) && StringUtil.isNotBlank(pacs.getUniqueName())
|
|
|
|
- && pacs.getName().equals(billNeoMaxDTO.getOrderName())
|
|
|
|
- && pacs.getUniqueName().equals(billNeoMaxDTO.getOrderStandName())) {
|
|
|
|
- if (!useList.contains(j)) { // 判断使用标识
|
|
|
|
- billNeoMaxDTO.setDateValue(pacs.getDateValue());
|
|
|
|
- useList.add(j);
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- processRule(billNeoMaxDTOList, wordCrfDTO, res);
|
|
|
|
- }
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ CommonFacade commonFacade;
|
|
|
|
|
|
// 规则处理
|
|
// 规则处理
|
|
- public void processRule(List<BillNeoMaxDTO> billNeoMaxDTOList, WordCrfDTO wordCrfDTO, IndicationDTO indicationDTO) {
|
|
|
|
- ChiefLabel chiefLabel = wordCrfDTO.getChiefLabel();
|
|
|
|
- PresentLabel presentLabel = wordCrfDTO.getPresentLabel();
|
|
|
|
- PastLabel pastLabel = wordCrfDTO.getPastLabel();
|
|
|
|
-
|
|
|
|
- // 【过敏药品数据来源】
|
|
|
|
- List<Item> allergyMedicines = commonRule.getDrugAllergySource(wordCrfDTO);
|
|
|
|
-
|
|
|
|
- // 【药品数据来源】(主诉、现病史、既往史、结构化药品)
|
|
|
|
- List<Item> medicineAll = wordCrfDTO.getDrugSource();
|
|
|
|
-
|
|
|
|
- // 【诊断数据来源】
|
|
|
|
- List<Item> diags = wordCrfDTO.getDiagSource();
|
|
|
|
-
|
|
|
|
- // 【辅检结果数据来源】
|
|
|
|
- PacsLabel pacsLabel = wordCrfDTO.getPacsLabel();
|
|
|
|
- List<Item> pacsDescList = pacsLabel.getRes();
|
|
|
|
-
|
|
|
|
- // 【手术数据来源】
|
|
|
|
- List<Operation> operations_all = new ArrayList<>();
|
|
|
|
- List<Item> operation = wordCrfDTO.getOperation();
|
|
|
|
- List<Operation> operationsItem = new ArrayList<>();
|
|
|
|
- for (Item item : operation) {
|
|
|
|
- Operation operaData = new Operation();
|
|
|
|
- operaData.setName(item.getName());
|
|
|
|
- operaData.setStandName(item.getUniqueName());
|
|
|
|
- operationsItem.add(operaData);
|
|
|
|
- }
|
|
|
|
- CoreUtil.addList(operations_all, chiefLabel.getOperations()); // 主诉手术
|
|
|
|
- CoreUtil.addList(operations_all, presentLabel.getOperations()); // 现病史手术
|
|
|
|
- CoreUtil.addList(operations_all, pastLabel.getOperations()); // 既往史手术
|
|
|
|
- CoreUtil.addList(operations_all, operationsItem); // 结构化手术
|
|
|
|
-
|
|
|
|
- // 【临床表现数据来源】(主诉、现病史)
|
|
|
|
- List<Clinical> clinicals = new ArrayList<>();
|
|
|
|
- CoreUtil.addList(clinicals, chiefLabel.getClinicals()); // 主诉临床表现
|
|
|
|
- CoreUtil.addList(clinicals, presentLabel.getClinicals()); // 现病史临床表现
|
|
|
|
-
|
|
|
|
- List<BillMsg> billMsgList = new ArrayList<>();
|
|
|
|
- for (BillNeoMaxDTO bill : billNeoMaxDTOList) {
|
|
|
|
- // 性别
|
|
|
|
- sexRule.bill(wordCrfDTO, bill, billMsgList, NeoEnum.gender.getName());
|
|
|
|
-
|
|
|
|
- // 年龄
|
|
|
|
- ageRule.bill(wordCrfDTO, bill, billMsgList, NeoEnum.ageNeoDTO.getName());
|
|
|
|
-
|
|
|
|
- // 诊断
|
|
|
|
- commonRule.compareItemWithBill(bill.getDisease(), diags, bill, billMsgList, NeoEnum.disease.getName());
|
|
|
|
-
|
|
|
|
- // 化验
|
|
|
|
- lisRule.bill(wordCrfDTO.getLis(), bill, billMsgList, NeoEnum.lis.getName());
|
|
|
|
-
|
|
|
|
- // 体征
|
|
|
|
- vitalRule.bill(wordCrfDTO.getVitalLabel(), bill, billMsgList, NeoEnum.vitals.getName());
|
|
|
|
|
|
+ public void processRule(List<RuleVO> ruleVOList, WordCrfDTO wordCrfDTO, IndicationDTO indicationDTO) {
|
|
|
|
+ List<BillMsg> billMsgList = indicationDTO.getBillMsgList();
|
|
|
|
+ Set<String> set = new LinkedHashSet<>(); // A与B不宜同时进行, B与A不宜同时进行 只能提示一个
|
|
|
|
+ for (RuleVO ruleVO : ruleVOList) {
|
|
|
|
+ /** 1、获取开单项相关数据 */
|
|
|
|
+ RuleExtDTO ruleExtDTO = commonFacade.getRuleData(ruleVO);
|
|
|
|
+ if (ruleExtDTO == null) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
|
|
- // 辅检
|
|
|
|
- pacsRule.bill(bill.getPacs(), wordCrfDTO.getPacs(), bill, billMsgList, NeoEnum.pacs.getName());
|
|
|
|
|
|
+ /** 2、简化拼接对象,用于开单项提示语 */
|
|
|
|
+ RuleSimpleDTO ruleSimpleDTO = new RuleSimpleDTO();
|
|
|
|
+ BeanUtil.copyProperties(ruleExtDTO, ruleSimpleDTO);
|
|
|
|
|
|
- // 临床表现
|
|
|
|
- commonRule.compareNameWithBill(bill.getClinicfindings(), clinicals, bill, billMsgList, NeoEnum.clinicfindings.getName());
|
|
|
|
|
|
+ /**---------------------------3、数据统一处理开始--------------------------------- */
|
|
|
|
+ ChiefLabel chiefLabel = wordCrfDTO.getChiefLabel();
|
|
|
|
+ PresentLabel presentLabel = wordCrfDTO.getPresentLabel();
|
|
|
|
+ PastLabel pastLabel = wordCrfDTO.getPastLabel();
|
|
|
|
|
|
- // 手术(既往史、现病史、医嘱手术)
|
|
|
|
- commonRule.compareNameWithBill(bill.getOperations(), operations_all, bill, billMsgList, NeoEnum.operations.getName());
|
|
|
|
|
|
+ // 【过敏药品数据来源】
|
|
|
|
+ List<Item> allergyMedicines = commonRule.getDrugAllergySource(wordCrfDTO);
|
|
|
|
|
|
- // 禁忌过敏药品(既往史)
|
|
|
|
- drugRule.bill(bill.getAllergicmeds(), allergyMedicines, bill, billMsgList, NeoEnum.allergicmeds.getName());
|
|
|
|
|
|
+ // 【药品数据来源】(主诉、现病史、既往史、结构化药品)
|
|
|
|
+ List<Item> medicineAll = wordCrfDTO.getDrugSource();
|
|
|
|
|
|
- // 服用药品(主诉、现病史、既往史、结构化药品)
|
|
|
|
- drugRule.bill(bill.getOralmeds(), medicineAll, bill, billMsgList, NeoEnum.oralmeds.getName());
|
|
|
|
|
|
+ // 【诊断数据来源】
|
|
|
|
+ List<Item> diags = wordCrfDTO.getDiagSource();
|
|
|
|
|
|
- // 禁忌人群
|
|
|
|
- groupRule.bill(wordCrfDTO, bill, billMsgList, NeoEnum.group.getName());
|
|
|
|
|
|
+ // 【辅检结果数据来源】
|
|
|
|
+ PacsLabel pacsLabel = wordCrfDTO.getPacsLabel();
|
|
|
|
+ List<Item> pacsDescList = pacsLabel.getRes();
|
|
|
|
|
|
- // 禁用辅助检查描述
|
|
|
|
- commonRule.compareItemWithBill(bill.getPacsDesc(), pacsDescList, bill, billMsgList, NeoEnum.pacsDesc.getName());
|
|
|
|
|
|
+ // 【手术数据来源】
|
|
|
|
+ List<Operation> operations_all = new ArrayList<>();
|
|
|
|
+ List<Item> operation = wordCrfDTO.getOperation();
|
|
|
|
+ List<Operation> operationsItem = new ArrayList<>();
|
|
|
|
+ for (Item item : operation) {
|
|
|
|
+ Operation operaData = new Operation();
|
|
|
|
+ operaData.setName(item.getName());
|
|
|
|
+ operaData.setStandName(item.getUniqueName());
|
|
|
|
+ operationsItem.add(operaData);
|
|
|
|
+ }
|
|
|
|
+ CoreUtil.addList(operations_all, chiefLabel.getOperations()); // 主诉手术
|
|
|
|
+ CoreUtil.addList(operations_all, presentLabel.getOperations()); // 现病史手术
|
|
|
|
+ CoreUtil.addList(operations_all, pastLabel.getOperations()); // 既往史手术
|
|
|
|
+ CoreUtil.addList(operations_all, operationsItem); // 结构化手术
|
|
|
|
|
|
- // 禁忌医疗器械及物品
|
|
|
|
- medEquRule.bill(wordCrfDTO, bill, billMsgList, NeoEnum.medEqu.getName());
|
|
|
|
|
|
+ // 【临床表现数据来源】(主诉、现病史)
|
|
|
|
+ List<Clinical> clinicals = new ArrayList<>();
|
|
|
|
+ CoreUtil.addList(clinicals, chiefLabel.getClinicals()); // 主诉临床表现
|
|
|
|
+ CoreUtil.addList(clinicals, presentLabel.getClinicals()); // 现病史临床表现
|
|
|
|
+ /**---------------------------数据统一处理结束--------------------------------- */
|
|
|
|
|
|
- // 无需重复开单项
|
|
|
|
- commonRule.needlessRepeatOrder(wordCrfDTO, bill, billMsgList);
|
|
|
|
|
|
+ /** 4、规则处理 */
|
|
|
|
+ List<RuleConditionDTO> ruleConditionDTOList = ruleExtDTO.getRuleConditionDTOList();
|
|
|
|
+ for (RuleConditionDTO ruleConditionDTO : ruleConditionDTOList) {
|
|
|
|
+ List<RuleBaseDTO> ruleBaseDTOList = ruleConditionDTO.getRuleBaseDTOList();
|
|
|
|
+ switch (RuleTypeEnum.getEnum(ruleExtDTO.getRuleType())) {
|
|
|
|
+ case bill: // redis 数据以 _1结尾
|
|
|
|
+ for (RuleBaseDTO ruleBaseDTO : ruleBaseDTOList) {
|
|
|
|
+ if (LibTypeEnum.getEnum(ruleBaseDTO.getBaseLibType()) != null) { // 避免空指针
|
|
|
|
+ switch (LibTypeEnum.getEnum(ruleBaseDTO.getBaseLibType())) {
|
|
|
|
+ case sex: // 性别
|
|
|
|
+ sexRule.bill(wordCrfDTO, ruleBaseDTO, billMsgList, ConEnum.gender.getName(), ruleSimpleDTO);
|
|
|
|
+ case age: // 年龄
|
|
|
|
+ ageRule.bill(wordCrfDTO, ruleBaseDTO, billMsgList, ConEnum.age.getName(), ruleSimpleDTO);
|
|
|
|
+ break;
|
|
|
|
+ case disease: // 诊断
|
|
|
|
+ commonRule.compareItemWithBill(diags, ruleBaseDTO, billMsgList, ConEnum.disease.getName(), ruleSimpleDTO);
|
|
|
|
+ break;
|
|
|
|
+ case lisDetail: // 化验
|
|
|
|
+ lisRule.bill(wordCrfDTO.getLis(), ruleBaseDTO, billMsgList, ConEnum.lis.getName(), ruleSimpleDTO);
|
|
|
|
+ break;
|
|
|
|
+ case vitalRes: //体格检查结果
|
|
|
|
+ case vital: // 体格检查项目
|
|
|
|
+ vitalRule.bill(wordCrfDTO.getVitalLabel(), ruleBaseDTO, billMsgList, ConEnum.vitals.getName(), ruleSimpleDTO);
|
|
|
|
+ break;
|
|
|
|
+ case pacs: // 辅检项目
|
|
|
|
+ if (ruleBaseDTO.getBaseType() != null && ruleBaseDTO.getBaseType().equals(BaseTypeEnum.B5.getKey())) {
|
|
|
|
+ // 开单项互斥
|
|
|
|
+ commonRule.exclusionBill(wordCrfDTO, ruleBaseDTO, billMsgList, ruleSimpleDTO, set);
|
|
|
|
+ } else {
|
|
|
|
+ // 辅检项目,暂无数据
|
|
|
|
+ pacsRule.bill(wordCrfDTO.getPacs(), ruleBaseDTO, billMsgList, ConEnum.pacs.getName(), ruleSimpleDTO);
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case clinical: // 临床表现
|
|
|
|
+ commonRule.compareNameWithBill(clinicals, ruleBaseDTO, billMsgList, ConEnum.clinicfindings.getName(), ruleSimpleDTO);
|
|
|
|
+ break;
|
|
|
|
+ case operation: // 手术(既往史、现病史、医嘱手术)
|
|
|
|
+ commonRule.compareNameWithBill(operations_all, ruleBaseDTO, billMsgList, ConEnum.operations.getName(), ruleSimpleDTO);
|
|
|
|
+ break;
|
|
|
|
+ case drug:
|
|
|
|
+ case yphxwzlb:
|
|
|
|
+ case ypzlxlb:
|
|
|
|
+ case ypylxlb:
|
|
|
|
+ case ypjpxlb:
|
|
|
|
+ if (ruleBaseDTO.getBaseType().equals(4)) {
|
|
|
|
+ // 禁忌过敏药品(既往史)
|
|
|
|
+ drugRule.bill(allergyMedicines, ruleBaseDTO, billMsgList, ConEnum.allergicmeds.getName(), ruleSimpleDTO);
|
|
|
|
+ } else {
|
|
|
|
+ // 服用药品(主诉、现病史、既往史、结构化药品)
|
|
|
|
+ drugRule.bill(medicineAll, ruleBaseDTO, billMsgList, ConEnum.oralmeds.getName(), ruleSimpleDTO);
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case otherAllergy: // 其他过敏原
|
|
|
|
+ drugRule.bill(allergyMedicines, ruleBaseDTO, billMsgList, ConEnum.otherAllergy.getName(), ruleSimpleDTO);
|
|
|
|
+ break;
|
|
|
|
+ case group: // 禁忌人群
|
|
|
|
+ groupRule.bill(wordCrfDTO, ruleBaseDTO, billMsgList, ConEnum.group.getName(), ruleSimpleDTO);
|
|
|
|
+ break;
|
|
|
|
+ case pacsResult: // 禁用辅助检查描述
|
|
|
|
+ commonRule.compareItemWithBill(pacsDescList, ruleBaseDTO, billMsgList, ConEnum.pacsDesc.getName(), ruleSimpleDTO);
|
|
|
|
+ break;
|
|
|
|
+ case ylqxjwp: // 禁忌医疗器械及物品
|
|
|
|
+ medEquRule.bill(wordCrfDTO, ruleBaseDTO, billMsgList, ConEnum.medEqu.getName(), ruleSimpleDTO);
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ case repeat: // redis 数据以 _6结尾
|
|
|
|
+ for (RuleBaseDTO ruleBaseDTO : ruleBaseDTOList) {
|
|
|
|
+ // 无需重复开单项
|
|
|
|
+ commonRule.needlessRepeatOrder(wordCrfDTO, ruleBaseDTO, billMsgList, ruleSimpleDTO);
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
-
|
|
|
|
// 24小时重复开单项
|
|
// 24小时重复开单项
|
|
commonRule.repeat24Bill(wordCrfDTO, billMsgList);
|
|
commonRule.repeat24Bill(wordCrfDTO, billMsgList);
|
|
-
|
|
|
|
- // 互斥开单项
|
|
|
|
- commonRule.exclusionBill(billNeoMaxDTOList, wordCrfDTO, billMsgList);
|
|
|
|
- indicationDTO.setBillMsgList(billMsgList);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // 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);
|
|
|
|
+ // billNeoMaxDTO.setType(TypeEnum.drug.getName());
|
|
|
|
+ // } else if (billNeoDTO.getLisBillNeoDTO() != null) {
|
|
|
|
+ // BeanUtil.copyProperties(billNeoDTO.getLisBillNeoDTO(), billNeoMaxDTO);
|
|
|
|
+ // billNeoMaxDTO.setType(TypeEnum.lis.getName());
|
|
|
|
+ // } else if (billNeoDTO.getPacsBillNeoDTO() != null) {
|
|
|
|
+ // BeanUtil.copyProperties(billNeoDTO.getPacsBillNeoDTO(), billNeoMaxDTO);
|
|
|
|
+ // billNeoMaxDTO.setType(TypeEnum.pacs.getName());
|
|
|
|
+ // } else if (billNeoDTO.getOperationBillNeoDTO() != null) {
|
|
|
|
+ // BeanUtil.copyProperties(billNeoDTO.getOperationBillNeoDTO(), billNeoMaxDTO);
|
|
|
|
+ // if (ListUtil.isNotEmpty(billNeoDTO.getOperationBillNeoDTO().getMedallegen())) {
|
|
|
|
+ // billNeoMaxDTO.getAllergicmeds().addAll(billNeoDTO.getOperationBillNeoDTO().getMedallegen());
|
|
|
|
+ // }
|
|
|
|
+ // billNeoMaxDTO.setType(TypeEnum.operation.getName());
|
|
|
|
+ // } else if (billNeoDTO.getTransfusionBillNeoDTO() != null) {
|
|
|
|
+ // BeanUtil.copyProperties(billNeoDTO.getTransfusionBillNeoDTO(), billNeoMaxDTO);
|
|
|
|
+ // billNeoMaxDTO.setType(TypeEnum.transfusion.getName());
|
|
|
|
+ // }
|
|
|
|
+ // billNeoMaxDTO.setOrderName(billNeoDTO.getName()); // 开单名称
|
|
|
|
+ // billNeoMaxDTO.setOrderStandName(billNeoDTO.getStandname()); // 开单标准名称
|
|
|
|
+ // // // TODO 测试数据开始
|
|
|
|
+ // // if (billNeoDTO.getStandname().equals("胸部CT")) {
|
|
|
|
+ // // NodeNeoDTO nodeNeoDTO = new NodeNeoDTO();
|
|
|
|
+ // // nodeNeoDTO.setName("幼儿");
|
|
|
|
+ // // billNeoMaxDTO.getGroup().add(nodeNeoDTO);
|
|
|
|
+ // // }
|
|
|
|
+ // // if (billNeoDTO.getStandname().equals("胸部CT")) {
|
|
|
|
+ // // NodeNeoDTO nodeNeoDTO = new NodeNeoDTO();
|
|
|
|
+ // // nodeNeoDTO.setName("心电图");
|
|
|
|
+ // // billNeoMaxDTO.getPacsOrder().add(nodeNeoDTO);
|
|
|
|
+ // // }
|
|
|
|
+ // // if (billNeoDTO.getStandname().equals("心电图")) {
|
|
|
|
+ // // NodeNeoDTO nodeNeoDTO = new NodeNeoDTO();
|
|
|
|
+ // // nodeNeoDTO.setName("胸部CT");
|
|
|
|
+ // // billNeoMaxDTO.getPacsOrder().add(nodeNeoDTO);
|
|
|
|
+ // // }
|
|
|
|
+ // // if (billNeoDTO.getName().equals("普通胃镜检查")) {
|
|
|
|
+ // // NodeNeoDTO sexNeo = new NodeNeoDTO();
|
|
|
|
+ // // sexNeo.setName("男");
|
|
|
|
+ // // billNeoMaxDTO.setGender(sexNeo);
|
|
|
|
+ // //
|
|
|
|
+ // // NodeNeoDTO nodeNeoDTO = new NodeNeoDTO();
|
|
|
|
+ // // nodeNeoDTO.setName("红细胞压积");
|
|
|
|
+ // // nodeNeoDTO.setVal("阳性");
|
|
|
|
+ // // billNeoDTO.getPacsBillNeoDTO().getLis().add(nodeNeoDTO);
|
|
|
|
+ // //
|
|
|
|
+ // // NodeNeoDTO nodepacsDTO = new NodeNeoDTO();
|
|
|
|
+ // // nodepacsDTO.setName("上腹部平扫");
|
|
|
|
+ // // billNeoDTO.getPacsBillNeoDTO().getPacs().add(nodepacsDTO);
|
|
|
|
+ // //
|
|
|
|
+ // // NodeNeoDTO opereat = new NodeNeoDTO();
|
|
|
|
+ // // opereat.setName("胸腔镜下左下肺叶切除术");
|
|
|
|
+ // // billNeoDTO.getPacsBillNeoDTO().getOperations().add(opereat);
|
|
|
|
+ // // NodeNeoDTO opereat2 = new NodeNeoDTO();
|
|
|
|
+ // // opereat2.setName("区域淋巴结清扫术");
|
|
|
|
+ // // billNeoDTO.getPacsBillNeoDTO().getOperations().add(opereat2);
|
|
|
|
+ // //
|
|
|
|
+ // // NodeNeoDTO drug = new NodeNeoDTO();
|
|
|
|
+ // // drug.setName("青霉素类");
|
|
|
|
+ // // billNeoDTO.getPacsBillNeoDTO().getAllergicmeds().add(drug);
|
|
|
|
+ // //
|
|
|
|
+ // // NodeNeoDTO drug3 = new NodeNeoDTO();
|
|
|
|
+ // // drug3.setName("泰舒达类");
|
|
|
|
+ // // billNeoDTO.getPacsBillNeoDTO().getOralmeds().add(drug3);
|
|
|
|
+ // //
|
|
|
|
+ // // // NodeNeoDTO vital = new NodeNeoDTO();
|
|
|
|
+ // // // vital.setName("体温");
|
|
|
|
+ // // // vital.setMax(new BigDecimal("39.1"));
|
|
|
|
+ // // // vital.setMin(new BigDecimal("35.1"));
|
|
|
|
+ // // // vital.setValType(1);
|
|
|
|
+ // // // billNeoDTO.getPacsBillNeoDTO().getVitals().add(vital);
|
|
|
|
+ // //
|
|
|
|
+ // // NodeNeoDTO vitalBp = new NodeNeoDTO();
|
|
|
|
+ // // vitalBp.setName("舒张压");
|
|
|
|
+ // // vitalBp.setMax(new BigDecimal("120"));
|
|
|
|
+ // // vitalBp.setMin(new BigDecimal("100"));
|
|
|
|
+ // // vitalBp.setValType(1);
|
|
|
|
+ // // billNeoDTO.getPacsBillNeoDTO().getVitals().add(vitalBp);
|
|
|
|
+ // //
|
|
|
|
+ // // NodeNeoDTO vitalBp2 = new NodeNeoDTO();
|
|
|
|
+ // // vitalBp2.setName("收缩压");
|
|
|
|
+ // // vitalBp2.setMax(new BigDecimal("120"));
|
|
|
|
+ // // vitalBp2.setMin(new BigDecimal("100"));
|
|
|
|
+ // // vitalBp2.setValType(1);
|
|
|
|
+ // // billNeoDTO.getPacsBillNeoDTO().getVitals().add(vitalBp2);
|
|
|
|
+ // // }
|
|
|
|
+ // // 测试数据结束
|
|
|
|
+ //
|
|
|
|
+ // System.out.println(billNeoMaxDTO);
|
|
|
|
+ // billNeoMaxDTOList.add(billNeoMaxDTO);
|
|
|
|
+ // }
|
|
|
|
+ //
|
|
|
|
+ // // 辅检开单项时间赋值,用于规则【无需重复开单项】
|
|
|
|
+ // // 由于mark之前返回的billNeoDTOList没有时间字段,就用辅检开单的原始数据name和uniqueName两个字段相同时
|
|
|
|
+ // // 进行赋值。可能会存在多个相同的开单项,时间需要分别赋值:处理方式是时间只用一次,刚好可以对上
|
|
|
|
+ // if (ListUtil.isNotEmpty(billNeoMaxDTOList) && ListUtil.isNotEmpty(wordCrfDTO.getPacsOrder())) {
|
|
|
|
+ // List<Integer> useList = new ArrayList<>();
|
|
|
|
+ // for (int i = 0; i < billNeoMaxDTOList.size(); i++) {
|
|
|
|
+ // BillNeoMaxDTO billNeoMaxDTO = billNeoMaxDTOList.get(i);
|
|
|
|
+ // for (int j = 0; j < wordCrfDTO.getPacsOrder().size(); j++) {
|
|
|
|
+ // Pacs pacs = wordCrfDTO.getPacsOrder().get(j);
|
|
|
|
+ // if (StringUtil.isNotBlank(pacs.getName()) && StringUtil.isNotBlank(pacs.getUniqueName())
|
|
|
|
+ // && pacs.getName().equals(billNeoMaxDTO.getOrderName())
|
|
|
|
+ // && pacs.getUniqueName().equals(billNeoMaxDTO.getOrderStandName())) {
|
|
|
|
+ // if (!useList.contains(j)) { // 判断使用标识
|
|
|
|
+ // billNeoMaxDTO.setDateValue(pacs.getDateValue());
|
|
|
|
+ // useList.add(j);
|
|
|
|
+ // break;
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // processRule(billNeoMaxDTOList, wordCrfDTO, res);
|
|
|
|
+ // }
|
|
|
|
+ //
|
|
|
|
+ // // 规则处理
|
|
|
|
+ // public void processRule(List<BillNeoMaxDTO> billNeoMaxDTOList, WordCrfDTO wordCrfDTO, IndicationDTO indicationDTO) {
|
|
|
|
+ // ChiefLabel chiefLabel = wordCrfDTO.getChiefLabel();
|
|
|
|
+ // PresentLabel presentLabel = wordCrfDTO.getPresentLabel();
|
|
|
|
+ // PastLabel pastLabel = wordCrfDTO.getPastLabel();
|
|
|
|
+ //
|
|
|
|
+ // // 【过敏药品数据来源】
|
|
|
|
+ // List<Item> allergyMedicines = commonRule.getDrugAllergySource(wordCrfDTO);
|
|
|
|
+ //
|
|
|
|
+ // // 【药品数据来源】(主诉、现病史、既往史、结构化药品)
|
|
|
|
+ // List<Item> medicineAll = wordCrfDTO.getDrugSource();
|
|
|
|
+ //
|
|
|
|
+ // // 【诊断数据来源】
|
|
|
|
+ // List<Item> diags = wordCrfDTO.getDiagSource();
|
|
|
|
+ //
|
|
|
|
+ // // 【辅检结果数据来源】
|
|
|
|
+ // PacsLabel pacsLabel = wordCrfDTO.getPacsLabel();
|
|
|
|
+ // List<Item> pacsDescList = pacsLabel.getRes();
|
|
|
|
+ //
|
|
|
|
+ // // 【手术数据来源】
|
|
|
|
+ // List<Operation> operations_all = new ArrayList<>();
|
|
|
|
+ // List<Item> operation = wordCrfDTO.getOperation();
|
|
|
|
+ // List<Operation> operationsItem = new ArrayList<>();
|
|
|
|
+ // for (Item item : operation) {
|
|
|
|
+ // Operation operaData = new Operation();
|
|
|
|
+ // operaData.setName(item.getName());
|
|
|
|
+ // operaData.setStandName(item.getUniqueName());
|
|
|
|
+ // operationsItem.add(operaData);
|
|
|
|
+ // }
|
|
|
|
+ // CoreUtil.addList(operations_all, chiefLabel.getOperations()); // 主诉手术
|
|
|
|
+ // CoreUtil.addList(operations_all, presentLabel.getOperations()); // 现病史手术
|
|
|
|
+ // CoreUtil.addList(operations_all, pastLabel.getOperations()); // 既往史手术
|
|
|
|
+ // CoreUtil.addList(operations_all, operationsItem); // 结构化手术
|
|
|
|
+ //
|
|
|
|
+ // // 【临床表现数据来源】(主诉、现病史)
|
|
|
|
+ // List<Clinical> clinicals = new ArrayList<>();
|
|
|
|
+ // CoreUtil.addList(clinicals, chiefLabel.getClinicals()); // 主诉临床表现
|
|
|
|
+ // CoreUtil.addList(clinicals, presentLabel.getClinicals()); // 现病史临床表现
|
|
|
|
+ //
|
|
|
|
+ // List<BillMsg> billMsgList = new ArrayList<>();
|
|
|
|
+ // for (BillNeoMaxDTO bill : billNeoMaxDTOList) {
|
|
|
|
+ // // 性别
|
|
|
|
+ // // sexRule.bill(wordCrfDTO, bill, billMsgList, NeoEnum.gender.getName());
|
|
|
|
+ //
|
|
|
|
+ // // 年龄
|
|
|
|
+ // // ageRule.bill(wordCrfDTO, bill, billMsgList, NeoEnum.ageNeoDTO.getName());
|
|
|
|
+ //
|
|
|
|
+ // // 诊断
|
|
|
|
+ // // commonRule.compareItemWithBill(bill.getDisease(), diags, bill, billMsgList, NeoEnum.disease.getName());
|
|
|
|
+ // //
|
|
|
|
+ // // // 化验
|
|
|
|
+ // // lisRule.bill(wordCrfDTO.getLis(), bill, billMsgList, NeoEnum.lis.getName());
|
|
|
|
+ //
|
|
|
|
+ // // 体征
|
|
|
|
+ // // vitalRule.bill(wordCrfDTO.getVitalLabel(), bill, billMsgList, NeoEnum.vitals.getName());
|
|
|
|
+ // //
|
|
|
|
+ // // // 辅检
|
|
|
|
+ // // pacsRule.bill(bill.getPacs(), wordCrfDTO.getPacs(), bill, billMsgList, NeoEnum.pacs.getName());
|
|
|
|
+ // //
|
|
|
|
+ // // // 临床表现
|
|
|
|
+ // // commonRule.compareNameWithBill(bill.getClinicfindings(), clinicals, bill, billMsgList, NeoEnum.clinicfindings.getName());
|
|
|
|
+ // //
|
|
|
|
+ // // // 手术(既往史、现病史、医嘱手术)
|
|
|
|
+ // // commonRule.compareNameWithBill(bill.getOperations(), operations_all, bill, billMsgList, NeoEnum.operations.getName());
|
|
|
|
+ // //
|
|
|
|
+ // // // 禁忌过敏药品(既往史)
|
|
|
|
+ // // drugRule.bill(bill.getAllergicmeds(), allergyMedicines, bill, billMsgList, NeoEnum.allergicmeds.getName());
|
|
|
|
+ // //
|
|
|
|
+ // // // 服用药品(主诉、现病史、既往史、结构化药品)
|
|
|
|
+ // // drugRule.bill(bill.getOralmeds(), medicineAll, bill, billMsgList, NeoEnum.oralmeds.getName());
|
|
|
|
+ // //
|
|
|
|
+ // // // 禁忌人群
|
|
|
|
+ // // groupRule.bill(wordCrfDTO, bill, billMsgList, NeoEnum.group.getName());
|
|
|
|
+ // //
|
|
|
|
+ // // // 禁用辅助检查描述
|
|
|
|
+ // // commonRule.compareItemWithBill(bill.getPacsDesc(), pacsDescList, bill, billMsgList, NeoEnum.pacsDesc.getName());
|
|
|
|
+ // //
|
|
|
|
+ // // // 禁忌医疗器械及物品
|
|
|
|
+ // // medEquRule.bill(wordCrfDTO, bill, billMsgList, NeoEnum.medEqu.getName());
|
|
|
|
+ // //
|
|
|
|
+ // // // 无需重复开单项
|
|
|
|
+ // // commonRule.needlessRepeatOrder(wordCrfDTO, bill, billMsgList);
|
|
|
|
+ // }
|
|
|
|
+ //
|
|
|
|
+ // // 24小时重复开单项
|
|
|
|
+ // commonRule.repeat24Bill(wordCrfDTO, billMsgList);
|
|
|
|
+ //
|
|
|
|
+ // // 互斥开单项
|
|
|
|
+ // commonRule.exclusionBill(billNeoMaxDTOList, wordCrfDTO, billMsgList);
|
|
|
|
+ // indicationDTO.setBillMsgList(billMsgList);
|
|
|
|
+ // }
|
|
|
|
+
|
|
}
|
|
}
|