From 3eb7a4325b448f67a8a4aaa911c741c40a09f148 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 3 Feb 2022 14:50:14 +0300 Subject: [PATCH] updates & fixes --- lib/config/config.dart | 5 +- lib/core/service/client/base_app_client.dart | 16 ++-- .../SearchResults_BACKUP_53339.dart | 74 ------------------- .../SearchResults_BASE_53339.dart | 66 ----------------- .../SearchResults_LOCAL_53339.dart | 74 ------------------- .../SearchResults_REMOTE_53339.dart | 66 ----------------- lib/pages/ToDoList/ToDo.dart | 29 ++++++++ .../appointment_services/GetDoctorsList.dart | 37 ++++++++++ lib/widgets/in_app_browser/InAppBrowser.dart | 8 +- 9 files changed, 82 insertions(+), 293 deletions(-) delete mode 100644 lib/pages/BookAppointment/SearchResults_BACKUP_53339.dart delete mode 100644 lib/pages/BookAppointment/SearchResults_BASE_53339.dart delete mode 100644 lib/pages/BookAppointment/SearchResults_LOCAL_53339.dart delete mode 100644 lib/pages/BookAppointment/SearchResults_REMOTE_53339.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index bdf1dffb..78bd9baf 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -259,7 +259,10 @@ const GET_PATIENT_SHARE = //URL to get patient appointment history const GET_PATIENT_APPOINTMENT_HISTORY = - "Services/Doctors.svc/REST/PateintHasAppoimentHistory_Async"; + "Services/Doctors.svc/REST/PateintHasAppoimentHistory"; + +const GET_OBGYNE_ORDERS_LIST = + "services/Patients.svc/REST/HIS_OBGYNEProcedureGet"; const DOCTOR_SCHEDULE_URL = 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable'; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 01050271..7ffe9d9d 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -122,14 +122,14 @@ class BaseAppClient { } } - // body['IdentificationNo'] = 2076117163; - // body['MobileNo'] = "966503109207"; - // body['PatientID'] = 3648586; //3844083 - // body['TokenID'] = "@dm!n"; - - // Patient ID: 2478442 - // Mobile no.: 0503109207 - // ID: 2076117163 + // body['IdentificationNo'] = 119116817; + // body['MobileNo'] = "9665023032857"; + body['PatientID'] = 1018977; //3844083 + body['TokenID'] = "@dm!n"; + + // Patient ID: 3027574 + // Mobile no.: 0502303285 + // ID: 119116817 body.removeWhere((key, value) => key == null || value == null); diff --git a/lib/pages/BookAppointment/SearchResults_BACKUP_53339.dart b/lib/pages/BookAppointment/SearchResults_BACKUP_53339.dart deleted file mode 100644 index ba35a0f3..00000000 --- a/lib/pages/BookAppointment/SearchResults_BACKUP_53339.dart +++ /dev/null @@ -1,74 +0,0 @@ -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; -import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; -import 'package:diplomaticquarterapp/theme/colors.dart'; -// import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; - -class SearchResults extends StatefulWidget { - List doctorsList = []; - List patientDoctorAppointmentListHospital; - bool isLiveCareAppointment; - - SearchResults({@required this.doctorsList, this.patientDoctorAppointmentListHospital, @required this.isLiveCareAppointment}); - - @override - _SearchResultsState createState() => _SearchResultsState(); -} - -class _SearchResultsState extends State { - // var event = RobotProvider(); - List tempList = []; - ProjectViewModel projectViewModel; - - @override - Widget build(BuildContext context) { - projectViewModel = Provider.of(context); - return AppScaffold( - appBarTitle: TranslationBase.of(context).bookAppo, - isShowDecPage: false, - isShowAppBar: true, - showNewAppBarTitle: true, - showNewAppBar: true, - backgroundColor: CustomColors.appBackgroudGrey2Color, - body: ListView.separated( - physics: BouncingScrollPhysics(), - separatorBuilder: (context, index) { - return Container( - height: 12, - margin: EdgeInsets.only(left: 21, right: 21), - // color: Color(0xffD9D9D9), - ); - }, - itemBuilder: (context, index) { - return AppExpandableNotifier( - title: (widget.patientDoctorAppointmentListHospital[index].distanceInKMs != "0") ? widget.patientDoctorAppointmentListHospital[index].filterName + " - " + widget.patientDoctorAppointmentListHospital[index].distanceInKMs + " " + TranslationBase.of(context).km : widget.patientDoctorAppointmentListHospital[index].filterName, - isTitleSingleLine: false, - bodyWidget: ListView.separated( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - padding: EdgeInsets.only(bottom: 10, top: 10, left: 21, right: 21), - itemBuilder: (context, _index) { - //widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index].speciality = null; - final doctor = widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index]; - return DoctorView( - doctor: doctor, - isLiveCareAppointment: widget.isLiveCareAppointment, - onTap: (){ - projectViewModel.analytics.appointment.book_appointment_select_doctor(appointment_type: 'regular', doctor: doctor); - } - ); - }, - separatorBuilder: (context, index) => SizedBox(height: 14), - itemCount: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList.length), - ); - }, - itemCount: widget.patientDoctorAppointmentListHospital.length, - ), - ); - } -} diff --git a/lib/pages/BookAppointment/SearchResults_BASE_53339.dart b/lib/pages/BookAppointment/SearchResults_BASE_53339.dart deleted file mode 100644 index 0a654e22..00000000 --- a/lib/pages/BookAppointment/SearchResults_BASE_53339.dart +++ /dev/null @@ -1,66 +0,0 @@ -import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; -import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; -import 'package:diplomaticquarterapp/theme/colors.dart'; -// import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:flutter/material.dart'; - -class SearchResults extends StatefulWidget { - List doctorsList = []; - List patientDoctorAppointmentListHospital; - bool isLiveCareAppointment; - - SearchResults({@required this.doctorsList, this.patientDoctorAppointmentListHospital, @required this.isLiveCareAppointment}); - - @override - _SearchResultsState createState() => _SearchResultsState(); -} - -class _SearchResultsState extends State { - // var event = RobotProvider(); - List tempList = []; - - @override - Widget build(BuildContext context) { - return AppScaffold( - appBarTitle: TranslationBase.of(context).bookAppo, - isShowDecPage: false, - isShowAppBar: true, - showNewAppBarTitle: true, - showNewAppBar: true, - backgroundColor: CustomColors.appBackgroudGrey2Color, - body: ListView.separated( - physics: BouncingScrollPhysics(), - separatorBuilder: (context, index) { - return Container( - height: 12, - margin: EdgeInsets.only(left: 21, right: 21), - // color: Color(0xffD9D9D9), - ); - }, - itemBuilder: (context, index) { - return AppExpandableNotifier( - title: (widget.patientDoctorAppointmentListHospital[index].distanceInKMs != "0") ? widget.patientDoctorAppointmentListHospital[index].filterName + " - " + widget.patientDoctorAppointmentListHospital[index].distanceInKMs + " " + TranslationBase.of(context).km : widget.patientDoctorAppointmentListHospital[index].filterName, - isTitleSingleLine: false, - bodyWidget: ListView.separated( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - padding: EdgeInsets.only(bottom: 10, top: 10, left: 21, right: 21), - itemBuilder: (context, _index) { - //widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index].speciality = null; - return DoctorView( - doctor: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index], - isLiveCareAppointment: widget.isLiveCareAppointment, - ); - }, - separatorBuilder: (context, index) => SizedBox(height: 14), - itemCount: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList.length), - ); - }, - itemCount: widget.patientDoctorAppointmentListHospital.length, - ), - ); - } -} diff --git a/lib/pages/BookAppointment/SearchResults_LOCAL_53339.dart b/lib/pages/BookAppointment/SearchResults_LOCAL_53339.dart deleted file mode 100644 index ba35a0f3..00000000 --- a/lib/pages/BookAppointment/SearchResults_LOCAL_53339.dart +++ /dev/null @@ -1,74 +0,0 @@ -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; -import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; -import 'package:diplomaticquarterapp/theme/colors.dart'; -// import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; - -class SearchResults extends StatefulWidget { - List doctorsList = []; - List patientDoctorAppointmentListHospital; - bool isLiveCareAppointment; - - SearchResults({@required this.doctorsList, this.patientDoctorAppointmentListHospital, @required this.isLiveCareAppointment}); - - @override - _SearchResultsState createState() => _SearchResultsState(); -} - -class _SearchResultsState extends State { - // var event = RobotProvider(); - List tempList = []; - ProjectViewModel projectViewModel; - - @override - Widget build(BuildContext context) { - projectViewModel = Provider.of(context); - return AppScaffold( - appBarTitle: TranslationBase.of(context).bookAppo, - isShowDecPage: false, - isShowAppBar: true, - showNewAppBarTitle: true, - showNewAppBar: true, - backgroundColor: CustomColors.appBackgroudGrey2Color, - body: ListView.separated( - physics: BouncingScrollPhysics(), - separatorBuilder: (context, index) { - return Container( - height: 12, - margin: EdgeInsets.only(left: 21, right: 21), - // color: Color(0xffD9D9D9), - ); - }, - itemBuilder: (context, index) { - return AppExpandableNotifier( - title: (widget.patientDoctorAppointmentListHospital[index].distanceInKMs != "0") ? widget.patientDoctorAppointmentListHospital[index].filterName + " - " + widget.patientDoctorAppointmentListHospital[index].distanceInKMs + " " + TranslationBase.of(context).km : widget.patientDoctorAppointmentListHospital[index].filterName, - isTitleSingleLine: false, - bodyWidget: ListView.separated( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - padding: EdgeInsets.only(bottom: 10, top: 10, left: 21, right: 21), - itemBuilder: (context, _index) { - //widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index].speciality = null; - final doctor = widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index]; - return DoctorView( - doctor: doctor, - isLiveCareAppointment: widget.isLiveCareAppointment, - onTap: (){ - projectViewModel.analytics.appointment.book_appointment_select_doctor(appointment_type: 'regular', doctor: doctor); - } - ); - }, - separatorBuilder: (context, index) => SizedBox(height: 14), - itemCount: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList.length), - ); - }, - itemCount: widget.patientDoctorAppointmentListHospital.length, - ), - ); - } -} diff --git a/lib/pages/BookAppointment/SearchResults_REMOTE_53339.dart b/lib/pages/BookAppointment/SearchResults_REMOTE_53339.dart deleted file mode 100644 index e4744c4e..00000000 --- a/lib/pages/BookAppointment/SearchResults_REMOTE_53339.dart +++ /dev/null @@ -1,66 +0,0 @@ -import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; -import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; -import 'package:diplomaticquarterapp/theme/colors.dart'; -// import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:flutter/material.dart'; - -class SearchResults extends StatefulWidget { - List doctorsList = []; - List patientDoctorAppointmentListHospital; - bool isLiveCareAppointment; - - SearchResults({@required this.doctorsList, this.patientDoctorAppointmentListHospital, @required this.isLiveCareAppointment}); - - @override - _SearchResultsState createState() => _SearchResultsState(); -} - -class _SearchResultsState extends State { - // var event = RobotProvider(); - List tempList = []; - - @override - Widget build(BuildContext context) { - return AppScaffold( - appBarTitle: TranslationBase.of(context).bookAppo, - isShowDecPage: false, - isShowAppBar: true, - showNewAppBarTitle: true, - showNewAppBar: true, - backgroundColor: CustomColors.appBackgroudGrey2Color, - body: ListView.separated( - physics: BouncingScrollPhysics(), - separatorBuilder: (context, index) { - return Container( - height: 12, - margin: EdgeInsets.only(left: 21, right: 21), - // color: Color(0xffD9D9D9), - ); - }, - itemBuilder: (context, index) { - return AppExpandableNotifier( - title: (widget.patientDoctorAppointmentListHospital[index].distanceInKMs != "0") ? widget.patientDoctorAppointmentListHospital[index].filterName + " - " + widget.patientDoctorAppointmentListHospital[index].distanceInKMs + " " + TranslationBase.of(context).km : widget.patientDoctorAppointmentListHospital[index].filterName, - isTitleSingleLine: false, - bodyWidget: ListView.separated( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - padding: EdgeInsets.only(bottom: 10, top: 10, left: 21, right: 21), - itemBuilder: (context, _index) { - //widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index].speciality = null; - return DoctorView( - doctor: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index], - isLiveCareAppointment: widget.isLiveCareAppointment ?? widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index].isLiveCare, - ); - }, - separatorBuilder: (context, index) => SizedBox(height: 14), - itemCount: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList.length), - ); - }, - itemCount: widget.patientDoctorAppointmentListHospital.length, - ), - ); - } -} diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 2a9b8e1b..8ba1139a 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -491,6 +491,34 @@ class _ToDoState extends State { }); } + getOBGyneOrdersList() { + DoctorsListService service = new DoctorsListService(); + + service.getOBGyneOrdersList(context).then((res) { + print(res['HIS_OBGYNEProcedureGet_List']); + // widget.appoList.clear(); + // GifLoaderDialogUtils.hideDialog(context); + // if (res['MessageStatus'] == 1) { + // setState(() { + // if (res['AppoimentAllHistoryResultList'].length != 0) { + // widget.appoList.clear(); + // res['AppoimentAllHistoryResultList'].forEach((v) { + // widget.appoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); + // }); + // } else { + // Navigator.of(context).popAndPushNamed(HOME); + // } + // }); + // } else { + // AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + // } + }).catchError((err) { + print(err); + // GifLoaderDialogUtils.hideDialog(context); + // err != null ?? AppToast.showErrorToast(message: err); + }); + } + getPatientAppointmentHistory() { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); @@ -508,6 +536,7 @@ class _ToDoState extends State { Navigator.of(context).popAndPushNamed(HOME); } }); + getOBGyneOrdersList(); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 139d847c..d42fbe3a 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -502,6 +502,43 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } + Future getOBGyneOrdersList(BuildContext context) async { + Map request; + + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + + request = { + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "ProjectID": 15, + "generalid": req.generalid, + "PatientOutSA": 0, + "SessionID": "YckwoXhUmWBsnHKEKig", + "isDentalAllowedBackend": false, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": authUser.patientID, + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType + }; + + dynamic localRes; + + await baseAppClient.post(GET_OBGYNE_ORDERS_LIST, 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; diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 960b6224..66b9a342 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -31,13 +31,13 @@ class MyInAppBrowser extends InAppBrowser { // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWeb/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE - static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT + // static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT - // static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store + static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID=';