|
@@ -30,6 +30,9 @@ func XcxApiControllersRegisterRouters() {
|
30
|
30
|
|
31
|
31
|
//获取排班数据
|
32
|
32
|
beego.Router("/xcx/api/mobile/schedule", &XcxApiController{}, "Get:GetScheduleInfo")
|
|
33
|
+
|
|
34
|
+ //获取透析记录
|
|
35
|
+ beego.Router("/xcx/api/mobile/dialysis", &XcxApiController{}, "Get:GetMobileSchedule")
|
33
|
36
|
}
|
34
|
37
|
|
35
|
38
|
type XcxApiController struct {
|
|
@@ -138,7 +141,7 @@ func (this *XcxApiController) GetLoginInfor() {
|
138
|
141
|
fmt.Println(mobile)
|
139
|
142
|
info, err := service.GetMobilePatientInfo(mobile)
|
140
|
143
|
if info.ID == 0 {
|
141
|
|
- if err == nil {
|
|
144
|
+ if err != nil {
|
142
|
145
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
143
|
146
|
return
|
144
|
147
|
}
|
|
@@ -181,10 +184,18 @@ func (this *XcxApiController) GetLoginInfor() {
|
181
|
184
|
}
|
182
|
185
|
|
183
|
186
|
func (this *XcxApiController) GetPatientList() {
|
184
|
|
- var appid = "wx20b60369111b063a"
|
185
|
|
- var key = "HobHcmPatZ0O5emMYcFo1Q=="
|
186
|
|
- var iv = "wJjr8o47Jv8zBoZF5la+jw=="
|
187
|
|
- var strs = "DKj+ZzSKd77D2X84UqySTfTOxcZ9W5yAArqt74g3Fek+/8N97XI3nKzLO4QadJxwl9f8BDqrpl2dauqNBC4HbkggFcEB9j1zsYDKAm5cM0NPOkjcHeGF8dxpuJGdXWFKZErD957XEPtyODbE3IUMIx/n8haGtCa3W9v5Gqosqxrb6eNY9ogf8V1dy2guuxVAxWojuZ2DLyYovksFLccD5Q=="
|
|
187
|
+ //var appid = "wx4f4bc4dec97d474b"
|
|
188
|
+ //var key = "tiihtNczf5v6AKRyjwEUhQ=="
|
|
189
|
+ //var iv = "r7BXXKkLb8qrSNn05n0qiA=="
|
|
190
|
+ //var strs = "CiyLU1Aw2KjvrjMdj8YKliAjtP4gsMZMQmRzooG2xrDcvSnxIMXFufNstNGTyaGS9uT5geRa0W4oTOb1WT7fJlAC+oNPdbB+3hVbJSRgv+4lGOETKUQz6OYStslQ142dNCuabNPGBzlooOmB231qMM85d2/fV6ChevvXvQP8Hkue1poOFtnEtpyxVLW1zAo6/1Xx1COxFvrc2d7UL/lmHInNlxuacJXwu0fjpXfz/YqYzBIBzD6WUfTIF9GRHpOn/Hz7saL8xz+W//FRAUid1OksQaQx4CMs8LOddcQhULW4ucetDf96JcR3g0gfRK4PC7E/r7Z6xNrXd2UIeorGj5Ef7b1pJAYB6Y5anaHqZ9J6nKEBvB4DnNLIVWSgARns/8wR2SiRS7MNACwTyrGvt9ts8p12PKFdlqYTopNHR1Vf7XjfhQlVsAJdNiKdYmYVoKlaRv85IfVunYzO0IKXsyl7JCUjCpoG20f0a04COwfneQAGGwd5oa+T8yO5hzuyDb/XcxxmK01EpqOyuxINew=="
|
|
191
|
+
|
|
192
|
+ appid := "wx4f4bc4dec97d474b"
|
|
193
|
+ key := "4BactRvIKCBXzvpyl2SQyQ=="
|
|
194
|
+ strs := "Gr5gmKz9OjWGipAxt3ujQtHBBXV/Uvhsm+qvvZy6gF+HBc8c6gZhZkqIqLbs8nHkId5zm/mGVNpghvM/egYTLOOI7LxhvjRsPE1691j+jltU9OIavGIWFp3I4m3OdP9CuPohhrpZPgwsGajJmtGNNjPvGA61ssErVZ7SBceq+leag532zCmgEXN3NpZP0TRgpIpwpegCAEW07oyI0LiRYA=="
|
|
195
|
+ iv := "aXiAcKIWKfseTyzelqcZ0w=="
|
|
196
|
+ //data, err := service.Dncrypt(strs, key, iv)
|
|
197
|
+ //fmt.Println(err)
|
|
198
|
+
|
188
|
199
|
data, err := service.DecryptData(appid, key, iv, strs)
|
189
|
200
|
patient_id, _ := this.GetInt64("patient_id")
|
190
|
201
|
patient, err := service.GetPatientListByPatientId(patient_id)
|
|
@@ -203,17 +214,20 @@ func (this *XcxApiController) GetPatientList() {
|
203
|
214
|
func (this *XcxApiController) GetDataInfo() {
|
204
|
215
|
|
205
|
216
|
appid := this.GetString("appid")
|
|
217
|
+ fmt.Println(appid)
|
206
|
218
|
key := this.GetString("key")
|
207
|
219
|
iv := this.GetString("iv")
|
208
|
220
|
encryptedData := this.GetString("encryptedData")
|
209
|
221
|
list, _ := service.DecryptData(appid, key, iv, encryptedData)
|
210
|
|
- fmt.Println(list)
|
|
222
|
+ //list, err := service.Dncrypt(encryptedData, key, iv)
|
|
223
|
+
|
211
|
224
|
this.ServeSuccessJSON(map[string]interface{}{
|
212
|
225
|
"list": list,
|
213
|
226
|
})
|
214
|
227
|
}
|
215
|
228
|
|
216
|
229
|
func (this *XcxApiController) GetScheduleInfo() {
|
|
230
|
+ patient_id, _ := this.GetInt64("patient_id")
|
217
|
231
|
thisWeekMonday := service.GetFirstDateOfWeek()
|
218
|
232
|
weekDayWeek := service.GetWeekDayOfWeek()
|
219
|
233
|
TimeMonday, _ := time.Parse("2006-01-02", thisWeekMonday)
|
|
@@ -229,8 +243,279 @@ func (this *XcxApiController) GetScheduleInfo() {
|
229
|
243
|
loc, _ := time.LoadLocation("Local")
|
230
|
244
|
|
231
|
245
|
startTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", weekMonday+" 00:00:00", loc)
|
232
|
|
-
|
|
246
|
+ fmt.Println("startiem", startTime)
|
233
|
247
|
endTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", weekDay+" 00:00:00", loc)
|
234
|
248
|
|
235
|
249
|
fmt.Println(startTime.Unix(), endTime.Unix())
|
|
250
|
+
|
|
251
|
+ schedule, err := service.GetScheduleInfo(1630252800, 1631980800, patient_id)
|
|
252
|
+ if err != nil {
|
|
253
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
254
|
+ return
|
|
255
|
+ }
|
|
256
|
+ array := []interface{}{
|
|
257
|
+ map[string]string{"schedule_type": "1", "schedule_date": "1630252800", "schedule_week": "1", "mode_id": "", "name": ""},
|
|
258
|
+ map[string]string{"schedule_type": "2", "schedule_date": "1630252800", "schedule_week": "1", "mode_id": "", "name": ""},
|
|
259
|
+ map[string]string{"schedule_type": "3", "schedule_date": "1630252800", "schedule_week": "1", "mode_id": "", "name": ""},
|
|
260
|
+ map[string]string{"schedule_type": "1", "schedule_date": "1630339200", "schedule_week": "2", "mode_id": "", "name": ""},
|
|
261
|
+ map[string]string{"schedule_type": "2", "schedule_date": "1630339200", "schedule_week": "2", "mode_id": "", "name": ""},
|
|
262
|
+ map[string]string{"schedule_type": "3", "schedule_date": "1630339200", "schedule_week": "2", "mode_id": "", "name": ""},
|
|
263
|
+ map[string]string{"schedule_type": "1", "schedule_date": "1630425600", "schedule_week": "3", "mode_id": "", "name": ""},
|
|
264
|
+ map[string]string{"schedule_type": "2", "schedule_date": "1630425600", "schedule_week": "3", "mode_id": "", "name": ""},
|
|
265
|
+ map[string]string{"schedule_type": "3", "schedule_date": "1630425600", "schedule_week": "3", "mode_id": "", "name": ""},
|
|
266
|
+ map[string]string{"schedule_type": "1", "schedule_date": "1630512000", "schedule_week": "4", "mode_id": "", "name": ""},
|
|
267
|
+ map[string]string{"schedule_type": "2", "schedule_date": "1630512000", "schedule_week": "4", "mode_id": "", "name": ""},
|
|
268
|
+ map[string]string{"schedule_type": "3", "schedule_date": "1630512000", "schedule_week": "4", "mode_id": "", "name": ""},
|
|
269
|
+ map[string]string{"schedule_type": "1", "schedule_date": "1630598400", "schedule_week": "5", "mode_id": "", "name": ""},
|
|
270
|
+ map[string]string{"schedule_type": "2", "schedule_date": "1630598400", "schedule_week": "5", "mode_id": "", "name": ""},
|
|
271
|
+ map[string]string{"schedule_type": "3", "schedule_date": "1630598400", "schedule_week": "5", "mode_id": "", "name": ""},
|
|
272
|
+ map[string]string{"schedule_type": "1", "schedule_date": "1630684800", "schedule_week": "6", "mode_id": "", "name": ""},
|
|
273
|
+ map[string]string{"schedule_type": "2", "schedule_date": "1630684800", "schedule_week": "6", "mode_id": "", "name": ""},
|
|
274
|
+ map[string]string{"schedule_type": "3", "schedule_date": "1630684800", "schedule_week": "6", "mode_id": "", "name": ""},
|
|
275
|
+ map[string]string{"schedule_type": "1", "schedule_date": "1630771200", "schedule_week": "7", "mode_id": "", "name": ""},
|
|
276
|
+ map[string]string{"schedule_type": "2", "schedule_date": "1630771200", "schedule_week": "7", "mode_id": "", "name": ""},
|
|
277
|
+ map[string]string{"schedule_type": "3", "schedule_date": "1630771200", "schedule_week": "7", "mode_id": "", "name": ""},
|
|
278
|
+
|
|
279
|
+ map[string]string{"schedule_type": "1", "schedule_date": "1630857600", "schedule_week": "1", "mode_id": "", "name": ""},
|
|
280
|
+ map[string]string{"schedule_type": "2", "schedule_date": "1630857600", "schedule_week": "1", "mode_id": "", "name": ""},
|
|
281
|
+ map[string]string{"schedule_type": "3", "schedule_date": "1630857600", "schedule_week": "1", "mode_id": "", "name": ""},
|
|
282
|
+ map[string]string{"schedule_type": "1", "schedule_date": "1630944000", "schedule_week": "2", "mode_id": "", "name": ""},
|
|
283
|
+ map[string]string{"schedule_type": "2", "schedule_date": "1630944000", "schedule_week": "2", "mode_id": "", "name": ""},
|
|
284
|
+ map[string]string{"schedule_type": "3", "schedule_date": "1630944000", "schedule_week": "2", "mode_id": "", "name": ""},
|
|
285
|
+ map[string]string{"schedule_type": "1", "schedule_date": "1631030400", "schedule_week": "3", "mode_id": "", "name": ""},
|
|
286
|
+ map[string]string{"schedule_type": "2", "schedule_date": "1631030400", "schedule_week": "3", "mode_id": "", "name": ""},
|
|
287
|
+ map[string]string{"schedule_type": "3", "schedule_date": "1631030400", "schedule_week": "3", "mode_id": "", "name": ""},
|
|
288
|
+ map[string]string{"schedule_type": "1", "schedule_date": "1631116800", "schedule_week": "4", "mode_id": "", "name": ""},
|
|
289
|
+ map[string]string{"schedule_type": "2", "schedule_date": "1631116800", "schedule_week": "4", "mode_id": "", "name": ""},
|
|
290
|
+ map[string]string{"schedule_type": "3", "schedule_date": "1631116800", "schedule_week": "4", "mode_id": "", "name": ""},
|
|
291
|
+ map[string]string{"schedule_type": "1", "schedule_date": "1631203200", "schedule_week": "5", "mode_id": "", "name": ""},
|
|
292
|
+ map[string]string{"schedule_type": "2", "schedule_date": "1631203200", "schedule_week": "5", "mode_id": "", "name": ""},
|
|
293
|
+ map[string]string{"schedule_type": "3", "schedule_date": "1631203200", "schedule_week": "5", "mode_id": "", "name": ""},
|
|
294
|
+ map[string]string{"schedule_type": "1", "schedule_date": "1631289600", "schedule_week": "6", "mode_id": "", "name": ""},
|
|
295
|
+ map[string]string{"schedule_type": "2", "schedule_date": "1631289600", "schedule_week": "6", "mode_id": "", "name": ""},
|
|
296
|
+ map[string]string{"schedule_type": "3", "schedule_date": "1631289600", "schedule_week": "6", "mode_id": "", "name": ""},
|
|
297
|
+ map[string]string{"schedule_type": "1", "schedule_date": "1631376000", "schedule_week": "7", "mode_id": "", "name": ""},
|
|
298
|
+ map[string]string{"schedule_type": "2", "schedule_date": "1631376000", "schedule_week": "7", "mode_id": "", "name": ""},
|
|
299
|
+ map[string]string{"schedule_type": "3", "schedule_date": "1631376000", "schedule_week": "7", "mode_id": "", "name": ""},
|
|
300
|
+
|
|
301
|
+ map[string]string{"schedule_type": "1", "schedule_date": "1631462400", "schedule_week": "1", "mode_id": "", "name": ""},
|
|
302
|
+ map[string]string{"schedule_type": "2", "schedule_date": "1631462400", "schedule_week": "1", "mode_id": "", "name": ""},
|
|
303
|
+ map[string]string{"schedule_type": "3", "schedule_date": "1631462400", "schedule_week": "1", "mode_id": "", "name": ""},
|
|
304
|
+ map[string]string{"schedule_type": "1", "schedule_date": "1631548800", "schedule_week": "2", "mode_id": "", "name": ""},
|
|
305
|
+ map[string]string{"schedule_type": "2", "schedule_date": "1631548800", "schedule_week": "2", "mode_id": "", "name": ""},
|
|
306
|
+ map[string]string{"schedule_type": "3", "schedule_date": "1631548800", "schedule_week": "2", "mode_id": "", "name": ""},
|
|
307
|
+ map[string]string{"schedule_type": "1", "schedule_date": "1631635200", "schedule_week": "3", "mode_id": "", "name": ""},
|
|
308
|
+ map[string]string{"schedule_type": "2", "schedule_date": "1631635200", "schedule_week": "3", "mode_id": "", "name": ""},
|
|
309
|
+ map[string]string{"schedule_type": "3", "schedule_date": "1631635200", "schedule_week": "3", "mode_id": "", "name": ""},
|
|
310
|
+ map[string]string{"schedule_type": "1", "schedule_date": "1631721600", "schedule_week": "4", "mode_id": "", "name": ""},
|
|
311
|
+ map[string]string{"schedule_type": "2", "schedule_date": "1631721600", "schedule_week": "4", "mode_id": "", "name": ""},
|
|
312
|
+ map[string]string{"schedule_type": "3", "schedule_date": "1631721600", "schedule_week": "4", "mode_id": "", "name": ""},
|
|
313
|
+ map[string]string{"schedule_type": "1", "schedule_date": "1631808000", "schedule_week": "5", "mode_id": "", "name": ""},
|
|
314
|
+ map[string]string{"schedule_type": "2", "schedule_date": "1631808000", "schedule_week": "5", "mode_id": "", "name": ""},
|
|
315
|
+ map[string]string{"schedule_type": "3", "schedule_date": "1631808000", "schedule_week": "5", "mode_id": "", "name": ""},
|
|
316
|
+ map[string]string{"schedule_type": "1", "schedule_date": "1631894400", "schedule_week": "6", "mode_id": "", "name": ""},
|
|
317
|
+ map[string]string{"schedule_type": "2", "schedule_date": "1631894400", "schedule_week": "6", "mode_id": "", "name": ""},
|
|
318
|
+ map[string]string{"schedule_type": "3", "schedule_date": "1631894400", "schedule_week": "6", "mode_id": "", "name": ""},
|
|
319
|
+ map[string]string{"schedule_type": "1", "schedule_date": "1631980800", "schedule_week": "7", "mode_id": "", "name": ""},
|
|
320
|
+ map[string]string{"schedule_type": "2", "schedule_date": "1631980800", "schedule_week": "7", "mode_id": "", "name": ""},
|
|
321
|
+ map[string]string{"schedule_type": "3", "schedule_date": "1631980800", "schedule_week": "7", "mode_id": "", "name": ""},
|
|
322
|
+ }
|
|
323
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
324
|
+ "list": schedule,
|
|
325
|
+ "array": array,
|
|
326
|
+ })
|
|
327
|
+}
|
|
328
|
+
|
|
329
|
+func (this *XcxApiController) GetMobileSchedule() {
|
|
330
|
+
|
|
331
|
+ patientID, _ := this.GetInt64("patient_id")
|
|
332
|
+ recordDateStr := this.GetString("date")
|
|
333
|
+ if patientID <= 0 {
|
|
334
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
335
|
+ return
|
|
336
|
+ }
|
|
337
|
+ if len(recordDateStr) == 0 {
|
|
338
|
+ recordDateStr = time.Now().Format("2006-01-02")
|
|
339
|
+ }
|
|
340
|
+ date, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", recordDateStr)
|
|
341
|
+ if parseDateErr != nil {
|
|
342
|
+ this.ErrorLog("日期(%v)解析错误:%v", recordDateStr, parseDateErr)
|
|
343
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
344
|
+ return
|
|
345
|
+ }
|
|
346
|
+
|
|
347
|
+ adminInfo := this.GetMobileAdminUserInfo()
|
|
348
|
+ patient, getPatientErr := service.MobileGetPatientDetail(adminInfo.Org.Id, patientID)
|
|
349
|
+ if getPatientErr != nil {
|
|
350
|
+ this.ErrorLog("获取患者信息失败:%v", getPatientErr)
|
|
351
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
352
|
+ return
|
|
353
|
+ } else if patient == nil {
|
|
354
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodePatientNoExist)
|
|
355
|
+ return
|
|
356
|
+ }
|
|
357
|
+
|
|
358
|
+ schedual, getSchedualErr := service.MobileGetSchedualDetail(adminInfo.Org.Id, patientID, date.Unix())
|
|
359
|
+
|
|
360
|
+ if getSchedualErr != nil {
|
|
361
|
+ this.ErrorLog("获取患者排班信息失败:%v", getSchedualErr)
|
|
362
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
363
|
+ return
|
|
364
|
+ }
|
|
365
|
+
|
|
366
|
+ receiverTreatmentAccess, getRTARErr := service.MobileGetReceiverTreatmentAccessRecord(adminInfo.Org.Id, patientID, date.Unix())
|
|
367
|
+ if getRTARErr != nil {
|
|
368
|
+ this.ErrorLog("获取接诊评估失败:%v", getRTARErr)
|
|
369
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
370
|
+ return
|
|
371
|
+ }
|
|
372
|
+
|
|
373
|
+ predialysisEvaluation, getPEErr := service.MobileGetPredialysisEvaluation(adminInfo.Org.Id, patientID, date.Unix())
|
|
374
|
+ if getPEErr != nil {
|
|
375
|
+ this.ErrorLog("获取透前评估失败:%v", getPEErr)
|
|
376
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
377
|
+ return
|
|
378
|
+ }
|
|
379
|
+
|
|
380
|
+ lastPredialysisEvaluation, getLPEErr := service.MobileGetLastTimePredialysisEvaluation(adminInfo.Org.Id, patientID, date.Unix())
|
|
381
|
+ if getLPEErr != nil {
|
|
382
|
+ this.ErrorLog("获取上一次透前评估失败:%v", getLPEErr)
|
|
383
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
384
|
+ return
|
|
385
|
+ }
|
|
386
|
+
|
|
387
|
+ doctorAdvices, getDoctorAdvicesErr := service.MobileGetDoctorAdvicesByGroups(adminInfo.Org.Id, patientID, date.Unix())
|
|
388
|
+ if getDoctorAdvicesErr != nil {
|
|
389
|
+ this.ErrorLog("获取临时医嘱失败:%v", getDoctorAdvicesErr)
|
|
390
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
391
|
+ return
|
|
392
|
+ }
|
|
393
|
+
|
|
394
|
+ dialysisOrder, getDialysisOrderErr := service.MobileGetSchedualDialysisRecord(adminInfo.Org.Id, patientID, date.Unix())
|
|
395
|
+ if getDialysisOrderErr != nil {
|
|
396
|
+ this.ErrorLog("获取透析记录失败:%v", getDialysisOrderErr)
|
|
397
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
398
|
+ return
|
|
399
|
+ }
|
|
400
|
+
|
|
401
|
+ doubleCheck, getDoubleCheckErr := service.MobileGetDoubleCheck(adminInfo.Org.Id, patientID, date.Unix())
|
|
402
|
+ if getDoubleCheckErr != nil {
|
|
403
|
+ this.ErrorLog("获取双人核对记录失败:%v", getDoubleCheckErr)
|
|
404
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
405
|
+ return
|
|
406
|
+ }
|
|
407
|
+
|
|
408
|
+ monitorRecords, getMonitorRecordsErr := service.MobileGetMonitorRecords(adminInfo.Org.Id, patientID, date.Unix())
|
|
409
|
+ if getMonitorRecordsErr != nil {
|
|
410
|
+ this.ErrorLog("获取透析监测记录失败:%v", getMonitorRecordsErr)
|
|
411
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
412
|
+ return
|
|
413
|
+ }
|
|
414
|
+ var lastMonitorRecord *models.MonitoringRecord
|
|
415
|
+
|
|
416
|
+ lastMonitorRecord, getLastErr := service.MobileGetLastMonitorRecord(adminInfo.Org.Id, patientID, date.Unix())
|
|
417
|
+ if getLastErr != nil {
|
|
418
|
+ this.ErrorLog("获取上一次透析的监测记录失败:%v", getLastErr)
|
|
419
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
420
|
+ return
|
|
421
|
+ }
|
|
422
|
+
|
|
423
|
+ assessmentAfterDislysis, getAADErr := service.MobileGetAssessmentAfterDislysis(adminInfo.Org.Id, patientID, date.Unix())
|
|
424
|
+ if getAADErr != nil {
|
|
425
|
+ this.ErrorLog("获取透后评估失败:%v", getAADErr)
|
|
426
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
427
|
+ return
|
|
428
|
+ }
|
|
429
|
+
|
|
430
|
+ lastAssessmentAfterDislysis, getLAADErr := service.MobileGetLastTimeAssessmentAfterDislysis(adminInfo.Org.Id, patientID, date.Unix())
|
|
431
|
+ if getLAADErr != nil {
|
|
432
|
+ this.ErrorLog("获取上一次透后评估失败:%v", getLAADErr)
|
|
433
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
434
|
+ return
|
|
435
|
+ }
|
|
436
|
+
|
|
437
|
+ treatmentSummary, getTreatmentSummaryErr := service.MobileGetTreatmentSummary(adminInfo.Org.Id, patientID, date.Unix())
|
|
438
|
+ if getTreatmentSummaryErr != nil {
|
|
439
|
+ this.ErrorLog("获取治疗小结失败:%v", getTreatmentSummaryErr)
|
|
440
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
441
|
+ return
|
|
442
|
+ }
|
|
443
|
+
|
|
444
|
+ dialysisPrescribe, _ := service.MobileGetDialysisPrescribeByModeId(adminInfo.Org.Id, patientID, date.Unix(), schedual.ModeId)
|
|
445
|
+
|
|
446
|
+ dialysisSolution, _ := service.MobileGetDialysisSolutionByModeId(adminInfo.Org.Id, patientID, schedual.ModeId)
|
|
447
|
+
|
|
448
|
+ lastDialysisPrescribe, _ := service.MobileGetLastDialysisPrescribeByModeId(adminInfo.Org.Id, patientID, schedual.ModeId)
|
|
449
|
+
|
|
450
|
+ //获取系统透析处方模版
|
|
451
|
+ systemDialysisPrescribe, _ := service.MobileGetSystemDialysisPrescribeByModeId(adminInfo.Org.Id, schedual.ModeId)
|
|
452
|
+
|
|
453
|
+ _, is_open_config := service.FindXTHisRecordByOrgId(adminInfo.Org.Id)
|
|
454
|
+
|
|
455
|
+ _, is_project_open_config := service.FindXTHisProjectByOrgId(adminInfo.Org.Id)
|
|
456
|
+
|
|
457
|
+ projects, _ := service.GetHisPrescriptionProjects(adminInfo.Org.Id, patientID, date.Unix())
|
|
458
|
+
|
|
459
|
+ stockType, _ := service.GetStockType(adminInfo.Org.Id)
|
|
460
|
+
|
|
461
|
+ prepare, _ := service.GetDialyStockOut(adminInfo.Org.Id, date.Unix(), patientID)
|
|
462
|
+
|
|
463
|
+ //获取最后一次血管通路
|
|
464
|
+ lastAssessment, parseDateErr := service.GetLastPassWayAssessment(adminInfo.Org.Id, patientID)
|
|
465
|
+
|
|
466
|
+ prescribeOne, parseDateErr := service.MobileGetDialysisPrescribeByModeIdOne(adminInfo.Org.Id, patientID, date.Unix())
|
|
467
|
+ var his_advices []*models.HisDoctorAdviceInfo
|
|
468
|
+ if is_open_config.IsOpen == 1 {
|
|
469
|
+ his_advices, _ = service.GetAllHisDoctorAdvice(adminInfo.Org.Id, patientID, date.Unix())
|
|
470
|
+ }
|
|
471
|
+
|
|
472
|
+ if getLPEErr != nil {
|
|
473
|
+ this.ErrorLog("获取上一次透前评估失败:%v", getLPEErr)
|
|
474
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
475
|
+ return
|
|
476
|
+ }
|
|
477
|
+
|
|
478
|
+ lastDryWeightDislysis, getDryErr := service.MobileGetLastDryWeight(adminInfo.Org.Id, patientID)
|
|
479
|
+ if getDryErr != nil {
|
|
480
|
+ this.ErrorLog("获取最后一条干体重失败:%v", getDryErr)
|
|
481
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
482
|
+ return
|
|
483
|
+ }
|
|
484
|
+
|
|
485
|
+ _, gobalConfig := service.FindAutomaticReduceRecordByOrgId(adminInfo.Org.Id)
|
|
486
|
+
|
|
487
|
+ operators, _ := service.GetAllStarfEs(adminInfo.Org.Id)
|
|
488
|
+
|
|
489
|
+ returnData := map[string]interface{}{
|
|
490
|
+ "patient": patient,
|
|
491
|
+ "schedual": schedual,
|
|
492
|
+ "prescription": dialysisPrescribe,
|
|
493
|
+ "solution": dialysisSolution,
|
|
494
|
+ "last_prescription": lastDialysisPrescribe,
|
|
495
|
+ "receiver_treatment_access": receiverTreatmentAccess,
|
|
496
|
+ "predialysis_evaluation": predialysisEvaluation,
|
|
497
|
+ "doctor_advices": doctorAdvices,
|
|
498
|
+ "double_check": doubleCheck,
|
|
499
|
+ "assessment_after_dislysis": assessmentAfterDislysis,
|
|
500
|
+ "treatment_summary": treatmentSummary,
|
|
501
|
+ "monitor_records": monitorRecords,
|
|
502
|
+ "dialysis_order": dialysisOrder,
|
|
503
|
+ "operators": operators,
|
|
504
|
+ "last_predialysis_evaluation": lastPredialysisEvaluation,
|
|
505
|
+ "last_assessment_after_dislysis": lastAssessmentAfterDislysis,
|
|
506
|
+ "last_monitor_record": lastMonitorRecord,
|
|
507
|
+ "config": gobalConfig,
|
|
508
|
+ "dry_weight": lastDryWeightDislysis,
|
|
509
|
+ "system_prescription": systemDialysisPrescribe,
|
|
510
|
+ "his_advices": his_advices,
|
|
511
|
+ "is_open_config": is_open_config,
|
|
512
|
+ "stockType": stockType,
|
|
513
|
+ "prepare": prepare,
|
|
514
|
+ "lastAssessment": lastAssessment,
|
|
515
|
+ "prescribeOne": prescribeOne,
|
|
516
|
+ "is_project_open_config": is_project_open_config,
|
|
517
|
+ "project": projects,
|
|
518
|
+ }
|
|
519
|
+ this.ServeSuccessJSON(returnData)
|
|
520
|
+
|
236
|
521
|
}
|