diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 9a71e55c..bdab5211 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -588,14 +588,7 @@ class _AppointmentActionsState extends State { navigateToToDoPage(BuildContext context, ToDoCountProviderModel model) { if (widget.projectViewModel.isLogin) { if (model.count != 0) { - Navigator.push( - context, - FadePage( - page: ToDo( - isShowAppBar: true, - isFromMyAppointments: true, - appointment: widget.appo, - ))); + getPatientAppointmentHistoryWithAppo(); } else { AppToast.showErrorToast(message: TranslationBase.of(context).upcomingEmpty); } @@ -611,6 +604,33 @@ class _AppointmentActionsState extends State { } } + getPatientAppointmentHistoryWithAppo() { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + service.getPatientAppointmentHistoryWithAppoNo(widget.appo.appointmentNo).then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList.fromJson(res['AppoimentAllHistoryResultList'][0]); + Navigator.push( + context, + FadePage( + page: ToDo( + isShowAppBar: true, + isFromMyAppointments: true, + appointment: appo, + ), + ), + ); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + print(err); + GifLoaderDialogUtils.hideDialog(context); + err != null ?? AppToast.showErrorToast(message: err); + }); + } + rateAppointment() { widget.browser = new MyInAppBrowser(); var url = 'http://hmg.com/SitePages/pso.aspx?p=' + widget.appo.projectID.toString() + '.' + widget.appo.appointmentNo.toString() + '&c=1'; diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 95be336f..76ed8e60 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -548,6 +548,9 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { case 10: confirmAppointment(appo); break; + case 15: + AppToast.showErrorToast(message: TranslationBase.of(context).upcomingPaymentPending); + break; case 20: getPatientShare(context, appo); // checkPatientNphiesEligibility(context, appo); @@ -836,7 +839,8 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { } dataLoaded = true; if (widget.isFromMyAppointments) { - getPatientShare(context, widget.appointment); + performNextAction(widget.appointment); + widget.isFromMyAppointments = false; } }); } else { diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 0a293818..8923f76e 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -614,6 +614,19 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } + Future getPatientAppointmentHistoryWithAppoNo(int appoNo) async { + Map request; + request = {"IsActiveAppointment": true, "AppointmentNo": appoNo, "IsComingFromCOC": false}; + dynamic localRes; + await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY, onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + + return Future.value(localRes); + } + Future getPatientAppointmentHistory(bool isActiveAppointment, BuildContext context, {bool isForCOC = false}) async { Map request; @@ -1843,6 +1856,4 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - - }