|
@@ -3,6 +3,7 @@ package com.diagbot.rule;
|
|
|
import com.diagbot.biz.push.entity.Lis;
|
|
|
import com.diagbot.dto.BillMsg;
|
|
|
import com.diagbot.dto.LisOtherDTO;
|
|
|
+import com.diagbot.dto.MatchDTO;
|
|
|
import com.diagbot.dto.RuleBaseDTO;
|
|
|
import com.diagbot.dto.RuleSimpleDTO;
|
|
|
import com.diagbot.dto.WordCrfDTO;
|
|
@@ -18,6 +19,7 @@ import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @description: 化验规则
|
|
@@ -46,9 +48,9 @@ public class LisRule {
|
|
|
public void bill(List<Lis> inputLis, RuleBaseDTO ruleBaseDTO, List<BillMsg> billMsgList, String conType, RuleSimpleDTO ruleSimpleDTO) {
|
|
|
if (ListUtil.isNotEmpty(inputLis) && StringUtil.isNotBlank(ruleBaseDTO.getBaseLibName())) {
|
|
|
for (Lis lis : inputLis) {
|
|
|
- Map<String, Object> map = CoreUtil.compareLis(ruleBaseDTO, lis);
|
|
|
- if (CoreUtil.getMapFlag(map)) {
|
|
|
- ruleSimpleDTO.setContent((String) map.get("msg"));
|
|
|
+ MatchDTO matchDTO = CoreUtil.compareLis(ruleBaseDTO, lis);
|
|
|
+ if (matchDTO != null) {
|
|
|
+ ruleSimpleDTO.setContent(matchDTO.getContent());
|
|
|
ruleSimpleDTO.setConType(conType);
|
|
|
BillMsg billMsg = msgNewUtil.getCommonBillMsg(ruleSimpleDTO);
|
|
|
CoreUtil.addBeanToList(billMsgList, billMsg);
|
|
@@ -68,9 +70,9 @@ public class LisRule {
|
|
|
public void highOperation(List<Lis> inputLis, RuleBaseDTO ruleBaseDTO, List<BillMsg> highRiskList, RuleSimpleDTO ruleSimpleDTO) {
|
|
|
if (ListUtil.isNotEmpty(inputLis) && StringUtil.isNotBlank(ruleBaseDTO.getBaseLibName())) {
|
|
|
for (Lis lis : inputLis) {
|
|
|
- Map<String, Object> map = CoreUtil.compareLis(ruleBaseDTO, lis);
|
|
|
- if (CoreUtil.getMapFlag(map)) {
|
|
|
- BillMsg billMsg = MsgUtil.getCommonHighRiskMsg((String) map.get("msg"), ruleSimpleDTO.getInputName(), ruleSimpleDTO.getLibTypeName());
|
|
|
+ MatchDTO matchDTO = CoreUtil.compareLis(ruleBaseDTO, lis);
|
|
|
+ if (matchDTO != null) {
|
|
|
+ BillMsg billMsg = MsgUtil.getCommonHighRiskMsg(matchDTO.getContent(), ruleSimpleDTO.getInputName(), ruleSimpleDTO.getLibTypeName());
|
|
|
highRiskList.add(billMsg);
|
|
|
}
|
|
|
}
|
|
@@ -99,19 +101,21 @@ public class LisRule {
|
|
|
case LisSubName: // 化验细项
|
|
|
if (ruleBaseDTO.getBaseLibName().equals(lisBean.getUniqueName())) {
|
|
|
// 化验自身
|
|
|
- map = CoreUtil.compareLis(ruleBaseDTO, lisBean);
|
|
|
- if (CoreUtil.getMapFlag(map)) {
|
|
|
+ MatchDTO matchDTO = CoreUtil.compareLis(ruleBaseDTO, lisBean);
|
|
|
+ if (matchDTO != null) {
|
|
|
i++;
|
|
|
- lisOtherDTO.setName((String) map.get("msg"));
|
|
|
+ lisOtherDTO.setName(matchDTO.getContent());
|
|
|
+ lisOtherDTO.setLisNameDetail(matchDTO.getLisNameDetail());
|
|
|
} else {
|
|
|
break;
|
|
|
}
|
|
|
} else {
|
|
|
// 其他化验——暂无数据
|
|
|
- map = CoreUtil.compareLis(ruleBaseDTO, wordCrfDTO.getLis());
|
|
|
- if (CoreUtil.getMapFlag(map)) {
|
|
|
+ List<MatchDTO> matchDTOList = CoreUtil.compareLis(ruleBaseDTO, wordCrfDTO.getLis());
|
|
|
+ if (ListUtil.isNotEmpty(matchDTOList)) {
|
|
|
i++;
|
|
|
- lisOtherDTO.setLisMsg((List<String>) map.get("msgList"));
|
|
|
+ List<String> msgLis = matchDTOList.stream().map(r -> r.getContent()).collect(Collectors.toList());
|
|
|
+ lisOtherDTO.setLisMsg(msgLis);
|
|
|
} else {
|
|
|
break;
|
|
|
}
|
|
@@ -146,17 +150,18 @@ public class LisRule {
|
|
|
// 条件全部符合
|
|
|
if (i == ruleBaseDTOList.size()) {
|
|
|
if (StringUtil.isNotBlank(lisOtherDTO.getName())) {
|
|
|
+ String lisNameDetail = lisOtherDTO.getLisNameDetail(); // 化验套餐和明细
|
|
|
// 就化验本身一个条件符合
|
|
|
if (i == 1) {
|
|
|
BillMsg billMsg = msgNewUtil.getCommonOtherMsg(TypeEnum.lis.getName(),
|
|
|
- lisOtherDTO.getName(), "", TypeEnum.lisSelf.getName(), lisBean, msg);
|
|
|
+ lisOtherDTO.getName(), "", TypeEnum.lisSelf.getName(), lisBean, msg, lisNameDetail);
|
|
|
CoreUtil.addBeanToList(otherList, billMsg);
|
|
|
} else { // 有其他条件符合
|
|
|
// 诊断
|
|
|
if (ListUtil.isNotEmpty(lisOtherDTO.getDiseaseMsg())) {
|
|
|
for (String str : lisOtherDTO.getDiseaseMsg()) {
|
|
|
BillMsg billMsg = msgNewUtil.getCommonOtherMsg(TypeEnum.lis.getName(), lisOtherDTO.getName(),
|
|
|
- str, TypeEnum.disease.getName(), lisBean, msg);
|
|
|
+ str, TypeEnum.disease.getName(), lisBean, msg, lisNameDetail);
|
|
|
CoreUtil.addBeanToList(otherList, billMsg);
|
|
|
}
|
|
|
}
|
|
@@ -164,7 +169,7 @@ public class LisRule {
|
|
|
if (ListUtil.isNotEmpty(lisOtherDTO.getDrugMsg())) {
|
|
|
for (String str : lisOtherDTO.getDrugMsg()) {
|
|
|
BillMsg billMsg = msgNewUtil.getCommonOtherMsg(TypeEnum.lis.getName(), lisOtherDTO.getName(),
|
|
|
- str, TypeEnum.drug.getName(), lisBean, msg);
|
|
|
+ str, TypeEnum.drug.getName(), lisBean, msg, lisNameDetail);
|
|
|
CoreUtil.addBeanToList(otherList, billMsg);
|
|
|
}
|
|
|
}
|
|
@@ -172,7 +177,7 @@ public class LisRule {
|
|
|
if (ListUtil.isNotEmpty(lisOtherDTO.getGroupMsg())) {
|
|
|
for (String str : lisOtherDTO.getGroupMsg()) {
|
|
|
BillMsg billMsg = msgNewUtil.getCommonOtherMsg(TypeEnum.lis.getName(), lisOtherDTO.getName(),
|
|
|
- str, TypeEnum.group.getName(), lisBean, msg);
|
|
|
+ str, TypeEnum.group.getName(), lisBean, msg, lisNameDetail);
|
|
|
CoreUtil.addBeanToList(otherList, billMsg);
|
|
|
}
|
|
|
}
|
|
@@ -180,7 +185,7 @@ public class LisRule {
|
|
|
if (ListUtil.isNotEmpty(lisOtherDTO.getLisMsg())) {
|
|
|
for (String str : lisOtherDTO.getLisMsg()) {
|
|
|
BillMsg billMsg = msgNewUtil.getCommonOtherMsg(TypeEnum.lis.getName(), lisOtherDTO.getName(),
|
|
|
- str, TypeEnum.lis.getName(), lisBean, msg);
|
|
|
+ str, TypeEnum.lis.getName(), lisBean, msg, lisNameDetail);
|
|
|
CoreUtil.addBeanToList(otherList, billMsg);
|
|
|
}
|
|
|
}
|
|
@@ -211,19 +216,21 @@ public class LisRule {
|
|
|
case LisSubName: // 化验细项
|
|
|
if (ruleBaseDTO.getBaseLibName().equals(lisBean.getUniqueName())) {
|
|
|
// 化验自身
|
|
|
- map = CoreUtil.compareLis(ruleBaseDTO, lisBean);
|
|
|
- if (CoreUtil.getMapFlag(map)) {
|
|
|
+ MatchDTO matchDTO = CoreUtil.compareLis(ruleBaseDTO, lisBean);
|
|
|
+ if (matchDTO != null) {
|
|
|
i++;
|
|
|
- lisOtherDTO.setName((String) map.get("msg"));
|
|
|
+ lisOtherDTO.setName(matchDTO.getContent());
|
|
|
+ lisOtherDTO.setLisNameDetail(matchDTO.getLisNameDetail());
|
|
|
} else {
|
|
|
break;
|
|
|
}
|
|
|
} else {
|
|
|
// 其他化验——暂无数据
|
|
|
- map = CoreUtil.compareLis(ruleBaseDTO, wordCrfDTO.getLis());
|
|
|
- if (CoreUtil.getMapFlag(map)) {
|
|
|
+ List<MatchDTO> matchDTOList = CoreUtil.compareLis(ruleBaseDTO, wordCrfDTO.getLis());
|
|
|
+ if (ListUtil.isNotEmpty(matchDTOList)) {
|
|
|
i++;
|
|
|
- lisOtherDTO.setLisMsg((List<String>) map.get("msgList"));
|
|
|
+ List<String> msgLis = matchDTOList.stream().map(r -> r.getContent()).collect(Collectors.toList());
|
|
|
+ lisOtherDTO.setLisMsg(msgLis);
|
|
|
} else {
|
|
|
break;
|
|
|
}
|
|
@@ -322,17 +329,17 @@ public class LisRule {
|
|
|
case LisSubName: // 化验细项
|
|
|
if (ruleBaseDTO.getBaseLibName().equals(lisBean.getUniqueName())) {
|
|
|
// 化验自身 【第一个】
|
|
|
- map = CoreUtil.compareLis(ruleBaseDTO, lisBean);
|
|
|
- if (CoreUtil.getMapFlag(map)) {
|
|
|
+ MatchDTO matchDTO = CoreUtil.compareLis(ruleBaseDTO, lisBean);
|
|
|
+ if (matchDTO != null) {
|
|
|
i++;
|
|
|
- msg = (String) map.get("msg");
|
|
|
+ msg = matchDTO.getContent();
|
|
|
} else {
|
|
|
break;
|
|
|
}
|
|
|
} else {
|
|
|
// 其他化验
|
|
|
- map = CoreUtil.compareLis(ruleBaseDTO, wordCrfDTO.getLis());
|
|
|
- if (CoreUtil.getMapFlag(map)) {
|
|
|
+ List<MatchDTO> matchDTOList = CoreUtil.compareLis(ruleBaseDTO, wordCrfDTO.getLis());
|
|
|
+ if (ListUtil.isNotEmpty(matchDTOList)) {
|
|
|
i++;
|
|
|
} else {
|
|
|
break;
|
|
@@ -366,8 +373,8 @@ public class LisRule {
|
|
|
public void push(List<Lis> inputLis, RuleBaseDTO ruleBaseDTO, List<Long> baseIdList, String ids) {
|
|
|
if (ListUtil.isNotEmpty(inputLis) && StringUtil.isNotBlank(ruleBaseDTO.getBaseLibName())) {
|
|
|
for (Lis lis : inputLis) {
|
|
|
- Map<String, Object> map = CoreUtil.compareLis(ruleBaseDTO, lis);
|
|
|
- if (CoreUtil.getMapFlag(map)) {
|
|
|
+ MatchDTO matchDTO = CoreUtil.compareLis(ruleBaseDTO, lis);
|
|
|
+ if (matchDTO != null) {
|
|
|
CoreUtil.addSplitString(baseIdList, ids);
|
|
|
}
|
|
|
}
|