yxh
昨天 fce96ef468291fb9a0e6a4d34ab371315e9485d4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
package cn.lihu.jh.module.ecg.service.queue;
 
import javax.validation.Valid;
import java.util.List;
 
import cn.lihu.jh.framework.common.exception.ErrorCode;
import cn.lihu.jh.framework.common.pojo.CommonResult;
import cn.lihu.jh.module.ecg.controller.admin.queue.vo.*;
import cn.lihu.jh.module.ecg.controller.admin.room.vo.MonitorInfoVO;
import cn.lihu.jh.module.ecg.controller.admin.room.vo.RoomRespVO;
import cn.lihu.jh.module.ecg.dal.dataobject.queue.QueueDO;
import cn.lihu.jh.framework.common.pojo.PageResult;
import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomDO;
 
/**
 * 排队 Service 接口
 *
 * @author 芋道源码
 */
public interface QueueService {
 
    void initCheckType();
    void startBiz();
    void closeBiz();
 
 
    /**
     * 创建排队
     *
     * @param createReqVO 创建信息
     * @return 编号
     */
    Integer createqueue(@Valid QueueSaveReqVO createReqVO);
 
    /**
     * 更新排队
     *
     * @param updateReqVO 更新信息
     */
    void updatequeue(@Valid QueueSaveReqVO updateReqVO);
 
    /**
     * 更新停诊
     *
     * @param
     */
    void updateStop(long roomId,String bedNo);
 
    /**
     * 删除排队
     *
     * @param id 编号
     */
    void deletequeue(Integer id);
 
    /**
     * 一个工位 可能支持多个检查类型,
     */
    void startHurryUpOneBed(Long roomId, String bedNo);
    void startHurryUpOneCheckType(Integer checkType);
 
    void startBedReload();
    void startResetRoom(Boolean needCloseBed);
    MonitorInfoVO getMonitorInfo();
 
    ErrorCode startBedOpen(Long roomId, String roomName, String bedNo);
    ErrorCode startBedClose(Long roomId, String bedNo);
    ErrorCode startBedDoctorPause(Long roomId, String bedNo, Long docId, String docName);
    ErrorCode startBedDoctorResume(Long roomId, String bedNo, Long docId, String docName);
    ErrorCode startBedDoctorOn(Long roomId, String bedNo, Long docId, String docName);
    ErrorCode startBedDoctorOff(Long roomId, String bedNo, Long docId, String docName);
    ErrorCode startNextPatient(Long roomId, String bedNo);
    ErrorCode startNextInstallPatient(Long roomId, String bedNo);
 
    CommonResult<RoomRespVO> getRoom(Long roomId, String bedNo, Long docId);
 
    /**
     * 获得排队
     *
     * @param id 编号
     * @return 排队
     */
    QueueDO getqueue(Integer id);
 
    /**
     * 获得排队分页
     *
     * @param pageReqVO 分页查询
     * @return 排队分页
     */
    PageResult<QueueDO> getqueuePage(QueuePageReqVO pageReqVO);
 
    /**
     * 患者排队
     * @param queueSaveReqVO
     */
    void queue(QueueSaveReqVO queueSaveReqVO);
 
    List<QueueDO> selectBookSeqNumByAppointIdList(List<Long> appointIdList);
 
    /**
     * 常规检查 医生叫下一位患者
     */
    void finishNextPatient(Long roomId, String bedNo);
 
    /**
     * 领用 医生叫下一位患者
     */
    void finishReceiveNextPatient(Long roomId, String bedNo);
 
    /**
     * 装机 医生叫下一位患者
     */
    void finishInstallNextPatient(Long roomId, String bedNo);
 
    /**
     * 过号排队中患者
     */
    void passWaitingPatient( String patId, Integer bookCheckType );
 
    /**
     * 常规过号、领用过号
     */
    void passNextPatient(Long roomId, String bedNo);
 
    /**
     * 装机过号
     */
    void passInstallNextPatient(Long roomId, String bedNo);
 
    List<QueueDO> getBedQueueByStatus(Long roomId, String bedNo, List<Integer> statusList);
 
    List<QueueDO> getRoomQueueByStatus(Long roomId, List<Integer> statusList);
 
    PatientStatisticVO getPatientStatistic(Long roomId, String bedNo);
 
    PatientStatisticVO getBedDevReadyStatistic(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);
 
    // ==================== 需求2:撤销「叫号 / 检查完成」 ====================
 
    /**
     * 撤销「检查完成」:把本工位今日的指定患者从 已就诊(40) 退回 候诊中(20)。
     * <p>
     * 必须提供 patId + checkType 做精确定位,避免误改其他患者。
     *
     * @return 受影响行数;0 表示未找到该患者今日的已完成记录
     */
    Integer undoFinishPatient(Long roomId, String bedNo, String patId, Integer checkType);
 
    /**
     * 撤销「误点叫号」:把本工位当前 就诊中(30) 的患者退回 候诊中(20)。
     *
     * @return 受影响行数;0 表示当前无就诊中患者
     */
    Integer undoCallPatient(Long roomId, String bedNo);
 
    /**
     * 取本工位今日**最近一位已完成**的患者(供界面提示可撤销对象)。
     */
    QueueDO getBedLastFinishedQueueItem(Long roomId, String bedNo);
 
    // ==================== 需求3:停止候诊开关 ====================
 
    /**
     * 设置「停止候诊」开关(持久化到 {@code clinic_room.stop_ready})。
     * <p>
     * 开启后:**已有候诊病人继续叫号,但不再新增候诊病人**;
     * 关闭后恢复正常接收。
     *
     * @param stop true=停止候诊;false=恢复
     * @return 成功返回 SUCCESS
     */
    ErrorCode setStopReady(Long roomId, String bedNo, boolean stop);
 
    /** 查询「停止候诊」状态;工位不存在返回 null */
    Boolean getStopReady(Long roomId, String bedNo);
 
    Integer patientJump(String patId, Integer bookCheckType, Byte jumped );
 
    List<RoomDO> getDocRoomInfo(Long docId);
 
    List<QueueDO> getCheckRelatedPatient(Long roomId, String bedNo);
 
    List<QueueDO> getInstallRelatedPatient(Long roomId, String bedNo);
 
    // ==================== 需求1:患者信息回填 ====================
 
    /**
     * 按 {@code applyNo} 从预约单(appointment)回填队列对象的患者信息。
     * <p>
     * queue 表只存了患者编号/姓名,其余(性别、出生日期、病区、床号、电话、来源、
     * 就诊卡号、登记时间、开单医师、开单日期、多耐药)都在 appointment 表。
     * <p>
     * 之所以对外暴露:大屏/诊间屏({@code CallingScreenServiceImpl})直接查
     * {@code queueMapper},不经过本 Service 的查询方法,需要显式调用本方法补齐。
     * 不补齐则大屏/诊间屏的患者信息只有姓名(性别/病区/床号等全为空)。
     *
     * @param queueDOList 队列对象列表(空/null 安全)
     */
    void fillAppointmentInfo(List<QueueDO> queueDOList);
}