From 7850748ea2a4015af93f71615005ab98560fe819 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 22 Jan 2024 11:08:54 +0300 Subject: [PATCH] Dental updates --- lib/config/config.dart | 4 ++-- lib/pages/BookAppointment/DentalComplaints.dart | 8 +++++--- lib/pages/BookAppointment/DoctorProfile.dart | 4 +++- .../components/DocAvailableAppointments.dart | 5 +++-- lib/pages/BookAppointment/widgets/DoctorView.dart | 11 +++++++---- lib/pages/ToDoList/ObGyne/ObGyne-TimeSlots.dart | 2 +- lib/services/appointment_services/GetDoctorsList.dart | 5 +++-- lib/services/clinic_services/get_clinic_service.dart | 6 +++--- 8 files changed, 27 insertions(+), 18 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 5c5f984c..bc651005 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -21,8 +21,8 @@ var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'http://10.50.100.198:4422/'; -var BASE_URL = 'https://uat.hmgwebservices.com/'; -// var BASE_URL = 'https://hmgwebservices.com/'; +// var BASE_URL = 'https://uat.hmgwebservices.com/'; +var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'http://10.20.200.111:1010/'; // var BASE_URL = 'https://uat.hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/'; diff --git a/lib/pages/BookAppointment/DentalComplaints.dart b/lib/pages/BookAppointment/DentalComplaints.dart index 487fbab4..67cd0215 100644 --- a/lib/pages/BookAppointment/DentalComplaints.dart +++ b/lib/pages/BookAppointment/DentalComplaints.dart @@ -118,6 +118,7 @@ class _DentalComplaintsState extends State { return DoctorView( doctor: doctor, isLiveCareAppointment: false, + isContinueDentalPlan: hasDentalPlan, ); }).toList(), )), @@ -146,8 +147,8 @@ class _DentalComplaintsState extends State { confirmMessage: TranslationBase.of(context).continuePlan, okText: TranslationBase.of(context).yes, cancelText: TranslationBase.of(context).no, - okFunction: () => {Navigator.of(context).pop(), continueDentalPlan()}, - cancelFunction: () => {getChiefComplaintsList()}); + okFunction: () => {Navigator.of(context).pop(), continueDentalPlan(), hasDentalPlan = true}, + cancelFunction: () => {getChiefComplaintsList(), hasDentalPlan = false}); dialog.showAlertDialog(context); } else { getChiefComplaintsList(); @@ -260,8 +261,9 @@ class _DentalComplaintsState extends State { int languageID = projectViewModel.isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); getLanguageID(); + hasDentalPlan = false; ClinicListService service = new ClinicListService(); - service.getChiefComplaintsList(widget.searchInfo.ClinicID, widget.searchInfo.ProjectID, languageID, context).then((res) { + service.getChiefComplaintsList(widget.searchInfo.ClinicID, widget.searchInfo.ProjectID, languageID, false, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart index 1ad0bf67..9c44fabf 100644 --- a/lib/pages/BookAppointment/DoctorProfile.dart +++ b/lib/pages/BookAppointment/DoctorProfile.dart @@ -39,8 +39,9 @@ class DoctorProfile extends StatefulWidget { final bool isOpenAppt; bool isLiveCareAppointment; bool isDoctorNameSearch; + bool isContinueDentalPlan; - DoctorProfile({@required this.doctor, @required this.docProfileList, @required this.isLiveCareAppointment, this.isOpenAppt = false, this.isDoctorNameSearch = false}); + DoctorProfile({@required this.doctor, @required this.docProfileList, @required this.isLiveCareAppointment, this.isOpenAppt = false, this.isDoctorNameSearch = false, this.isContinueDentalPlan = false}); AuthenticatedUser authUser; @@ -203,6 +204,7 @@ class _DoctorProfileState extends State with TickerProviderStateM doctor: widget.doctor, isLiveCareAppointment: widget.isLiveCareAppointment, doctorSchedule: doctorSchedule, + isContinueDentalPlan: widget.isContinueDentalPlan, ), ], controller: _tabController, diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart index 61e697f4..d1aaa1f5 100644 --- a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart +++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart @@ -27,10 +27,11 @@ class DocAvailableAppointments extends StatefulWidget { static String selectedDate; static String selectedTime; bool isLiveCareAppointment; + bool isContinueDentalPlan; final dynamic doctorSchedule; static int initialSlotDuration; - DocAvailableAppointments({@required this.doctor, this.doctorSchedule, @required this.isLiveCareAppointment}); + DocAvailableAppointments({@required this.doctor, this.doctorSchedule, @required this.isLiveCareAppointment, this.isContinueDentalPlan = false}); @override _DocAvailableAppointmentsState createState() => _DocAvailableAppointmentsState(); @@ -320,7 +321,7 @@ class _DocAvailableAppointmentsState extends State wit print(DocAvailableAppointments.initialSlotDuration); GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.getDoctorFreeSlots(docObject.doctorID, docObject.clinicID, docObject.projectID, context, projectViewModel).then((res) { + service.getDoctorFreeSlots(docObject.doctorID, docObject.clinicID, docObject.projectID, widget.isContinueDentalPlan, context, projectViewModel).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { if (res['FreeTimeSlots'].length != 0) { diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index 6969302f..3e14a6fc 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -28,6 +28,7 @@ class DoctorView extends StatelessWidget { bool isObGyneAppointment; bool isShowFlag; bool isDoctorNameSearch; + bool isContinueDentalPlan; OBGyneProcedureListResponse obGyneProcedureListResponse; final VoidCallback onTap; @@ -36,6 +37,7 @@ class DoctorView extends StatelessWidget { @required this.isLiveCareAppointment, this.isObGyneAppointment = false, this.isDoctorNameSearch = false, + this.isContinueDentalPlan = false, this.isShowFlag = true, this.onTap, this.obGyneProcedureListResponse}); @@ -54,7 +56,7 @@ class DoctorView extends StatelessWidget { // showDentalChiefComplaintsList(context); // } else if (isShowFlag) { - getDoctorsProfile(context, doctor, isAppo: true); + getDoctorsProfile(context, doctor, isAppo: true, isContinueDentalPlan: isContinueDentalPlan); } (onTap ?? () {})(); // For log analytics of doctor click from book appointment } @@ -182,7 +184,7 @@ class DoctorView extends StatelessWidget { return docSpeciality; } - getDoctorsProfile(context, DoctorList docObject, {isAppo}) { + getDoctorsProfile(context, DoctorList docObject, {isAppo, bool isContinueDentalPlan = false}) { int languageID = projectViewModel.isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); List docProfileList = []; @@ -195,7 +197,7 @@ class DoctorView extends StatelessWidget { docProfileList.add(new DoctorProfileList.fromJson(v)); }); } else {} - navigateToDoctorProfile(context, docObject, docProfileList[0], isAppo: isAppo); + navigateToDoctorProfile(context, docObject, docProfileList[0], isAppo: isAppo, isContinueDentalPlan: isContinueDentalPlan); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } @@ -234,7 +236,7 @@ class DoctorView extends StatelessWidget { FadePage(page: ObGyneTimeSlots(projectID: doctor.projectID, selectedClinicID: doctor.clinicID, selectedDoctorID: doctor.doctorID, obGyneProcedureListResponse: obGyneProcedureListResponse))); } - Future navigateToDoctorProfile(context, docObject, docProfile, {isAppo}) async { + Future navigateToDoctorProfile(context, docObject, docProfile, {isAppo, bool isContinueDentalPlan = false}) async { Navigator.push( context, FadePage( @@ -244,6 +246,7 @@ class DoctorView extends StatelessWidget { docProfileList: docProfile, isOpenAppt: isAppo, isDoctorNameSearch: isDoctorNameSearch, + isContinueDentalPlan: isContinueDentalPlan, ), ), ); diff --git a/lib/pages/ToDoList/ObGyne/ObGyne-TimeSlots.dart b/lib/pages/ToDoList/ObGyne/ObGyne-TimeSlots.dart index 242a072f..0d02afe8 100644 --- a/lib/pages/ToDoList/ObGyne/ObGyne-TimeSlots.dart +++ b/lib/pages/ToDoList/ObGyne/ObGyne-TimeSlots.dart @@ -466,7 +466,7 @@ class _CovidTimeSlotsState extends State with TickerProviderSta getCovidFreeSlots(BuildContext context, int projectID) { DoctorsListService service = new DoctorsListService(); GifLoaderDialogUtils.showMyDialog(context); - service.getDoctorFreeSlots(widget.selectedDoctorID, widget.selectedClinicID, widget.projectID, context).then((res) { + service.getDoctorFreeSlots(widget.selectedDoctorID, widget.selectedClinicID, widget.projectID, false, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { if (res['FreeTimeSlots'].length != 0) { diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index d057dcbb..b85ec599 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -257,7 +257,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getDoctorFreeSlots(int docID, int clinicID, int projectID, BuildContext context, [ProjectViewModel projectViewModel]) async { + Future getDoctorFreeSlots(int docID, int clinicID, int projectID, bool isContinueDentalPlan, BuildContext context, [ProjectViewModel projectViewModel]) async { Map request; Request req = appGlobal.getPublicRequest(); @@ -277,7 +277,8 @@ class DoctorsListService extends BaseService { "SessionID": null, "isDentalAllowedBackend": false, "LanguageID": 1, - "DeviceTypeID": 1 + "DeviceTypeID": 1, + "ContinueDentalPlan": isContinueDentalPlan, }; if (clinicID == 253) { diff --git a/lib/services/clinic_services/get_clinic_service.dart b/lib/services/clinic_services/get_clinic_service.dart index 80032015..8b1098e6 100644 --- a/lib/services/clinic_services/get_clinic_service.dart +++ b/lib/services/clinic_services/get_clinic_service.dart @@ -61,7 +61,7 @@ class ClinicListService extends BaseService { return Future.value(localRes); } - Future getChiefComplaintsList(int clinicID, int projectID, int languageID, BuildContext context, {doctorId}) async { + Future getChiefComplaintsList(int clinicID, int projectID, int languageID, bool isContinueDentalPlan, BuildContext context, {doctorId}) async { //Utils.showProgressDialog(context); Map request; @@ -86,8 +86,8 @@ class ClinicListService extends BaseService { "SessionID": null, "isDentalAllowedBackend": true, "DeviceTypeID": 1, - "PatientID": 1, - "ContinueDentalPlan": true, + // "PatientID": 1, + "ContinueDentalPlan": isContinueDentalPlan, "IsSearchAppointmnetByClinicID": false, "DateofBirth": authUser.dateofBirth };