| | |
| | | patTaskRelevance.setDiagname(serviceSubtask1.getLeavediagname()); |
| | | patTaskRelevance.setPatid(serviceSubtask1.getPatid()); |
| | | patTaskRelevance.setSendStatus(serviceSubtask1.getSendstate()); |
| | | patTaskRelevance.setDeptcode(serviceSubtask1.getDeptcode()); |
| | | patTaskRelevance.setDeptName(serviceSubtask1.getDeptname()); |
| | | patTaskRelevance.setDeptcode(serviceSubtask1.getLeaveldeptcode()); |
| | | patTaskRelevance.setDeptName(serviceSubtask1.getLeaveldeptname()); |
| | | patTaskRelevance.setLeavehospitaldistrictcode(serviceSubtask1.getLeavehospitaldistrictcode()); |
| | | patTaskRelevance.setLeavehospitaldistrictname(serviceSubtask1.getLeavehospitaldistrictname()); |
| | | patTaskRelevance.setInhosptime(serviceSubtask1.getInhosptime()); |
| | |
| | | patTaskRelevance.setTelcode(serviceSubtask1.getPhone()); |
| | | patTaskRelevance.setFinishtime(serviceSubtask1.getFinishtime()); |
| | | patTaskRelevance.setAddr(serviceSubtask1.getAddr()); |
| | | patTaskRelevance.setDeptName(serviceSubtask1.getDeptname()); |
| | | patTaskRelevance.setDeptcode(serviceSubtask1.getDeptcode()); |
| | | patTaskRelevance.setDeptName(serviceSubtask1.getLeaveldeptname()); |
| | | patTaskRelevance.setDeptcode(serviceSubtask1.getLeaveldeptcode()); |
| | | patTaskRelevance.setBedNo(serviceSubtask1.getBedNo()); |
| | | patTaskRelevance.setDiagname(serviceSubtask1.getLeavediagname()); |
| | | patTaskRelevance.setPatid(serviceSubtask1.getPatid()); |
| | |
| | | visitDeptCode = requestDeptCode; |
| | | visitDeptName = requestDeptName; |
| | | } else { |
| | | visitDeptCode = serviceSubtask.getDeptcode(); |
| | | visitDeptName = serviceSubtask.getDeptname(); |
| | | visitDeptCode = serviceSubtask.getLeaveldeptcode(); |
| | | visitDeptName = serviceSubtask.getLeaveldeptname(); |
| | | } |
| | | if (StringUtils.isEmpty(visitDeptCode)) { |
| | | log.error("再次随访任务创建失败,本科室随访未找到随访科室, subTaskId = {}", serviceSubtask.getId()); |
| | |
| | | visitDeptCode = fallbackDeptCode; |
| | | visitDeptName = serviceSubtask.getVisitDeptName(); |
| | | } else { |
| | | visitDeptCode = serviceSubtask.getDeptcode(); |
| | | visitDeptName = serviceSubtask.getDeptname(); |
| | | visitDeptCode = serviceSubtask.getLeaveldeptcode(); |
| | | visitDeptName = serviceSubtask.getLeaveldeptname(); |
| | | } |
| | | } |
| | | ServiceSubtask serviceSubtaskAgain = patMedInhospService.boxedServiceSubtask(nextServiceTask, |
| | |
| | | serviceSubtask.setSendstate(2L); |
| | | String subtaskDeptCode = patTaskRelevance.getDeptcode(); |
| | | if (StringUtils.isEmpty(subtaskDeptCode) && StringUtils.isNotEmpty(serviceTaskVO.getDeptcode())) { |
| | | // service_subtask.deptcode 为单值字段,不能写入任务的多科室拼接串,取第一个科室兜底 |
| | | // service_subtask.leaveldeptcode 为单值字段,不能写入任务的多科室拼接串,取第一个科室兜底 |
| | | subtaskDeptCode = serviceTaskVO.getDeptcode().split(",")[0].trim(); |
| | | } |
| | | serviceSubtask.setDeptcode(subtaskDeptCode); |
| | | serviceSubtask.setDeptname(StringUtils.isNotEmpty(patTaskRelevance.getDeptName()) ? patTaskRelevance.getDeptName() : serviceTaskVO.getDeptname()); |
| | | serviceSubtask.setLeaveldeptcode(subtaskDeptCode); |
| | | serviceSubtask.setLeaveldeptname(StringUtils.isNotEmpty(patTaskRelevance.getDeptName()) ? patTaskRelevance.getDeptName() : serviceTaskVO.getDeptname()); |
| | | serviceSubtask.setLeavehospitaldistrictcode(patTaskRelevance.getLeavehospitaldistrictcode()); |
| | | serviceSubtask.setLeavehospitaldistrictname(patTaskRelevance.getLeavehospitaldistrictname()); |
| | | serviceSubtask.setType(serviceTaskVO.getType()); |
| | |
| | | serviceSubtask.setAddr(patTaskRelevance.getAddr()); |
| | | serviceSubtask.setPatid(patTaskRelevance.getPatid()); |
| | | serviceSubtask.setOpenid(patTaskRelevance.getOpenid()); |
| | | serviceSubtask.setDeptcode(patTaskRelevance.getDeptcode()); |
| | | serviceSubtask.setLeaveldeptcode(patTaskRelevance.getDeptcode()); |
| | | serviceSubtask.setLeavehospitaldistrictname(patTaskRelevance.getLeavehospitaldistrictname()); |
| | | serviceSubtask.setLeavehospitaldistrictcode(patTaskRelevance.getLeavehospitaldistrictcode()); |
| | | serviceSubtask.setDeptname(patTaskRelevance.getDeptName()); |
| | | serviceSubtask.setLeaveldeptname(patTaskRelevance.getDeptName()); |
| | | serviceSubtask.setType(serviceTaskVO.getType()); |
| | | serviceSubtask.setCreateTime(DateUtils.getNowDate()); |
| | | serviceSubtask.setDrname(patTaskRelevance.getDrname()); |
| | |
| | | collect = rawData.stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getManagementDoctorCode()).orElse("Unknown"))); |
| | | break; |
| | | case "deptcode": |
| | | collect = rawData.stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getDeptcode()).orElse("Unknown"))); |
| | | collect = rawData.stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getLeaveldeptcode()).orElse("Unknown"))); |
| | | break; |
| | | case "leavehospitaldistrictcode": |
| | | collect = rawData.stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getLeavehospitaldistrictcode()).orElse("Unknown"))); |
| | |
| | | if (serviceSubtaskCountReq.getDrcode() != null && !serviceSubtaskCountReq.getDrcode().isEmpty()) { |
| | | collect = serviceSubtaskMapper.getSfStatistics(serviceSubtaskCountReq).stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getDrname()).orElse("Unknown"))); |
| | | } else { |
| | | collect = serviceSubtaskMapper.getSfStatistics(serviceSubtaskCountReq).stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getDeptname()).orElse("Unknown"))); |
| | | collect = serviceSubtaskMapper.getSfStatistics(serviceSubtaskCountReq).stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getLeaveldeptname()).orElse("Unknown"))); |
| | | } |
| | | } |
| | | List<ServiceSubtaskCount> joySubCount = serviceSubtaskMapper.getSfStatisticsJoy(serviceSubtaskCountReq); |
| | |
| | | if (CollectionUtils.isNotEmpty(serviceSubtaskCountReq.getLeavehospitaldistrictcodes())) { |
| | | ss.setLeavehospitaldistrictcode(serviceSubtaskList.get(0).getLeavehospitaldistrictcode()); |
| | | } else if (CollectionUtils.isNotEmpty(serviceSubtaskCountReq.getDeptcodes())) { |
| | | ss.setDeptcode(serviceSubtaskList.get(0).getDeptcode()); |
| | | ss.setLeaveldeptcode(serviceSubtaskList.get(0).getLeaveldeptcode()); |
| | | } |
| | | } |
| | | |
| | |
| | | } else { |
| | | //格式化为两位小数的百分比 |
| | | DecimalFormat percentFormat = new DecimalFormat("##.##%"); |
| | | serviceSubtaskStatistic.setDeptname(serviceSubtaskList.get(0).getDeptname()); |
| | | serviceSubtaskStatistic.setDeptcode(serviceSubtaskList.get(0).getDeptcode()); |
| | | serviceSubtaskStatistic.setDeptname(serviceSubtaskList.get(0).getLeaveldeptname()); |
| | | serviceSubtaskStatistic.setDeptcode(serviceSubtaskList.get(0).getLeaveldeptcode()); |
| | | serviceSubtaskStatistic.setLeavehospitaldistrictname(serviceSubtaskList.get(0).getLeavehospitaldistrictname()); |
| | | serviceSubtaskStatistic.setLeavehospitaldistrictcode(serviceSubtaskList.get(0).getLeavehospitaldistrictcode()); |
| | | serviceSubtaskStatistic.setDrcode(serviceSubtaskList.get(0).getDrcode()); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 再次随访附加统计:待随访、已发送、人工电话超时及回院复诊复查(suggest=6)。 |
| | | * 再次随访附加统计:待随访、已发送、人工电话超时及回院复诊复查(suggest=7)。 |
| | | */ |
| | | private void applyAgainFollowUpExtraStatistics(ServiceSubtaskStatistic statistic, ServiceSubtask serviceSubtask) { |
| | | if (serviceSubtask.getVisitCount() == null || serviceSubtask.getVisitCount() <= 1) { |
| | |
| | | return; |
| | | } |
| | | Long sendstate = serviceSubtask.getSendstate(); |
| | | // 回院复诊复查:再次随访中按处理意见 suggest=6 统计 |
| | | if (StringUtils.equals("6", StringUtils.trim(serviceSubtask.getSuggest()))) { |
| | | statistic.setSuggest6CountAgain(statistic.getSuggest6CountAgain() + 1L); |
| | | // 回院复诊复查:再次随访中按处理意见 suggest=7 统计 |
| | | if (StringUtils.equals("7", StringUtils.trim(serviceSubtask.getSuggest()))) { |
| | | statistic.setSuggest7CountAgain(statistic.getSuggest7CountAgain() + 1L); |
| | | } |
| | | if (sendstate.equals(3L)) { |
| | | statistic.setSentAgain(statistic.getSentAgain() + 1L); |
| | |
| | | ServiceSubtaskStatistic serviceSubtaskStatistic = new ServiceSubtaskStatistic(); |
| | | //格式化为两位小数的百分比 |
| | | DecimalFormat percentFormat = new DecimalFormat("##.##%"); |
| | | serviceSubtaskStatistic.setDeptname(serviceSubtaskList.get(0).getDeptname()); |
| | | serviceSubtaskStatistic.setDeptcode(serviceSubtaskList.get(0).getDeptcode()); |
| | | serviceSubtaskStatistic.setDeptname(serviceSubtaskList.get(0).getLeaveldeptname()); |
| | | serviceSubtaskStatistic.setDeptcode(serviceSubtaskList.get(0).getLeaveldeptcode()); |
| | | serviceSubtaskStatistic.setLeavehospitaldistrictname(serviceSubtaskList.get(0).getLeavehospitaldistrictname()); |
| | | serviceSubtaskStatistic.setLeavehospitaldistrictcode(serviceSubtaskList.get(0).getLeavehospitaldistrictcode()); |
| | | serviceSubtaskStatistic.setDrcode(serviceSubtaskList.get(0).getDrcode()); |
| | |
| | | ServiceSubtaskStatistic serviceSubtaskStatistic = new ServiceSubtaskStatistic(); |
| | | //格式化为两位小数的百分比 |
| | | DecimalFormat percentFormat = new DecimalFormat("##.##%"); |
| | | serviceSubtaskStatistic.setDeptname(serviceSubtaskList.get(0).getDeptname()); |
| | | serviceSubtaskStatistic.setDeptcode(serviceSubtaskList.get(0).getDeptcode()); |
| | | serviceSubtaskStatistic.setDeptname(serviceSubtaskList.get(0).getLeaveldeptname()); |
| | | serviceSubtaskStatistic.setDeptcode(serviceSubtaskList.get(0).getLeaveldeptcode()); |
| | | serviceSubtaskStatistic.setLeavehospitaldistrictname(serviceSubtaskList.get(0).getLeavehospitaldistrictname()); |
| | | serviceSubtaskStatistic.setLeavehospitaldistrictcode(serviceSubtaskList.get(0).getLeavehospitaldistrictcode()); |
| | | serviceSubtaskStatistic.setDrcode(serviceSubtaskList.get(0).getDrcode()); |
| | |
| | | ServiceSubtaskStatistic serviceSubtaskStatistic = new ServiceSubtaskStatistic(); |
| | | //格式化为两位小数的百分比 |
| | | DecimalFormat percentFormat = new DecimalFormat("##.##%"); |
| | | serviceSubtaskStatistic.setDeptname(serviceSubtaskList.get(0).getDeptname()); |
| | | serviceSubtaskStatistic.setDeptcode(serviceSubtaskList.get(0).getDeptcode()); |
| | | serviceSubtaskStatistic.setDeptname(serviceSubtaskList.get(0).getLeaveldeptname()); |
| | | serviceSubtaskStatistic.setDeptcode(serviceSubtaskList.get(0).getLeaveldeptcode()); |
| | | serviceSubtaskStatistic.setLeavehospitaldistrictname(serviceSubtaskList.get(0).getLeavehospitaldistrictname()); |
| | | serviceSubtaskStatistic.setLeavehospitaldistrictcode(serviceSubtaskList.get(0).getLeavehospitaldistrictcode()); |
| | | serviceSubtaskStatistic.setDrcode(serviceSubtaskList.get(0).getDrcode()); |
| | |
| | | ServiceSubtaskStatistic serviceSubtaskStatistic = new ServiceSubtaskStatistic(); |
| | | //格式化为两位小数的百分比 |
| | | DecimalFormat percentFormat = new DecimalFormat("##.##%"); |
| | | serviceSubtaskStatistic.setDeptname(serviceSubtaskList.get(0).getDeptname()); |
| | | serviceSubtaskStatistic.setDeptcode(serviceSubtaskList.get(0).getDeptcode()); |
| | | serviceSubtaskStatistic.setDeptname(serviceSubtaskList.get(0).getLeaveldeptname()); |
| | | serviceSubtaskStatistic.setDeptcode(serviceSubtaskList.get(0).getLeaveldeptcode()); |
| | | serviceSubtaskStatistic.setLeavehospitaldistrictname(serviceSubtaskList.get(0).getLeavehospitaldistrictname()); |
| | | serviceSubtaskStatistic.setLeavehospitaldistrictcode(serviceSubtaskList.get(0).getLeavehospitaldistrictcode()); |
| | | serviceSubtaskStatistic.setDrcode(serviceSubtaskList.get(0).getDrcode()); |
| | |
| | | * pendingFollowUpSentAgainInfo - visitCount > 1 && sendstate in (3,7) |
| | | * sentInfo - visitCount = 1 && sendstate = 3 |
| | | * sentAgainInfo - visitCount > 1 && sendstate = 3 |
| | | * suggest6CountAgainInfo - visitCount > 1 && suggest = 6 |
| | | * suggest7CountAgainInfo - visitCount > 1 && suggest = 7 |
| | | * filterCountList - taskSituation = 6 && sendstate = 4 |
| | | * |
| | | */ |
| | |
| | | serviceSubtaskCountReq.setVisitCount(2); |
| | | serviceSubtaskCountReq.setExcep("1"); |
| | | break; |
| | | case "suggest6CountAgainInfo": |
| | | // 再次随访回院复诊复查:visitCount > 1 且 suggest = 6 |
| | | case "suggest7CountAgainInfo": |
| | | // 再次随访回院复诊复查:visitCount > 1 且 suggest = 7 |
| | | serviceSubtaskCountReq.setVisitCount(2); |
| | | serviceSubtaskCountReq.setSuggest("6"); |
| | | serviceSubtaskCountReq.setSuggest("7"); |
| | | break; |
| | | case "taskSituation1Info": |
| | | serviceSubtaskCountReq.setTaskSituation(1); |
| | |
| | | List<ServiceSubtask> rawData = serviceSubtaskMapper.getSfStatistics(serviceSubtaskCountReq); |
| | | switch (groupKey) { |
| | | case "deptcode": |
| | | collect = rawData.stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getDeptcode()).orElse("Unknown"))); |
| | | collect = rawData.stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getLeaveldeptcode()).orElse("Unknown"))); |
| | | break; |
| | | case "drcode": |
| | | collect = rawData.stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getDrcode()).orElse("Unknown"))); |
| | |
| | | total.setSentAgain(0L); |
| | | total.setFollowUpSuccessAgain(0L); |
| | | total.setFollowUpFailAgain(0L); |
| | | total.setSuggest6CountAgain(0L); |
| | | total.setSuggest7CountAgain(0L); |
| | | total.setManualAgain(0L); |
| | | total.setSmsAgain(0L); |
| | | total.setWeChatAgain(0L); |
| | |
| | | total.setSentAgain(total.getSentAgain() + (stat.getSentAgain() != null ? stat.getSentAgain() : 0L)); |
| | | total.setFollowUpSuccessAgain(total.getFollowUpSuccessAgain() + (stat.getFollowUpSuccessAgain() != null ? stat.getFollowUpSuccessAgain() : 0L)); |
| | | total.setFollowUpFailAgain(total.getFollowUpFailAgain() + (stat.getFollowUpFailAgain() != null ? stat.getFollowUpFailAgain() : 0L)); |
| | | total.setSuggest6CountAgain(total.getSuggest6CountAgain() + (stat.getSuggest6CountAgain() != null ? stat.getSuggest6CountAgain() : 0L)); |
| | | total.setSuggest7CountAgain(total.getSuggest7CountAgain() + (stat.getSuggest7CountAgain() != null ? stat.getSuggest7CountAgain() : 0L)); |
| | | total.setManualAgain(total.getManualAgain() + (stat.getManualAgain() != null ? stat.getManualAgain() : 0L)); |
| | | total.setSmsAgain(total.getSmsAgain() + (stat.getSmsAgain() != null ? stat.getSmsAgain() : 0L)); |
| | | total.setWeChatAgain(total.getWeChatAgain() + (stat.getWeChatAgain() != null ? stat.getWeChatAgain() : 0L)); |
| | |
| | | diagname.setPhone(subtask.getPhone()); |
| | | diagname.setNurseName(subtask.getNurseName()); |
| | | diagname.setDrname(subtask.getDrname()); |
| | | diagname.setDeptname(subtask.getDeptname()); |
| | | diagname.setDeptname(subtask.getLeaveldeptname()); |
| | | diagname.setLeavehospitaldistrictname(subtask.getLeavehospitaldistrictname()); |
| | | diagname.setTemplatename(subtask.getTemplatename()); |
| | | diagname.setPreachform(subtask.getPreachform()); |
| | |
| | | // serviceSubtask.setDrcode(patMedInhosp1.getDrcode()); |
| | | // serviceSubtask.setDrname(patMedInhosp1.getDrname()); |
| | | if (StringUtils.isNotEmpty(serviceTaskdept.getDeptType()) && serviceTaskdept.getDeptType().equals("1")) { |
| | | serviceSubtask.setDeptcode(serviceTaskdept.getDeptCode()); |
| | | serviceSubtask.setDeptname(serviceTaskdept.getDeptName()); |
| | | serviceSubtask.setLeaveldeptcode(serviceTaskdept.getDeptCode()); |
| | | serviceSubtask.setLeaveldeptname(serviceTaskdept.getDeptName()); |
| | | } else { |
| | | serviceSubtask.setLeavehospitaldistrictcode(serviceTaskdept.getDeptCode()); |
| | | serviceSubtask.setLeavehospitaldistrictname(serviceTaskdept.getDeptName()); |