|
@@ -1,5 +1,6 @@
|
|
|
package com.diagbot.rule;
|
|
|
|
|
|
+import com.diagbot.biz.push.entity.Lis;
|
|
|
import com.diagbot.biz.push.entity.Pacs;
|
|
|
import com.diagbot.dto.BaseDiagnoseDTO;
|
|
|
import com.diagbot.dto.BillMsg;
|
|
@@ -233,15 +234,16 @@ public class CommonRule {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
- * 无需重复开单项
|
|
|
+ * 正常结果,无需重复开单项——辅检
|
|
|
*
|
|
|
* @param wordCrfDTO
|
|
|
* @param ruleBaseDTO
|
|
|
* @param billMsgList
|
|
|
* @param ruleSimpleDTO
|
|
|
*/
|
|
|
- public void needlessRepeatOrder(WordCrfDTO wordCrfDTO, RuleBaseDTO ruleBaseDTO, List<BillMsg> billMsgList, String conType, RuleSimpleDTO ruleSimpleDTO) {
|
|
|
+ public void needlessRepeatOrderPacs(WordCrfDTO wordCrfDTO, RuleBaseDTO ruleBaseDTO, List<BillMsg> billMsgList, String conType, RuleSimpleDTO ruleSimpleDTO) {
|
|
|
String orderStandName = ruleBaseDTO.getBaseLibName();
|
|
|
Map<String, List<Pacs>> map = EntityUtil.makeEntityListMap(wordCrfDTO.getPacs(), "uniqueName");
|
|
|
List<Pacs> pacsList = map.get(orderStandName);
|
|
@@ -253,17 +255,42 @@ public class CommonRule {
|
|
|
&& RegexUtil.getRegexRes(result, ruleBaseDTO.getBaseEqValue())) {
|
|
|
String dateValue = pacs.getDateValue(); // 结果日期
|
|
|
String orderDateValue = ruleSimpleDTO.getDateValue(); // 开单项日期
|
|
|
- if (StringUtil.isNotBlank(dateValue) && StringUtil.isNotBlank(orderDateValue)) {
|
|
|
- Date dateValueDate = CatalogueUtil.parseStringDate(dateValue);
|
|
|
- Date orderDateValueDate = CatalogueUtil.parseStringDate(orderDateValue);
|
|
|
- if (dateValueDate != null && orderDateValueDate != null) {
|
|
|
- if (!CatalogueUtil.compareTime(dateValueDate, orderDateValueDate, 60L * 24 * 7, false)) {
|
|
|
- ruleSimpleDTO.setContent(pacs.getName());
|
|
|
- ruleSimpleDTO.setConType(conType);
|
|
|
- BillMsg billMsg = msgNewUtil.getCommonBillMsg(ruleSimpleDTO);
|
|
|
- CoreUtil.addBeanToList(billMsgList, billMsg);
|
|
|
- }
|
|
|
- }
|
|
|
+ int flag = CoreUtil.compareTime(dateValue, orderDateValue, 60L * 24 * 7, false);
|
|
|
+ if (flag == 1) {
|
|
|
+ ruleSimpleDTO.setContent(result);
|
|
|
+ ruleSimpleDTO.setConType(conType);
|
|
|
+ BillMsg billMsg = msgNewUtil.getCommonBillMsg(ruleSimpleDTO);
|
|
|
+ CoreUtil.addBeanToList(billMsgList, billMsg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 正常结果,无需重复开单项——化验
|
|
|
+ *
|
|
|
+ * @param wordCrfDTO
|
|
|
+ * @param ruleBaseDTO
|
|
|
+ * @param billMsgList
|
|
|
+ * @param ruleSimpleDTO
|
|
|
+ */
|
|
|
+ public void needlessRepeatOrderLis(WordCrfDTO wordCrfDTO, RuleBaseDTO ruleBaseDTO, List<BillMsg> billMsgList, String conType, RuleSimpleDTO ruleSimpleDTO) {
|
|
|
+ String orderStandName = ruleBaseDTO.getBaseLibName();
|
|
|
+ Map<String, List<Lis>> map = EntityUtil.makeEntityListMap(wordCrfDTO.getLis(), "uniqueName");
|
|
|
+ List<Lis> lisList = map.get(orderStandName);
|
|
|
+ if (ListUtil.isNotEmpty(lisList)) {
|
|
|
+ sortByProperty(lisList, "dateValue");
|
|
|
+ Lis lis = lisList.get(lisList.size() - 1); // 按时间排序,取最后一条
|
|
|
+ Map<String, Object> lisMap = CoreUtil.compareLis(ruleBaseDTO, lis);
|
|
|
+ if (CoreUtil.getMapFlag(lisMap)) {
|
|
|
+ String dateValue = lis.getDateValue(); // 结果日期
|
|
|
+ String orderDateValue = ruleSimpleDTO.getDateValue(); // 开单项日期
|
|
|
+ int flag = CoreUtil.compareTime(dateValue, orderDateValue, 60L * 24 * 7, false);
|
|
|
+ if (flag == 1) { // 有效期范围内
|
|
|
+ ruleSimpleDTO.setContent(CoreUtil.getMapMsg(lisMap));
|
|
|
+ ruleSimpleDTO.setConType(conType);
|
|
|
+ BillMsg billMsg = msgNewUtil.getCommonBillMsg(ruleSimpleDTO);
|
|
|
+ CoreUtil.addBeanToList(billMsgList, billMsg);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -325,25 +352,56 @@ public class CommonRule {
|
|
|
// repeat24BillWithType(billMsgList, wordCrfDTO.getTransfusionOrder(), TypeEnum.transfusion.getName(), ConEnum.repeat24.getName()); // 输血重复开单
|
|
|
}
|
|
|
|
|
|
+ // /**
|
|
|
+ // * 互斥开单项——辅检
|
|
|
+ // *
|
|
|
+ // * @param wordCrfDTO
|
|
|
+ // * @param ruleBaseDTO
|
|
|
+ // * @param billMsgList
|
|
|
+ // * @param ruleSimpleDTO
|
|
|
+ // * @param set 用于记录:A与B不宜同时进行, B与A不宜同时进行 只能提示一个
|
|
|
+ // */
|
|
|
+ // public void exclusionBill(WordCrfDTO wordCrfDTO, RuleBaseDTO ruleBaseDTO, List<BillMsg> billMsgList, String conType, RuleSimpleDTO ruleSimpleDTO, Set<String> set) {
|
|
|
+ // // 辅检开单项互斥
|
|
|
+ // List<Pacs> pacsOrder = wordCrfDTO.getPacsOrder();
|
|
|
+ // if (ListUtil.isNotEmpty(pacsOrder) && pacsOrder.size() > 1) {
|
|
|
+ // // 不同的辅检项目可能对应同一个uniqueName,提示显示多条
|
|
|
+ // Map<String, List<Pacs>> map = EntityUtil.makeEntityListMap(pacsOrder, "uniqueName");
|
|
|
+ // List<Pacs> orginNameList = map.get(ruleBaseDTO.getBaseLibName()); // 互斥名称
|
|
|
+ // if (map.get(ruleBaseDTO.getBaseLibName()) != null) {
|
|
|
+ // for (Pacs pacs : orginNameList) {
|
|
|
+ // String orginName = pacs.getName();
|
|
|
+ // // A与B不宜同时进行, B与A不宜同时进行 只能提示一个
|
|
|
+ // if (!set.contains(ruleSimpleDTO.getLibName() + "******" + orginName)) {
|
|
|
+ // set.add(ruleSimpleDTO.getLibName() + "******" + orginName);
|
|
|
+ // set.add(orginName + "******" + ruleSimpleDTO.getLibName());
|
|
|
+ // ruleSimpleDTO.setContent(orginName);
|
|
|
+ // ruleSimpleDTO.setConType(conType);
|
|
|
+ // BillMsg billMsg = msgNewUtil.getCommonBillMsg(ruleSimpleDTO);
|
|
|
+ // CoreUtil.addBeanToList(billMsgList, billMsg);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
/**
|
|
|
* 互斥开单项
|
|
|
*
|
|
|
- * @param wordCrfDTO
|
|
|
+ * @param orderList 开单列表
|
|
|
* @param ruleBaseDTO
|
|
|
* @param billMsgList
|
|
|
* @param ruleSimpleDTO
|
|
|
* @param set 用于记录:A与B不宜同时进行, B与A不宜同时进行 只能提示一个
|
|
|
*/
|
|
|
- public void exclusionBill(WordCrfDTO wordCrfDTO, RuleBaseDTO ruleBaseDTO, List<BillMsg> billMsgList, String conType, RuleSimpleDTO ruleSimpleDTO, Set<String> set) {
|
|
|
- // 辅检开单项互斥
|
|
|
- List<Pacs> pacsOrder = wordCrfDTO.getPacsOrder();
|
|
|
- if (ListUtil.isNotEmpty(pacsOrder) && pacsOrder.size() > 1) {
|
|
|
- // 不同的辅检项目可能对应同一个uniqueName,提示显示多条
|
|
|
- Map<String, List<Pacs>> map = EntityUtil.makeEntityListMap(pacsOrder, "uniqueName");
|
|
|
- List<Pacs> orginNameList = map.get(ruleBaseDTO.getBaseLibName());
|
|
|
+ public <T> void exclusionBill(List<T> orderList, RuleBaseDTO ruleBaseDTO, List<BillMsg> billMsgList, String conType, RuleSimpleDTO ruleSimpleDTO, Set<String> set) {
|
|
|
+ if (ListUtil.isNotEmpty(orderList) && orderList.size() > 1) {
|
|
|
+ // 不同的项目可能对应同一个uniqueName,提示显示多条
|
|
|
+ Map<String, List<T>> map = EntityUtil.makeEntityListMap(orderList, "uniqueName");
|
|
|
+ List<T> orginNameList = map.get(ruleBaseDTO.getBaseLibName());
|
|
|
if (map.get(ruleBaseDTO.getBaseLibName()) != null) {
|
|
|
- for (Pacs pacs : orginNameList) {
|
|
|
- String orginName = pacs.getName();
|
|
|
+ for (T bean : orginNameList) {
|
|
|
+ String orginName = ReflectUtil.getProperty(bean, "name");
|
|
|
// A与B不宜同时进行, B与A不宜同时进行 只能提示一个
|
|
|
if (!set.contains(ruleSimpleDTO.getLibName() + "******" + orginName)) {
|
|
|
set.add(ruleSimpleDTO.getLibName() + "******" + orginName);
|