| | |
| | | int primaryGeneratedCount = deptGenCount + wardGenCount + diagGenCount; |
| | | log.info("【基于规则】首要规则执行结果: deptGen={}, wardGen={}, diagGen={}, total={}", deptGenCount, wardGenCount, diagGenCount, primaryGeneratedCount); |
| | | |
| | | String remark = patMedInhosp1.getRemark(); |
| | | // 第二步:判断首要规则是否有任意一个生成成功 |
| | | if (primaryGeneratedCount > 0) { |
| | | // 至少有一个首要规则生成成功 |
| | | // —— 将=2的次要规则对应flag设为"2"(跳过) |
| | | log.info("【基于规则】首要规则有成功(count={}),将次要规则对应flag设为2", primaryGeneratedCount); |
| | | if (deptIsSecondary) { |
| | | updateCheckFlag(patMedInhosp1, 1, "2", "首要规则已生成,次要规则跳过"); |
| | | updateCheckFlag(patMedInhosp1, 1, "2", StringUtils.isNotEmpty(remark)?remark+";首要规则已生成,次要规则跳过":"首要规则已生成,次要规则跳过"); |
| | | } |
| | | if (!active.equals("xh")) { |
| | | if (wardIsSecondary) { |
| | | updateCheckFlag(patMedInhosp1, 2, "2", "首要规则已生成,次要规则跳过"); |
| | | updateCheckFlag(patMedInhosp1, 2, "2", StringUtils.isNotEmpty(remark)?remark+";首要规则已生成,次要规则跳过":"首要规则已生成,次要规则跳过"); |
| | | } |
| | | if (diagIsSecondary) { |
| | | updateCheckFlag(patMedInhosp1, 3, "2", "首要规则已生成,次要规则跳过"); |
| | | updateCheckFlag(patMedInhosp1, 3, "2", StringUtils.isNotEmpty(remark)?remark+";首要规则已生成,次要规则跳过":"首要规则已生成,次要规则跳过"); |
| | | } |
| | | } |
| | | // —— 对于=1且生成成功的,将其对应flag设为"1" |
| | | if (deptIsPrimary && deptGenCount > 0) { |
| | | updateCheckFlag(patMedInhosp1, 1, "1", "科室首要规则生成成功"); |
| | | updateCheckFlag(patMedInhosp1, 1, "1", StringUtils.isNotEmpty(remark)?remark+";科室首要规则生成成功":"科室首要规则生成成功"); |
| | | } |
| | | if (!active.equals("xh")) { |
| | | if (wardIsPrimary && wardGenCount > 0) { |
| | | updateCheckFlag(patMedInhosp1, 2, "1", "病区首要规则生成成功"); |
| | | updateCheckFlag(patMedInhosp1, 2, "1", StringUtils.isNotEmpty(remark)?remark+";病区首要规则生成成功":"病区首要规则生成成功"); |
| | | } |
| | | if (diagIsPrimary && diagGenCount > 0) { |
| | | updateCheckFlag(patMedInhosp1, 3, "1", "疾病首要规则生成成功"); |
| | | updateCheckFlag(patMedInhosp1, 3, "1", StringUtils.isNotEmpty(remark)?remark+";疾病首要规则生成成功":"疾病首要规则生成成功"); |
| | | } |
| | | } |
| | | // —— 对于=1但生成失败的,将其对应flag设为"2" |
| | | if (deptIsPrimary && deptGenCount == 0) { |
| | | updateCheckFlag(patMedInhosp1, 1, "2", "科室首要规则生成失败"); |
| | | updateCheckFlag(patMedInhosp1, 1, "2", StringUtils.isNotEmpty(remark)?remark+";科室首要规则生成失败":"科室首要规则生成失败"); |
| | | } |
| | | if (!active.equals("xh")) { |
| | | if (wardIsPrimary && wardGenCount == 0) { |
| | | updateCheckFlag(patMedInhosp1, 2, "2", "病区首要规则生成失败"); |
| | | updateCheckFlag(patMedInhosp1, 2, "2", StringUtils.isNotEmpty(remark)?remark+";病区首要规则生成失败":"病区首要规则生成失败"); |
| | | } |
| | | if (diagIsPrimary && diagGenCount == 0) { |
| | | updateCheckFlag(patMedInhosp1, 3, "2", "疾病首要规则生成失败"); |
| | | updateCheckFlag(patMedInhosp1, 3, "2", StringUtils.isNotEmpty(remark)?remark+";疾病首要规则生成失败":"疾病首要规则生成失败"); |
| | | } |
| | | } |
| | | } else { |
| | | // 所有首要规则全部失败,将=1的flag设为"2",然后执行=2的方法 |
| | | log.info("【基于规则】首要规则全部失败,将=1的flag设为2,开始执行次要规则"); |
| | | if (deptIsPrimary) { |
| | | updateCheckFlag(patMedInhosp1, 1, "2", "科室首要规则全部失败"); |
| | | updateCheckFlag(patMedInhosp1, 1, "2", StringUtils.isNotEmpty(remark)?remark+";科室首要规则全部失败":"科室首要规则全部失败"); |
| | | } |
| | | if (!active.equals("xh")) { |
| | | if (wardIsPrimary) { |
| | | updateCheckFlag(patMedInhosp1, 2, "2", "病区首要规则全部失败"); |
| | | updateCheckFlag(patMedInhosp1, 2, "2", StringUtils.isNotEmpty(remark)?remark+";病区首要规则全部失败":"病区首要规则全部失败"); |
| | | } |
| | | if (diagIsPrimary) { |
| | | updateCheckFlag(patMedInhosp1, 3, "2", "疾病首要规则全部失败"); |
| | | updateCheckFlag(patMedInhosp1, 3, "2", StringUtils.isNotEmpty(remark)?remark+";疾病首要规则全部失败":"疾病首要规则全部失败"); |
| | | } |
| | | } |
| | | // 执行次要规则(=2)的方法 |