|
@@ -165,12 +165,21 @@ func (this *DialysisRecordAPIController) GetSchedules() {
|
165
|
165
|
redis.Set(key, scheduals_json, time.Second*60)
|
166
|
166
|
}
|
167
|
167
|
}
|
168
|
|
- information, _ := service.GetAdminUserRoleInformation(orgID)
|
169
|
168
|
|
170
|
|
- this.ServeSuccessJSON(map[string]interface{}{
|
171
|
|
- "schedules": scheduals,
|
172
|
|
- "information": information,
|
173
|
|
- })
|
|
169
|
+ _, errcodes := service.GetOrgFollowIsExist(orgID)
|
|
170
|
+ if errcodes == gorm.ErrRecordNotFound {
|
|
171
|
+ information, _ := service.GetAdminUserRoleInformation(0)
|
|
172
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
173
|
+ "schedules": scheduals,
|
|
174
|
+ "information": information,
|
|
175
|
+ })
|
|
176
|
+ } else if errcodes == nil {
|
|
177
|
+ information, _ := service.GetAdminUserRoleInformation(orgID)
|
|
178
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
179
|
+ "schedules": scheduals,
|
|
180
|
+ "information": information,
|
|
181
|
+ })
|
|
182
|
+ }
|
174
|
183
|
|
175
|
184
|
}
|
176
|
185
|
|
|
@@ -183,9 +192,20 @@ func (this *DialysisRecordAPIController) GetSchedules() {
|
183
|
192
|
|
184
|
193
|
}
|
185
|
194
|
|
186
|
|
- this.ServeSuccessJSON(map[string]interface{}{
|
187
|
|
- "schedules": dat,
|
188
|
|
- })
|
|
195
|
+ _, errcodes := service.GetOrgFollowIsExist(orgID)
|
|
196
|
+ if errcodes == gorm.ErrRecordNotFound {
|
|
197
|
+ information, _ := service.GetAdminUserRoleInformation(0)
|
|
198
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
199
|
+ "schedules": dat,
|
|
200
|
+ "information": information,
|
|
201
|
+ })
|
|
202
|
+ } else if errcodes == nil {
|
|
203
|
+ information, _ := service.GetAdminUserRoleInformation(orgID)
|
|
204
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
205
|
+ "schedules": dat,
|
|
206
|
+ "information": information,
|
|
207
|
+ })
|
|
208
|
+ }
|
189
|
209
|
|
190
|
210
|
}
|
191
|
211
|
|
|
@@ -396,39 +416,77 @@ func (this *DialysisRecordAPIController) DialysisSchedule() {
|
396
|
416
|
his_advices, _ = service.GetAllHisDoctorAdvice(adminInfo.CurrentOrgId, patientID, date.Unix())
|
397
|
417
|
}
|
398
|
418
|
|
399
|
|
- information, _ := service.GetAdminUserRoleInformation(adminInfo.CurrentOrgId)
|
400
|
|
- returnData := map[string]interface{}{
|
401
|
|
- "patient": patient,
|
402
|
|
- "schedual": schedual,
|
403
|
|
- "prescription": dialysisPrescribe,
|
404
|
|
- "solution": dialysisSolution,
|
405
|
|
- "receiver_treatment_access": receiverTreatmentAccess,
|
406
|
|
- "predialysis_evaluation": predialysisEvaluation,
|
407
|
|
- "doctor_advices": doctorAdvices,
|
408
|
|
- "double_check": doubleCheck,
|
409
|
|
- "assessment_after_dislysis": assessmentAfterDislysis,
|
410
|
|
- "treatment_summary": treatmentSummary,
|
411
|
|
- "monitor_records": monitorRecords,
|
412
|
|
- "dialysis_order": dialysisOrder,
|
413
|
|
- "doctors": admins,
|
414
|
|
- "config": record,
|
415
|
|
- "devices": devices,
|
416
|
|
- "device_numbers": deviceNumbers,
|
417
|
|
- "lastPredialysisEvaluation": lastPredialysisEvaluation,
|
418
|
|
- "lastMonitorRecord": lastMonitorRecord,
|
419
|
|
- "lastAssessmentAfterDislysis": lastAssessmentAfterDislysis,
|
420
|
|
- "lastDialysisPrescribe": lastDialysisPrescribe,
|
421
|
|
- "lastDryWeightDislysis": lastDryWeightDislysis,
|
422
|
|
- "headNurses": headNurses,
|
423
|
|
- "system_prescribe": systemDialysisPrescribe,
|
424
|
|
- "his_advices": his_advices,
|
425
|
|
- "is_open_config": is_open_config,
|
426
|
|
- "stockType": stockType,
|
427
|
|
- "prepare": prepare,
|
428
|
|
- "lastAssessment": lastAssessment,
|
429
|
|
- "information": information,
|
430
|
|
- }
|
431
|
|
- this.ServeSuccessJSON(returnData)
|
|
419
|
+ _, errcode := service.GetOrgFollowIsExist(adminInfo.CurrentOrgId)
|
|
420
|
+ if errcode == gorm.ErrRecordNotFound {
|
|
421
|
+ information, _ := service.GetAdminUserRoleInformation(0)
|
|
422
|
+ returnData := map[string]interface{}{
|
|
423
|
+ "patient": patient,
|
|
424
|
+ "schedual": schedual,
|
|
425
|
+ "prescription": dialysisPrescribe,
|
|
426
|
+ "solution": dialysisSolution,
|
|
427
|
+ "receiver_treatment_access": receiverTreatmentAccess,
|
|
428
|
+ "predialysis_evaluation": predialysisEvaluation,
|
|
429
|
+ "doctor_advices": doctorAdvices,
|
|
430
|
+ "double_check": doubleCheck,
|
|
431
|
+ "assessment_after_dislysis": assessmentAfterDislysis,
|
|
432
|
+ "treatment_summary": treatmentSummary,
|
|
433
|
+ "monitor_records": monitorRecords,
|
|
434
|
+ "dialysis_order": dialysisOrder,
|
|
435
|
+ "doctors": admins,
|
|
436
|
+ "config": record,
|
|
437
|
+ "devices": devices,
|
|
438
|
+ "device_numbers": deviceNumbers,
|
|
439
|
+ "lastPredialysisEvaluation": lastPredialysisEvaluation,
|
|
440
|
+ "lastMonitorRecord": lastMonitorRecord,
|
|
441
|
+ "lastAssessmentAfterDislysis": lastAssessmentAfterDislysis,
|
|
442
|
+ "lastDialysisPrescribe": lastDialysisPrescribe,
|
|
443
|
+ "lastDryWeightDislysis": lastDryWeightDislysis,
|
|
444
|
+ "headNurses": headNurses,
|
|
445
|
+ "system_prescribe": systemDialysisPrescribe,
|
|
446
|
+ "his_advices": his_advices,
|
|
447
|
+ "is_open_config": is_open_config,
|
|
448
|
+ "stockType": stockType,
|
|
449
|
+ "prepare": prepare,
|
|
450
|
+ "lastAssessment": lastAssessment,
|
|
451
|
+ "information": information,
|
|
452
|
+ }
|
|
453
|
+ this.ServeSuccessJSON(returnData)
|
|
454
|
+
|
|
455
|
+ } else if errcode == nil {
|
|
456
|
+ information, _ := service.GetAdminUserRoleInformation(adminInfo.CurrentOrgId)
|
|
457
|
+ returnData := map[string]interface{}{
|
|
458
|
+ "patient": patient,
|
|
459
|
+ "schedual": schedual,
|
|
460
|
+ "prescription": dialysisPrescribe,
|
|
461
|
+ "solution": dialysisSolution,
|
|
462
|
+ "receiver_treatment_access": receiverTreatmentAccess,
|
|
463
|
+ "predialysis_evaluation": predialysisEvaluation,
|
|
464
|
+ "doctor_advices": doctorAdvices,
|
|
465
|
+ "double_check": doubleCheck,
|
|
466
|
+ "assessment_after_dislysis": assessmentAfterDislysis,
|
|
467
|
+ "treatment_summary": treatmentSummary,
|
|
468
|
+ "monitor_records": monitorRecords,
|
|
469
|
+ "dialysis_order": dialysisOrder,
|
|
470
|
+ "doctors": admins,
|
|
471
|
+ "config": record,
|
|
472
|
+ "devices": devices,
|
|
473
|
+ "device_numbers": deviceNumbers,
|
|
474
|
+ "lastPredialysisEvaluation": lastPredialysisEvaluation,
|
|
475
|
+ "lastMonitorRecord": lastMonitorRecord,
|
|
476
|
+ "lastAssessmentAfterDislysis": lastAssessmentAfterDislysis,
|
|
477
|
+ "lastDialysisPrescribe": lastDialysisPrescribe,
|
|
478
|
+ "lastDryWeightDislysis": lastDryWeightDislysis,
|
|
479
|
+ "headNurses": headNurses,
|
|
480
|
+ "system_prescribe": systemDialysisPrescribe,
|
|
481
|
+ "his_advices": his_advices,
|
|
482
|
+ "is_open_config": is_open_config,
|
|
483
|
+ "stockType": stockType,
|
|
484
|
+ "prepare": prepare,
|
|
485
|
+ "lastAssessment": lastAssessment,
|
|
486
|
+ "information": information,
|
|
487
|
+ }
|
|
488
|
+ this.ServeSuccessJSON(returnData)
|
|
489
|
+ }
|
432
|
490
|
|
433
|
491
|
}
|
434
|
492
|
|