| | |
| | | |
| | | @Value("${spring.profiles.active}") |
| | | private String active; |
| | | @Autowired |
| | | private PatMedOperationMapper patMedOperationMapper; |
| | | @Autowired |
| | | private PatMedOperationItemMapper patMedOperationItemMapper; |
| | | |
| | | /** |
| | | * 查询单一任务(随访) |
| | |
| | | patMedOuthosp.setServerState("0"); |
| | | patMedOuthospService.updatePatMedOuthosp(patMedOuthosp); |
| | | } |
| | | } |
| | | } else if (serviceSubtask.getServiceType().equals("19")) { |
| | | ServiceTask st = serviceTaskService.selectServiceTaskByTaskid(serviceSubtask.getTaskid()); |
| | | //如果任务是长期任务,需要将该患者的手术详情数据 |
| | | if (st != null && st.getLongTask() == 1 && ObjectUtils.isNotEmpty(serviceSubtask.getOperationItemId())) { |
| | | PatMedOperationItem patMedOperationItem = new PatMedOperationItem(); |
| | | patMedOperationItem.setOpercheckFlag("0"); |
| | | patMedOperationItem.setId(serviceSubtask.getOperationItemId()); |
| | | patMedOperationItemMapper.updatePatMedOperationItem(patMedOperationItem); |
| | | } |
| | | } |
| | | } |
| | |
| | | collect = rawData.stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getDrcode()).orElse("Unknown"))); |
| | | break; |
| | | case "management_doctor_code": |
| | | rawData = rawData.stream() |
| | | .peek(item -> { |
| | | item.setDrname(item.getManagementDoctor()); |
| | | item.setDrcode(item.getManagementDoctorCode()); |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | collect = rawData.stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getManagementDoctorCode()).orElse("Unknown"))); |
| | | break; |
| | | case "deptcode": |
| | |
| | | return serviceSubtaskMapper.statQuestionOption(taskIds, startOutHospTime, endOutHospTime); |
| | | } |
| | | |
| | | /** |
| | | * 标准化问卷答案文本:去掉 A/B/C/D 单字母前缀和后续空格 |
| | | * 例如 "A 是" -> "是","B 否" -> "否" |
| | | */ |
| | | private String normalizeOptionAnswer(String answer) { |
| | | if (StringUtils.isBlank(answer)) { |
| | | return ""; |
| | | } |
| | | String trimmed = answer.trim(); |
| | | if (trimmed.length() >= 3 && trimmed.charAt(1) == ' ') { |
| | | char firstChar = trimmed.charAt(0); |
| | | if (firstChar >= 'A' && firstChar <= 'Z') { |
| | | return trimmed.substring(2).trim(); |
| | | } |
| | | } |
| | | return trimmed; |
| | | } |
| | | |
| | | private Boolean saveServiceSubtaskDetail(ServiceSubtask serviceSubtask) { |
| | | Boolean result = true; |
| | | //3.4 如果3.1或3.2为true的话,根据type判断什么类型 |