| | |
| | | @AllArgsConstructor |
| | | public enum QueueStatusEnum implements IntArrayValuable { |
| | | |
| | | //5:过号 10:排队中 15:已召回 20:候诊准备 30:就诊中 40:就诊完成 |
| | | PASSED_WAITING(3, "已过号-排队中"), |
| | | PASSED(5, "已过号"), |
| | | PASSED_INSTALL(7, "已过号-安装"), |
| | | WAITING(10, "排队中"), |
| | |
| | | } |
| | | |
| | | // 常规检查过号、领用过号 |
| | | @GetMapping("/pass-waiting-patient") |
| | | @Operation(summary = "过号排队中患者") |
| | | @Parameter(name = "patId", description = "患者编号", required = true, example = "20247845") |
| | | @Parameter(name = "checkType", description = "预约检查类型", required = true, example = "100") |
| | | @PreAuthorize("@ss.hasPermission('ecg:doctor:task')") |
| | | public CommonResult<Integer> passWaitingPatient( |
| | | @RequestParam("patId") String patId, |
| | | @RequestParam("checkType") Integer checkType) |
| | | { |
| | | queueService.passWaitingPatient( patId, checkType ); |
| | | return success(0); |
| | | } |
| | | |
| | | // 常规检查过号、领用过号 |
| | | @GetMapping("/pass-next-patient") |
| | | @Operation(summary = "过号、下一位患者") |
| | | @Parameter(name = "roomId", description = "诊室编号", required = true, example = "116") |
| | |
| | | return success(patientStatisticVO); |
| | | } |
| | | |
| | | @GetMapping("/recall-pass-waiting-patient") |
| | | @Operation(summary = "过号-排队中 患者召回") |
| | | @Parameter(name = "patId", description = "患者编号", required = true, example = "B2") |
| | | @Parameter(name = "checkType", description = "预约检查类型", required = true, example = "100") |
| | | @PreAuthorize("@ss.hasPermission('ecg:doctor:task')") |
| | | public CommonResult<String> recallPatient( |
| | | @RequestParam("patId") String patId, |
| | | @RequestParam("checkType") Integer checkType) |
| | | { |
| | | Integer result = queueService.recallPassWaitingPatient(patId, checkType); |
| | | if (null == result || 0 == result) |
| | | return error(PATIENT_NOT_EXISTS); |
| | | |
| | | return success("操作成功"); |
| | | } |
| | | |
| | | @GetMapping("/recall-patient") |
| | | @Operation(summary = "过号病人召回") |
| | | @Parameter(name = "roomId", description = "诊室编号", required = true, example = "116") |
| | |
| | | @Param("curStatus")Integer curStatus); |
| | | */ |
| | | |
| | | @Update("update lihu.queue set status = #{newStatus} where pat_id = #{patId} and book_check_type = #{checkType} and status = #{curStatus}; " ) |
| | | Integer updatePatientQueueStatus(@Param("patId")String patId, @Param("checkType")Integer checkType, @Param("curStatus")Integer curStatus, @Param("newStatus")Integer newStatus); |
| | | |
| | | @Update("update lihu.queue set status = #{newStatus} where status = #{curStatus} and seq_num = \n" + |
| | | "(select a.min_seq_num from \n" + |
| | | " (select min(seq_num) as min_seq_num from lihu.queue where room_id = #{roomId} and bed_no = #{bedNo} and status = #{curStatus}) a )") |
| | |
| | | void finishInstallNextPatient(Long roomId, String bedNo); |
| | | |
| | | /** |
| | | * 过号排队中患者 |
| | | */ |
| | | void passWaitingPatient( String patId, Integer bookCheckType ); |
| | | |
| | | /** |
| | | * 常规过号、领用过号 |
| | | */ |
| | | void passNextPatient(Long roomId, String bedNo); |
| | |
| | | |
| | | PatientStatisticVO getBedDevInstallStatistic(Long roomId, String bedNo); |
| | | |
| | | Integer recallPassWaitingPatient(String patId, Integer checkType); |
| | | |
| | | Integer recallPatient(Long roomId, String bedNo, String patId, Integer checkType); |
| | | |
| | | Integer recallInstallPatient(Long roomId, String bedNo, String patId, Integer checkType, Long roomId_operator, String bedNo_operator); |
| | |
| | | startNextInstallPatient(roomId, bedNo); |
| | | } |
| | | |
| | | @Override |
| | | public void passWaitingPatient(String patId, Integer bookCheckType) { |
| | | // 从 DB 把 排队中的人 设置为 过号-排队中 |
| | | Integer ret = queueMapper.updatePatientQueueStatus(patId, bookCheckType, |
| | | QueueStatusEnum.WAITING.getStatus(), QueueStatusEnum.PASSED_WAITING.getStatus()); |
| | | } |
| | | |
| | | public void passNextPatient(Long roomId, String bedNo) { |
| | | // 从 DB 把 就诊中的人 设置为过号 |
| | | Integer ret = queueMapper.updateBedQueueStatus(roomId, bedNo, |
| | |
| | | return patientStatisticVO; |
| | | } |
| | | |
| | | @Override |
| | | public Integer recallPassWaitingPatient(String patId, Integer bookCheckType) { |
| | | // 从 DB 把 过号-排队中的人 设置为 排队中 |
| | | Integer ret = queueMapper.updatePatientQueueStatus(patId, bookCheckType, |
| | | QueueStatusEnum.PASSED_WAITING.getStatus(), QueueStatusEnum.WAITING.getStatus()); |
| | | |
| | | return ret; |
| | | } |
| | | |
| | | public PatientStatisticVO getBedDevReadyStatistic(Long roomId, String bedNo) { |
| | | PatientStatisticVO patientStatisticVO = new PatientStatisticVO(); |
| | | List<BedQueueStatisticDO> bedQueueStatisticDOList = queueMapper.bedQueueStatistic(roomId, bedNo); |