|
@@ -40,6 +40,7 @@ import org.jeecg.modules.medical.ruleengine.dict.DictUtil;
|
|
import org.jeecg.modules.medical.ruleengine.plugin.InterfItemListPlugin;
|
|
import org.jeecg.modules.medical.ruleengine.plugin.InterfItemListPlugin;
|
|
import org.jeecg.modules.medical.service.IAdvanceWarningAuditDetailService;
|
|
import org.jeecg.modules.medical.service.IAdvanceWarningAuditDetailService;
|
|
import org.jeecg.modules.medical.service.IAdvanceWarningAuditService;
|
|
import org.jeecg.modules.medical.service.IAdvanceWarningAuditService;
|
|
|
|
+import org.jeecg.modules.medical.service.IAfterIncidentDetailLogService;
|
|
import org.jeecg.modules.medical.service.IAfterwardsAuditDetailService;
|
|
import org.jeecg.modules.medical.service.IAfterwardsAuditDetailService;
|
|
import org.jeecg.modules.medical.service.IAfterwardsAuditService;
|
|
import org.jeecg.modules.medical.service.IAfterwardsAuditService;
|
|
import org.jeecg.modules.medical.service.IAfterwardsIncidentAuditDiagnoseService;
|
|
import org.jeecg.modules.medical.service.IAfterwardsIncidentAuditDiagnoseService;
|
|
@@ -61,10 +62,6 @@ import org.jeecg.modules.message.websocket.WebSocket;
|
|
import org.jeecg.modules.system.service.ISysDictService;
|
|
import org.jeecg.modules.system.service.ISysDictService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
|
|
|
-import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
|
|
|
|
-import org.springframework.context.annotation.Conditional;
|
|
|
|
-import org.springframework.context.annotation.Profile;
|
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
import org.springframework.scheduling.annotation.Async;
|
|
import org.springframework.scheduling.annotation.Async;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
@@ -138,6 +135,8 @@ public class RuleEngine {
|
|
IDiagnoseItemsService diagnoseItemsService;
|
|
IDiagnoseItemsService diagnoseItemsService;
|
|
@Autowired
|
|
@Autowired
|
|
ISysDictService sysDictService;
|
|
ISysDictService sysDictService;
|
|
|
|
+ @Autowired
|
|
|
|
+ IAfterIncidentDetailLogService afterIncidentDetailLogService;
|
|
|
|
|
|
@Value("${cache.auto:false}")
|
|
@Value("${cache.auto:false}")
|
|
private Boolean cacheAutoInit;
|
|
private Boolean cacheAutoInit;
|
|
@@ -184,21 +183,21 @@ public class RuleEngine {
|
|
|
|
|
|
@PostConstruct
|
|
@PostConstruct
|
|
public void initMedicalInsRuleAuto() {
|
|
public void initMedicalInsRuleAuto() {
|
|
- if(cacheAutoInit) {
|
|
|
|
|
|
+ if (cacheAutoInit) {
|
|
initMedicalInsRule();
|
|
initMedicalInsRule();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public void initRuleDaysSet(){
|
|
|
|
|
|
+ public void initRuleDaysSet() {
|
|
List<DictModel> ruleList = sysDictService.getDictItems(Constant.DICT_RULE_ID_AGE_DAYS_KEY);
|
|
List<DictModel> ruleList = sysDictService.getDictItems(Constant.DICT_RULE_ID_AGE_DAYS_KEY);
|
|
- if(CollectionUtil.isNotEmpty(ruleList)){
|
|
|
|
- for(DictModel dictModel : ruleList){
|
|
|
|
|
|
+ if (CollectionUtil.isNotEmpty(ruleList)) {
|
|
|
|
+ for (DictModel dictModel : ruleList) {
|
|
daysRuleIdSet.add(Integer.parseInt(dictModel.getValue()));
|
|
daysRuleIdSet.add(Integer.parseInt(dictModel.getValue()));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public void initFactor(){
|
|
|
|
|
|
+ public void initFactor() {
|
|
LambdaQueryWrapper<RuleFactorRela> query = new LambdaQueryWrapper<RuleFactorRela>();
|
|
LambdaQueryWrapper<RuleFactorRela> query = new LambdaQueryWrapper<RuleFactorRela>();
|
|
query.eq(RuleFactorRela::getDelFlag, CommonConstant.DEL_FLAG_0);
|
|
query.eq(RuleFactorRela::getDelFlag, CommonConstant.DEL_FLAG_0);
|
|
query.orderByAsc(RuleFactorRela::getSeqNum);
|
|
query.orderByAsc(RuleFactorRela::getSeqNum);
|
|
@@ -207,11 +206,11 @@ public class RuleEngine {
|
|
Set<Integer> factorEnchangeIdList = ruleFactorRelaList.stream().map(RuleFactorRela::getFactorEnhanceId).collect(Collectors.toSet());
|
|
Set<Integer> factorEnchangeIdList = ruleFactorRelaList.stream().map(RuleFactorRela::getFactorEnhanceId).collect(Collectors.toSet());
|
|
List<FactorEnchance> factorEnchanceList = factorEnchanceService.listByIds(factorEnchangeIdList);
|
|
List<FactorEnchance> factorEnchanceList = factorEnchanceService.listByIds(factorEnchangeIdList);
|
|
Map<Integer, FactorEnchance> integerFactorEnchanceMap = factorEnchanceList.stream().collect(Collectors.toMap(FactorEnchance::getId, v -> v, (v1, v2) -> v1));
|
|
Map<Integer, FactorEnchance> integerFactorEnchanceMap = factorEnchanceList.stream().collect(Collectors.toMap(FactorEnchance::getId, v -> v, (v1, v2) -> v1));
|
|
- for(RuleFactorRela ruleFactorRela : ruleFactorRelaList){
|
|
|
|
|
|
+ for (RuleFactorRela ruleFactorRela : ruleFactorRelaList) {
|
|
FactorEnchance factorEnchance = integerFactorEnchanceMap.get(ruleFactorRela.getFactorEnhanceId());
|
|
FactorEnchance factorEnchance = integerFactorEnchanceMap.get(ruleFactorRela.getFactorEnhanceId());
|
|
- if(allEnchanceTypeMap.containsKey(ruleFactorRela.getMedicalInsRuleInfoId())){
|
|
|
|
|
|
+ if (allEnchanceTypeMap.containsKey(ruleFactorRela.getMedicalInsRuleInfoId())) {
|
|
allEnchanceTypeMap.get(ruleFactorRela.getMedicalInsRuleInfoId()).add(factorEnchance);
|
|
allEnchanceTypeMap.get(ruleFactorRela.getMedicalInsRuleInfoId()).add(factorEnchance);
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
List<FactorEnchance> ruleIdFactorEnchanceList = new ArrayList<>();
|
|
List<FactorEnchance> ruleIdFactorEnchanceList = new ArrayList<>();
|
|
ruleIdFactorEnchanceList.add(factorEnchance);
|
|
ruleIdFactorEnchanceList.add(factorEnchance);
|
|
allEnchanceTypeMap.put(ruleFactorRela.getMedicalInsRuleInfoId(), ruleIdFactorEnchanceList);
|
|
allEnchanceTypeMap.put(ruleFactorRela.getMedicalInsRuleInfoId(), ruleIdFactorEnchanceList);
|
|
@@ -321,7 +320,6 @@ public class RuleEngine {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
public void genItemCodeAndRuleIdMapTest(String medicalProjectCode, AfterwardsAuditDetail afterwardsAuditDetail, List<MedicalInsRuleInfo> medicalInsRuleInfoList, Map<Integer, MedicalInsRuleInfo> medicalMap, Map<String, Boolean> codeDataMap) {
|
|
public void genItemCodeAndRuleIdMapTest(String medicalProjectCode, AfterwardsAuditDetail afterwardsAuditDetail, List<MedicalInsRuleInfo> medicalInsRuleInfoList, Map<Integer, MedicalInsRuleInfo> medicalMap, Map<String, Boolean> codeDataMap) {
|
|
try {
|
|
try {
|
|
List<Integer> ruleIdList = medicalInsRuleInfoList.stream().map(MedicalInsRuleInfo::getId).collect(Collectors.toList());
|
|
List<Integer> ruleIdList = medicalInsRuleInfoList.stream().map(MedicalInsRuleInfo::getId).collect(Collectors.toList());
|
|
@@ -566,13 +564,13 @@ public class RuleEngine {
|
|
if (CollectionUtil.isEmpty(medicalInsRuleInfoIdList)) {
|
|
if (CollectionUtil.isEmpty(medicalInsRuleInfoIdList)) {
|
|
log.error("项目编码未匹配到对应的医保规则:{} 再次从数据库检索", itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY));
|
|
log.error("项目编码未匹配到对应的医保规则:{} 再次从数据库检索", itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY));
|
|
medicalInsRuleProjectList = medicalInsRuleProjectService.getRuleProjectByMedicalProjectCode(itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY).toString());
|
|
medicalInsRuleProjectList = medicalInsRuleProjectService.getRuleProjectByMedicalProjectCode(itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY).toString());
|
|
- if(CollectionUtil.isEmpty(medicalInsRuleProjectList)){
|
|
|
|
|
|
+ if (CollectionUtil.isEmpty(medicalInsRuleProjectList)) {
|
|
log.error("项目编码未匹配到对应的医保规则:{} 在规则库数据库中未检索到数据", itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY));
|
|
log.error("项目编码未匹配到对应的医保规则:{} 在规则库数据库中未检索到数据", itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY));
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
medicalInsRuleInfoIdList = medicalInsRuleProjectList.stream().map(MedicalInsRuleProject::getMedicalInsRuleInfoId).collect(Collectors.toSet());
|
|
medicalInsRuleInfoIdList = medicalInsRuleProjectList.stream().map(MedicalInsRuleProject::getMedicalInsRuleInfoId).collect(Collectors.toSet());
|
|
log.info("数据库检索到匹配规则ID列表:{}", medicalInsRuleInfoIdList);
|
|
log.info("数据库检索到匹配规则ID列表:{}", medicalInsRuleInfoIdList);
|
|
}
|
|
}
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
medicalInsRuleProjectList = medicalInsRuleProjectService.getRuleProjectByRuleIdAndProjectCode(new ArrayList<>(medicalInsRuleInfoIdList), itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY).toString());
|
|
medicalInsRuleProjectList = medicalInsRuleProjectService.getRuleProjectByRuleIdAndProjectCode(new ArrayList<>(medicalInsRuleInfoIdList), itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY).toString());
|
|
}
|
|
}
|
|
|
|
|
|
@@ -583,39 +581,39 @@ public class RuleEngine {
|
|
List<MedicalInsRuleProject> medicalInsRuleProjectTempList = null;
|
|
List<MedicalInsRuleProject> medicalInsRuleProjectTempList = null;
|
|
if (CollectionUtil.isEmpty(diagnoseMedicalInsRuleInfoIdList)) {
|
|
if (CollectionUtil.isEmpty(diagnoseMedicalInsRuleInfoIdList)) {
|
|
medicalInsRuleProjectTempList = medicalInsRuleProjectService.getRuleProjectByDiagCode(diagnose.toString());
|
|
medicalInsRuleProjectTempList = medicalInsRuleProjectService.getRuleProjectByDiagCode(diagnose.toString());
|
|
- if(CollectionUtil.isEmpty(medicalInsRuleProjectTempList)){
|
|
|
|
|
|
+ if (CollectionUtil.isEmpty(medicalInsRuleProjectTempList)) {
|
|
log.info("诊断编码未匹配到对应的医保规则:{} 在规则库数据库中未检索到数据", diagnose);
|
|
log.info("诊断编码未匹配到对应的医保规则:{} 在规则库数据库中未检索到数据", diagnose);
|
|
}
|
|
}
|
|
Set<Integer> medicalInsRuleInfoIdDiagSet = medicalInsRuleProjectTempList.stream().map(MedicalInsRuleProject::getMedicalInsRuleInfoId).collect(Collectors.toSet());
|
|
Set<Integer> medicalInsRuleInfoIdDiagSet = medicalInsRuleProjectTempList.stream().map(MedicalInsRuleProject::getMedicalInsRuleInfoId).collect(Collectors.toSet());
|
|
log.info("数据库检索到匹配规则ID列表:{} 诊断编码为:{}", medicalInsRuleInfoIdDiagSet, diagnose);
|
|
log.info("数据库检索到匹配规则ID列表:{} 诊断编码为:{}", medicalInsRuleInfoIdDiagSet, diagnose);
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
medicalInsRuleProjectTempList = medicalInsRuleProjectService.getRuleProjectByRuleIdAndDiagCode(new ArrayList<>(diagnoseMedicalInsRuleInfoIdList), diagnose.toString());
|
|
medicalInsRuleProjectTempList = medicalInsRuleProjectService.getRuleProjectByRuleIdAndDiagCode(new ArrayList<>(diagnoseMedicalInsRuleInfoIdList), diagnose.toString());
|
|
}
|
|
}
|
|
- if(CollectionUtil.isNotEmpty(medicalInsRuleProjectTempList)){
|
|
|
|
- if(CollectionUtil.isEmpty(medicalInsRuleProjectList)){
|
|
|
|
|
|
+ if (CollectionUtil.isNotEmpty(medicalInsRuleProjectTempList)) {
|
|
|
|
+ if (CollectionUtil.isEmpty(medicalInsRuleProjectList)) {
|
|
medicalInsRuleProjectList = new ArrayList<>();
|
|
medicalInsRuleProjectList = new ArrayList<>();
|
|
}
|
|
}
|
|
- for(MedicalInsRuleProject medicalInsRuleProject : medicalInsRuleProjectTempList){
|
|
|
|
|
|
+ for (MedicalInsRuleProject medicalInsRuleProject : medicalInsRuleProjectTempList) {
|
|
MedicalInsRuleInfo projectRuleInfo = allMedicalMap.get(medicalInsRuleProject.getMedicalInsRuleInfoId());
|
|
MedicalInsRuleInfo projectRuleInfo = allMedicalMap.get(medicalInsRuleProject.getMedicalInsRuleInfoId());
|
|
String selectedRoles = projectRuleInfo.getSelectedRoles();
|
|
String selectedRoles = projectRuleInfo.getSelectedRoles();
|
|
if (StringUtils.isNotBlank(selectedRoles)) {
|
|
if (StringUtils.isNotBlank(selectedRoles)) {
|
|
String[] selectedRolesArr = selectedRoles.split(",");
|
|
String[] selectedRolesArr = selectedRoles.split(",");
|
|
boolean diagnoseFlag = Arrays.stream(selectedRolesArr).anyMatch(attr -> attr.equals("medicalDiagnoseCode"));
|
|
boolean diagnoseFlag = Arrays.stream(selectedRolesArr).anyMatch(attr -> attr.equals("medicalDiagnoseCode"));
|
|
boolean projectCodeFlag = Arrays.stream(selectedRolesArr).anyMatch(attr -> attr.equals("projectCode"));
|
|
boolean projectCodeFlag = Arrays.stream(selectedRolesArr).anyMatch(attr -> attr.equals("projectCode"));
|
|
- if(diagnoseFlag && !projectCodeFlag){
|
|
|
|
|
|
+ if (diagnoseFlag && !projectCodeFlag) {
|
|
medicalInsRuleProjectList.add(medicalInsRuleProject);
|
|
medicalInsRuleProjectList.add(medicalInsRuleProject);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if(CollectionUtil.isEmpty(medicalInsRuleProjectList)){
|
|
|
|
|
|
+ if (CollectionUtil.isEmpty(medicalInsRuleProjectList)) {
|
|
log.error("项目编码未匹配到对应的医保规则:{} 在规则库数据库中未检索到数据,退出规则执行", itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY));
|
|
log.error("项目编码未匹配到对应的医保规则:{} 在规则库数据库中未检索到数据,退出规则执行", itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY));
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
- Map<Integer,List<MedicalInsRuleProject>> ruleAndProjectMap = medicalInsRuleProjectList.stream().collect(Collectors.groupingBy(MedicalInsRuleProject::getMedicalInsRuleInfoId));
|
|
|
|
|
|
+ Map<Integer, List<MedicalInsRuleProject>> ruleAndProjectMap = medicalInsRuleProjectList.stream().collect(Collectors.groupingBy(MedicalInsRuleProject::getMedicalInsRuleInfoId));
|
|
paramMap.put(SystemEventAttrConstant.ADVICE_DETAILS_LIST_KEY, itemList);
|
|
paramMap.put(SystemEventAttrConstant.ADVICE_DETAILS_LIST_KEY, itemList);
|
|
- for(Integer medicalInsRuleInfoId : ruleAndProjectMap.keySet()){
|
|
|
|
|
|
+ for (Integer medicalInsRuleInfoId : ruleAndProjectMap.keySet()) {
|
|
List<String> medicalInsCorrProjectCodeList = ruleAndProjectMap.get(medicalInsRuleInfoId).stream().map(MedicalInsRuleProject::getCorrelationProjectCode).collect(Collectors.toList());
|
|
List<String> medicalInsCorrProjectCodeList = ruleAndProjectMap.get(medicalInsRuleInfoId).stream().map(MedicalInsRuleProject::getCorrelationProjectCode).collect(Collectors.toList());
|
|
MedicalInsRuleProject medicalInsRuleProject = ruleAndProjectMap.get(medicalInsRuleInfoId).get(0);
|
|
MedicalInsRuleProject medicalInsRuleProject = ruleAndProjectMap.get(medicalInsRuleInfoId).get(0);
|
|
setProjectToLocalMap(itemMap, medicalInsRuleProject);
|
|
setProjectToLocalMap(itemMap, medicalInsRuleProject);
|
|
@@ -624,7 +622,7 @@ public class RuleEngine {
|
|
boolean sendFlagTemp = false;
|
|
boolean sendFlagTemp = false;
|
|
try {
|
|
try {
|
|
sendFlagTemp = runMidEngine(itemMap, medicalInsRuleInfoId, midIncidentAudit, itemList);
|
|
sendFlagTemp = runMidEngine(itemMap, medicalInsRuleInfoId, midIncidentAudit, itemList);
|
|
- }catch (Exception e){
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
log.error(e.getMessage(), e);
|
|
log.error(e.getMessage(), e);
|
|
}
|
|
}
|
|
sendFlag = sendFlagTemp || sendFlag;
|
|
sendFlag = sendFlagTemp || sendFlag;
|
|
@@ -668,13 +666,13 @@ public class RuleEngine {
|
|
if (CollectionUtil.isEmpty(medicalInsRuleInfoIdList)) {
|
|
if (CollectionUtil.isEmpty(medicalInsRuleInfoIdList)) {
|
|
log.error("项目编码未匹配到对应的医保规则:{} 再次从数据库检索", itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY));
|
|
log.error("项目编码未匹配到对应的医保规则:{} 再次从数据库检索", itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY));
|
|
medicalInsRuleProjectList = medicalInsRuleProjectService.getRuleProjectByMedicalProjectCode(itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY).toString());
|
|
medicalInsRuleProjectList = medicalInsRuleProjectService.getRuleProjectByMedicalProjectCode(itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY).toString());
|
|
- if(CollectionUtil.isEmpty(medicalInsRuleProjectList)){
|
|
|
|
|
|
+ if (CollectionUtil.isEmpty(medicalInsRuleProjectList)) {
|
|
log.error("项目编码未匹配到对应的医保规则:{} 在规则库数据库中未检索到数据", itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY));
|
|
log.error("项目编码未匹配到对应的医保规则:{} 在规则库数据库中未检索到数据", itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY));
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
medicalInsRuleInfoIdList = medicalInsRuleProjectList.stream().map(MedicalInsRuleProject::getMedicalInsRuleInfoId).collect(Collectors.toSet());
|
|
medicalInsRuleInfoIdList = medicalInsRuleProjectList.stream().map(MedicalInsRuleProject::getMedicalInsRuleInfoId).collect(Collectors.toSet());
|
|
log.info("数据库检索到匹配规则ID列表:{}", medicalInsRuleInfoIdList);
|
|
log.info("数据库检索到匹配规则ID列表:{}", medicalInsRuleInfoIdList);
|
|
}
|
|
}
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
medicalInsRuleProjectList = medicalInsRuleProjectService.getRuleProjectByRuleIdAndProjectCode(new ArrayList<>(medicalInsRuleInfoIdList), itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY).toString());
|
|
medicalInsRuleProjectList = medicalInsRuleProjectService.getRuleProjectByRuleIdAndProjectCode(new ArrayList<>(medicalInsRuleInfoIdList), itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY).toString());
|
|
}
|
|
}
|
|
Object diagnose = itemMap.get(Constant.MEDICAL_DIAGNOSE_CODE_KEY);
|
|
Object diagnose = itemMap.get(Constant.MEDICAL_DIAGNOSE_CODE_KEY);
|
|
@@ -684,39 +682,39 @@ public class RuleEngine {
|
|
List<MedicalInsRuleProject> medicalInsRuleProjectTempList = null;
|
|
List<MedicalInsRuleProject> medicalInsRuleProjectTempList = null;
|
|
if (CollectionUtil.isEmpty(diagnoseMedicalInsRuleInfoIdList)) {
|
|
if (CollectionUtil.isEmpty(diagnoseMedicalInsRuleInfoIdList)) {
|
|
medicalInsRuleProjectTempList = medicalInsRuleProjectService.getRuleProjectByDiagCode(diagnose.toString());
|
|
medicalInsRuleProjectTempList = medicalInsRuleProjectService.getRuleProjectByDiagCode(diagnose.toString());
|
|
- if(CollectionUtil.isEmpty(medicalInsRuleProjectTempList)){
|
|
|
|
|
|
+ if (CollectionUtil.isEmpty(medicalInsRuleProjectTempList)) {
|
|
log.info("诊断编码未匹配到对应的医保规则:{} 在规则库数据库中未检索到数据", diagnose);
|
|
log.info("诊断编码未匹配到对应的医保规则:{} 在规则库数据库中未检索到数据", diagnose);
|
|
}
|
|
}
|
|
Set<Integer> medicalInsRuleInfoIdDiagSet = medicalInsRuleProjectTempList.stream().map(MedicalInsRuleProject::getMedicalInsRuleInfoId).collect(Collectors.toSet());
|
|
Set<Integer> medicalInsRuleInfoIdDiagSet = medicalInsRuleProjectTempList.stream().map(MedicalInsRuleProject::getMedicalInsRuleInfoId).collect(Collectors.toSet());
|
|
log.info("数据库检索到匹配规则ID列表:{} 诊断编码为:{}", medicalInsRuleInfoIdDiagSet, diagnose);
|
|
log.info("数据库检索到匹配规则ID列表:{} 诊断编码为:{}", medicalInsRuleInfoIdDiagSet, diagnose);
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
medicalInsRuleProjectTempList = medicalInsRuleProjectService.getRuleProjectByRuleIdAndDiagCode(new ArrayList<>(diagnoseMedicalInsRuleInfoIdList), diagnose.toString());
|
|
medicalInsRuleProjectTempList = medicalInsRuleProjectService.getRuleProjectByRuleIdAndDiagCode(new ArrayList<>(diagnoseMedicalInsRuleInfoIdList), diagnose.toString());
|
|
}
|
|
}
|
|
- if(CollectionUtil.isNotEmpty(medicalInsRuleProjectTempList)){
|
|
|
|
- if(CollectionUtil.isEmpty(medicalInsRuleProjectList)){
|
|
|
|
|
|
+ if (CollectionUtil.isNotEmpty(medicalInsRuleProjectTempList)) {
|
|
|
|
+ if (CollectionUtil.isEmpty(medicalInsRuleProjectList)) {
|
|
medicalInsRuleProjectList = new ArrayList<>();
|
|
medicalInsRuleProjectList = new ArrayList<>();
|
|
}
|
|
}
|
|
- for(MedicalInsRuleProject medicalInsRuleProject : medicalInsRuleProjectTempList){
|
|
|
|
|
|
+ for (MedicalInsRuleProject medicalInsRuleProject : medicalInsRuleProjectTempList) {
|
|
MedicalInsRuleInfo projectRuleInfo = allMedicalMap.get(medicalInsRuleProject.getMedicalInsRuleInfoId());
|
|
MedicalInsRuleInfo projectRuleInfo = allMedicalMap.get(medicalInsRuleProject.getMedicalInsRuleInfoId());
|
|
String selectedRoles = projectRuleInfo.getSelectedRoles();
|
|
String selectedRoles = projectRuleInfo.getSelectedRoles();
|
|
if (StringUtils.isNotBlank(selectedRoles)) {
|
|
if (StringUtils.isNotBlank(selectedRoles)) {
|
|
String[] selectedRolesArr = selectedRoles.split(",");
|
|
String[] selectedRolesArr = selectedRoles.split(",");
|
|
boolean diagnoseFlag = Arrays.stream(selectedRolesArr).anyMatch(attr -> attr.equals("medicalDiagnoseCode"));
|
|
boolean diagnoseFlag = Arrays.stream(selectedRolesArr).anyMatch(attr -> attr.equals("medicalDiagnoseCode"));
|
|
boolean projectCodeFlag = Arrays.stream(selectedRolesArr).anyMatch(attr -> attr.equals("projectCode"));
|
|
boolean projectCodeFlag = Arrays.stream(selectedRolesArr).anyMatch(attr -> attr.equals("projectCode"));
|
|
- if(diagnoseFlag && !projectCodeFlag){
|
|
|
|
|
|
+ if (diagnoseFlag && !projectCodeFlag) {
|
|
medicalInsRuleProjectList.add(medicalInsRuleProject);
|
|
medicalInsRuleProjectList.add(medicalInsRuleProject);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if(CollectionUtil.isEmpty(medicalInsRuleProjectList)){
|
|
|
|
|
|
+ if (CollectionUtil.isEmpty(medicalInsRuleProjectList)) {
|
|
log.error("项目编码未匹配到对应的医保规则:{} 在规则库数据库中未检索到数据,退出规则执行", itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY));
|
|
log.error("项目编码未匹配到对应的医保规则:{} 在规则库数据库中未检索到数据,退出规则执行", itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY));
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
- Map<Integer,List<MedicalInsRuleProject>> ruleAndProjectMap = medicalInsRuleProjectList.stream().collect(Collectors.groupingBy(MedicalInsRuleProject::getMedicalInsRuleInfoId));
|
|
|
|
|
|
+ Map<Integer, List<MedicalInsRuleProject>> ruleAndProjectMap = medicalInsRuleProjectList.stream().collect(Collectors.groupingBy(MedicalInsRuleProject::getMedicalInsRuleInfoId));
|
|
paramMap.put(SystemEventAttrConstant.ADVICE_DETAILS_LIST_KEY, itemList);
|
|
paramMap.put(SystemEventAttrConstant.ADVICE_DETAILS_LIST_KEY, itemList);
|
|
- for(Integer medicalInsRuleInfoId : ruleAndProjectMap.keySet()){
|
|
|
|
|
|
+ for (Integer medicalInsRuleInfoId : ruleAndProjectMap.keySet()) {
|
|
List<String> medicalInsCorrProjectCodeList = ruleAndProjectMap.get(medicalInsRuleInfoId).stream().map(MedicalInsRuleProject::getCorrelationProjectCode).collect(Collectors.toList());
|
|
List<String> medicalInsCorrProjectCodeList = ruleAndProjectMap.get(medicalInsRuleInfoId).stream().map(MedicalInsRuleProject::getCorrelationProjectCode).collect(Collectors.toList());
|
|
MedicalInsRuleProject medicalInsRuleProject = ruleAndProjectMap.get(medicalInsRuleInfoId).get(0);
|
|
MedicalInsRuleProject medicalInsRuleProject = ruleAndProjectMap.get(medicalInsRuleInfoId).get(0);
|
|
setProjectToLocalMap(itemMap, medicalInsRuleProject);
|
|
setProjectToLocalMap(itemMap, medicalInsRuleProject);
|
|
@@ -725,7 +723,7 @@ public class RuleEngine {
|
|
boolean sendFlagTemp = false;
|
|
boolean sendFlagTemp = false;
|
|
try {
|
|
try {
|
|
sendFlagTemp = runMidEngine(itemMap, medicalInsRuleInfoId, midIncidentAudit, itemList);
|
|
sendFlagTemp = runMidEngine(itemMap, medicalInsRuleInfoId, midIncidentAudit, itemList);
|
|
- }catch (Exception e){
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
log.error(e.getMessage(), e);
|
|
log.error(e.getMessage(), e);
|
|
}
|
|
}
|
|
sendFlag = sendFlagTemp || sendFlag;
|
|
sendFlag = sendFlagTemp || sendFlag;
|
|
@@ -767,13 +765,13 @@ public class RuleEngine {
|
|
if (CollectionUtil.isEmpty(medicalInsRuleInfoIdList)) {
|
|
if (CollectionUtil.isEmpty(medicalInsRuleInfoIdList)) {
|
|
log.error("项目编码未匹配到对应的医保规则:{} 再次从数据库检索", itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY));
|
|
log.error("项目编码未匹配到对应的医保规则:{} 再次从数据库检索", itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY));
|
|
medicalInsRuleProjectList = medicalInsRuleProjectService.getRuleProjectByMedicalProjectCode(itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY).toString());
|
|
medicalInsRuleProjectList = medicalInsRuleProjectService.getRuleProjectByMedicalProjectCode(itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY).toString());
|
|
- if(CollectionUtil.isEmpty(medicalInsRuleProjectList)){
|
|
|
|
|
|
+ if (CollectionUtil.isEmpty(medicalInsRuleProjectList)) {
|
|
log.error("项目编码未匹配到对应的医保规则:{} 在规则库数据库中未检索到数据", itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY));
|
|
log.error("项目编码未匹配到对应的医保规则:{} 在规则库数据库中未检索到数据", itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY));
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
medicalInsRuleInfoIdList = medicalInsRuleProjectList.stream().map(MedicalInsRuleProject::getMedicalInsRuleInfoId).collect(Collectors.toSet());
|
|
medicalInsRuleInfoIdList = medicalInsRuleProjectList.stream().map(MedicalInsRuleProject::getMedicalInsRuleInfoId).collect(Collectors.toSet());
|
|
log.info("数据库检索到匹配规则ID列表:{}", medicalInsRuleInfoIdList);
|
|
log.info("数据库检索到匹配规则ID列表:{}", medicalInsRuleInfoIdList);
|
|
}
|
|
}
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
medicalInsRuleProjectList = medicalInsRuleProjectService.getRuleProjectByRuleIdAndProjectCode(new ArrayList<>(medicalInsRuleInfoIdList), itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY).toString());
|
|
medicalInsRuleProjectList = medicalInsRuleProjectService.getRuleProjectByRuleIdAndProjectCode(new ArrayList<>(medicalInsRuleInfoIdList), itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY).toString());
|
|
}
|
|
}
|
|
Object diagnose = itemMap.get(Constant.MEDICAL_DIAGNOSE_CODE_KEY);
|
|
Object diagnose = itemMap.get(Constant.MEDICAL_DIAGNOSE_CODE_KEY);
|
|
@@ -783,47 +781,60 @@ public class RuleEngine {
|
|
List<MedicalInsRuleProject> medicalInsRuleProjectTempList = null;
|
|
List<MedicalInsRuleProject> medicalInsRuleProjectTempList = null;
|
|
if (CollectionUtil.isEmpty(diagnoseMedicalInsRuleInfoIdList)) {
|
|
if (CollectionUtil.isEmpty(diagnoseMedicalInsRuleInfoIdList)) {
|
|
medicalInsRuleProjectTempList = medicalInsRuleProjectService.getRuleProjectByDiagCode(diagnose.toString());
|
|
medicalInsRuleProjectTempList = medicalInsRuleProjectService.getRuleProjectByDiagCode(diagnose.toString());
|
|
- if(CollectionUtil.isEmpty(medicalInsRuleProjectTempList)){
|
|
|
|
|
|
+ if (CollectionUtil.isEmpty(medicalInsRuleProjectTempList)) {
|
|
log.info("诊断编码未匹配到对应的医保规则:{} 在规则库数据库中未检索到数据", diagnose);
|
|
log.info("诊断编码未匹配到对应的医保规则:{} 在规则库数据库中未检索到数据", diagnose);
|
|
}
|
|
}
|
|
Set<Integer> medicalInsRuleInfoIdDiagSet = medicalInsRuleProjectTempList.stream().map(MedicalInsRuleProject::getMedicalInsRuleInfoId).collect(Collectors.toSet());
|
|
Set<Integer> medicalInsRuleInfoIdDiagSet = medicalInsRuleProjectTempList.stream().map(MedicalInsRuleProject::getMedicalInsRuleInfoId).collect(Collectors.toSet());
|
|
log.info("数据库检索到匹配规则ID列表:{} 诊断编码为:{}", medicalInsRuleInfoIdDiagSet, diagnose);
|
|
log.info("数据库检索到匹配规则ID列表:{} 诊断编码为:{}", medicalInsRuleInfoIdDiagSet, diagnose);
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
medicalInsRuleProjectTempList = medicalInsRuleProjectService.getRuleProjectByRuleIdAndDiagCode(new ArrayList<>(diagnoseMedicalInsRuleInfoIdList), diagnose.toString());
|
|
medicalInsRuleProjectTempList = medicalInsRuleProjectService.getRuleProjectByRuleIdAndDiagCode(new ArrayList<>(diagnoseMedicalInsRuleInfoIdList), diagnose.toString());
|
|
}
|
|
}
|
|
- if(CollectionUtil.isNotEmpty(medicalInsRuleProjectTempList)){
|
|
|
|
- if(CollectionUtil.isEmpty(medicalInsRuleProjectList)){
|
|
|
|
|
|
+ if (CollectionUtil.isNotEmpty(medicalInsRuleProjectTempList)) {
|
|
|
|
+ if (CollectionUtil.isEmpty(medicalInsRuleProjectList)) {
|
|
medicalInsRuleProjectList = new ArrayList<>();
|
|
medicalInsRuleProjectList = new ArrayList<>();
|
|
}
|
|
}
|
|
- for(MedicalInsRuleProject medicalInsRuleProject : medicalInsRuleProjectTempList){
|
|
|
|
|
|
+ for (MedicalInsRuleProject medicalInsRuleProject : medicalInsRuleProjectTempList) {
|
|
MedicalInsRuleInfo projectRuleInfo = allMedicalMap.get(medicalInsRuleProject.getMedicalInsRuleInfoId());
|
|
MedicalInsRuleInfo projectRuleInfo = allMedicalMap.get(medicalInsRuleProject.getMedicalInsRuleInfoId());
|
|
String selectedRoles = projectRuleInfo.getSelectedRoles();
|
|
String selectedRoles = projectRuleInfo.getSelectedRoles();
|
|
if (StringUtils.isNotBlank(selectedRoles)) {
|
|
if (StringUtils.isNotBlank(selectedRoles)) {
|
|
String[] selectedRolesArr = selectedRoles.split(",");
|
|
String[] selectedRolesArr = selectedRoles.split(",");
|
|
boolean diagnoseFlag = Arrays.stream(selectedRolesArr).anyMatch(attr -> attr.equals("medicalDiagnoseCode"));
|
|
boolean diagnoseFlag = Arrays.stream(selectedRolesArr).anyMatch(attr -> attr.equals("medicalDiagnoseCode"));
|
|
boolean projectCodeFlag = Arrays.stream(selectedRolesArr).anyMatch(attr -> attr.equals("projectCode"));
|
|
boolean projectCodeFlag = Arrays.stream(selectedRolesArr).anyMatch(attr -> attr.equals("projectCode"));
|
|
- if(diagnoseFlag && !projectCodeFlag){
|
|
|
|
|
|
+ if (diagnoseFlag && !projectCodeFlag) {
|
|
medicalInsRuleProjectList.add(medicalInsRuleProject);
|
|
medicalInsRuleProjectList.add(medicalInsRuleProject);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if(CollectionUtil.isEmpty(medicalInsRuleProjectList)){
|
|
|
|
|
|
+ if (CollectionUtil.isEmpty(medicalInsRuleProjectList)) {
|
|
log.error("项目编码未匹配到对应的医保规则:{} 在规则库数据库中未检索到数据,退出执行规则", itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY));
|
|
log.error("项目编码未匹配到对应的医保规则:{} 在规则库数据库中未检索到数据,退出执行规则", itemMap.get(Constant.MEDICAL_PROJECT_CODE_KEY));
|
|
|
|
+ afterIncidentDetailLogService.lambdaUpdate().set(AfterIncidentDetailLog::getErrorDescription, "项目编码未匹配到对应的医保规则 在规则库数据库中未检索到数据,退出执行规则")
|
|
|
|
+ .set(AfterIncidentDetailLog::getState, Constant.FAIL)
|
|
|
|
+ .eq(AfterIncidentDetailLog::getId, afterIncidentDetailLog.getId()).update();
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- Map<Integer,List<MedicalInsRuleProject>> ruleAndProjectMap = medicalInsRuleProjectList.stream().collect(Collectors.groupingBy(MedicalInsRuleProject::getMedicalInsRuleInfoId));
|
|
|
|
|
|
+ Map<Integer, List<MedicalInsRuleProject>> ruleAndProjectMap = medicalInsRuleProjectList.stream().collect(Collectors.groupingBy(MedicalInsRuleProject::getMedicalInsRuleInfoId));
|
|
log.info("明细记录ID:{} 匹配到规则:{}", afterIncidentDetailLog.getId(), ruleAndProjectMap.keySet());
|
|
log.info("明细记录ID:{} 匹配到规则:{}", afterIncidentDetailLog.getId(), ruleAndProjectMap.keySet());
|
|
- for(Integer medicalInsRuleInfoId : ruleAndProjectMap.keySet()){
|
|
|
|
|
|
+ for (Integer medicalInsRuleInfoId : ruleAndProjectMap.keySet()) {
|
|
List<String> medicalInsCorrProjectCodeList = ruleAndProjectMap.get(medicalInsRuleInfoId).stream().map(MedicalInsRuleProject::getCorrelationProjectCode).collect(Collectors.toList());
|
|
List<String> medicalInsCorrProjectCodeList = ruleAndProjectMap.get(medicalInsRuleInfoId).stream().map(MedicalInsRuleProject::getCorrelationProjectCode).collect(Collectors.toList());
|
|
MedicalInsRuleProject medicalInsRuleProject = ruleAndProjectMap.get(medicalInsRuleInfoId).get(0);
|
|
MedicalInsRuleProject medicalInsRuleProject = ruleAndProjectMap.get(medicalInsRuleInfoId).get(0);
|
|
setProjectToLocalMap(itemMap, medicalInsRuleProject);
|
|
setProjectToLocalMap(itemMap, medicalInsRuleProject);
|
|
itemMap.put(SystemEventAttrConstant.MEDICAL_INS_CORRELATIONMEDICALDIAGNOSECODE, medicalInsCorrProjectCodeList);
|
|
itemMap.put(SystemEventAttrConstant.MEDICAL_INS_CORRELATIONMEDICALDIAGNOSECODE, medicalInsCorrProjectCodeList);
|
|
setItemCodeListToItemMap(itemList, itemMap);
|
|
setItemCodeListToItemMap(itemList, itemMap);
|
|
- runAfterEngine(itemMap, medicalInsRuleInfoId, afterwardsAudit, itemList);
|
|
|
|
|
|
+ MedicalInsRuleInfo medicalInsRuleInfo = allMedicalMap.get(medicalInsRuleInfoId);
|
|
|
|
+ boolean auditFlag = runAfterEngine(itemMap, medicalInsRuleInfoId, afterwardsAudit, itemList);
|
|
|
|
+ if (Constant.VALIDATION_HANDER_METHOD_RETURN.equals(medicalInsRuleInfo.getViolationHandingMethod()) && auditFlag) {
|
|
|
|
+ log.error("事后提醒数据:{} 规则名:{} 触发诊断类规则,直接全金额,后续规则无需再跑", itemMap, medicalInsRuleInfo);
|
|
|
|
+ String description = "触发诊断类规则,直接全金额,后续规则无需再跑,规则ID:" + medicalInsRuleInfo.getId();
|
|
|
|
+ itemMap.put(Constant.SPEL_LOG, description);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ Object description = itemMap.get(Constant.SPEL_LOG);
|
|
|
|
+ afterIncidentDetailLogService.lambdaUpdate().set(AfterIncidentDetailLog::getErrorDescription, description)
|
|
|
|
+ .set(AfterIncidentDetailLog::getState, Constant.SUCCESS)
|
|
|
|
+ .eq(AfterIncidentDetailLog::getId, afterIncidentDetailLog.getId()).update();
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
log.error(e.getMessage(), e);
|
|
log.error(e.getMessage(), e);
|
|
}
|
|
}
|
|
@@ -833,11 +844,11 @@ public class RuleEngine {
|
|
/**
|
|
/**
|
|
* 把当前明细记录的主单下的所有项目编码设置到当前项目记录
|
|
* 把当前明细记录的主单下的所有项目编码设置到当前项目记录
|
|
*/
|
|
*/
|
|
- public void setItemCodeListToItemMap(List<Map<String,Object>> itemList, Map<String,Object> itemMap){
|
|
|
|
|
|
+ public void setItemCodeListToItemMap(List<Map<String, Object>> itemList, Map<String, Object> itemMap) {
|
|
List<String> medicalProjectCodeList = new ArrayList<>();
|
|
List<String> medicalProjectCodeList = new ArrayList<>();
|
|
- for(Map<String,Object> itemTempMap : itemList){
|
|
|
|
|
|
+ for (Map<String, Object> itemTempMap : itemList) {
|
|
Object medicalProjectCode = itemTempMap.get(SystemEventAttrConstant.MEDICAL_PROJECT_CODE_KEY);
|
|
Object medicalProjectCode = itemTempMap.get(SystemEventAttrConstant.MEDICAL_PROJECT_CODE_KEY);
|
|
- if(null != medicalProjectCode){
|
|
|
|
|
|
+ if (null != medicalProjectCode) {
|
|
medicalProjectCodeList.add(medicalProjectCode.toString());
|
|
medicalProjectCodeList.add(medicalProjectCode.toString());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -846,23 +857,22 @@ public class RuleEngine {
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
- *
|
|
|
|
* @param itemMap
|
|
* @param itemMap
|
|
* @param medicalInsRuleProject
|
|
* @param medicalInsRuleProject
|
|
*/
|
|
*/
|
|
- public void setProjectToLocalMap(Map<String,Object> itemMap, MedicalInsRuleProject medicalInsRuleProject){
|
|
|
|
- if(null != medicalInsRuleProject.getAge()){
|
|
|
|
- if(daysRuleIdSet.contains(medicalInsRuleProject.getMedicalInsRuleInfoId())){
|
|
|
|
|
|
+ public void setProjectToLocalMap(Map<String, Object> itemMap, MedicalInsRuleProject medicalInsRuleProject) {
|
|
|
|
+ if (null != medicalInsRuleProject.getAge()) {
|
|
|
|
+ if (daysRuleIdSet.contains(medicalInsRuleProject.getMedicalInsRuleInfoId())) {
|
|
medicalInsRuleProject.setAgeDays(Double.valueOf(medicalInsRuleProject.getAge()));
|
|
medicalInsRuleProject.setAgeDays(Double.valueOf(medicalInsRuleProject.getAge()));
|
|
- }else{
|
|
|
|
- if(null != medicalInsRuleProject.getAge()){
|
|
|
|
|
|
+ } else {
|
|
|
|
+ if (null != medicalInsRuleProject.getAge()) {
|
|
medicalInsRuleProject.setAgeDays(Double.valueOf(medicalInsRuleProject.getAge() * 365));
|
|
medicalInsRuleProject.setAgeDays(Double.valueOf(medicalInsRuleProject.getAge() * 365));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
String jsonStr = JSON.toJSONString(medicalInsRuleProject);
|
|
String jsonStr = JSON.toJSONString(medicalInsRuleProject);
|
|
JSONObject jsonObject = JSONObject.parseObject(jsonStr);
|
|
JSONObject jsonObject = JSONObject.parseObject(jsonStr);
|
|
- Map<String,Object> transferMedicalMap = filterMap(jsonObject);
|
|
|
|
|
|
+ Map<String, Object> transferMedicalMap = filterMap(jsonObject);
|
|
itemMap.putAll(transferMedicalMap);
|
|
itemMap.putAll(transferMedicalMap);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1110,7 +1120,7 @@ public class RuleEngine {
|
|
paramMap.put(SystemEventAttrConstant.MEDICAL_INS_RULE_INFO_NAME, medicalInsRuleInfo.getRuleName());
|
|
paramMap.put(SystemEventAttrConstant.MEDICAL_INS_RULE_INFO_NAME, medicalInsRuleInfo.getRuleName());
|
|
paramMap.put(SystemEventAttrConstant.MEDICAL_INS_RULE_INFO_DESC, medicalInsRuleInfo.getDescription());
|
|
paramMap.put(SystemEventAttrConstant.MEDICAL_INS_RULE_INFO_DESC, medicalInsRuleInfo.getDescription());
|
|
factorEnchangeFactory.runFactorEnchange(medicalRuleInsInfoId, medicalInsRuleInfo, audit, paramMap, ruleFactorRelaList, factorEnchanceList, null);
|
|
factorEnchangeFactory.runFactorEnchange(medicalRuleInsInfoId, medicalInsRuleInfo, audit, paramMap, ruleFactorRelaList, factorEnchanceList, null);
|
|
- }catch (Exception e){
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
log.error(e.getMessage(), e);
|
|
log.error(e.getMessage(), e);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1148,7 +1158,7 @@ public class RuleEngine {
|
|
log.error("事后统计数据:{} 规则名:{} 触发诊断类规则,直接全金额,后续规则无需再跑", paramMap, medicalInsRuleInfo);
|
|
log.error("事后统计数据:{} 规则名:{} 触发诊断类规则,直接全金额,后续规则无需再跑", paramMap, medicalInsRuleInfo);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- }catch (Exception e){
|
|
|
|
|
|
+ } catch (Exception e) {
|
|
log.error(e.getMessage(), e);
|
|
log.error(e.getMessage(), e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1161,10 +1171,10 @@ public class RuleEngine {
|
|
*
|
|
*
|
|
* @param paramMap
|
|
* @param paramMap
|
|
*/
|
|
*/
|
|
- public void runAfterEngine(Map<String, Object> paramMap, Integer medicalRuleInsInfoId, AfterwardsAudit afterIncidentAudit, List<Map<String, Object>> itemList) throws Exception {
|
|
|
|
|
|
+ public boolean runAfterEngine(Map<String, Object> paramMap, Integer medicalRuleInsInfoId, AfterwardsAudit afterIncidentAudit, List<Map<String, Object>> itemList) throws Exception {
|
|
if (null == medicalRuleInsInfoId) {
|
|
if (null == medicalRuleInsInfoId) {
|
|
log.error("未有对应的规则,接口数据:{}", paramMap);
|
|
log.error("未有对应的规则,接口数据:{}", paramMap);
|
|
- return;
|
|
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
if (allEnchanceTypeMap.containsKey(medicalRuleInsInfoId)) {
|
|
if (allEnchanceTypeMap.containsKey(medicalRuleInsInfoId)) {
|
|
MedicalInsRuleInfo medicalInsRuleInfo = allMedicalMap.get(medicalRuleInsInfoId);
|
|
MedicalInsRuleInfo medicalInsRuleInfo = allMedicalMap.get(medicalRuleInsInfoId);
|
|
@@ -1176,13 +1186,12 @@ public class RuleEngine {
|
|
getRuleProjectIntoMap(medicalInsRuleInfo, paramMap);
|
|
getRuleProjectIntoMap(medicalInsRuleInfo, paramMap);
|
|
paramMap.put(SystemEventAttrConstant.ADVICE_DETAILS_LIST_KEY, itemList);
|
|
paramMap.put(SystemEventAttrConstant.ADVICE_DETAILS_LIST_KEY, itemList);
|
|
boolean auditFlag = factorEnchangeFactory.runFactorEnchange(medicalRuleInsInfoId, medicalInsRuleInfo, afterIncidentAudit, paramMap, ruleFactorRelaSortList, factorEnchanceListTemp, itemList);
|
|
boolean auditFlag = factorEnchangeFactory.runFactorEnchange(medicalRuleInsInfoId, medicalInsRuleInfo, afterIncidentAudit, paramMap, ruleFactorRelaSortList, factorEnchanceListTemp, itemList);
|
|
- if (Constant.VALIDATION_HANDER_METHOD_RETURN.equals(medicalInsRuleInfo.getViolationHandingMethod()) && auditFlag) {
|
|
|
|
- log.error("事后提醒数据:{} 规则名:{} 触发诊断类规则,直接全金额,后续规则无需再跑", paramMap, medicalInsRuleInfo);
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
|
|
+ return auditFlag;
|
|
|
|
+ } else {
|
|
log.error("该医保规则ID:{} 未有配置医保规则处理流程-请到规则配置页面进行配置", medicalRuleInsInfoId);
|
|
log.error("该医保规则ID:{} 未有配置医保规则处理流程-请到规则配置页面进行配置", medicalRuleInsInfoId);
|
|
|
|
+ paramMap.put(Constant.SPEL_LOG, "项目编码未匹配到对应的医保规则 在规则库数据库中未检索到数据,退出执行规则");
|
|
}
|
|
}
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -1211,7 +1220,7 @@ public class RuleEngine {
|
|
log.error("事后提醒数据:{} 规则名:{} 触发诊断类规则,直接全金额,后续规则无需再跑", paramMap, medicalInsRuleInfo);
|
|
log.error("事后提醒数据:{} 规则名:{} 触发诊断类规则,直接全金额,后续规则无需再跑", paramMap, medicalInsRuleInfo);
|
|
return auditFlag;
|
|
return auditFlag;
|
|
}
|
|
}
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
log.error("该医保规则ID:{} 未有配置医保规则处理流程-请到规则配置页面进行配置", medicalRuleInsInfoId);
|
|
log.error("该医保规则ID:{} 未有配置医保规则处理流程-请到规则配置页面进行配置", medicalRuleInsInfoId);
|
|
}
|
|
}
|
|
return auditFlag;
|
|
return auditFlag;
|
|
@@ -1236,11 +1245,11 @@ public class RuleEngine {
|
|
conditionFlag = true;
|
|
conditionFlag = true;
|
|
}
|
|
}
|
|
medicalInsRuleProjectDiagnoseList = medicalInsRuleProjectDiagnoseService.lambdaQuery().eq(MedicalInsRuleProjectDiagnose::getMedicalInsRuleInfoId, medicalInsRuleInfo.getId())
|
|
medicalInsRuleProjectDiagnoseList = medicalInsRuleProjectDiagnoseService.lambdaQuery().eq(MedicalInsRuleProjectDiagnose::getMedicalInsRuleInfoId, medicalInsRuleInfo.getId())
|
|
- .eq(MedicalInsRuleProjectDiagnose::getProjectCodeType, 1).last(conditionFlag, " and INSTR('"+projectCode+"', medical_ins_project_code)").list();
|
|
|
|
|
|
+ .eq(MedicalInsRuleProjectDiagnose::getProjectCodeType, 1).last(conditionFlag, " and INSTR('" + projectCode + "', medical_ins_project_code)").list();
|
|
if (CollectionUtil.isNotEmpty(medicalInsRuleProjectDiagnoseList)) {
|
|
if (CollectionUtil.isNotEmpty(medicalInsRuleProjectDiagnoseList)) {
|
|
List<String> medicalDiagnoseStrList = medicalInsRuleProjectDiagnoseList.stream().map(MedicalInsRuleProjectDiagnose::getMedicalDiagnoseCode).collect(Collectors.toList());
|
|
List<String> medicalDiagnoseStrList = medicalInsRuleProjectDiagnoseList.stream().map(MedicalInsRuleProjectDiagnose::getMedicalDiagnoseCode).collect(Collectors.toList());
|
|
itemMap.put(SystemEventAttrConstant.MEDICAL_INS_MEDICALDIAGNOSECODELIST, medicalDiagnoseStrList);
|
|
itemMap.put(SystemEventAttrConstant.MEDICAL_INS_MEDICALDIAGNOSECODELIST, medicalDiagnoseStrList);
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
log.error("配置了诊断编码规则属性,但是具体规则参数未配置,请管理员尽快配置 医保规则:{}", medicalInsRuleInfo);
|
|
log.error("配置了诊断编码规则属性,但是具体规则参数未配置,请管理员尽快配置 医保规则:{}", medicalInsRuleInfo);
|
|
itemMap.put(SystemEventAttrConstant.MEDICAL_INS_MEDICALDIAGNOSECODELIST, new ArrayList<>());
|
|
itemMap.put(SystemEventAttrConstant.MEDICAL_INS_MEDICALDIAGNOSECODELIST, new ArrayList<>());
|
|
}
|
|
}
|
|
@@ -1249,16 +1258,16 @@ public class RuleEngine {
|
|
if (correlationDiagnoseFlag) {
|
|
if (correlationDiagnoseFlag) {
|
|
List<MedicalInsRuleProjectDiagnose> medicalInsRuleProjectDiagnoseList = null;
|
|
List<MedicalInsRuleProjectDiagnose> medicalInsRuleProjectDiagnoseList = null;
|
|
boolean conditionFlag = false;
|
|
boolean conditionFlag = false;
|
|
- String collectionProjectCode = itemMap.getOrDefault(SystemEventAttrConstant.MEDICAL_INS_CORRELATIONMEDICALDIAGNOSECODE,"").toString();
|
|
|
|
|
|
+ String collectionProjectCode = itemMap.getOrDefault(SystemEventAttrConstant.MEDICAL_INS_CORRELATIONMEDICALDIAGNOSECODE, "").toString();
|
|
if (StringUtils.isNotBlank(collectionProjectCode)) {
|
|
if (StringUtils.isNotBlank(collectionProjectCode)) {
|
|
conditionFlag = true;
|
|
conditionFlag = true;
|
|
}
|
|
}
|
|
medicalInsRuleProjectDiagnoseList = medicalInsRuleProjectDiagnoseService.lambdaQuery().eq(MedicalInsRuleProjectDiagnose::getMedicalInsRuleInfoId, medicalInsRuleInfo.getId())
|
|
medicalInsRuleProjectDiagnoseList = medicalInsRuleProjectDiagnoseService.lambdaQuery().eq(MedicalInsRuleProjectDiagnose::getMedicalInsRuleInfoId, medicalInsRuleInfo.getId())
|
|
- .eq(MedicalInsRuleProjectDiagnose::getProjectCodeType, 2).last(conditionFlag, " and INSTR('"+projectCode+"', medical_ins_project_code)").list();
|
|
|
|
|
|
+ .eq(MedicalInsRuleProjectDiagnose::getProjectCodeType, 2).last(conditionFlag, " and INSTR('" + projectCode + "', medical_ins_project_code)").list();
|
|
if (CollectionUtil.isNotEmpty(medicalInsRuleProjectDiagnoseList)) {
|
|
if (CollectionUtil.isNotEmpty(medicalInsRuleProjectDiagnoseList)) {
|
|
List<String> medicalDiagnoseStrList = medicalInsRuleProjectDiagnoseList.stream().map(MedicalInsRuleProjectDiagnose::getMedicalDiagnoseCode).collect(Collectors.toList());
|
|
List<String> medicalDiagnoseStrList = medicalInsRuleProjectDiagnoseList.stream().map(MedicalInsRuleProjectDiagnose::getMedicalDiagnoseCode).collect(Collectors.toList());
|
|
itemMap.put(SystemEventAttrConstant.MEDICAL_INS_CORRELATIONMEDICALDIAGNOSECODE, medicalDiagnoseStrList);
|
|
itemMap.put(SystemEventAttrConstant.MEDICAL_INS_CORRELATIONMEDICALDIAGNOSECODE, medicalDiagnoseStrList);
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
log.error("配置了关联诊断编码规则属性,但是具体规则参数未配置,请管理员尽快配置 医保规则:{}", medicalInsRuleInfo);
|
|
log.error("配置了关联诊断编码规则属性,但是具体规则参数未配置,请管理员尽快配置 医保规则:{}", medicalInsRuleInfo);
|
|
itemMap.put(SystemEventAttrConstant.MEDICAL_INS_CORRELATIONMEDICALDIAGNOSECODE, new ArrayList<>());
|
|
itemMap.put(SystemEventAttrConstant.MEDICAL_INS_CORRELATIONMEDICALDIAGNOSECODE, new ArrayList<>());
|
|
}
|
|
}
|