From 3401496739a30c4f1b0797c55ce0468c04dd714c Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 2 Jan 2024 14:16:10 +0300 Subject: [PATCH 01/13] Updates & fixes --- .../xcshareddata/xcschemes/Runner.xcscheme | 97 ------------------- lib/core/service/client/base_app_client.dart | 10 +- .../medical/ask_doctor_view_model.dart | 12 ++- lib/pages/DrawerPages/family/my-family.dart | 51 +++++----- lib/pages/MyAppointments/MyAppointments.dart | 1 - .../family_files/family_files_provider.dart | 2 +- lib/widgets/drawer/app_drawer_widget.dart | 2 +- 7 files changed, 40 insertions(+), 135 deletions(-) delete mode 100644 ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index ea96fe5f..00000000 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index c234304f..43b0a9b1 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -75,9 +75,13 @@ class BaseAppClient { body['Channel'] = CHANNEL; if (body.containsKey('LanguageID')) { - if(body['LanguageID'] != null) { + if (body['LanguageID'] != null) { //change this line because language issue happened on dental - body['LanguageID'] = body['LanguageID'] =='ar' ? 1 : body['LanguageID'] =='en' ? 2 : body['LanguageID']; + body['LanguageID'] = body['LanguageID'] == 'ar' + ? 1 + : body['LanguageID'] == 'en' + ? 2 + : body['LanguageID']; } else { body['LanguageID'] = Provider.of(AppGlobal.context, listen: false).isArabic ? 1 : 2; } @@ -716,7 +720,7 @@ class BaseAppClient { String getSessionId(String id) { ///return id.replaceAll(RegExp('/[^\w\s]/'), ''); - return id.replaceAll(RegExp('/[^a-zA-Z]'), ''); + if (id != null) return id.replaceAll(RegExp('/[^a-zA-Z]'), ''); } static defaultHttpParameters() async { diff --git a/lib/core/viewModels/medical/ask_doctor_view_model.dart b/lib/core/viewModels/medical/ask_doctor_view_model.dart index abe2220c..9f8d9862 100644 --- a/lib/core/viewModels/medical/ask_doctor_view_model.dart +++ b/lib/core/viewModels/medical/ask_doctor_view_model.dart @@ -28,12 +28,14 @@ class AskDoctorViewModel extends BaseViewModel { setState(ViewState.Error); } else if (_myDoctorService.patientDoctorAppointmentList.length != 0) { _myDoctorService.patientDoctorAppointmentList.forEach((element) { - List doctorByClinic = patientDoctorAppointmentListHospital.where((elementClinic) => elementClinic.filterName == element.projectName).toList(); + if (!element.isLiveCareClinic) { + List doctorByClinic = patientDoctorAppointmentListHospital.where((elementClinic) => elementClinic.filterName == element.projectName).toList(); - if (doctorByClinic.length != 0) { - patientDoctorAppointmentListHospital[patientDoctorAppointmentListHospital.indexOf(doctorByClinic[0])].patientDoctorAppointmentList.add(element); - } else { - patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, patientDoctorAppointment: element)); + if (doctorByClinic.length != 0) { + patientDoctorAppointmentListHospital[patientDoctorAppointmentListHospital.indexOf(doctorByClinic[0])].patientDoctorAppointmentList.add(element); + } else { + patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, patientDoctorAppointment: element)); + } } setState(ViewState.Idle); }); diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index 9feb62ec..ef6f5e3d 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -341,8 +341,8 @@ class _MyFamily extends State with TickerProviderStateMixin { return requestDecoratedContainerWithExpandable( TranslationBase.of(context).sentRequest, [ - Expanded(flex: 4, child: columnText(TranslationBase.of(context).name)), - Expanded(flex: 2, child: columnText(TranslationBase.of(context).status)), + Expanded(flex: 3, child: columnText(TranslationBase.of(context).name)), + Expanded(flex: 1, child: columnText(TranslationBase.of(context).status)), ], sentRecordsList.map((result) { return sentItemView(result); @@ -351,29 +351,26 @@ class _MyFamily extends State with TickerProviderStateMixin { Widget sentItemView(GetAllSharedRecordsByStatusList result) { return Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Expanded(flex: 2, child: rowText(result.patientName)), + Expanded(flex: 3, child: rowText(result.patientName)), Expanded( flex: 1, - child: Row( - children: [ - Container( - padding: EdgeInsets.only(top: 3, bottom: 3, left: 8, right: 8), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(50), - color: result.status == 3 ? Color(0xff349745) : Color(0xffD02127), - ), - child: Text( - result.statusDescription != null ? result.statusDescription : "", - style: TextStyle( - fontSize: 10, - color: Colors.white, - letterSpacing: -0.4, - fontWeight: FontWeight.w600, - ), - ), + child: Container( + padding: EdgeInsets.only(top: 3, bottom: 3, left: 8, right: 8), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(50), + color: result.status == 3 ? Color(0xff349745) : Color(0xffD02127), + ), + child: Text( + result.statusDescription != null ? result.statusDescription : "", + style: TextStyle( + fontSize: 10, + color: Colors.white, + letterSpacing: -0.4, + fontWeight: FontWeight.w600, ), - ], + ), ), ), ], @@ -553,6 +550,7 @@ class _MyFamily extends State with TickerProviderStateMixin { List sentRecordsList = []; Future getFamilyFiles() async { + int languageID = projectViewModel.isArabic ? 1 : 2; GetAllSharedRecordsByStatusResponse familySharedRecords; if (await sharedPref.getObject(FAMILY_FILE) != null) { familySharedRecords = GetAllSharedRecordsByStatusResponse.fromJson(await sharedPref.getObject(FAMILY_FILE)); @@ -560,7 +558,6 @@ class _MyFamily extends State with TickerProviderStateMixin { GifLoaderDialogUtils.showMyDialog(context); try { if (familySharedRecords == null) { - int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; familySharedRecords = await familyFileProvider.getSharedRecordByStatus(languageID); } familySharedRecordsList =[]; @@ -573,7 +570,7 @@ class _MyFamily extends State with TickerProviderStateMixin { }); approvedRecordsList = []; pendingRecordsList = []; - GetAllSharedRecordsByStatusResponse pendingAndApprovedRecords = await getUserViewRequest(); + GetAllSharedRecordsByStatusResponse pendingAndApprovedRecords = await getUserViewRequest(languageID); pendingAndApprovedRecords.getAllSharedRecordsByStatusList.forEach((element) { print(element.toJson()); @@ -589,9 +586,9 @@ class _MyFamily extends State with TickerProviderStateMixin { GifLoaderDialogUtils.hideDialog(context); } - Future getUserViewRequest() async { + Future getUserViewRequest(int languageID) async { var user = await sharedPref.getObject(USER_PROFILE); - return familyFileProvider.getUserViewRequest(user['PatientID']); + return familyFileProvider.getUserViewRequest(user['PatientID'], languageID); } Future getSentRequest() async { @@ -617,7 +614,7 @@ class _MyFamily extends State with TickerProviderStateMixin { Widget columnText(String title) { return Text( title, - textAlign: TextAlign.left, + // textAlign: TextAlign.left, style: TextStyle( fontSize: 12, color: CustomColors.textDarkColor, @@ -630,7 +627,7 @@ class _MyFamily extends State with TickerProviderStateMixin { Widget rowText(String title) { return Text( title, - textAlign: TextAlign.left, + // textAlign: TextAlign.left, style: TextStyle( fontSize: 10, color: CustomColors.textColor, diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index 072c622e..b1477b77 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -501,7 +501,6 @@ class _MyAppointmentsState extends State with SingleTickerProvid getPatientAppointmentHistory(false, true); } }); - //_pageController.animateToPage(index, duration: Duration(milliseconds: 250), curve: Curves.easeInOut); }, ), ), diff --git a/lib/services/family_files/family_files_provider.dart b/lib/services/family_files/family_files_provider.dart index 4b8b31ad..f209812e 100644 --- a/lib/services/family_files/family_files_provider.dart +++ b/lib/services/family_files/family_files_provider.dart @@ -61,7 +61,7 @@ class FamilyFilesProvider with ChangeNotifier { } } - Future getUserViewRequest(responseID) async { + Future getUserViewRequest(responseID, int languageID) async { try { dynamic localRes; Map request = {}; diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 8f3cf40c..af6cd03f 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -669,7 +669,7 @@ class _AppDrawerState extends State { }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); print(err); - AppToast.showErrorToast(message: err.toString()); + // AppToast.showErrorToast(message: err.toString()); Navigator.of(context).pop(); }); } From 27b6e04d33421823191cb5839c3f0f8766b49df9 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 2 Jan 2024 14:35:26 +0300 Subject: [PATCH 02/13] updates --- ios/Runner.xcodeproj/project.pbxproj | 6 +++--- lib/config/config.dart | 4 ++-- pubspec.yaml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index c3e46b58..db84daa7 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -540,7 +540,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.5.75; + MARKETING_VERSION = 4.5.77; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -684,7 +684,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.5.75; + MARKETING_VERSION = 4.5.77; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -722,7 +722,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.5.75; + MARKETING_VERSION = 4.5.77; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/lib/config/config.dart b/lib/config/config.dart index 7652d6f0..128264a2 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,8 +20,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/pubspec.yaml b/pubspec.yaml index 58c83fe0..8fb7faae 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.037+4050037 +version: 4.5.040+4050040 environment: sdk: ">=2.7.0 <3.0.0" From 75bfeaa71656b890003df5bb48c92855d4c0b4bb Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 2 Jan 2024 17:00:05 +0300 Subject: [PATCH 03/13] My appointment fixes --- lib/core/service/client/base_app_client.dart | 6 +- lib/pages/MyAppointments/MyAppointments.dart | 132 ++++++++++--------- lib/widgets/drawer/app_drawer_widget.dart | 2 +- 3 files changed, 75 insertions(+), 65 deletions(-) diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 43b0a9b1..d6b88e33 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -158,7 +158,8 @@ class BaseAppClient { ? body['PatientOutSA'] : user['OutSA'] : user['OutSA']; - body['SessionID'] = getSessionId(body['TokenID']); //getSe + body['SessionID'] = getSessionId(body['TokenID'] != null ? body['TokenID'] : ""); //getSe + // body['SessionID'] = body['TokenID']; //getSe headers = { 'Content-Type': 'application/json', @@ -720,7 +721,8 @@ class BaseAppClient { String getSessionId(String id) { ///return id.replaceAll(RegExp('/[^\w\s]/'), ''); - if (id != null) return id.replaceAll(RegExp('/[^a-zA-Z]'), ''); + // if (id != null) return id.replaceAll(RegExp('/[^a-zA-Z]'), ''); + return id.replaceAll(RegExp('/[^a-zA-Z]'), ''); } static defaultHttpParameters() async { diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index b1477b77..3d0eb15f 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -25,6 +25,11 @@ import 'package:provider/provider.dart'; import 'AppointmentDetails.dart'; class MyAppointments extends StatefulWidget { + @override + _MyAppointmentsState createState() => _MyAppointmentsState(); +} + +class _MyAppointmentsState extends State with SingleTickerProviderStateMixin { List upcomingAppoList = []; List arrivedAppoListNew = []; @@ -43,11 +48,6 @@ class MyAppointments extends StatefulWidget { List _patientBookedAndConfirmedAppointmentListHospital = List(); List _patientBookedAndConfirmedAppointmentListClinic = List(); - @override - _MyAppointmentsState createState() => _MyAppointmentsState(); -} - -class _MyAppointmentsState extends State with SingleTickerProviderStateMixin { bool isDataLoaded = false; var sharedPref = new AppSharedPreferences(); AuthenticatedUserObject authenticatedUserObject = locator(); @@ -145,23 +145,23 @@ class _MyAppointmentsState extends State with SingleTickerProvid GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - widget.upcomingAppoList.clear(); - widget.arrivedAppoListNew.clear(); + upcomingAppoList.clear(); + arrivedAppoListNew.clear(); - widget.bookedAppoList.clear(); - widget.confirmedAppoList.clear(); - widget.arrivedAppoList.clear(); + bookedAppoList.clear(); + confirmedAppoList.clear(); + arrivedAppoList.clear(); - widget._patientBookedAppointmentListHospital.clear(); - widget._patientConfirmedAppointmentListHospital.clear(); - widget._patientArrivedAppointmentListHospital.clear(); + _patientBookedAppointmentListHospital.clear(); + _patientConfirmedAppointmentListHospital.clear(); + _patientArrivedAppointmentListHospital.clear(); - widget._patientBookedAppointmentListClinic.clear(); - widget._patientConfirmedAppointmentListClinic.clear(); - widget._patientArrivedAppointmentListClinic.clear(); + _patientBookedAppointmentListClinic.clear(); + _patientConfirmedAppointmentListClinic.clear(); + _patientArrivedAppointmentListClinic.clear(); - widget._patientBookedAndConfirmedAppointmentListHospital.clear(); - widget._patientBookedAndConfirmedAppointmentListClinic.clear(); + _patientBookedAndConfirmedAppointmentListHospital.clear(); + _patientBookedAndConfirmedAppointmentListClinic.clear(); service.getPatientAppointmentHistory(false, languageID, context, isForUpcomming: isForUpcoming, IsForArrived: isForArrived).then((res) { GifLoaderDialogUtils.hideDialog(context); @@ -170,9 +170,9 @@ class _MyAppointmentsState extends State with SingleTickerProvid if (res['AppoimentAllHistoryResultList'].length != 0) { res['AppoimentAllHistoryResultList'].forEach((v) { if (isForArrived) { - widget.arrivedAppoListNew.add(new AppoitmentAllHistoryResultList.fromJson(v)); + arrivedAppoListNew.add(new AppoitmentAllHistoryResultList.fromJson(v)); } else { - widget.upcomingAppoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); + upcomingAppoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); } }); sortAppointmentList(isForUpcoming, isForArrived); @@ -217,118 +217,118 @@ class _MyAppointmentsState extends State with SingleTickerProvid sortAppointmentList(bool isForUpcoming, bool isForArrived) { if (isForArrived) { - widget.arrivedAppoListNew.forEach((v) { + arrivedAppoListNew.forEach((v) { if (isBooked(v)) { - widget.bookedAppoList.add(v); + bookedAppoList.add(v); } if (isConfirmed(v)) { - widget.confirmedAppoList.add(v); + confirmedAppoList.add(v); } if (isArrived(v)) { - widget.arrivedAppoList.add(v); + arrivedAppoList.add(v); } }); } else { - widget.upcomingAppoList.forEach((v) { + upcomingAppoList.forEach((v) { if (isBooked(v)) { - widget.bookedAppoList.add(v); + bookedAppoList.add(v); } if (isConfirmed(v)) { - widget.confirmedAppoList.add(v); + confirmedAppoList.add(v); } if (isArrived(v)) { - widget.arrivedAppoList.add(v); + arrivedAppoList.add(v); } }); } - widget.bookedAppoList.forEach((element) { - List doctorByClinic = widget._patientBookedAppointmentListClinic + bookedAppoList.forEach((element) { + List doctorByClinic = _patientBookedAppointmentListClinic .where( (elementClinic) => elementClinic.filterName == element.clinicName, ) .toList(); if (doctorByClinic.length != 0) { - widget._patientBookedAppointmentListClinic[widget._patientBookedAppointmentListClinic.indexOf(doctorByClinic[0])].patientDoctorAppointmentList.add(element); + _patientBookedAppointmentListClinic[_patientBookedAppointmentListClinic.indexOf(doctorByClinic[0])].patientDoctorAppointmentList.add(element); } else { - widget._patientBookedAppointmentListClinic.add(PatientAppointmentList(filterName: element.clinicName, patientDoctorAppointment: element)); + _patientBookedAppointmentListClinic.add(PatientAppointmentList(filterName: element.clinicName, patientDoctorAppointment: element)); } - List doctorByHospital = widget._patientBookedAppointmentListHospital + List doctorByHospital = _patientBookedAppointmentListHospital .where( (elementClinic) => elementClinic.filterName == element.projectName, ) .toList(); if (doctorByHospital.length != 0) { - widget._patientBookedAppointmentListHospital[widget._patientBookedAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); + _patientBookedAppointmentListHospital[_patientBookedAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); } else { - widget._patientBookedAppointmentListHospital.add(PatientAppointmentList(filterName: element.projectName, patientDoctorAppointment: element)); + _patientBookedAppointmentListHospital.add(PatientAppointmentList(filterName: element.projectName, patientDoctorAppointment: element)); } //Merging Booked & Confirmed Appointments into Upcoming Tab - widget._patientBookedAndConfirmedAppointmentListHospital.addAll(widget._patientBookedAppointmentListHospital); - widget._patientBookedAndConfirmedAppointmentListClinic.addAll(widget._patientBookedAppointmentListClinic); + _patientBookedAndConfirmedAppointmentListHospital.addAll(_patientBookedAppointmentListHospital); + _patientBookedAndConfirmedAppointmentListClinic.addAll(_patientBookedAppointmentListClinic); }); - widget.confirmedAppoList.forEach((element) { - List doctorByClinic = widget._patientConfirmedAppointmentListClinic + confirmedAppoList.forEach((element) { + List doctorByClinic = _patientConfirmedAppointmentListClinic .where( (elementClinic) => elementClinic.filterName == element.clinicName, ) .toList(); if (doctorByClinic.length != 0) { - widget._patientConfirmedAppointmentListClinic[widget._patientConfirmedAppointmentListClinic.indexOf(doctorByClinic[0])].patientDoctorAppointmentList.add(element); + _patientConfirmedAppointmentListClinic[_patientConfirmedAppointmentListClinic.indexOf(doctorByClinic[0])].patientDoctorAppointmentList.add(element); } else { - widget._patientConfirmedAppointmentListClinic.add(PatientAppointmentList(filterName: element.clinicName, patientDoctorAppointment: element)); + _patientConfirmedAppointmentListClinic.add(PatientAppointmentList(filterName: element.clinicName, patientDoctorAppointment: element)); } - List doctorByHospital = widget._patientConfirmedAppointmentListHospital + List doctorByHospital = _patientConfirmedAppointmentListHospital .where( (elementClinic) => elementClinic.filterName == element.projectName, ) .toList(); if (doctorByHospital.length != 0) { - widget._patientConfirmedAppointmentListHospital[widget._patientConfirmedAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); + _patientConfirmedAppointmentListHospital[_patientConfirmedAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); } else { - widget._patientConfirmedAppointmentListHospital.add(PatientAppointmentList(filterName: element.projectName, patientDoctorAppointment: element)); + _patientConfirmedAppointmentListHospital.add(PatientAppointmentList(filterName: element.projectName, patientDoctorAppointment: element)); } //Merging Booked & Confirmed Appointments into Upcoming Tab - widget._patientBookedAndConfirmedAppointmentListHospital.addAll(widget._patientConfirmedAppointmentListHospital); - widget._patientBookedAndConfirmedAppointmentListClinic.addAll(widget._patientConfirmedAppointmentListClinic); + _patientBookedAndConfirmedAppointmentListHospital.addAll(_patientConfirmedAppointmentListHospital); + _patientBookedAndConfirmedAppointmentListClinic.addAll(_patientConfirmedAppointmentListClinic); }); - widget.arrivedAppoList.forEach((element) { - List doctorByClinic = widget._patientArrivedAppointmentListClinic + arrivedAppoList.forEach((element) { + List doctorByClinic = _patientArrivedAppointmentListClinic .where( (elementClinic) => elementClinic.filterName == element.clinicName, ) .toList(); if (doctorByClinic.length != 0) { - widget._patientArrivedAppointmentListClinic[widget._patientArrivedAppointmentListClinic.indexOf(doctorByClinic[0])].patientDoctorAppointmentList.add(element); + _patientArrivedAppointmentListClinic[_patientArrivedAppointmentListClinic.indexOf(doctorByClinic[0])].patientDoctorAppointmentList.add(element); } else { - widget._patientArrivedAppointmentListClinic.add(PatientAppointmentList(filterName: element.clinicName, patientDoctorAppointment: element)); + _patientArrivedAppointmentListClinic.add(PatientAppointmentList(filterName: element.clinicName, patientDoctorAppointment: element)); } - List doctorByHospital = widget._patientArrivedAppointmentListHospital + List doctorByHospital = _patientArrivedAppointmentListHospital .where( (elementClinic) => elementClinic.filterName == element.projectName, ) .toList(); if (doctorByHospital.length != 0) { - widget._patientArrivedAppointmentListHospital[widget._patientArrivedAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); + _patientArrivedAppointmentListHospital[_patientArrivedAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); } else { - widget._patientArrivedAppointmentListHospital.add(PatientAppointmentList(filterName: element.projectName, patientDoctorAppointment: element)); + _patientArrivedAppointmentListHospital.add(PatientAppointmentList(filterName: element.projectName, patientDoctorAppointment: element)); } // openAppointmentsTab(); @@ -345,11 +345,11 @@ class _MyAppointmentsState extends State with SingleTickerProvid } else if (flag == 3) { index = 2; } else { - if (widget._patientBookedAppointmentListClinic.length != 0) { + if (_patientBookedAppointmentListClinic.length != 0) { index = 0; - } else if (widget._patientConfirmedAppointmentListClinic.length != 0) { + } else if (_patientConfirmedAppointmentListClinic.length != 0) { index = 1; - } else if (widget._patientArrivedAppointmentListClinic.length != 0) { + } else if (_patientArrivedAppointmentListClinic.length != 0) { index = 2; // return; } @@ -359,12 +359,12 @@ class _MyAppointmentsState extends State with SingleTickerProvid } Widget getBookedAppointments() { - return _getAppointment(widget.bookedAppoList.length, (filterType == FilterType.Clinic) ? widget._patientBookedAppointmentListClinic : widget._patientBookedAppointmentListHospital); + return _getAppointment(bookedAppoList.length, (filterType == FilterType.Clinic) ? _patientBookedAppointmentListClinic : _patientBookedAppointmentListHospital); } Widget getBookedAndConfirmedAppointments() { - return _getAppointment((widget.bookedAppoList.length + widget.confirmedAppoList.length), - (filterType == FilterType.Clinic) ? widget._patientBookedAndConfirmedAppointmentListClinic : widget._patientBookedAndConfirmedAppointmentListHospital); + return _getAppointment( + (bookedAppoList.length + confirmedAppoList.length), (filterType == FilterType.Clinic) ? _patientBookedAndConfirmedAppointmentListClinic : _patientBookedAndConfirmedAppointmentListHospital); } Widget _getAppointment(int _listLength, List _list) { @@ -382,7 +382,9 @@ class _MyAppointmentsState extends State with SingleTickerProvid Container( margin: EdgeInsets.only(top: 10.0), child: Text( - _currentPage == 0 ? TranslationBase.of(context).noBookedAppo : (_currentPage == 1 ? TranslationBase.of(context).noUpcomingAppointment : TranslationBase.of(context).noArrivedAppo), + _currentPage == 0 + ? TranslationBase.of(context).noBookedAppo + : (_currentPage == 1 ? TranslationBase.of(context).noUpcomingAppointment : TranslationBase.of(context).noArrivedAppo), style: TextStyle( fontSize: 16.0, ), @@ -461,11 +463,11 @@ class _MyAppointmentsState extends State with SingleTickerProvid } Widget getConfirmedAppointments() { - return _getAppointment(widget.confirmedAppoList.length, (filterType == FilterType.Clinic) ? widget._patientConfirmedAppointmentListClinic : widget._patientConfirmedAppointmentListHospital); + return _getAppointment(confirmedAppoList.length, (filterType == FilterType.Clinic) ? _patientConfirmedAppointmentListClinic : _patientConfirmedAppointmentListHospital); } Widget getArrivedAppointments() { - return _getAppointment(widget.arrivedAppoList.length, (filterType == FilterType.Clinic) ? widget._patientArrivedAppointmentListClinic : widget._patientArrivedAppointmentListHospital); + return _getAppointment(arrivedAppoList.length, (filterType == FilterType.Clinic) ? _patientArrivedAppointmentListClinic : _patientArrivedAppointmentListHospital); } setFilterType(FilterType filterType) { @@ -479,6 +481,12 @@ class _MyAppointmentsState extends State with SingleTickerProvid onTap: () { setState(() { _currentPage = _value; + if (_value == 1) { + getPatientAppointmentHistory(true, false); + } + if (_value == 2) { + getPatientAppointmentHistory(false, true); + } }); }, child: Row( diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index af6cd03f..89d35885 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -706,7 +706,7 @@ class _AppDrawerState extends State { _vitalSignService.heightCm = ""; _vitalSignService.weightKg = ""; - if (pharmacyModuleViewModel.error.isNotEmpty) await pharmacyModuleViewModel.createUser(); + // if (pharmacyModuleViewModel.error.isNotEmpty) await pharmacyModuleViewModel.createUser(); int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; From e5d8505c2d4791f69a405a6c1e42aabe7ed4f8c6 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 3 Jan 2024 11:08:00 +0300 Subject: [PATCH 04/13] Updates & fixes --- lib/core/service/medical/labs_service.dart | 3 + lib/core/viewModels/er/rrt-view-model.dart | 8 +-- lib/pages/BookAppointment/BookConfirm.dart | 6 +- lib/pages/BookAppointment/BookSuccess.dart | 4 +- lib/pages/BookAppointment/DoctorProfile.dart | 4 +- .../components/LaserClinic.dart | 2 +- .../Covid-DriveThru/Covid-TimeSlots.dart | 4 +- .../rapid-response-team/rrt-main-screen.dart | 2 +- .../rapid-response-team/rrt-request-page.dart | 7 +- .../MyAppointments/AppointmentDetails.dart | 2 +- .../widgets/PrescriptionReport.dart | 8 ++- .../ToDoList/ObGyne/ObGyne-TimeSlots.dart | 4 +- lib/pages/ToDoList/ToDo.dart | 8 +-- lib/pages/medical/eye/EyeHomePage.dart | 5 +- .../appointment_services/GetDoctorsList.dart | 70 +++++++++++++------ lib/widgets/new_design/doctor_header.dart | 2 +- 16 files changed, 90 insertions(+), 49 deletions(-) diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index 1d635c69..8e5ac3b4 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -191,6 +191,8 @@ class LabsService extends BaseService { body['ProjectID'] = patientLabOrder.projectID; body['ClinicID'] = patientLabOrder.clinicID; body['Procedure'] = procedure; + body['Procedure'] = procedure; + body['LanguageID'] = 1; await baseAppClient.post(GET_Patient_LAB_ORDERS_RESULT, onSuccess: (dynamic response, int statusCode) { labOrdersResultsList.clear(); response['ListPLR'].forEach((lab) { @@ -223,6 +225,7 @@ class LabsService extends BaseService { _requestSendLabReportEmail.orderNo = patientLabOrder.orderNo; _requestSendLabReportEmail.isDownload = isDownload; _requestSendLabReportEmail.doctorID = patientLabOrder.doctorID; + _requestSendLabReportEmail.languageID = 1; await baseAppClient.post(SEND_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) { if (isDownload) { diff --git a/lib/core/viewModels/er/rrt-view-model.dart b/lib/core/viewModels/er/rrt-view-model.dart index d615ef98..0ed0cf55 100644 --- a/lib/core/viewModels/er/rrt-view-model.dart +++ b/lib/core/viewModels/er/rrt-view-model.dart @@ -38,10 +38,10 @@ class RRTViewModel extends BaseViewModel { _RRTServiceData rrtServiceData = _RRTServiceData(); - Future<_RRTServiceData> loadRequiredData() async { + Future<_RRTServiceData> loadRequiredData(int languageID) async { // await getServicePrice(); // await getAllOrders(); - await getProcedureDetails(); + await getProcedureDetails(languageID); await getAllOrdersRC(); // getProcedureDetails(); return rrtServiceData; @@ -120,9 +120,9 @@ class RRTViewModel extends BaseViewModel { return rrtServiceData; } - Future<_RRTServiceData> getProcedureDetails() async { + Future<_RRTServiceData> getProcedureDetails(int languageID) async { DoctorsListService service = new DoctorsListService(); - await service.getRRTProcedures(15).then((res) { + await service.getRRTProcedures(15, languageID).then((res) { rrtProcedureList.clear(); var data = res["Vida_ProcedureList"]; data.forEach((json) { diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index 74f7c142..63f58910 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -329,7 +329,7 @@ class _BookConfirmState extends State { GifLoaderDialogUtils.showMyDialog(context); AppoitmentAllHistoryResultList appo; widget.service - .insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, widget.selectedTime, widget.selectedDate, initialSlotDuration, context, null, null, null, projectViewModel) + .insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, widget.selectedTime, widget.selectedDate, initialSlotDuration, projectViewModel.isArabic ? 1 : 2, context, null, null, null, projectViewModel) .then((res) { if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess); @@ -385,7 +385,7 @@ class _BookConfirmState extends State { widget.selectedTime = timeSlot.toUtc().add(Duration(hours: 3)).toString().split(" ")[1].substring(0, 5); GifLoaderDialogUtils.showMyDialog(context); AppoitmentAllHistoryResultList appo; - widget.service.insertLiveCareScheduleAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, docObject.serviceID, widget.selectedTime, widget.selectedDate, context).then((res) { + widget.service.insertLiveCareScheduleAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, docObject.serviceID, widget.selectedTime, widget.selectedDate, projectViewModel.isArabic ? 1 : 2, context).then((res) { if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess); print(res['AppointmentNo']); @@ -489,7 +489,7 @@ class _BookConfirmState extends State { } getLiveCareAppointmentPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) { - widget.service.getLiveCareAppointmentPatientShare(appointmentNo, clinicID, projectID, context).then((res) { + widget.service.getLiveCareAppointmentPatientShare(appointmentNo, clinicID, projectID, projectViewModel.isArabic ? 1 : 2, context).then((res) { widget.patientShareResponse = new PatientShareResponse.fromJson(res); GifLoaderDialogUtils.hideDialog(context); navigateToBookSuccess(context, docObject, widget.patientShareResponse, false); diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index ea0f186b..52113d74 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -493,7 +493,7 @@ class _BookSuccessState extends State { setOnlineCheckInForAppointment() { DoctorsListService service = new DoctorsListService(); GifLoaderDialogUtils.showMyDialog(context); - service.setOnlineCheckInForAppointment(widget.patientShareResponse.appointmentNo.toString(), widget.patientShareResponse.projectID, context).then((res) { + service.setOnlineCheckInForAppointment(widget.patientShareResponse.appointmentNo.toString(), widget.patientShareResponse.projectID, projectViewModel.isArabic ? 1 : 2, context).then((res) { AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); appo.clinicID = widget.docObject.clinicID; appo.projectID = widget.docObject.projectID; @@ -538,7 +538,7 @@ class _BookSuccessState extends State { GifLoaderDialogUtils.showMyDialog(context); service .insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate, - Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context) + Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), projectViewModel.isArabic ? 1 : 2, context) .then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart index 426df212..1ad0bf67 100644 --- a/lib/pages/BookAppointment/DoctorProfile.dart +++ b/lib/pages/BookAppointment/DoctorProfile.dart @@ -234,7 +234,7 @@ class _DoctorProfileState extends State with TickerProviderStateM getDoctorRatings() { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.getDoctorsRating(widget.doctor.doctorID, context).then((res) { + service.getDoctorsRating(widget.doctor.doctorID, projectViewModel.isArabic ? 1 : 2, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { print(res['NotesDoctorRatingList']); @@ -251,7 +251,7 @@ class _DoctorProfileState extends State with TickerProviderStateM getDoctorRatingsDetails() { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.getDoctorsRatingDetails(widget.doctor.doctorID, context).then((res) { + service.getDoctorsRatingDetails(widget.doctor.doctorID, projectViewModel.isArabic ? 1 : 2, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { doctorDetailsList.clear(); diff --git a/lib/pages/BookAppointment/components/LaserClinic.dart b/lib/pages/BookAppointment/components/LaserClinic.dart index c7e32565..61ca55d7 100644 --- a/lib/pages/BookAppointment/components/LaserClinic.dart +++ b/lib/pages/BookAppointment/components/LaserClinic.dart @@ -69,7 +69,7 @@ class _LaserClinicState extends State with SingleTickerProviderStat GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.getLaserBodyPartsList(laserCategoryId, widget.selectedHospital.iD).then((res) { + service.getLaserBodyPartsList(laserCategoryId, widget.selectedHospital.iD, projectViewModel.isArabic ? 1 : 2).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { if (res['Laser_GetBodyPartsByCategoryList'].length != 0) { diff --git a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart index d5c60b20..8acf6efe 100644 --- a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart +++ b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart @@ -412,7 +412,7 @@ class _CovidTimeSlotsState extends State with TickerProviderStat insertCovidQuestionnaire(context, DoctorList docObject) async { DoctorsListService service = new DoctorsListService(); List qa = await sharedPref.getObject(COVID_QA_LIST); - service.insertCovidQuestionnaire(qa, widget.projectID, widget.selectedProject.testTypeEnum, widget.selectedProject.testProcedureEnum).then((res) { + service.insertCovidQuestionnaire(qa, widget.projectID, widget.selectedProject.testTypeEnum, projectViewModel.isArabic ? 1 : 2, widget.selectedProject.testProcedureEnum).then((res) { insertAppointmentCovidTest(context, docObject); }).catchError((err) { print(err); @@ -430,7 +430,7 @@ class _CovidTimeSlotsState extends State with TickerProviderStat DoctorsListService service = new DoctorsListService(); AppoitmentAllHistoryResultList appo; service - .insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, CovidTimeSlots.selectedTime, CovidTimeSlots.selectedDate, 0, context, widget.selectedProcedure.procedureID, + .insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, CovidTimeSlots.selectedTime, CovidTimeSlots.selectedDate, 0, projectViewModel.isArabic ? 1 : 2, context, widget.selectedProcedure.procedureID, widget.selectedProject.testTypeEnum, widget.selectedProject.testProcedureEnum) .then((res) { if (res['MessageStatus'] == 1) { diff --git a/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart b/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart index b56e28d5..ec1d5a23 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart @@ -56,7 +56,7 @@ class RRTMainScreenState extends State with SingleTickerProviderS onModelReady: (vm) async { viewModel = vm; loadingData = true; - await vm.loadRequiredData().then((value) {}).whenComplete(() => setState(() => loadingData = false)); + await vm.loadRequiredData(projectViewModel.isArabic ? 1 : 2).then((value) {}).whenComplete(() => setState(() => loadingData = false)); }, builder: (ctx, vm, widget) => content(), )); diff --git a/lib/pages/ErService/rapid-response-team/rrt-request-page.dart b/lib/pages/ErService/rapid-response-team/rrt-request-page.dart index 8541b859..beada490 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-request-page.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-request-page.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/rrt/RRTProcedureList.dart'; import 'package:diplomaticquarterapp/models/rrt/service_price.dart'; import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-order-list-item.dart'; @@ -16,6 +17,7 @@ import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class RRTRequestPage extends StatefulWidget { final List pendingOrders; @@ -32,6 +34,8 @@ class RRTRequestPageState extends State { bool acceptTerms = false; VidaProcedureList selectedProcedure; + ProjectViewModel projectViewModel; + @override void initState() { // getProcedureDetails(); @@ -40,6 +44,7 @@ class RRTRequestPageState extends State { @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); return BaseView( onModelReady: (vm) { // viewModel = vm; @@ -272,7 +277,7 @@ class RRTRequestPageState extends State { getProcedureDetails() { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.getRRTProcedures(15).then((res) { + service.getRRTProcedures(15, projectViewModel.isArabic ? 1 : 2).then((res) { GifLoaderDialogUtils.hideDialog(context); print(res['Vida_ProcedureList']); }).catchError((err) { diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index 67b165b8..cd5597db 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -328,7 +328,7 @@ class _AppointmentDetailsState extends State with SingleTick void getDoctorRatingsDetails() { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.getDoctorsRatingDetails(widget.appo.doctorID, context).then((res) { + service.getDoctorsRatingDetails(widget.appo.doctorID, projectViewModel.isArabic ? 1 : 2, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { doctorDetailsList.clear(); diff --git a/lib/pages/MyAppointments/widgets/PrescriptionReport.dart b/lib/pages/MyAppointments/widgets/PrescriptionReport.dart index 33c55ddd..69470f23 100644 --- a/lib/pages/MyAppointments/widgets/PrescriptionReport.dart +++ b/lib/pages/MyAppointments/widgets/PrescriptionReport.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_details_page.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; @@ -10,6 +11,7 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class PrescriptionReportPage extends StatefulWidget { List prescriptionReportEnhList; @@ -26,6 +28,9 @@ class PrescriptionReportPage extends StatefulWidget { } class _PrescriptionReportState extends State { + + ProjectViewModel projectViewModel; + @override void initState() { super.initState(); @@ -33,6 +38,7 @@ class _PrescriptionReportState extends State { @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); return AppScaffold( isShowAppBar: true, appBarTitle: 'Items', @@ -117,7 +123,7 @@ class _PrescriptionReportState extends State { DoctorsListService service = new DoctorsListService(); GifLoaderDialogUtils.showMyDialog(context); service - .sendPrescriptionEmail(widget.appo.appointmentDate, widget.appo.setupID, + .sendPrescriptionEmail(widget.appo.appointmentDate, widget.appo.setupID, projectViewModel.isArabic ? 1 : 2, widget.listPres, context) .then((res) { GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/ToDoList/ObGyne/ObGyne-TimeSlots.dart b/lib/pages/ToDoList/ObGyne/ObGyne-TimeSlots.dart index ff3bc13c..242a072f 100644 --- a/lib/pages/ToDoList/ObGyne/ObGyne-TimeSlots.dart +++ b/lib/pages/ToDoList/ObGyne/ObGyne-TimeSlots.dart @@ -353,7 +353,7 @@ class _CovidTimeSlotsState extends State with TickerProviderSta AppoitmentAllHistoryResultList appo; service .insertAppointment( - docObject.doctorID, docObject.clinicID, docObject.projectID, ObGyneTimeSlots.selectedTime, ObGyneTimeSlots.selectedDate, 0, context, widget.obGyneProcedureListResponse.procedureId) + docObject.doctorID, docObject.clinicID, docObject.projectID, ObGyneTimeSlots.selectedTime, ObGyneTimeSlots.selectedDate, 0, projectViewModel.isArabic ? 1 : 2, context, widget.obGyneProcedureListResponse.procedureId) .then((res) { if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess); @@ -394,7 +394,7 @@ class _CovidTimeSlotsState extends State with TickerProviderSta DoctorsListService service = new DoctorsListService(); service .updateObGyneAppointment(widget.obGyneProcedureListResponse.episodeID, int.parse(appoNo), widget.obGyneProcedureListResponse.orderNo, widget.obGyneProcedureListResponse.procedureId, - widget.obGyneProcedureListResponse.lineItemNo, widget.obGyneProcedureListResponse.uniqueRowID) + widget.obGyneProcedureListResponse.lineItemNo, widget.obGyneProcedureListResponse.uniqueRowID, projectViewModel.isArabic ? 1 : 2) .then((res) {}) .catchError((err) { print(err); diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index b5f417e2..5fb46243 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -776,7 +776,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { DoctorsListService service = new DoctorsListService(); List doctorsList = []; List _patientDoctorAppointmentListHospital = []; - service.getOBGyneDoctorsList(projectID, setupID, context).then((res) { + service.getOBGyneDoctorsList(projectID, setupID, projectViewModel.isArabic ? 1 : 2, context).then((res) { GifLoaderDialogUtils.hideDialog(context); print(res['HIS_ObgyneUltrasoundDoctorsList'][0]); if (res['MessageStatus'] == 1) { @@ -967,7 +967,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { getLiveCareAppointmentPatientShare(context, DoctorsListService service, AppoitmentAllHistoryResultList appo) { GifLoaderDialogUtils.showMyDialog(context); - service.getLiveCareAppointmentPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, context).then((res) { + service.getLiveCareAppointmentPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, projectViewModel.isArabic ? 1 : 2, context).then((res) { GifLoaderDialogUtils.hideDialog(context); widget.patientShareResponse = new PatientShareResponse.fromJson(res); openPaymentDialog(appo, widget.patientShareResponse); @@ -1274,7 +1274,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { DoctorsListService service = new DoctorsListService(); service .insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate, - Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context) + Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), projectViewModel.isArabic ? 1 : 2, context) .then((res) { GifLoaderDialogUtils.hideDialog(context); getPatientAppointmentHistory(); @@ -1334,7 +1334,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { DoctorsListService service = new DoctorsListService(); service .insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate, - Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context) + Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), projectViewModel.isArabic ? 1 : 2, context) .then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { diff --git a/lib/pages/medical/eye/EyeHomePage.dart b/lib/pages/medical/eye/EyeHomePage.dart index 901ce187..288689fb 100644 --- a/lib/pages/medical/eye/EyeHomePage.dart +++ b/lib/pages/medical/eye/EyeHomePage.dart @@ -36,6 +36,7 @@ class EyeHomePage extends StatefulWidget { class _EyeHomePageState extends State with SingleTickerProviderStateMixin { TabController _tabController; List doctorDetailsList = List(); + ProjectViewModel projectViewModel; @override void initState() { @@ -54,7 +55,7 @@ class _EyeHomePageState extends State with SingleTickerProviderStat @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); + projectViewModel = Provider.of(context); return BaseView( builder: (_, model, w) => AppScaffold( isShowAppBar: true, @@ -180,7 +181,7 @@ class _EyeHomePageState extends State with SingleTickerProviderStat void getDoctorRatingsDetails() { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.getDoctorsRatingDetails(widget.appointmentAllHistoryResultList.doctorID, context).then((res) { + service.getDoctorsRatingDetails(widget.appointmentAllHistoryResultList.doctorID, projectViewModel.isArabic ? 1 : 2, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { doctorDetailsList.clear(); diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 02559d95..8f47063c 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -14,6 +14,7 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da import 'package:diplomaticquarterapp/models/Request.dart'; import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_orders_proc_list.dart'; import 'package:diplomaticquarterapp/models/apple_pay_request.dart'; +import 'package:diplomaticquarterapp/pages/final_products_page.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -174,7 +175,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getDoctorsRating(int docID, context) async { + Future getDoctorsRating(int docID,int languageID, context) async { Map request; Request req = appGlobal.getPublicRequest(); @@ -191,6 +192,7 @@ class DoctorsListService extends BaseService { "PatientID": 0, "License": true, "IsRegistered": true, + "LanguageID": languageID, "isDentalAllowedBackend": false }; @@ -224,7 +226,7 @@ class DoctorsListService extends BaseService { return Future.value(images); } - Future getDoctorsRatingDetails(int docID, context) async { + Future getDoctorsRatingDetails(int docID,int languageID, context) async { Map request; Request req = appGlobal.getPublicRequest(); @@ -241,6 +243,7 @@ class DoctorsListService extends BaseService { "PatientID": 0, "License": true, "IsRegistered": true, + "LanguageID": languageID, "isDentalAllowedBackend": false }; @@ -273,6 +276,7 @@ class DoctorsListService extends BaseService { "PatientOutSA": authProvider.isLogin ? authUser.outSA : 0, "SessionID": null, "isDentalAllowedBackend": false, + "LanguageID": 1, "DeviceTypeID": 1 }; @@ -316,6 +320,7 @@ class DoctorsListService extends BaseService { "PatientOutSA": authUser.outSA, "SessionID": null, "isDentalAllowedBackend": false, + "LanguageID": 1, "DeviceTypeID": 1 }; @@ -329,7 +334,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future insertAppointment(int docID, int clinicID, int projectID, String selectedTime, String selectedDate, int initialSlotDuration, BuildContext context, + Future insertAppointment(int docID, int clinicID, int projectID, String selectedTime, String selectedDate, int initialSlotDuration, int languageID, BuildContext context, [String procedureID, num testTypeEnum, num testProcedureEnum, ProjectViewModel projectViewModel]) async { Map request; @@ -392,7 +397,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future insertLiveCareScheduleAppointment(int docID, int clinicID, int projectID, int serviceID, String selectedTime, String selectedDate, BuildContext context) async { + Future insertLiveCareScheduleAppointment(int docID, int clinicID, int projectID, int serviceID, String selectedTime, String selectedDate, int languageID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -482,14 +487,14 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future setOnlineCheckInForAppointment(String appoID, int projectID, BuildContext context) async { + Future setOnlineCheckInForAppointment(String appoID, int projectID, int languageID, 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; } - request = {"ProjectID": projectID, "AppointmentNo": appoID}; + request = {"ProjectID": projectID, "AppointmentNo": appoID, "LanguageID": languageID}; dynamic localRes; @@ -501,7 +506,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getLiveCareAppointmentPatientShare(String appoID, int clinicID, int projectID, BuildContext context) async { + Future getLiveCareAppointmentPatientShare(String appoID, int clinicID, int projectID, int languageID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -527,6 +532,7 @@ class DoctorsListService extends BaseService { "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, + "LanguageID": languageID, "PatientType": authUser.patientType }; @@ -562,7 +568,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getOBGyneDoctorsList(int projectID, String setupID, BuildContext context) async { + Future getOBGyneDoctorsList(int projectID, String setupID, int languageID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -579,6 +585,7 @@ class DoctorsListService extends BaseService { "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, + "LanguageID": languageID, "PatientType": authUser.patientType }; @@ -697,6 +704,7 @@ class DoctorsListService extends BaseService { "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, + "LanguageID": 1, "PatientType": authUser.patientType }; @@ -710,7 +718,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future insertVIDARequest(int appoNo, int clinicID, int projectID, int serviceID, int docID, String appoDate, String clientRequestID, BuildContext context) async { + Future insertVIDARequest(int appoNo, int clinicID, int projectID, int serviceID, int docID, String appoDate, String clientRequestID, int languageID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -751,6 +759,7 @@ class DoctorsListService extends BaseService { "PatientTypeID": authUser.patientType, "PatientType": authUser.patientType, "VoipToken": await sharedPref.getString(ONESIGNAL_APNS_TOKEN), + "LanguageID": languageID, "IsVoip": Platform.isIOS ? true : false }; @@ -796,6 +805,7 @@ class DoctorsListService extends BaseService { "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, + "LanguageID": 1, "PatientType": authUser.patientType }; @@ -834,6 +844,7 @@ class DoctorsListService extends BaseService { "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, + "LanguageID": 1, "PatientType": authUser.patientType }; @@ -909,6 +920,7 @@ class DoctorsListService extends BaseService { "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, + "LanguageID": 1, "PatientType": authUser.patientType }; dynamic localRes; @@ -955,6 +967,7 @@ class DoctorsListService extends BaseService { "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, + "LanguageID": 1, "PatientType": authUser.patientType }; dynamic localRes; @@ -998,6 +1011,7 @@ class DoctorsListService extends BaseService { "PatientType": authUser.patientType, "DeviceToken": await sharedPref.getString(PUSH_TOKEN), "VoipToken": await sharedPref.getString(ONESIGNAL_APNS_TOKEN), + "LanguageID": 1, "IsVoip": Platform.isIOS ? true : false }; @@ -1034,6 +1048,7 @@ class DoctorsListService extends BaseService { }); request = { + "LanguageID": 1, "RequestAncillaryOrderInvoice": [ {"MemberID": 102, "ProjectID": projectID, "AppointmentNo": appointmentID, "OrderNo": orderNo, "AncillaryOrderInvoiceProcList": selectedProcListAPI} ], @@ -1234,7 +1249,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getPatientPrescriptionReports(AppoitmentAllHistoryResultList appo, BuildContext context) async { + Future getPatientPrescriptionReports(AppoitmentAllHistoryResultList appo, int languageID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); @@ -1258,6 +1273,7 @@ class DoctorsListService extends BaseService { "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, + "LanguageID": languageID, "PatientType": authUser.patientType }; @@ -1270,7 +1286,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future sendPrescriptionEmail(String appoDate, String setupId, dynamic prescriptionReportEnhList, BuildContext context) async { + Future sendPrescriptionEmail(String appoDate, String setupId, int languageID, dynamic prescriptionReportEnhList, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); @@ -1297,6 +1313,7 @@ class DoctorsListService extends BaseService { "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, + "LanguageID": authUser.patientType, "PatientType": authUser.patientType }; @@ -1340,6 +1357,7 @@ class DoctorsListService extends BaseService { "isDentalAllowedBackend": false, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, + "LanguageID": 1, "PatientType": authUser.patientType }; dynamic localRes; @@ -1378,7 +1396,7 @@ class DoctorsListService extends BaseService { "PaymentMethod": paymentMethodName, "VersionID": req.VersionID, "Channel": req.Channel, - + "LanguageID": 1, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -1414,6 +1432,7 @@ class DoctorsListService extends BaseService { "generalid": req.generalid, "PatientOutSA": authUser.outSA, "PatientTypeID": authUser.patientType, + "LanguageID": 1, "ERAdvanceAmount": { "ProjectId": projectID, "PatientId": authUser.patientID, @@ -1454,6 +1473,7 @@ class DoctorsListService extends BaseService { "generalid": req.generalid, "PatientOutSA": authUser.outSA, "PatientTypeID": authUser.patientType, + "LanguageID": 1, "EROnlineCheckinPaymentDetails": { "CheckinDate": DateUtil.convertDateToString(DateTime.now()), "ExpectedArrivalTime": DateUtil.convertDateToString(DateTime.now()), @@ -1516,7 +1536,7 @@ class DoctorsListService extends BaseService { Future sendCheckinNfcRequest(int appointmentNo, String nfcCode, int projectId, int checkInBy, BuildContext context) async { Map request; - request = {"AppointmentNo": appointmentNo, "NFC_Code": nfcCode, "ProjectID": projectId, "CheckinBy": checkInBy}; + request = {"AppointmentNo": appointmentNo, "NFC_Code": nfcCode, "ProjectID": projectId, "CheckinBy": checkInBy, "LanguageID": 1}; dynamic localRes; await baseAppClient.post(SEND_CHECK_IN_NFC_REQUEST, onSuccess: (response, statusCode) async { localRes = response; @@ -1531,6 +1551,7 @@ class DoctorsListService extends BaseService { request = { "ProjectID": projectID, + "LanguageID": 1, }; dynamic localRes; await baseAppClient.post(HAS_DENTAL_PLAN, onSuccess: (response, statusCode) async { @@ -1592,12 +1613,13 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getLaserBodyPartsList(int laserCategoryID, int projectID) async { + Future getLaserBodyPartsList(int laserCategoryID, int projectID, int languageID) async { Map request; request = { "LaserCategoryID": laserCategoryID, "ProjectID": projectID, + "LanguageID": languageID, }; dynamic localRes; await baseAppClient.post(LASER_BODY_PARTS, onSuccess: (response, statusCode) async { @@ -1608,11 +1630,12 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future insertCovidQuestionnaire(List qa, int projectID, int testTypeEnum, int testProcedureEnum) async { + Future insertCovidQuestionnaire(List qa, int projectID, int testTypeEnum, int languageID, int testProcedureEnum) async { Map request; request = { "ProjectID": projectID, + "LanguageID": languageID, "IsForTravel": qa[0]['ans'].toString(), "IsComingOutSA": qa[1]['ans'].toString(), "IsFeverCurrently": qa[2]['ans'].toString(), @@ -1655,11 +1678,12 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future updateObGyneAppointment(int episodeID, int appointmentNo, int orderNo, String procedureId, int lineItemNo, int uniqueRowID) async { + Future updateObGyneAppointment(int episodeID, int appointmentNo, int orderNo, String procedureId, int lineItemNo, int uniqueRowID, int languageID) async { Map request; request = { "EpisodeID": episodeID, + "LanguageID": languageID, "AppointmentNo": appointmentNo, "OrderNo": orderNo, "ProcedureId": procedureId, @@ -1678,10 +1702,10 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getRRTProcedures(int projectID) async { + Future getRRTProcedures(int projectID, int languageID) async { Map request; - request = {"ProjectID": projectID}; + request = {"ProjectID": projectID, "LanguageID": languageID}; dynamic localRes; await baseAppClient.post(GET_RRT_PROCEDURE_LIST, onSuccess: (response, statusCode) async { @@ -1699,6 +1723,7 @@ class DoctorsListService extends BaseService { "ClientRequestID": clientRequestID, "Status": status, "FortID": tamaraOrderID, // Tamara order ID + "LanguageID": 1, "Installments_Number": selectedInstallments }; @@ -1714,7 +1739,7 @@ class DoctorsListService extends BaseService { Future markAppointmentForTamara(int projectID, String appoNo) async { Map request; - request = {"ProjectID": projectID, "AppointmentNo": appoNo}; + request = {"ProjectID": projectID, "AppointmentNo": appoNo, "LanguageID": 1}; dynamic localRes; await baseAppClient.post(MARK_APPOINTMENT_TAMARA_STATUS, onSuccess: (response, statusCode) async { localRes = response; @@ -1727,7 +1752,7 @@ class DoctorsListService extends BaseService { Future autoGenerateInvoiceTamara(int projectID, String appoNo, String mobileNo) async { Map request; - request = {"ProjectID": projectID, "AppointmentNo": appoNo, "MobileNo": mobileNo, "UserID": 102}; + request = {"ProjectID": projectID, "AppointmentNo": appoNo, "MobileNo": mobileNo, "UserID": 102, "LanguageID": 1}; dynamic localRes; await baseAppClient.post(AUTO_GENERATE_INVOICE_TAMARA, onSuccess: (response, statusCode) async { localRes = response; @@ -1740,7 +1765,7 @@ class DoctorsListService extends BaseService { Future checkPatientNphiesEligibility(int projectID) async { Map request; - request = {"ProjectID": projectID}; + request = {"ProjectID": projectID, "LanguageID": 1}; dynamic localRes; await baseAppClient.post(CHECK_PATIENT_NPHIES_ELIGIBILITY, onSuccess: (response, statusCode) async { localRes = response; @@ -1753,7 +1778,7 @@ class DoctorsListService extends BaseService { Future convertPatientToCash(int projectID) async { Map request; - request = {"ProjectID": projectID}; + request = {"ProjectID": projectID, "LanguageID": 1}; dynamic localRes; await baseAppClient.post(CONVERT_PATIENT_TO_CASH, onSuccess: (response, statusCode) async { localRes = response; @@ -1797,6 +1822,7 @@ class DoctorsListService extends BaseService { "PatientOutSA": authProvider.isLogin ? authUser.outSA : 0, "SessionID": null, "isDentalAllowedBackend": false, + "LanguageID": 1, "DeviceTypeID": 1 }; diff --git a/lib/widgets/new_design/doctor_header.dart b/lib/widgets/new_design/doctor_header.dart index 549c182a..7e75b63a 100644 --- a/lib/widgets/new_design/doctor_header.dart +++ b/lib/widgets/new_design/doctor_header.dart @@ -203,7 +203,7 @@ class DoctorHeader extends StatelessWidget { List doctorDetailsList = List(); DoctorsListService service = new DoctorsListService(); - service.getDoctorsRatingDetails(headerModel.doctorId, context).then((res) { + service.getDoctorsRatingDetails(headerModel.doctorId, projectViewModel.isArabic ? 1 : 2, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { doctorDetailsList.clear(); From 86d3e03c06f1d44c6420675b60c04e803cc53d74 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 3 Jan 2024 14:35:49 +0300 Subject: [PATCH 05/13] Updates --- lib/pages/DrawerPages/family/my-family.dart | 2 +- .../family_files/family_files_provider.dart | 1 + lib/widgets/drawer/app_drawer_widget.dart | 20 +++++++++---------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index ef6f5e3d..9d80ee83 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -477,7 +477,7 @@ class _MyFamily extends State with TickerProviderStateMixin { var bloodType = await sharedPref.getString(BLOOD_TYPE); var mainUser = await sharedPref.getObject(MAIN_USER); var loginType = await sharedPref.getInt(LAST_LOGIN); - this.sharedPref.clear(); + // this.sharedPref.clear(); if (mainUser["PatientID"] != result.list.patientID) { result.list.isFamily = true; } diff --git a/lib/services/family_files/family_files_provider.dart b/lib/services/family_files/family_files_provider.dart index f209812e..88cc0c69 100644 --- a/lib/services/family_files/family_files_provider.dart +++ b/lib/services/family_files/family_files_provider.dart @@ -43,6 +43,7 @@ class FamilyFilesProvider with ChangeNotifier { dynamic localRes; try { var request = GetAllSharedRecordsByStatusReq(); + // var request = {"LanguageID": languageID}; // var result = await sharedPref.getObject(MAIN_USER); // request.status = 0; // request.patientID = result["PatientID"]; diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 89d35885..47dbdabe 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -67,12 +67,6 @@ class AppDrawer extends StatefulWidget { class _AppDrawerState extends State { final InAppReview _inAppReview = InAppReview.instance; - @override - void initState() { - super.initState(); - checkUserData(); - } - ProjectViewModel projectProvider; var sharedPref = new AppSharedPreferences(); var familyFileProvider = FamilyFilesProvider(); @@ -89,6 +83,12 @@ class _AppDrawerState extends State { final authService = new AuthProvider(); String pharmacyLiveCareQRCode = ""; + @override + void initState() { + super.initState(); + checkUserData(); + } + @override Widget build(BuildContext context) { projectProvider = Provider.of(context); @@ -684,16 +684,16 @@ class _AppDrawerState extends State { var currentLang = await sharedPref.getString(APP_LANGUAGE); var mainUser = await sharedPref.getObject(MAIN_USER); var loginType = await sharedPref.getInt(LAST_LOGIN); - this.sharedPref.clear(); + // this.sharedPref.clear(); if (mainUser["PatientID"] != result.list.patientID) { result.list.isFamily = true; } else { result.list.isFamily = false; } // result.list.cRSVerificationStatus = result['CRSVerificationStatus']; - this.sharedPref.setString(APP_LANGUAGE, currentLang); - this.sharedPref.setString(BLOOD_TYPE, bloodType); - this.sharedPref.setInt(LAST_LOGIN, loginType); + await this.sharedPref.setString(APP_LANGUAGE, currentLang); + await this.sharedPref.setString(BLOOD_TYPE, bloodType); + await this.sharedPref.setInt(LAST_LOGIN, loginType); await this.sharedPref.setObject(MAIN_USER, mainUser); await this.sharedPref.setObject(USER_PROFILE, result.list); await this.sharedPref.setObject(FAMILY_FILE, familyFile); From e6d093a84ce92856d5f94e9a6bd74cdb484abf33 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 3 Jan 2024 16:27:38 +0300 Subject: [PATCH 06/13] updates --- lib/config/config.dart | 4 +- lib/core/service/client/base_app_client.dart | 2 +- lib/uitl/utils.dart | 68 +++++++++----------- 3 files changed, 35 insertions(+), 39 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 128264a2..a77a0814 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,8 +20,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/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index d6b88e33..109326bc 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -175,7 +175,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - // body['PatientID'] = 291367; //3844083 + // body['PatientID'] = 1018977; //3844083 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index 77522108..4022f2ef 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -614,42 +614,38 @@ class Utils { hasBadge: true, isEnable: projectViewModel.havePrivilege(5)), projectViewModel.isArabic - ? !projectViewModel.isLoginChild - ? Positioned( - left: 8, - top: 4, - child: badge_import.Badge( - toAnimate: false, - elevation: 0, - position: badge_import.BadgePosition.topEnd(), - shape: badge_import.BadgeShape.circle, - badgeColor: secondaryColor.withOpacity(1.0), - borderRadius: BorderRadius.circular(8), - badgeContent: Container( - padding: EdgeInsets.all(2.0), - child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), - ), - ), - ) - : Container() - : !projectViewModel.isLoginChild - ? Positioned( - right: 8, - top: 4, - child: badge_import.Badge( - toAnimate: false, - elevation: 0, - position: badge_import.BadgePosition.topEnd(), - shape: badge_import.BadgeShape.circle, - badgeColor: secondaryColor.withOpacity(1.0), - borderRadius: BorderRadius.circular(8), - badgeContent: Container( - padding: EdgeInsets.all(2.0), - child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), - ), - ), - ) - : Container(), + ? Positioned( + left: 8, + top: 4, + child: badge_import.Badge( + toAnimate: false, + elevation: 0, + position: badge_import.BadgePosition.topEnd(), + shape: badge_import.BadgeShape.circle, + badgeColor: secondaryColor.withOpacity(1.0), + borderRadius: BorderRadius.circular(8), + badgeContent: Container( + padding: EdgeInsets.all(2.0), + child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), + ), + ), + ) + : Positioned( + right: 8, + top: 4, + child: badge_import.Badge( + toAnimate: false, + elevation: 0, + position: badge_import.BadgePosition.topEnd(), + shape: badge_import.BadgeShape.circle, + badgeColor: secondaryColor.withOpacity(1.0), + borderRadius: BorderRadius.circular(8), + badgeContent: Container( + padding: EdgeInsets.all(2.0), + child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), + ), + ), + ), ]) : MedicalProfileItem( title: TranslationBase.of(context).myAppointments, From e1718270eb4743d1e9a89d5d08eaff9a268d5313 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 4 Jan 2024 09:59:47 +0300 Subject: [PATCH 07/13] updates --- lib/pages/MyAppointments/MyAppointments.dart | 7 ++++++- pubspec.yaml | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index 3d0eb15f..1163da12 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -431,7 +431,12 @@ class _MyAppointmentsState extends State with SingleTickerProvid ), ), ).then((value) { - getPatientAppointmentHistory(true, false); + if(_currentPage == 1) { + getPatientAppointmentHistory(true, false); + } + if(_currentPage == 2) { + getPatientAppointmentHistory(false, true); + } }), isInOutPatient: _appointmentResult.isInOutPatient, name: _appointmentResult.doctorTitle + " " + _appointmentResult.doctorNameObj, diff --git a/pubspec.yaml b/pubspec.yaml index 8fb7faae..0cb06dd5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.040+4050040 +version: 4.5.78+1 environment: sdk: ">=2.7.0 <3.0.0" From 63621b5fedaf73422243d3e0e0907623970e9bf5 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 7 Jan 2024 09:42:28 +0300 Subject: [PATCH 08/13] Updates & fixes --- lib/pages/ToDoList/ToDo.dart | 137 ++++++++++++++++++----------------- pubspec.yaml | 2 +- 2 files changed, 70 insertions(+), 69 deletions(-) diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 5fb46243..2be4f097 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -48,9 +48,6 @@ import 'package:rating_bar/rating_bar.dart'; class ToDo extends StatefulWidget { PatientShareResponse patientShareResponse; - List appoList = []; - List ancillaryLists = []; - List obGyneAppoList = []; var languageID; bool isShowAppBar = true; @@ -86,6 +83,10 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { bool isCash = false; MyInAppBrowser browser; + List appoList = []; + List ancillaryLists = []; + List obGyneAppoList = []; + @override void initState() { widget.patientShareResponse = new PatientShareResponse(); @@ -103,6 +104,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { @override void dispose() { super.dispose(); + // getToDoCount(); _tabController.dispose(); } @@ -162,15 +164,15 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { child: AppExpandableNotifier( isExpand: true, hasCounter: true, - counter: widget.appoList.length.toString(), + counter: appoList.length.toString(), title: TranslationBase.of(context).appointments, - bodyWidget: widget.appoList.length != 0 + bodyWidget: appoList.length != 0 ? ListView.builder( scrollDirection: Axis.vertical, shrinkWrap: true, physics: ScrollPhysics(), padding: EdgeInsets.all(0.0), - itemCount: widget.appoList.length, + itemCount: appoList.length, itemBuilder: (context, index) { return Container( width: double.infinity, @@ -190,12 +192,12 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { children: [ Padding( padding: const EdgeInsets.only(top: 4.0), - child: widget.appoList[index].clinicID == 265 + child: appoList[index].clinicID == 265 ? Container( margin: EdgeInsets.only(left: 5.0, right: 5.0), child: SvgPicture.asset("assets/images/new/CoronaIcon.svg", width: 35.0, height: 35.0), ) - : widget.appoList[index].isLiveCareAppointment + : appoList[index].isLiveCareAppointment ? SvgPicture.asset("assets/images/new/virtual.svg") : SvgPicture.asset("assets/images/new/hospital-visit.svg"), ), @@ -205,9 +207,9 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { Padding( padding: const EdgeInsets.only(left: 8.0, right: 8.0), child: Text( - widget.appoList[index].clinicID == 265 + appoList[index].clinicID == 265 ? TranslationBase.of(context).covidTestTodo - : widget.appoList[index].isLiveCareAppointment + : appoList[index].isLiveCareAppointment ? TranslationBase.of(context).liveCareAppo : TranslationBase.of(context).walkinAppo, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48)), @@ -215,8 +217,8 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { Padding( padding: const EdgeInsets.only(left: 8.0, right: 8.0), child: CountdownTimer( - controller: new CountdownTimerController( - endTime: DateTime.now().millisecondsSinceEpoch + (widget.appoList[index].remaniningHoursTocanPay * 1000) * 60), + controller: + new CountdownTimerController(endTime: DateTime.now().millisecondsSinceEpoch + (appoList[index].remaniningHoursTocanPay * 1000) * 60), widgetBuilder: (_, CurrentRemainingTime time) { return time != null ? Text( @@ -236,17 +238,17 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { child: Container( child: InkWell( onTap: () { - performNextAction(widget.appoList[index]); + performNextAction(appoList[index]); }, child: Container( padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14), decoration: BoxDecoration( - color: getNextActionButtonColor(widget.appoList[index].nextAction), + color: getNextActionButtonColor(appoList[index].nextAction), border: Border.all(color: Colors.white, width: 1), borderRadius: BorderRadius.circular(6), ), child: Text( - getNextActionText(widget.appoList[index].nextAction), + getNextActionText(appoList[index].nextAction), textAlign: TextAlign.center, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4), ), @@ -259,7 +261,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { Padding( padding: const EdgeInsets.only(top: 8.0), child: Text( - widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj, + appoList[index].doctorTitle + " " + appoList[index].doctorNameObj, style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), ), ), @@ -267,8 +269,8 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { mainAxisSize: MainAxisSize.min, children: [ LargeAvatar( - name: widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj, - url: widget.appoList[index].doctorImageURL, + name: appoList[index].doctorTitle + " " + appoList[index].doctorNameObj, + url: appoList[index].doctorImageURL, width: 52, height: 52, ), @@ -278,32 +280,32 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - MyRichText(TranslationBase.of(context).clinic + ": ", widget.appoList[index].clinicName, projectViewModel.isArabic), + MyRichText(TranslationBase.of(context).clinic + ": ", appoList[index].clinicName, projectViewModel.isArabic), // MyRichText(TranslationBase.of(context).appointmentDate + ": ", - // DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate)) + " " + widget.appoList[index].startTime.substring(0, 5), projectViewModel.isArabic), + // DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(appoList[index].appointmentDate)) + " " + appoList[index].startTime.substring(0, 5), projectViewModel.isArabic), // Timezone changes - widget.appoList[index].isLiveCareAppointment + appoList[index].isLiveCareAppointment ? MyRichText( TranslationBase.of(context).appointmentDate + ": ", - DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate)) + + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(appoList[index].appointmentDate)) + " " + - DateUtil.convertStringToDate(widget.appoList[index].appointmentDate).toString().split(" ")[1].substring(0, 5), + DateUtil.convertStringToDate(appoList[index].appointmentDate).toString().split(" ")[1].substring(0, 5), projectViewModel.isArabic) : MyRichText( TranslationBase.of(context).appointmentDate + ": ", - DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate)) + + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(appoList[index].appointmentDate)) + " " + - widget.appoList[index].startTime.substring(0, 5), + appoList[index].startTime.substring(0, 5), projectViewModel.isArabic), - MyRichText(TranslationBase.of(context).branch, widget.appoList[index].projectName, projectViewModel.isArabic), + MyRichText(TranslationBase.of(context).branch, appoList[index].projectName, projectViewModel.isArabic), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisSize: MainAxisSize.max, children: [ RatingBar.readOnly( - initialRating: widget.appoList[index].actualDoctorRate.toDouble(), + initialRating: appoList[index].actualDoctorRate.toDouble(), size: 16.0, filledColor: Color(0XFFD02127), emptyColor: Color(0XFFD02127), @@ -322,13 +324,13 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { Padding( padding: const EdgeInsets.only(top: 12.0), child: Text( - getNextActionDescription(widget.appoList[index].nextAction), + getNextActionDescription(appoList[index].nextAction), style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 25 / 16), ), ), InkWell( onTap: () { - navigateToAppointmentDetails(context, widget.appoList[index]); + navigateToAppointmentDetails(context, appoList[index]); }, child: Padding( padding: const EdgeInsets.only(top: 0.0), @@ -357,9 +359,9 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { child: AppExpandableNotifier( isExpand: true, hasCounter: true, - counter: (widget.ancillaryLists.isNotEmpty) ? widget.ancillaryLists[0].ancillaryOrderList.length.toString() : "0", + counter: (ancillaryLists.isNotEmpty) ? ancillaryLists[0].ancillaryOrderList.length.toString() : "0", title: TranslationBase.of(context).anicllaryOrders, - bodyWidget: widget.ancillaryLists.length != 0 + bodyWidget: ancillaryLists.length != 0 ? Container( padding: EdgeInsets.all(12), child: ListView.separated( @@ -368,18 +370,18 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { reverse: true, itemBuilder: (context, index) { return DoctorCard( - onTap: () => ancillaryOrdersDetails(widget.ancillaryLists[0].ancillaryOrderList[index], widget.ancillaryLists[0].projectID), + onTap: () => ancillaryOrdersDetails(ancillaryLists[0].ancillaryOrderList[index], ancillaryLists[0].projectID), isInOutPatient: true, - name: TranslationBase.of(context).dr.toString() + " " + (widget.ancillaryLists[0].ancillaryOrderList[index].doctorName ?? ""), - billNo: widget.ancillaryLists[0].ancillaryOrderList[index].orderNo.toString(), + name: TranslationBase.of(context).dr.toString() + " " + (ancillaryLists[0].ancillaryOrderList[index].doctorName ?? ""), + billNo: ancillaryLists[0].ancillaryOrderList[index].orderNo.toString(), profileUrl: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png", - subName: widget.ancillaryLists[0].projectName, + subName: ancillaryLists[0].projectName, isLiveCareAppointment: false, - date: DateUtil.convertStringToDate(widget.ancillaryLists[0].ancillaryOrderList[index].orderDate), + date: DateUtil.convertStringToDate(ancillaryLists[0].ancillaryOrderList[index].orderDate), isSortByClinic: true, ); }, - itemCount: widget.ancillaryLists[0].ancillaryOrderList.length, + itemCount: ancillaryLists[0].ancillaryOrderList.length, separatorBuilder: (context, index) => SizedBox(height: 14), ), ) @@ -389,13 +391,13 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { ), ), Container( - child: widget.obGyneAppoList.length != 0 + child: obGyneAppoList.length != 0 ? ListView.builder( scrollDirection: Axis.vertical, shrinkWrap: true, physics: ScrollPhysics(), padding: EdgeInsets.all(0.0), - itemCount: widget.obGyneAppoList.length, + itemCount: obGyneAppoList.length, itemBuilder: (context, index) { return Container( width: double.infinity, @@ -433,7 +435,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { Container( child: InkWell( onTap: () { - getOBGyneDoctorsList(widget.obGyneAppoList[index].projectID, widget.obGyneAppoList[index].setupID, widget.obGyneAppoList[index]); + getOBGyneDoctorsList(obGyneAppoList[index].projectID, obGyneAppoList[index].setupID, obGyneAppoList[index]); }, child: Container( padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14), @@ -454,7 +456,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { Padding( padding: const EdgeInsets.only(top: 8.0), child: Text( - TranslationBase.of(context).dr + " " + widget.obGyneAppoList[index].doctorName, + TranslationBase.of(context).dr + " " + obGyneAppoList[index].doctorName, style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), ), ), @@ -462,7 +464,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { mainAxisSize: MainAxisSize.min, children: [ LargeAvatar( - name: TranslationBase.of(context).dr + " " + widget.obGyneAppoList[index].doctorName, + name: TranslationBase.of(context).dr + " " + obGyneAppoList[index].doctorName, url: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png", width: 52, height: 52, @@ -473,12 +475,12 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - MyRichText(TranslationBase.of(context).clinic + ": ", widget.obGyneAppoList[index].clinicDescription, projectViewModel.isArabic), + MyRichText(TranslationBase.of(context).clinic + ": ", obGyneAppoList[index].clinicDescription, projectViewModel.isArabic), MyRichText( TranslationBase.of(context).orderDate + ": ", - DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(widget.obGyneAppoList[index].orderDate)).split(" ")[0], + DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(obGyneAppoList[index].orderDate)).split(" ")[0], projectViewModel.isArabic), - MyRichText(TranslationBase.of(context).branch, widget.obGyneAppoList[index].projectDescription, projectViewModel.isArabic), + MyRichText(TranslationBase.of(context).branch, obGyneAppoList[index].projectDescription, projectViewModel.isArabic), ], ), ), @@ -749,14 +751,14 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); service.getOBGyneOrdersList(context).then((res) { - widget.obGyneAppoList.clear(); + obGyneAppoList.clear(); GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { if (res['HIS_OBGYNEProcedureGet_List'].length != 0) { - widget.obGyneAppoList.clear(); + obGyneAppoList.clear(); res['HIS_OBGYNEProcedureGet_List'].forEach((v) { - widget.obGyneAppoList.add(new OBGyneProcedureListResponse.fromJson(v)); + obGyneAppoList.add(new OBGyneProcedureListResponse.fromJson(v)); }); } else { // Navigator.of(context).popAndPushNamed(HOME); @@ -822,32 +824,31 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { obGyneProcedureListResponse: obGyneProcedureListResponse))); } - getPatientAppointmentHistory() { + getPatientAppointmentHistory() async { int languageID = projectViewModel.isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); service.getPatientAppointmentHistory(true, languageID, context).then((res) { - widget.appoList.clear(); + 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)); - }); - } - if (res['AncillaryOrderList'].length != 0) { - res['AncillaryOrderList'].forEach((item) { - widget.ancillaryLists.add(AncillaryOrdersListModel.fromJson(item)); - }); - } - dataLoaded = true; - if (widget.isFromMyAppointments) { - performNextAction(widget.appointment); - widget.isFromMyAppointments = false; - } - }); + if (res['AppoimentAllHistoryResultList'].length != 0) { + appoList.clear(); + res['AppoimentAllHistoryResultList'].forEach((v) { + appoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); + }); + } + if (res['AncillaryOrderList'].length != 0) { + res['AncillaryOrderList'].forEach((item) { + ancillaryLists.add(AncillaryOrdersListModel.fromJson(item)); + }); + } + dataLoaded = true; + if (widget.isFromMyAppointments) { + performNextAction(widget.appointment); + widget.isFromMyAppointments = false; + } + setState(() {}); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } diff --git a/pubspec.yaml b/pubspec.yaml index 0cb06dd5..5de7f32e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.78+1 +version: 4.5.79+1 environment: sdk: ">=2.7.0 <3.0.0" From b39357a497d97564a7f12b134e6f56e8632c988f Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 7 Jan 2024 15:06:22 +0300 Subject: [PATCH 09/13] Medical report changes, Loading added in Location Check-In --- lib/config/config.dart | 4 ++-- lib/core/model/reports/Reports.dart | 4 ++++ lib/core/service/client/base_app_client.dart | 2 +- lib/pages/BookAppointment/QRCode.dart | 5 ++++ lib/pages/landing/landing_page.dart | 2 +- .../medical/reports/report_list_widget.dart | 5 +++- lib/uitl/location_util.dart | 24 +++++++++++++++---- 7 files changed, 36 insertions(+), 10 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index a77a0814..128264a2 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,8 +20,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/core/model/reports/Reports.dart b/lib/core/model/reports/Reports.dart index 6791a3d4..0d409f04 100644 --- a/lib/core/model/reports/Reports.dart +++ b/lib/core/model/reports/Reports.dart @@ -5,6 +5,7 @@ class Reports { DateTime encounterDate; int projectID; int invoiceNo; + int invoiceNo_VP; int encounterNo; String procedureId; int requestType; @@ -35,6 +36,7 @@ class Reports { this.encounterDate, this.projectID, this.invoiceNo, + this.invoiceNo_VP, this.encounterNo, this.procedureId, this.requestType, @@ -67,6 +69,7 @@ class Reports { json['EncounterDate']); //json['EncounterDate']; projectID = json['ProjectID']; invoiceNo = json['InvoiceNo']; + invoiceNo_VP = json['InvoiceNo_VP']; encounterNo = json['EncounterNo']; procedureId = json['ProcedureId']; requestType = json['RequestType']; @@ -104,6 +107,7 @@ class Reports { data['EncounterDate'] = this.encounterDate; data['ProjectID'] = this.projectID; data['InvoiceNo'] = this.invoiceNo; + data['InvoiceNo_VP'] = this.invoiceNo_VP; data['EncounterNo'] = this.encounterNo; data['ProcedureId'] = this.procedureId; data['RequestType'] = this.requestType; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 109326bc..f756ba8e 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -175,7 +175,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - // body['PatientID'] = 1018977; //3844083 + // body['PatientID'] = 1400563; //3844083 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index 90e39767..cc700e97 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -93,16 +93,21 @@ class _QRCodeState extends State { } startLocationCheckIn() async { + GifLoaderDialogUtils.showMyDialog(context); locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context); locationUtils.getCurrentLocation(callBack: (value) { projectDetailListModel = Utils.getProjectDetailObj(projectViewModel, widget.appointment.projectID); double dist = Utils.distance(value.latitude, value.longitude, double.parse(projectDetailListModel.latitude), double.parse(projectDetailListModel.longitude)).ceilToDouble() * 1000; print(dist); if (dist <= projectDetailListModel.geofenceRadius) { + GifLoaderDialogUtils.hideDialog(context); sendNfcCheckInRequest(projectDetailListModel.checkInQrCode, 3); } else { + GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: TranslationBase.of(context).locationCheckInError); } + }, failureCallBack: () { + GifLoaderDialogUtils.hideDialog(context); }); } diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 601e7303..36257423 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -650,7 +650,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { authService.getDashboard().then((value) async { setState(() { if (value != null) { - notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); + notificationCount = value ['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); model.setState(model.count, 0, true, notificationCount); sharedPref.setString(NOTIFICATION_COUNT, notificationCount); FlutterAppIconBadge.updateBadge(num.parse(notificationCount)); diff --git a/lib/pages/medical/reports/report_list_widget.dart b/lib/pages/medical/reports/report_list_widget.dart index 2809b317..82df163c 100644 --- a/lib/pages/medical/reports/report_list_widget.dart +++ b/lib/pages/medical/reports/report_list_widget.dart @@ -12,6 +12,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; @@ -197,7 +198,9 @@ class ReportListWidget extends StatelessWidget { GifLoaderDialogUtils.showMyDialog(AppGlobal.context); ReportsService _reportsService = locator(); _reportsService - .sendEmailForMedicalReport(report.projectName, report.clinicDescription, report.doctorName, DateUtil.convertDateToString(report.requestDate), report.invoiceNo.toString(), report.projectID, + .sendEmailForMedicalReport(report.projectName, report.clinicDescription, report.doctorName, DateUtil.convertDateToString(report.requestDate), + Utils.isVidaPlusProject(projectViewModel, report.projectID) ? report.invoiceNo_VP.toString() : report.invoiceNo.toString(), + report.projectID, DateUtil.convertDateToString(report.requestDate), report.setupId) .then((value) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); diff --git a/lib/uitl/location_util.dart b/lib/uitl/location_util.dart index 3eb6388f..b890882f 100644 --- a/lib/uitl/location_util.dart +++ b/lib/uitl/location_util.dart @@ -28,7 +28,7 @@ class LocationUtils { LocationUtils({@required this.isShowConfirmDialog, @required this.context, this.isHuawei = false}); - void getCurrentLocation({Function(LatLng) callBack}) async { + void getCurrentLocation({Function(LatLng) callBack, Function() failureCallBack}) async { if (Platform.isAndroid && isHuawei) { _getHMSCurrentLocation(callBack); } else { @@ -68,7 +68,7 @@ class LocationUtils { print(err); }); } else { - if (isShowConfirmDialog) showErrorLocationDialog(false); + if (isShowConfirmDialog) showErrorLocationDialog(false, failureCallBack: failureCallBack); } }).catchError((err) { print(err); @@ -141,14 +141,28 @@ class LocationUtils { } } - showErrorLocationDialog(bool isPermissionError) { + showErrorLocationDialog(bool isPermissionError, {Function() failureCallBack}) { ConfirmDialog dialog = new ConfirmDialog( context: context, confirmMessage: TranslationBase.of(context).locationDialogMessage, okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, - okFunction: () => {ConfirmDialog.closeAlertDialog(context), if (isPermissionError) Geolocator.openAppSettings() else Geolocator.openLocationSettings(), Navigator.of(context).canPop()}, - cancelFunction: () => {}); + okFunction: () { + ConfirmDialog.closeAlertDialog(context); + if (isPermissionError) + Geolocator.openAppSettings(); + else + Geolocator.openLocationSettings(); + Navigator.of(context).canPop(); + if (failureCallBack != null) { + failureCallBack(); + } + }, + cancelFunction: () { + if (failureCallBack != null) { + failureCallBack(); + } + }); return dialog.showAlertDialog(context); } From e67bd54c04940df668912727c39a5e61f83b2a3a Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 7 Jan 2024 15:06:44 +0300 Subject: [PATCH 10/13] updates --- lib/services/appointment_services/GetDoctorsList.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 8f47063c..47826a43 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -1536,7 +1536,7 @@ class DoctorsListService extends BaseService { Future sendCheckinNfcRequest(int appointmentNo, String nfcCode, int projectId, int checkInBy, BuildContext context) async { Map request; - request = {"AppointmentNo": appointmentNo, "NFC_Code": nfcCode, "ProjectID": projectId, "CheckinBy": checkInBy, "LanguageID": 1}; + request = {"AppointmentNo": appointmentNo, "NFC_Code": nfcCode, "ProjectID": projectId, "CheckinBy": checkInBy}; dynamic localRes; await baseAppClient.post(SEND_CHECK_IN_NFC_REQUEST, onSuccess: (response, statusCode) async { localRes = response; From 27ed5c95f2195439cfb1500ef614e23451c16950 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 8 Jan 2024 10:24:08 +0300 Subject: [PATCH 11/13] update to stores --- lib/config/config.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 128264a2..09e07839 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,8 +20,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/'; @@ -342,7 +342,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 11.8; +var VERSION_ID = 11.9; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; From 98a5b7d049e26f731213ae6dbc26adda2f8f55ac Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 8 Jan 2024 12:25:32 +0300 Subject: [PATCH 12/13] my appointments fixes --- lib/pages/MyAppointments/MyAppointments.dart | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index 1163da12..7939e0c0 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -270,10 +270,6 @@ class _MyAppointmentsState extends State with SingleTickerProvid } else { _patientBookedAppointmentListHospital.add(PatientAppointmentList(filterName: element.projectName, patientDoctorAppointment: element)); } - - //Merging Booked & Confirmed Appointments into Upcoming Tab - _patientBookedAndConfirmedAppointmentListHospital.addAll(_patientBookedAppointmentListHospital); - _patientBookedAndConfirmedAppointmentListClinic.addAll(_patientBookedAppointmentListClinic); }); confirmedAppoList.forEach((element) { @@ -302,8 +298,8 @@ class _MyAppointmentsState extends State with SingleTickerProvid } //Merging Booked & Confirmed Appointments into Upcoming Tab - _patientBookedAndConfirmedAppointmentListHospital.addAll(_patientConfirmedAppointmentListHospital); - _patientBookedAndConfirmedAppointmentListClinic.addAll(_patientConfirmedAppointmentListClinic); + // _patientBookedAndConfirmedAppointmentListHospital.addAll(_patientConfirmedAppointmentListHospital); + // _patientBookedAndConfirmedAppointmentListClinic.addAll(_patientConfirmedAppointmentListClinic); }); arrivedAppoList.forEach((element) { @@ -333,6 +329,11 @@ class _MyAppointmentsState extends State with SingleTickerProvid // openAppointmentsTab(); }); + + //Merging Booked & Confirmed Appointments into Upcoming Tab + _patientBookedAndConfirmedAppointmentListHospital.addAll(_patientBookedAppointmentListHospital); + _patientBookedAndConfirmedAppointmentListClinic.addAll(_patientBookedAppointmentListClinic); + } openAppointmentsTab() async { From ac52ba75a7cea05302d772a05596b12236d6aa92 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 9 Jan 2024 11:48:54 +0300 Subject: [PATCH 13/13] Updates & Fixes --- lib/config/config.dart | 4 ++-- lib/core/service/medical/reports_service.dart | 3 ++- .../viewModels/medical/reports_view_model.dart | 4 ++-- lib/pages/medical/reports/report_home_page.dart | 17 ++++++++++------- lib/widgets/drawer/app_drawer_widget.dart | 2 +- 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 09e07839..65f5fb5e 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,8 +20,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/core/service/medical/reports_service.dart b/lib/core/service/medical/reports_service.dart index d80c80e4..a79f8f3e 100644 --- a/lib/core/service/medical/reports_service.dart +++ b/lib/core/service/medical/reports_service.dart @@ -42,9 +42,10 @@ class ReportsService extends BaseService { }, body: _requestReportsInpatient.toJson()); } - Future getInpatientAdmissionsList() async { + Future getInpatientAdmissionsList(int languageID) async { Map body = new Map(); body['IsForMedicalReport'] = true; + body['LanguageID'] = languageID; hasError = false; await baseAppClient.post(GET_INPATIENT_ADMISSIONS, onSuccess: (dynamic response, int statusCode) { admissionsMedicalReport.clear(); diff --git a/lib/core/viewModels/medical/reports_view_model.dart b/lib/core/viewModels/medical/reports_view_model.dart index 8f55b3b7..9e977dfe 100644 --- a/lib/core/viewModels/medical/reports_view_model.dart +++ b/lib/core/viewModels/medical/reports_view_model.dart @@ -26,7 +26,7 @@ class ReportsViewModel extends BaseViewModel { List get admissionsMedicalReportList => _reportsService.admissionsMedicalReport; - getReports() async { + getReports(int languageID) async { setState(ViewState.Busy); reportsOrderRequestList.clear(); reportsOrderReadyList.clear(); @@ -37,7 +37,7 @@ class ReportsViewModel extends BaseViewModel { setState(ViewState.Error); } else { _filterList(); - await _reportsService.getInpatientAdmissionsList(); + await _reportsService.getInpatientAdmissionsList(languageID); setState(ViewState.Idle); } } diff --git a/lib/pages/medical/reports/report_home_page.dart b/lib/pages/medical/reports/report_home_page.dart index 55d1b901..95225b39 100644 --- a/lib/pages/medical/reports/report_home_page.dart +++ b/lib/pages/medical/reports/report_home_page.dart @@ -31,6 +31,7 @@ class _HomeReportPageState extends State with SingleTickerProvid TabController _tabController_new; List imagesInfo = List(); int _currentPage = 0; + ProjectViewModel projectViewModel; @override void initState() { @@ -46,7 +47,7 @@ class _HomeReportPageState extends State with SingleTickerProvid @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); + projectViewModel = Provider.of(context); imagesInfo.add(ImagesInfo( imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/0.png')); imagesInfo.add(ImagesInfo( @@ -55,7 +56,7 @@ class _HomeReportPageState extends State with SingleTickerProvid imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/2.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/2.png')); return BaseView( onModelReady: (model) { - model.getReports(); + model.getReports(projectViewModel.isArabic ? 1 : 2); }, builder: (_, model, widget) => AppScaffold( isShowAppBar: true, @@ -156,11 +157,13 @@ class _HomeReportPageState extends State with SingleTickerProvid return InkWell( onTap: () { Navigator.push( - context, - FadePage( - page: InPatientMedicalReports( + context, + FadePage( + page: InPatientMedicalReports( admissionMedicalReport: admissionMedicalReport, - ))); + ), + ), + ); }, child: Container( // height: 100.0, @@ -259,7 +262,7 @@ class _HomeReportPageState extends State with SingleTickerProvid page: MedicalReports(), ), ).then((value) { - model.getReports(); + model.getReports(projectViewModel.isArabic ? 1 : 2); }), ), ) diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 47dbdabe..0ca93570 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -222,7 +222,7 @@ class _AppDrawerState extends State { builder: (BuildContext context, AsyncSnapshot snapshot) { switch (snapshot.connectionState) { case ConnectionState.waiting: - return Padding(padding: EdgeInsets.all(10), child: Text('')); + return Padding(padding: EdgeInsets.all(10), child:CircularProgressIndicator()); default: if (snapshot.hasError) return Padding(padding: EdgeInsets.all(10), child: Text(snapshot.error));