|
@@ -372,22 +372,10 @@ func (this *StaffScheduleApiController) UpdatePatientScheduleById() {
|
372
|
372
|
"msg": "切换成功",
|
373
|
373
|
})
|
374
|
374
|
}
|
375
|
|
-
|
376
|
|
-func (this *StaffScheduleApiController) UpdateBloodSchedule() {
|
377
|
|
-
|
378
|
|
- id, _ := this.GetInt64("id")
|
|
375
|
+func (this *StaffScheduleApiController) UpdateDialysisPrescription() {
|
379
|
376
|
patient_id, _ := this.GetInt64("patient_id")
|
380
|
|
- mode_id, _ := this.GetInt64("mode_id")
|
381
|
|
- schedule_type, _ := this.GetInt64("schedule_type")
|
382
|
377
|
start_time, _ := this.GetInt64("start_time")
|
383
|
378
|
dialyzer_perfusion_apparatus := this.GetString("dialyzer_perfusion_apparatus")
|
384
|
|
- //更改排班
|
385
|
|
- schedule := models.XtSchedule{
|
386
|
|
- ScheduleType: schedule_type,
|
387
|
|
- ModeId: mode_id,
|
388
|
|
- }
|
389
|
|
- service.UpdatedSchedule(schedule, id)
|
390
|
|
-
|
391
|
379
|
//更改透析模式
|
392
|
380
|
_, errcode := service.GetDialyisSolution(patient_id, start_time)
|
393
|
381
|
if errcode == gorm.ErrRecordNotFound {
|
|
@@ -411,6 +399,45 @@ func (this *StaffScheduleApiController) UpdateBloodSchedule() {
|
411
|
399
|
}
|
412
|
400
|
}
|
413
|
401
|
|
|
402
|
+func (this *StaffScheduleApiController) UpdateBloodScheduleMode() {
|
|
403
|
+ id, _ := this.GetInt64("id")
|
|
404
|
+ mode_id, _ := this.GetInt64("mode_id")
|
|
405
|
+ schedule := models.XtSchedule{
|
|
406
|
+ ModeId: mode_id,
|
|
407
|
+ }
|
|
408
|
+ service.UpdatedScheduleMode(schedule, id)
|
|
409
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
410
|
+ "msg": "保存成功",
|
|
411
|
+ })
|
|
412
|
+}
|
|
413
|
+
|
|
414
|
+func (this *StaffScheduleApiController) UpdateBloodSchedule() {
|
|
415
|
+
|
|
416
|
+ patient_id, _ := this.GetInt64("patient_id")
|
|
417
|
+ mode_id, _ := this.GetInt64("mode_id")
|
|
418
|
+ schedule_type, _ := this.GetInt64("schedule_type")
|
|
419
|
+ start_time, _ := this.GetInt64("start_time")
|
|
420
|
+ dialyzer_perfusion_apparatus := this.GetString("dialyzer_perfusion_apparatus")
|
|
421
|
+ bed_id, _ := this.GetInt64("bed_id")
|
|
422
|
+ //更改排班
|
|
423
|
+ schedule := models.XtSchedule{
|
|
424
|
+ ScheduleType: schedule_type,
|
|
425
|
+ ModeId: mode_id,
|
|
426
|
+ }
|
|
427
|
+
|
|
428
|
+ //查询该床位该班次是否存在排班
|
|
429
|
+ _, errschedulecode := service.GetPatientScheduleIsExist(patient_id, start_time, schedule_type, bed_id)
|
|
430
|
+ if errschedulecode == gorm.ErrRecordNotFound {
|
|
431
|
+ service.UpdatedSchedule(schedule, patient_id, start_time, schedule_type, bed_id)
|
|
432
|
+ } else if errschedulecode == nil {
|
|
433
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
434
|
+ "msg": "1",
|
|
435
|
+ "msgerr": "排班已存在",
|
|
436
|
+ })
|
|
437
|
+ }
|
|
438
|
+
|
|
439
|
+}
|
|
440
|
+
|
414
|
441
|
func (this *StaffScheduleApiController) GetSchedulePatient() {
|
415
|
442
|
|
416
|
443
|
schedule, _ := this.GetInt64("schedule", 0) //1已2未
|