From 6a17372e7a87c37f5404f7ccc8eebc4fca5c97ca Mon Sep 17 00:00:00 2001 From: yaso Date: Wed, 9 Oct 2024 11:03:05 +0200 Subject: [PATCH] pending appointment can be cancelled but not be viewed --- .../builder/build_patient_queue_list.dart | 41 +++++++++++-------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/Frontend/patient_manager/lib/mih_packages/patient_profile/builder/build_patient_queue_list.dart b/Frontend/patient_manager/lib/mih_packages/patient_profile/builder/build_patient_queue_list.dart index afbb922d..f57543a4 100644 --- a/Frontend/patient_manager/lib/mih_packages/patient_profile/builder/build_patient_queue_list.dart +++ b/Frontend/patient_manager/lib/mih_packages/patient_profile/builder/build_patient_queue_list.dart @@ -175,23 +175,27 @@ class _BuildPatientsListState extends State { child: MIHButton( onTap: () { //updateAccessAPICall(index, "approved"); - Patient selectedPatient; - fetchPatients(widget.patientQueue[index].app_id).then( - (result) { - setState(() { - selectedPatient = result; - Navigator.of(context) - .pushNamed('/patient-manager/patient', - arguments: PatientViewArguments( - widget.signedInUser, - selectedPatient, - widget.businessUser, - widget.business, - "business", - )); - }); - }, - ); + if (widget.patientQueue[index].access == "approved") { + Patient selectedPatient; + fetchPatients(widget.patientQueue[index].app_id).then( + (result) { + setState(() { + selectedPatient = result; + Navigator.of(context) + .pushNamed('/patient-manager/patient', + arguments: PatientViewArguments( + widget.signedInUser, + selectedPatient, + widget.businessUser, + widget.business, + "business", + )); + }); + }, + ); + } else { + noAccessWarning(); + } }, buttonText: "View Patient Profile", buttonColor: @@ -321,7 +325,8 @@ class _BuildPatientsListState extends State { } else if (widget.patientQueue[index].access == "cancelled") { appointmentCancelledWarning(); } else { - noAccessWarning(); + viewConfirmationPopUp(index); + //noAccessWarning(); } }, trailing: Icon(