|
@@ -361,20 +361,20 @@ func (this *XcxApiController) GetScheduleInfo() {
|
361
|
361
|
func (this *XcxApiController) GetMobileSchedule() {
|
362
|
362
|
|
363
|
363
|
patientID, _ := this.GetInt64("patient_id")
|
364
|
|
- recordDateStr := this.GetString("date")
|
365
|
|
- if patientID <= 0 {
|
366
|
|
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
367
|
|
- return
|
368
|
|
- }
|
369
|
|
- if len(recordDateStr) == 0 {
|
370
|
|
- recordDateStr = time.Now().Format("2006-01-02")
|
371
|
|
- }
|
372
|
|
- date, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", recordDateStr)
|
373
|
|
- if parseDateErr != nil {
|
374
|
|
- this.ErrorLog("日期(%v)解析错误:%v", recordDateStr, parseDateErr)
|
375
|
|
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
376
|
|
- return
|
377
|
|
- }
|
|
364
|
+ //recordDateStr := this.GetString("date")
|
|
365
|
+ //if patientID <= 0 {
|
|
366
|
+ // this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
367
|
+ // return
|
|
368
|
+ //}
|
|
369
|
+ //if len(recordDateStr) == 0 {
|
|
370
|
+ // recordDateStr = time.Now().Format("2006-01-02")
|
|
371
|
+ //}
|
|
372
|
+ //date, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", recordDateStr)
|
|
373
|
+ //if parseDateErr != nil {
|
|
374
|
+ // this.ErrorLog("日期(%v)解析错误:%v", recordDateStr, parseDateErr)
|
|
375
|
+ // this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
376
|
+ // return
|
|
377
|
+ //}
|
378
|
378
|
|
379
|
379
|
adminInfo := this.GetMobileAdminUserInfo()
|
380
|
380
|
patient, getPatientErr := service.MobileGetPatientDetail(adminInfo.Org.Id, patientID)
|
|
@@ -387,7 +387,7 @@ func (this *XcxApiController) GetMobileSchedule() {
|
387
|
387
|
return
|
388
|
388
|
}
|
389
|
389
|
|
390
|
|
- schedual, getSchedualErr := service.MobileGetSchedualDetail(adminInfo.Org.Id, patientID, date.Unix())
|
|
390
|
+ schedual, getSchedualErr := service.MobileGetSchedualDetailOne(adminInfo.Org.Id, patientID)
|
391
|
391
|
|
392
|
392
|
if getSchedualErr != nil {
|
393
|
393
|
this.ErrorLog("获取患者排班信息失败:%v", getSchedualErr)
|
|
@@ -395,49 +395,49 @@ func (this *XcxApiController) GetMobileSchedule() {
|
395
|
395
|
return
|
396
|
396
|
}
|
397
|
397
|
|
398
|
|
- receiverTreatmentAccess, getRTARErr := service.MobileGetReceiverTreatmentAccessRecord(adminInfo.Org.Id, patientID, date.Unix())
|
|
398
|
+ receiverTreatmentAccess, getRTARErr := service.MobileGetReceiverTreatmentAccessRecordOne(adminInfo.Org.Id, patientID)
|
399
|
399
|
if getRTARErr != nil {
|
400
|
400
|
this.ErrorLog("获取接诊评估失败:%v", getRTARErr)
|
401
|
401
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
402
|
402
|
return
|
403
|
403
|
}
|
404
|
404
|
|
405
|
|
- predialysisEvaluation, getPEErr := service.MobileGetPredialysisEvaluation(adminInfo.Org.Id, patientID, date.Unix())
|
|
405
|
+ predialysisEvaluation, getPEErr := service.MobileGetPredialysisEvaluationOne(adminInfo.Org.Id, patientID)
|
406
|
406
|
if getPEErr != nil {
|
407
|
407
|
this.ErrorLog("获取透前评估失败:%v", getPEErr)
|
408
|
408
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
409
|
409
|
return
|
410
|
410
|
}
|
411
|
411
|
|
412
|
|
- lastPredialysisEvaluation, getLPEErr := service.MobileGetLastTimePredialysisEvaluation(adminInfo.Org.Id, patientID, date.Unix())
|
|
412
|
+ lastPredialysisEvaluation, getLPEErr := service.MobileGetLastTimePredialysisEvaluationOne(adminInfo.Org.Id, patientID)
|
413
|
413
|
if getLPEErr != nil {
|
414
|
414
|
this.ErrorLog("获取上一次透前评估失败:%v", getLPEErr)
|
415
|
415
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
416
|
416
|
return
|
417
|
417
|
}
|
418
|
418
|
|
419
|
|
- doctorAdvices, getDoctorAdvicesErr := service.MobileGetDoctorAdvicesByGroups(adminInfo.Org.Id, patientID, date.Unix())
|
|
419
|
+ doctorAdvices, getDoctorAdvicesErr := service.MobileGetDoctorAdvicesByGroupsOne(adminInfo.Org.Id, patientID)
|
420
|
420
|
if getDoctorAdvicesErr != nil {
|
421
|
421
|
this.ErrorLog("获取临时医嘱失败:%v", getDoctorAdvicesErr)
|
422
|
422
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
423
|
423
|
return
|
424
|
424
|
}
|
425
|
425
|
|
426
|
|
- dialysisOrder, getDialysisOrderErr := service.MobileGetSchedualDialysisRecord(adminInfo.Org.Id, patientID, date.Unix())
|
|
426
|
+ dialysisOrder, getDialysisOrderErr := service.MobileGetSchedualDialysisRecordOne(adminInfo.Org.Id, patientID)
|
427
|
427
|
if getDialysisOrderErr != nil {
|
428
|
428
|
this.ErrorLog("获取透析记录失败:%v", getDialysisOrderErr)
|
429
|
429
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
430
|
430
|
return
|
431
|
431
|
}
|
432
|
432
|
|
433
|
|
- doubleCheck, getDoubleCheckErr := service.MobileGetDoubleCheck(adminInfo.Org.Id, patientID, date.Unix())
|
|
433
|
+ doubleCheck, getDoubleCheckErr := service.MobileGetDoubleCheckOne(adminInfo.Org.Id, patientID)
|
434
|
434
|
if getDoubleCheckErr != nil {
|
435
|
435
|
this.ErrorLog("获取双人核对记录失败:%v", getDoubleCheckErr)
|
436
|
436
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
437
|
437
|
return
|
438
|
438
|
}
|
439
|
439
|
|
440
|
|
- monitorRecords, getMonitorRecordsErr := service.MobileGetMonitorRecords(adminInfo.Org.Id, patientID, date.Unix())
|
|
440
|
+ monitorRecords, getMonitorRecordsErr := service.MobileGetMonitorRecordsOne(adminInfo.Org.Id, patientID)
|
441
|
441
|
if getMonitorRecordsErr != nil {
|
442
|
442
|
this.ErrorLog("获取透析监测记录失败:%v", getMonitorRecordsErr)
|
443
|
443
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
@@ -445,35 +445,35 @@ func (this *XcxApiController) GetMobileSchedule() {
|
445
|
445
|
}
|
446
|
446
|
var lastMonitorRecord *models.MonitoringRecord
|
447
|
447
|
|
448
|
|
- lastMonitorRecord, getLastErr := service.MobileGetLastMonitorRecord(adminInfo.Org.Id, patientID, date.Unix())
|
|
448
|
+ lastMonitorRecord, getLastErr := service.MobileGetLastMonitorRecordOne(adminInfo.Org.Id, patientID)
|
449
|
449
|
if getLastErr != nil {
|
450
|
450
|
this.ErrorLog("获取上一次透析的监测记录失败:%v", getLastErr)
|
451
|
451
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
452
|
452
|
return
|
453
|
453
|
}
|
454
|
454
|
|
455
|
|
- assessmentAfterDislysis, getAADErr := service.MobileGetAssessmentAfterDislysis(adminInfo.Org.Id, patientID, date.Unix())
|
|
455
|
+ assessmentAfterDislysis, getAADErr := service.MobileGetAssessmentAfterDislysisOne(adminInfo.Org.Id, patientID)
|
456
|
456
|
if getAADErr != nil {
|
457
|
457
|
this.ErrorLog("获取透后评估失败:%v", getAADErr)
|
458
|
458
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
459
|
459
|
return
|
460
|
460
|
}
|
461
|
461
|
|
462
|
|
- lastAssessmentAfterDislysis, getLAADErr := service.MobileGetLastTimeAssessmentAfterDislysis(adminInfo.Org.Id, patientID, date.Unix())
|
|
462
|
+ lastAssessmentAfterDislysis, getLAADErr := service.MobileGetAssessmentAfterDislysisOne(adminInfo.Org.Id, patientID)
|
463
|
463
|
if getLAADErr != nil {
|
464
|
464
|
this.ErrorLog("获取上一次透后评估失败:%v", getLAADErr)
|
465
|
465
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
466
|
466
|
return
|
467
|
467
|
}
|
468
|
468
|
|
469
|
|
- treatmentSummary, getTreatmentSummaryErr := service.MobileGetTreatmentSummary(adminInfo.Org.Id, patientID, date.Unix())
|
|
469
|
+ treatmentSummary, getTreatmentSummaryErr := service.MobileGetTreatmentSummaryOne(adminInfo.Org.Id, patientID)
|
470
|
470
|
if getTreatmentSummaryErr != nil {
|
471
|
471
|
this.ErrorLog("获取治疗小结失败:%v", getTreatmentSummaryErr)
|
472
|
472
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
473
|
473
|
return
|
474
|
474
|
}
|
475
|
475
|
|
476
|
|
- dialysisPrescribe, _ := service.MobileGetDialysisPrescribeByModeId(adminInfo.Org.Id, patientID, date.Unix(), schedual.ModeId)
|
|
476
|
+ dialysisPrescribe, _ := service.MobileGetDialysisPrescribeByModeIdSix(adminInfo.Org.Id, patientID, schedual.ModeId)
|
477
|
477
|
|
478
|
478
|
dialysisSolution, _ := service.MobileGetDialysisSolutionByModeId(adminInfo.Org.Id, patientID, schedual.ModeId)
|
479
|
479
|
|
|
@@ -486,19 +486,19 @@ func (this *XcxApiController) GetMobileSchedule() {
|
486
|
486
|
|
487
|
487
|
_, is_project_open_config := service.FindXTHisProjectByOrgId(adminInfo.Org.Id)
|
488
|
488
|
|
489
|
|
- projects, _ := service.GetHisPrescriptionProjects(adminInfo.Org.Id, patientID, date.Unix())
|
|
489
|
+ projects, _ := service.GetHisPrescriptionProjectsOne(adminInfo.Org.Id, patientID)
|
490
|
490
|
|
491
|
491
|
stockType, _ := service.GetStockType(adminInfo.Org.Id)
|
492
|
492
|
|
493
|
|
- prepare, _ := service.GetDialyStockOut(adminInfo.Org.Id, date.Unix(), patientID)
|
|
493
|
+ prepare, _ := service.GetDialyStockOutOne(adminInfo.Org.Id, patientID)
|
494
|
494
|
|
495
|
495
|
//获取最后一次血管通路
|
496
|
|
- lastAssessment, parseDateErr := service.GetLastPassWayAssessment(adminInfo.Org.Id, patientID)
|
|
496
|
+ lastAssessment, _ := service.GetLastPassWayAssessment(adminInfo.Org.Id, patientID)
|
497
|
497
|
|
498
|
|
- prescribeOne, parseDateErr := service.MobileGetDialysisPrescribeByModeIdOne(adminInfo.Org.Id, patientID, date.Unix())
|
|
498
|
+ prescribeOne, _ := service.MobileGetDialysisPrescribeByModeIdFive(adminInfo.Org.Id, patientID)
|
499
|
499
|
var his_advices []*models.HisDoctorAdviceInfo
|
500
|
500
|
if is_open_config.IsOpen == 1 {
|
501
|
|
- his_advices, _ = service.GetAllHisDoctorAdvice(adminInfo.Org.Id, patientID, date.Unix())
|
|
501
|
+ his_advices, _ = service.GetAllHisDoctorAdviceOne(adminInfo.Org.Id, patientID)
|
502
|
502
|
}
|
503
|
503
|
|
504
|
504
|
if getLPEErr != nil {
|