| | |
| | | package cn.lihu.jh.module.ecg.controller.admin.appointment.vo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | |
| | | public class AppointmentConfirmReqVO { |
| | | |
| | | private Long id; |
| | | |
| | | @Schema(description = "预约申请号", example = "2024435") |
| | | private String applyNo; |
| | | |
| | | @Schema(description = "就诊流水号", example = "2024546") |
| | | //@NotEmpty(message = "就诊流水号") |
| | |
| | | @Schema(description = "患者性别", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | //@NotNull(message = "患者性别不能为空") |
| | | private Byte patGender; |
| | | |
| | | @Schema(description = "预约编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "27849") |
| | | //@NotEmpty(message = "预约编号不能为空") |
| | | private String bookId; |
| | | |
| | | @Schema(description = "预约日期", requiredMode = Schema.RequiredMode.REQUIRED) |
| | | //@NotNull(message = "预约日期不能为空") |
| | |
| | | package cn.lihu.jh.module.ecg.controller.admin.appointment.vo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import lombok.*; |
| | | |
| | | import java.time.LocalDate; |
| | |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ToString(callSuper = true) |
| | | public class AppointmentPageReqVO extends PageParam { |
| | | |
| | | @Schema(description = "预约申请号", example = "2024435") |
| | | private String applyNo; |
| | | |
| | | @Schema(description = "就诊流水号", example = "2024546") |
| | | private String episodeId; |
| | |
| | | |
| | | @Schema(description = "床号") |
| | | private String patBedNo; |
| | | |
| | | @Schema(description = "预约编号", example = "27849") |
| | | private String bookId; |
| | | |
| | | @Schema(description = "预约日期") |
| | | private LocalDate bookDate; |
| | |
| | | |
| | | private Long id; |
| | | |
| | | @Schema(description = "预约申请号", example = "2024435") |
| | | @ExcelProperty("预约申请号") |
| | | private String applyNo; |
| | | |
| | | @Schema(description = "就诊流水号", example = "2024546") |
| | | @ExcelProperty("就诊流水号") |
| | | private String episodeId; |
| | | |
| | | @Schema(description = "患者来源", example = "2024546") |
| | | @ExcelProperty("患者来源") |
| | | private Integer patSrc; |
| | | |
| | | @Schema(description = "患者编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "29034") |
| | | @ExcelProperty("患者编号") |
| | | private String patId; |
| | |
| | | |
| | | private Long id; |
| | | |
| | | @Schema(description = "预约申请号", example = "2024435") |
| | | private String applyNo; |
| | | |
| | | @Schema(description = "就诊流水号", example = "2024546") |
| | | //@NotEmpty(message = "就诊流水号") |
| | | private String episodeId; |
| | |
| | | */ |
| | | private String patBedNo; |
| | | /** |
| | | * 预约编号 |
| | | */ |
| | | private String bookId; |
| | | /** |
| | | * 预约日期 |
| | | */ |
| | | private LocalDate bookDate; |
| | |
| | | default PageResult<AppointmentDO> selectPage(AppointmentPageReqVO reqVO) { |
| | | |
| | | return selectPage(reqVO, new LambdaQueryWrapperX<AppointmentDO>() |
| | | .eqIfPresent(AppointmentDO::getApplyNo, reqVO.getApplyNo()) |
| | | .eqIfPresent(AppointmentDO::getEpisodeId, reqVO.getEpisodeId()) |
| | | .eqIfPresent(AppointmentDO::getPatId, reqVO.getPatId()) |
| | | .likeIfPresent(AppointmentDO::getPatName, reqVO.getPatName()) |
| | | .eqIfPresent(AppointmentDO::getPatGender, reqVO.getPatGender()) |
| | |
| | | .eqIfPresent(AppointmentDO::getPatWardCode, reqVO.getPatWardCode()) |
| | | .eqIfPresent(AppointmentDO::getPatWardDesc, reqVO.getPatWardDesc()) |
| | | .eqIfPresent(AppointmentDO::getPatBedNo, reqVO.getPatBedNo()) |
| | | .eqIfPresent(AppointmentDO::getBookId, reqVO.getBookId()) |
| | | .eqIfPresent(AppointmentDO::getBookDate, reqVO.getBookDate()) |
| | | .eqIfPresent(AppointmentDO::getBookTimeslot, reqVO.getBookTimeslot()) |
| | | .betweenIfPresent(AppointmentDO::getBookTime, reqVO.getBookTime()) |
| | |
| | | |
| | | @Select("SELECT * FROM lihu.check_type;") |
| | | @Results({ |
| | | @Result(property = "displayBarcode", column = "display_barcode", typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler.class) |
| | | @Result(property = "displayBarcode", column = "display_barcode", typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler.class), |
| | | @Result(property = "affinityCheckTypes", column = "affinity_check_types", typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler.class) |
| | | }) |
| | | List<CheckTypeDO> simpleCheckTypeList(); |
| | |
| | | " (select min(seq_num) as min_seq_num from lihu.queue where room_id = #{roomId} and bed_no = #{bedNo} and status = #{curStatus}) a )") |
| | | Integer updateBedQueueStatus(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("curStatus")Integer curStatus, @Param("newStatus")Integer newStatus); |
| | | |
| | | // 弃用原因:需要先获取,判断逻辑处理后,再更新 |
| | | // 某个诊室范围内 [已领用] [已召回-安装] 人员 抢占, 会更新 [工位号] |
| | | // 没有限定检查类型,不要使用时间槽 |
| | | @Update("<script> " + |
| | |
| | | "</script>" |
| | | ) |
| | | Integer preemptToBeInstalledPatient(@Param("roomId")Long roomId, @Param("bedNo")String bedNo, @Param("curStatusList")List<Integer> curStatusList, @Param("newStatus")Integer newStatus); |
| | | |
| | | @Update("update lihu.queue set status = #{newStatus} where pat_id = #{patId} and status = #{curStatus}") |
| | | Integer updatePatientQueueStatus(@Param("patId")String patId, @Param("curStatus")Integer curStatus, @Param("newStatus")Integer newStatus); |
| | | |
| | | // 整个系统范围内 [排队中]人员 [被工位医生]抢占 |
| | | @Update("update lihu.queue set status = #{newStatus}, room_id = #{roomId}, room_name = #{roomName}, \n" + |
| | |
| | | appointmentDO.setPatWardDesc(appointmentExternal.getPatLocWardDesc()); |
| | | appointmentDO.setPatMobile(appointmentExternal.getPhone()); |
| | | appointmentDO.setPatBedNo(appointmentExternal.getEnBedno()); |
| | | appointmentDO.setBookId(appointmentExternal.getReqIdeApplyno()); |
| | | appointmentDO.setBookCheckType(getCorrespondingCheckType(appointmentExternal.getPlanDefItemList().getPlanDefItem().getPlanDefItemcode())); |
| | | appointmentDO.setBookTime(DateUtils.ofUTC(appointmentExternal.getReqAuthoredOn())); // 开单时间 |
| | | appointmentDO.setBookSrc( getBookSource(appointmentExternal.getAdmTypeCode()) ); |
| | | appointmentDO.setBookSrc( 0 ); |
| | | |
| | | // 光开单的情况,没有预约时间 |
| | | if (null != appointmentExternal.getReqExtBooktime() ) { |
| | |
| | | |
| | | try { |
| | | QueueSaveReqVO queueSaveReqVO = new QueueSaveReqVO(); |
| | | queueSaveReqVO.setApplyNo( appointment.getApplyNo() ); |
| | | queueSaveReqVO.setEpisodeId( appointment.getEpisodeId() ); |
| | | queueSaveReqVO.setAppointId(appointment.getId()); |
| | | queueSaveReqVO.setPatId(appointment.getPatId()); |
| | |
| | | } |
| | | |
| | | return newSeqNo; |
| | | } |
| | | |
| | | private Integer getBookSource(String admTypeCode) { |
| | | if (admTypeCode.equals("AMB")) // 门诊 |
| | | return 1; |
| | | else if (admTypeCode.equals("EMER")) // 急诊 |
| | | return 2; |
| | | else if (admTypeCode.equals("PHY")) // 体检 |
| | | return 3; |
| | | else if (admTypeCode.equals("IMP")) // 住院 |
| | | return 4; |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | private Integer getCorrespondingCheckType(String strPlanDefItemcode) { |