yxh
2026-10-18 01ee694a3bb8048372fc793a8de314d70b688b35
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
210
211
212
213
214
215
216
import request from '@/config/axios'
 
export interface RoomProfileVO {
  roomId: number | null // 诊室编号
  roomName: string | null
  bedNum: number | null // 诊疗床数量
  callingScreenType: number | null // 叫号屏类型
}
 
export interface RoomBedVO {
  roomId: number | null // 诊室编号
  roomName: string | null
  bedNo: string | null // 诊疗床编号
  checkTypes: number[] | null
  opType: number | null
}
 
export interface PatientVO {
  roomId: number // 诊室编号
  bedNo: string // 诊疗床编号
  patId: string // 患者编号
  checkType: number // 检查项目
  jumpFlag?: number // 插队标记
  roomId_operator: number | null
  bedNo_operator: string | null
}
 
export interface PatientStatisticVO {
  finishedNum?: number
  readyNum?: number
  receivedNum?: number
  passedNum?: number
  queuingNum?: number
}
 
// 医生 API
export const DoctorApi = {
 
  // 医生暂停,暂时不接收患者
  bedDoctorPause: async (params) => {
    return await request.get({ url: `/ecg/doctor/bed-doctor-pause`, params })
  },
 
  // 医生恢复,恢复接收患者
  bedDoctorResume: async (params) => {
    return await request.get({ url: `/ecg/doctor/bed-doctor-resume`, params })
  },
 
  // 医生入座,
  bedDoctorOn: async (params) => {
    return await request.get({ url: `/ecg/doctor/bed-doctor-on`, params })
  },
 
  // 医生离座,
  bedDoctorOff: async (params) => {
    return await request.get({ url: `/ecg/doctor/bed-doctor-off`, params })
  },
 
  // 获取医生的工位信息
  bedDoctorGet: async (params) => {
    return await request.get({ url: `/ecg/doctor/bed-doctor-get`, params })
  },
 
  // 常规叫号,取下一位患者
  finishNextPatient: async (params: RoomBedVO) => {
    return await request.get({ url: `/ecg/doctor/finish-next-patient`, params })
  },
 
  // 领用叫号,取下一位患者
  finishReceiveNextPatient: async (params: RoomBedVO) => {
    return await request.get({ url: `/ecg/doctor/finish-receive-next-patient`, params })
  },
 
  // 装机叫号,取下一位患者
  finishInstallNextPatient: async (params: RoomBedVO) => {
    return await request.get({ url: `/ecg/doctor/finish-install-next-patient`, params })
  },
 
  // 过号,取下一位患者
  passNextPatient: async (params: RoomBedVO) => {
    return await request.get({ url: `/ecg/doctor/pass-next-patient`, params })
  },
 
  // 装机过号,取下一位患者
  passInstallNextPatient: async (params: RoomBedVO) => {
    return await request.get({ url: `/ecg/doctor/pass-install-next-patient`, params })
  },
 
  // 重叫
  callPatientAgain: async (params: RoomBedVO) => {
    return await request.get({ url: `/ecg/doctor/call-again`, params })
  },
 
  // 重叫 安装
  callInstallingPatientAgain: async (params: RoomBedVO) => {
    return await request.get({ url: `/ecg/doctor/call-install-again`, params })
  },
 
  // 取 常规检查、领用 患者列表
  getToBeCheckedPatientList: async (params: RoomBedVO) => {
    return await request.get({ url: `/ecg/doctor/get-to-be-checked-list`, params })
  },
 
  // 取 [待装机] 患者列表
  getToBeInstalledPatientList: async (params: RoomBedVO) => {
    return await request.get({ url: `/ecg/doctor/get-to-be-installed-list`, params })
  },
 
  /**
   * 取「本诊室排队中(未分配工位)」患者列表。
   *
   * 候诊列表只含"已分流到本工位"的患者(queue.room_id + bed_no 指向本工位),
   * 而"排队中(10)"的患者还没分配工位 —— 大屏能看到、工作台原先看不到。
   * 这个接口按本工位开展的检查项目把他们查出来,供医生手工「拉入」。
   */
  getRoomWaitingList: async (params: RoomBedVO) => {
    return await request.get({ url: `/ecg/doctor/get-room-waiting-list`, params })
  },
 
  /** 把「排队中」的患者手工拉入本工位(只有工位主人能拉,后端有硬校验) */
  pullWaitingPatient: async (params: { roomId: any; bedNo: any; id: any }) => {
    return await request.get({ url: `/ecg/doctor/pull-waiting-patient`, params })
  },
 
  /**
   * 立即补人:手动触发一次本工位的自动分流,并返回诊断信息
   * (系统开诊状态 / 是否停止候诊 / 候诊上限 / 补人前后人数 / 结论)。
   * 候诊区为空时的自助排查:不必等定时任务,也不用重启去猜是哪道门闸挡住的。
   */
  hurryUpNow: async (params: RoomBedVO) => {
    return await request.get({ url: `/ecg/doctor/hurry-up-now`, params })
  },
 
  // 取患者统计
  getPatientStatistic: async (params: RoomBedVO) => {
    return await request.get({ url: `/ecg/doctor/get-patient-statistic`, params })
  },
 
  // 设备领用统计
  getDevReadyStatistic: async (params: RoomBedVO) => {
    return await request.get({ url: `/ecg/doctor/get-dev-ready-statistic`, params })
  },
 
  // 设备装机统计
  getDevInstallStatistic: async (params: RoomBedVO) => {
    return await request.get({ url: `/ecg/doctor/get-dev-install-statistic`, params })
  },
 
  // 过号 [排队中] 患者
  passWaitingPatient: async (params: PatientVO) => {
    return await request.get({ url: `/ecg/doctor/pass-waiting-patient`, params })
  },
 
  // 召回 [过号-排队中] 患者
  recallPassWaitingPatient: async (params: PatientVO) => {
    return await request.get({ url: `/ecg/doctor/recall-pass-waiting-patient`, params })
  },
 
  // 召回过号患者
  recallPatient: async (params: PatientVO) => {
    return await request.get({ url: `/ecg/doctor/recall-patient`, params })
  },
 
  // 召回 安装过号 患者
  recallInstallPatient: async (params: PatientVO) => {
    return await request.get({ url: `/ecg/doctor/recall-install-patient`, params })
  },
 
  // 加急患者
  patientJump: async (params: PatientVO) => {
    return await request.get({ url: `/ecg/doctor/patient-jump`, params })
  },
 
  // ==================== 需求2:撤销「叫号 / 检查完成」 ====================
 
  // 撤销检查完成:已就诊(40) → 候诊中(20)。必须带 patId + checkType 精确定位
  undoFinishPatient: async (params: PatientVO) => {
    return await request.get({ url: `/ecg/doctor/undo-finish-patient`, params })
  },
 
  // 撤销叫号:就诊中(30) → 候诊中(20)
  undoCallPatient: async (params: { roomId: number | null; bedNo: string | null }) => {
    return await request.get({ url: `/ecg/doctor/undo-call-patient`, params })
  },
 
  // 取本工位今日最近一位已完成患者(供撤销提示)
  lastFinishedPatient: async (params: { roomId: number | null; bedNo: string | null }) => {
    return await request.get({ url: `/ecg/doctor/last-finished-patient`, params })
  },
 
  // ==================== 需求3:停止候诊开关 ====================
 
  // 停止候诊:不再新增候诊患者(已有候诊仍可叫号)
  stopReady: async (params: { roomId: number | null; bedNo: string | null }) => {
    return await request.get({ url: `/ecg/doctor/stop-ready`, params })
  },
 
  // 恢复候诊:重新开始接收候诊患者
  resumeReady: async (params: { roomId: number | null; bedNo: string | null }) => {
    return await request.get({ url: `/ecg/doctor/resume-ready`, params })
  },
 
  // 查询停止候诊状态
  getStopReady: async (params: { roomId: number | null; bedNo: string | null }) => {
    return await request.get({ url: `/ecg/doctor/get-stop-ready`, params })
  },
 
  // 下载
 yddownload: async (id: number | string) => {
  return await request.get({ url: `/ecg/template/download/${id}` })
},
 sgdownload: async (id: number | string) => {
  return await request.get({ url: `/ecg/template/downloadesophagus/${id}` })
}
 
}