diff --git a/lib/config/config.dart b/lib/config/config.dart index e7635e5b..7652d6f0 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -21,10 +21,10 @@ 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 = 'http://10.20.200.111:1010/'; - // 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/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; @@ -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.7; +var VERSION_ID = 11.8; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ba17f2ec..cc45dfeb 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1903,4 +1903,6 @@ const Map localizedValues = { "validInsurance": {"en": "Do you have a valid insurance?", "ar": "هل لديك تأمين صالح؟"}, "checkInViaLocation": {"en": "Check-In Via Location", "ar": "تسجيل الوصول عبر الموقع"}, "locationCheckInError": {"en": "Please make sure that you're within the hospital location to perform online check-in.", "ar": "يرجى التأكد من تواجدك داخل موقع المستشفى لإجراء تسجيل الوصول عبر الإنترنت."}, + "upcoming": {"en": "Upcoming", "ar": "المواعيد القادمة"}, + "noUpcomingAppointment": {"en": "No upcoming appointments", "ar": "لا توجد مواعيد القادمة"}, }; \ No newline at end of file diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 26bacebe..c234304f 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -170,7 +170,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - // body['PatientID'] = 1014144; //3844083 + // body['PatientID'] = 291367; //3844083 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 @@ -710,7 +710,7 @@ class BaseAppClient { var model = Provider.of(AppGlobal.context, listen: false); _vitalSignService.weightKg = ""; _vitalSignService.heightCm = ""; - model.setState(0, false, null); + model.setState(0, 0, false, null); Navigator.of(AppGlobal.context).pushReplacementNamed(HOME); } diff --git a/lib/core/viewModels/notifications_view_model.dart b/lib/core/viewModels/notifications_view_model.dart index 80e89edb..a520f36e 100644 --- a/lib/core/viewModels/notifications_view_model.dart +++ b/lib/core/viewModels/notifications_view_model.dart @@ -39,7 +39,7 @@ class NotificationViewModel extends BaseViewModel { await authService.getDashboard().then((value) { var notificationCount = ''; notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); - model.setState(model.count, true, notificationCount); + model.setState(model.count, 0, true, notificationCount); sharedPref.setString(NOTIFICATION_COUNT, notificationCount); }); diff --git a/lib/models/Appointments/toDoCountProviderModel.dart b/lib/models/Appointments/toDoCountProviderModel.dart index 3363471f..cf2c0ca4 100644 --- a/lib/models/Appointments/toDoCountProviderModel.dart +++ b/lib/models/Appointments/toDoCountProviderModel.dart @@ -2,19 +2,23 @@ import 'package:flutter/cupertino.dart'; class ToDoCountProviderModel with ChangeNotifier { int _count; + int _ancillaryCount; String _notificationsCount; bool _isShowBadge = false; int get count => _count == null ? 0 : _count; + int get ancillaryCount => _ancillaryCount == null ? 0 : _ancillaryCount; + String get notificationsCount => _notificationsCount == null ? "0" : _notificationsCount; bool get isShowBadge => _isShowBadge; - void setState(int count, bool isShowBadge, String notifCount) { + void setState(int count, int ancillaryCount, bool isShowBadge, String notifCount) { _count = count; _isShowBadge = isShowBadge; _notificationsCount = notifCount; + _ancillaryCount = ancillaryCount; notifyListeners(); } } \ No newline at end of file diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index bb4d153a..74f7c142 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -428,12 +428,13 @@ class _BookConfirmState extends State { } getToDoCount() { - toDoProvider.setState(0, true, toDoProvider.notificationsCount); + toDoProvider.setState(0, 0, true, toDoProvider.notificationsCount); ClinicListService service = new ClinicListService(); service.getActiveAppointmentNo(context).then((res) { print(res['AppointmentActiveNumber']); if (res['MessageStatus'] == 1) { - toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); + toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, toDoProvider.notificationsCount); + // toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); } else {} }).catchError((err) { print(err); @@ -441,9 +442,10 @@ class _BookConfirmState extends State { } getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) { + int languageID = projectViewModel.isArabic ? 1 : 2; String errorMsg = ""; GifLoaderDialogUtils.showMyDialog(context); - widget.service.getPatientShare(appointmentNo, clinicID, projectID, context).then((res) { + widget.service.getPatientShare(appointmentNo, clinicID, projectID, languageID, context).then((res) { projectViewModel.selectedBodyPartList.clear(); projectViewModel.laserSelectionDuration = 0; if(res['OnlineCheckInAppointments'].length != 0) { diff --git a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart index 9b5c47a7..d5c60b20 100644 --- a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart +++ b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart @@ -468,12 +468,13 @@ class _CovidTimeSlotsState extends State with TickerProviderStat } getToDoCount() { - toDoProvider.setState(0, true, toDoProvider.notificationsCount); + toDoProvider.setState(0, 0, true, toDoProvider.notificationsCount); ClinicListService service = new ClinicListService(); service.getActiveAppointmentNo(context).then((res) { print(res['AppointmentActiveNumber']); if (res['MessageStatus'] == 1) { - toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); + toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, toDoProvider.notificationsCount); + // toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); } else {} }).catchError((err) { print(err); @@ -499,8 +500,9 @@ class _CovidTimeSlotsState extends State with TickerProviderStat } getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) { + int languageID = projectViewModel.isArabic ? 1 : 2; DoctorsListService service = new DoctorsListService(); - service.getPatientShare(appointmentNo, clinicID, projectID, context).then((res) { + service.getPatientShare(appointmentNo, clinicID, projectID, languageID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); print(res); widget.patientShareResponse = new PatientShareResponse.fromJson(res); diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index eedf36fc..9feb62ec 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -600,13 +600,14 @@ class _MyFamily extends State with TickerProviderStateMixin { } getToDoCount() async { - toDoProvider.setState(0, true, toDoProvider.notificationsCount); + toDoProvider.setState(0, 0, true, toDoProvider.notificationsCount); ClinicListService service = ClinicListService(); try { var res = await service.getActiveAppointmentNo(context); print(res['AppointmentActiveNumber']); if (res['MessageStatus'] == 1 && res['AppointmentActiveNumber'] != null) { - toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); + // toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); + toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, toDoProvider.notificationsCount); } else {} } catch (ex) { print("getToDoCount:$ex"); diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index ceee266b..67b165b8 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -11,6 +11,7 @@ import 'package:diplomaticquarterapp/models/header_model.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/BookConfirm.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/DocAvailableAppointments.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/SchedulePage.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; @@ -260,6 +261,19 @@ class _AppointmentDetailsState extends State with SingleTick ), ), ); + list.add( + SizedBox(width: 8), + ); + if (AppointmentType.isBooked(widget.appo)) + list.add( + Expanded( + child: DefaultButton( + TranslationBase.of(context).confirm, + confirmAppointment, + color: Color(0xff359846), + ), + ), + ); } else if (_tabController.index == 1) { list.add( Expanded( @@ -489,10 +503,10 @@ class _AppointmentDetailsState extends State with SingleTick minWidth: MediaQuery.of(context).size.width, height: 40.0, child: CustomTextButton( - elevation: 0.0, - backgroundColor: Colors.white, - disabledForegroundColor: new Color(0xFFbcc2c4).withOpacity(0.38), - disabledBackgroundColor: new Color(0xFFbcc2c4).withOpacity(0.12), + elevation: 0.0, + backgroundColor: Colors.white, + disabledForegroundColor: new Color(0xFFbcc2c4).withOpacity(0.38), + disabledBackgroundColor: new Color(0xFFbcc2c4).withOpacity(0.12), onPressed: () { Navigator.of(context).pop(); }, @@ -627,11 +641,12 @@ class _AppointmentDetailsState extends State with SingleTick } getToDoCount() { - toDoProvider.setState(0, true, toDoProvider.notificationsCount); + toDoProvider.setState(0, 0, true, toDoProvider.notificationsCount); ClinicListService service = new ClinicListService(); service.getActiveAppointmentNo(context).then((res) { if (res['MessageStatus'] == 1) { - toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); + // toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); + toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, toDoProvider.notificationsCount); } else {} }).catchError((err) { print(err); diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index a53b231f..072c622e 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -25,7 +25,8 @@ import 'package:provider/provider.dart'; import 'AppointmentDetails.dart'; class MyAppointments extends StatefulWidget { - List appoList = []; + List upcomingAppoList = []; + List arrivedAppoListNew = []; List bookedAppoList = []; List confirmedAppoList = []; @@ -39,6 +40,9 @@ class MyAppointments extends StatefulWidget { List _patientConfirmedAppointmentListClinic = List(); List _patientArrivedAppointmentListClinic = List(); + List _patientBookedAndConfirmedAppointmentListHospital = List(); + List _patientBookedAndConfirmedAppointmentListClinic = List(); + @override _MyAppointmentsState createState() => _MyAppointmentsState(); } @@ -52,7 +56,7 @@ class _MyAppointmentsState extends State with SingleTickerProvid FilterType filterType; - int _currentPage = 0; + int _currentPage = 1; ToDoCountProviderModel toDoProvider; ProjectViewModel projectViewModel; @@ -61,7 +65,7 @@ class _MyAppointmentsState extends State with SingleTickerProvid void initState() { filterType = FilterType.Clinic; WidgetsBinding.instance.addPostFrameCallback((_) { - if (Provider.of(context, listen: false).isLogin) getPatientAppointmentHistory(); + if (Provider.of(context, listen: false).isLogin) getPatientAppointmentHistory(true, false); }); imagesInfo.add(ImagesInfo( imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-appointment/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-appointment/ar/0.png')); @@ -86,7 +90,7 @@ class _MyAppointmentsState extends State with SingleTickerProvid showNewAppBar: true, backgroundColor: Color(0xffF8F8F8), showNewAppBarTitle: true, - showDropDown: true, + showDropDown: false, dropdownIndexValue: _currentPage, dropDownIndexChange: (index) { setState(() { @@ -94,8 +98,8 @@ class _MyAppointmentsState extends State with SingleTickerProvid }); }, dropDownList: [ - TranslationBase.of(context).booked, - TranslationBase.of(context).confirmed, + // TranslationBase.of(context).booked, + TranslationBase.of(context).upcoming, TranslationBase.of(context).arrived, ], description: TranslationBase.of(context).infoMyAppointments, @@ -115,10 +119,10 @@ class _MyAppointmentsState extends State with SingleTickerProvid Padding( padding: EdgeInsets.only(left: 21, right: 21), child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - myRadioButton(TranslationBase.of(context).booked, 0), - myRadioButton(TranslationBase.of(context).confirmed, 1), + myRadioButton(TranslationBase.of(context).upcoming, 1), + // myRadioButton(TranslationBase.of(context).upcoming, 1), myRadioButton(TranslationBase.of(context).arrived, 2), ], ), @@ -127,7 +131,7 @@ class _MyAppointmentsState extends State with SingleTickerProvid ? Expanded( child: IndexedStack( index: _currentPage, - children: [getBookedAppointments(), getConfirmedAppointments(), getArrivedAppointments()], + children: [getBookedAppointments(), getBookedAndConfirmedAppointments(), getArrivedAppointments()], ), ) : Container(), @@ -136,11 +140,14 @@ class _MyAppointmentsState extends State with SingleTickerProvid ); } - getPatientAppointmentHistory() { + getPatientAppointmentHistory(bool isForUpcoming, bool isForArrived) { int languageID = projectViewModel.isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - widget.appoList.clear(); + + widget.upcomingAppoList.clear(); + widget.arrivedAppoListNew.clear(); + widget.bookedAppoList.clear(); widget.confirmedAppoList.clear(); widget.arrivedAppoList.clear(); @@ -153,19 +160,23 @@ class _MyAppointmentsState extends State with SingleTickerProvid widget._patientConfirmedAppointmentListClinic.clear(); widget._patientArrivedAppointmentListClinic.clear(); - service.getPatientAppointmentHistory(false, languageID, context).then((res) { + widget._patientBookedAndConfirmedAppointmentListHospital.clear(); + widget._patientBookedAndConfirmedAppointmentListClinic.clear(); + + service.getPatientAppointmentHistory(false, languageID, context, isForUpcomming: isForUpcoming, IsForArrived: isForArrived).then((res) { GifLoaderDialogUtils.hideDialog(context); setState(() { if (res['MessageStatus'] == 1) { - // setState(() { if (res['AppoimentAllHistoryResultList'].length != 0) { - // isDataLoaded = true; res['AppoimentAllHistoryResultList'].forEach((v) { - widget.appoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); + if (isForArrived) { + widget.arrivedAppoListNew.add(new AppoitmentAllHistoryResultList.fromJson(v)); + } else { + widget.upcomingAppoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); + } }); - sortAppointmentList(); + sortAppointmentList(isForUpcoming, isForArrived); } else {} - // }); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } @@ -180,11 +191,12 @@ class _MyAppointmentsState extends State with SingleTickerProvid } getToDoCount() { - toDoProvider.setState(0, true, "0"); + toDoProvider.setState(0, 0, true, "0"); ClinicListService service = new ClinicListService(); service.getActiveAppointmentNo(context).then((res) { if (res['MessageStatus'] == 1) { - toDoProvider.setState(res['AppointmentActiveNumber'], true, "0"); + // toDoProvider.setState(res['AppointmentActiveNumber'], true, "0"); + toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, "0"); } else {} }).catchError((err) { print(err); @@ -203,20 +215,36 @@ class _MyAppointmentsState extends State with SingleTickerProvid return AppointmentType.isBooked(appo); } - sortAppointmentList() { - widget.appoList.forEach((v) { - if (isBooked(v)) { - widget.bookedAppoList.add(v); - } + sortAppointmentList(bool isForUpcoming, bool isForArrived) { + if (isForArrived) { + widget.arrivedAppoListNew.forEach((v) { + if (isBooked(v)) { + widget.bookedAppoList.add(v); + } - if (isConfirmed(v)) { - widget.confirmedAppoList.add(v); - } + if (isConfirmed(v)) { + widget.confirmedAppoList.add(v); + } - if (isArrived(v)) { - widget.arrivedAppoList.add(v); - } - }); + if (isArrived(v)) { + widget.arrivedAppoList.add(v); + } + }); + } else { + widget.upcomingAppoList.forEach((v) { + if (isBooked(v)) { + widget.bookedAppoList.add(v); + } + + if (isConfirmed(v)) { + widget.confirmedAppoList.add(v); + } + + if (isArrived(v)) { + widget.arrivedAppoList.add(v); + } + }); + } widget.bookedAppoList.forEach((element) { List doctorByClinic = widget._patientBookedAppointmentListClinic @@ -242,6 +270,10 @@ class _MyAppointmentsState extends State with SingleTickerProvid } else { widget._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); }); widget.confirmedAppoList.forEach((element) { @@ -268,6 +300,10 @@ class _MyAppointmentsState extends State with SingleTickerProvid } else { widget._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); }); widget.arrivedAppoList.forEach((element) { @@ -295,7 +331,7 @@ class _MyAppointmentsState extends State with SingleTickerProvid widget._patientArrivedAppointmentListHospital.add(PatientAppointmentList(filterName: element.projectName, patientDoctorAppointment: element)); } - openAppointmentsTab(); + // openAppointmentsTab(); }); } @@ -326,6 +362,11 @@ class _MyAppointmentsState extends State with SingleTickerProvid return _getAppointment(widget.bookedAppoList.length, (filterType == FilterType.Clinic) ? widget._patientBookedAppointmentListClinic : widget._patientBookedAppointmentListHospital); } + Widget getBookedAndConfirmedAppointments() { + return _getAppointment((widget.bookedAppoList.length + widget.confirmedAppoList.length), + (filterType == FilterType.Clinic) ? widget._patientBookedAndConfirmedAppointmentListClinic : widget._patientBookedAndConfirmedAppointmentListHospital); + } + Widget _getAppointment(int _listLength, List _list) { return Container( child: Container( @@ -341,7 +382,7 @@ 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).noConfirmedAppo : 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, ), @@ -388,7 +429,7 @@ class _MyAppointmentsState extends State with SingleTickerProvid ), ), ).then((value) { - getPatientAppointmentHistory(); + getPatientAppointmentHistory(true, false); }), isInOutPatient: _appointmentResult.isInOutPatient, name: _appointmentResult.doctorTitle + " " + _appointmentResult.doctorNameObj, @@ -453,6 +494,12 @@ class _MyAppointmentsState extends State with SingleTickerProvid onChanged: (index) { setState(() { _currentPage = index; + if (_value == 1) { + getPatientAppointmentHistory(true, false); + } + if (_value == 2) { + getPatientAppointmentHistory(false, true); + } }); //_pageController.animateToPage(index, duration: Duration(milliseconds: 250), curve: Curves.easeInOut); }, diff --git a/lib/pages/ToDoList/ObGyne/ObGyne-TimeSlots.dart b/lib/pages/ToDoList/ObGyne/ObGyne-TimeSlots.dart index 970d31c7..ff3bc13c 100644 --- a/lib/pages/ToDoList/ObGyne/ObGyne-TimeSlots.dart +++ b/lib/pages/ToDoList/ObGyne/ObGyne-TimeSlots.dart @@ -402,13 +402,14 @@ class _CovidTimeSlotsState extends State with TickerProviderSta } getToDoCount() { - toDoProvider.setState(0, true, toDoProvider.notificationsCount); + toDoProvider.setState(0, 0, true, toDoProvider.notificationsCount); ClinicListService service = new ClinicListService(); service.getActiveAppointmentNo(context).then((res) { GifLoaderDialogUtils.hideDialog(context); print(res['AppointmentActiveNumber']); if (res['MessageStatus'] == 1) { - toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); + // toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); + toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, toDoProvider.notificationsCount); } else {} Navigator.pushAndRemoveUntil( context, diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 9a2d73bc..b5f417e2 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -860,11 +860,11 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { } getToDoCount() { - toDoProvider.setState(0, true, "0"); + toDoProvider.setState(0, 0, true, "0"); ClinicListService service = new ClinicListService(); service.getActiveAppointmentNo(context).then((res) { if (res['MessageStatus'] == 1) { - toDoProvider.setState(res['AppointmentActiveNumber'], true, "0"); + toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, "0"); } else {} }).catchError((err) { print(err); @@ -919,13 +919,14 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { } getPatientShare(context, AppoitmentAllHistoryResultList appo) { + int languageID = projectViewModel.isArabic ? 1 : 2; String errorMsg = ""; DoctorsListService service = new DoctorsListService(); if (appo.isLiveCareAppointment) { getLiveCareAppointmentPatientShare(context, service, appo); } else { GifLoaderDialogUtils.showMyDialog(context); - service.getPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, context).then((res) { + service.getPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, languageID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['OnlineCheckInAppointments'].length != 0) { widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]); diff --git a/lib/pages/landing/fragments/home_page_fragment2.dart b/lib/pages/landing/fragments/home_page_fragment2.dart index c25e9fd0..6d013e8b 100644 --- a/lib/pages/landing/fragments/home_page_fragment2.dart +++ b/lib/pages/landing/fragments/home_page_fragment2.dart @@ -67,7 +67,7 @@ class _HomePageFragment2State extends State { projectViewModel = Provider.of(context); initialiseHmgServices(false); var appoCountProvider = Provider.of(context); - var userProvider = Provider.of(context); + // var userProvider = Provider.of(context); List myMedicalList = Utils.myMedicalListHomePage(projectViewModel: projectViewModel, context: context, count: appoCountProvider.count, isLogin: projectViewModel.isLogin); return Container( width: double.infinity, diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 1cebe35d..601e7303 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -253,13 +253,14 @@ class _LandingPageState extends State with WidgetsBindingObserver { } getToDoCount() { - toDoProvider.setState(0, true, toDoProvider.notificationsCount); + toDoProvider.setState(0, 0, true, toDoProvider.notificationsCount); ClinicListService service = new ClinicListService(); service.getActiveAppointmentNo(context).then((res) { GifLoaderDialogUtils.hideDialog(context); print(res['AppointmentActiveNumber']); if (res['MessageStatus'] == 1) { - toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); + // toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); + toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, toDoProvider.notificationsCount); } else {} }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); @@ -453,7 +454,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { setState(() { notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); - model.setState(model.count, true, notificationCount); + model.setState(model.count, 0, true, notificationCount); sharedPref.setString(NOTIFICATION_COUNT, notificationCount); }) } @@ -650,7 +651,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { setState(() { if (value != null) { notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); - model.setState(model.count, true, notificationCount); + model.setState(model.count, 0, true, notificationCount); sharedPref.setString(NOTIFICATION_COUNT, notificationCount); FlutterAppIconBadge.updateBadge(num.parse(notificationCount)); } diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index 437e93c9..d47e5117 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -492,8 +492,9 @@ class _clinic_listState extends State { addNewCallForPatientER(String clientRequestID) { LiveCareService service = new LiveCareService(); + int languageID = projectViewModel.isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); - service.addNewCallForPatientER(selectedClinicID, clientRequestID, widget.isPharmacyLiveCare, context).then((res) { + service.addNewCallForPatientER(selectedClinicID, clientRequestID, languageID, widget.isPharmacyLiveCare, context).then((res) { GifLoaderDialogUtils.hideDialog(context); AppToast.showSuccessToast(message: "New Call has been added successfully"); widget.getLiveCareHistory(); diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index d4c8b17f..7497856d 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -677,11 +677,12 @@ class _ConfirmLogin extends State { } getToDoCount() { - toDoProvider.setState(0, true, "0"); + toDoProvider.setState(0, 0, true, "0"); ClinicListService service = new ClinicListService(); service.getActiveAppointmentNo(context).then((res) { if (res['MessageStatus'] == 1) { - toDoProvider.setState(res['AppointmentActiveNumber'], true, "0"); + toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, "0"); + // toDoProvider.setState(res['AppointmentActiveNumber'], true, "0"); } else {} }).catchError((err) { print(err); diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index 69ff8dbb..d55c4017 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -387,12 +387,13 @@ class _Login extends State { } getToDoCount() { - toDoProvider.setState(0, true, toDoProvider.notificationsCount); + toDoProvider.setState(0, 0, true, toDoProvider.notificationsCount); ClinicListService service = new ClinicListService(); service.getActiveAppointmentNo(context).then((res) { print(res['AppointmentActiveNumber']); if (res['MessageStatus'] == 1) { - toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); + // toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); + toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, toDoProvider.notificationsCount); } else {} }).catchError((err) { print(err); diff --git a/lib/pages/login/register-info.dart b/lib/pages/login/register-info.dart index e004663e..8b60295a 100644 --- a/lib/pages/login/register-info.dart +++ b/lib/pages/login/register-info.dart @@ -748,11 +748,12 @@ class _RegisterInfo extends State { } getToDoCount() { - toDoProvider.setState(0, true, "0"); + toDoProvider.setState(0, 0, true, "0"); ClinicListService service = new ClinicListService(); service.getActiveAppointmentNo(context).then((res) { if (res['MessageStatus'] == 1) { - toDoProvider.setState(res['AppointmentActiveNumber'], true, "0"); + // toDoProvider.setState(res['AppointmentActiveNumber'], true, "0"); + toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, "0"); } else {} }).catchError((err) { print(err); diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 910c2680..02559d95 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -443,7 +443,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getPatientShare(String appoID, int clinicID, int projectID, BuildContext context) async { + Future getPatientShare(String appoID, int clinicID, int projectID, int languageID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -468,6 +468,7 @@ class DoctorsListService extends BaseService { "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, + "LanguageID": languageID, "PatientType": authUser.patientType }; @@ -604,7 +605,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getPatientAppointmentHistory(bool isActiveAppointment, int languageID, BuildContext context, {bool isForCOC = false}) async { + Future getPatientAppointmentHistory(bool isActiveAppointment, int languageID, BuildContext context, {bool isForCOC = false, isForUpcomming = false, IsForArrived = false}) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -627,7 +628,9 @@ class DoctorsListService extends BaseService { "PatientTypeID": authUser.patientType, "IsComingFromCOC": isForCOC, "PatientType": authUser.patientType, - "LanguageID": languageID + "LanguageID": languageID, + "isForUpcomming": isForUpcomming, + "IsForArrived": IsForArrived }; dynamic localRes; diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart index ff8abbdc..9b1f1e3b 100644 --- a/lib/services/authentication/auth_provider.dart +++ b/lib/services/authentication/auth_provider.dart @@ -565,7 +565,7 @@ class AuthProvider with ChangeNotifier { await authenticatedUserObject.getUser(); Provider.of(AppGlobal.context, listen: false).isLogin = false; var model = Provider.of(AppGlobal.context, listen: false); - model.setState(0, false, null); + model.setState(0, 0, false, null); Navigator.of(AppGlobal.context).pushReplacementNamed(HOME); } } diff --git a/lib/services/livecare_services/livecare_provider.dart b/lib/services/livecare_services/livecare_provider.dart index b0262ea5..25df930d 100644 --- a/lib/services/livecare_services/livecare_provider.dart +++ b/lib/services/livecare_services/livecare_provider.dart @@ -209,7 +209,7 @@ class LiveCareService extends BaseService { return Future.value(localRes); } - Future addNewCallForPatientER(int serviceID, String clientRequestID, bool isPharma, BuildContext context) async { + Future addNewCallForPatientER(int serviceID, String clientRequestID, int languageID, bool isPharma, BuildContext context) async { Map request; String deviceToken; @@ -237,6 +237,7 @@ class LiveCareService extends BaseService { "Age": authUser.age != null ? authUser.age : 0, "PatientID": authUser.patientID != null ? authUser.patientID : 0, "Gender": authUser.gender != null ? authUser.gender : 0, + "LanguageID": languageID, "IsVoip": Platform.isIOS ? true : false }; diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index e1f1ac74..03a76dc1 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2912,6 +2912,8 @@ class TranslationBase { String get validInsurance => localizedValues["validInsurance"][locale.languageCode]; String get checkInViaLocation => localizedValues["checkInViaLocation"][locale.languageCode]; String get locationCheckInError => localizedValues["locationCheckInError"][locale.languageCode]; + String get upcoming => localizedValues["upcoming"][locale.languageCode]; + String get noUpcomingAppointment => localizedValues["noUpcomingAppointment"][locale.languageCode]; } diff --git a/lib/widgets/bottom_navigation/bottom_navigation_item.dart b/lib/widgets/bottom_navigation/bottom_navigation_item.dart index f7cdafce..db5d0979 100644 --- a/lib/widgets/bottom_navigation/bottom_navigation_item.dart +++ b/lib/widgets/bottom_navigation/bottom_navigation_item.dart @@ -114,7 +114,7 @@ class BottomNavigationItem extends StatelessWidget { borderRadius: BorderRadius.circular(8), badgeContent: Container( padding: EdgeInsets.all(2.0), - child: Text(model.count.toString(), style: TextStyle(color: Colors.white, fontSize: 14.0)), + child: Text((model.count + model.ancillaryCount).toString(), style: TextStyle(color: Colors.white, fontSize: 14.0)), ), ), ), diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 28ff1833..8f3cf40c 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -752,12 +752,13 @@ class _AppDrawerState extends State { } getToDoCount() { - toDoProvider.setState(0, true, toDoProvider.notificationsCount); + toDoProvider.setState(0, 0, true, toDoProvider.notificationsCount); ClinicListService service = new ClinicListService(); service.getActiveAppointmentNo(context).then((res) { print(res['AppointmentActiveNumber']); if (res['MessageStatus'] == 1 && res['AppointmentActiveNumber'] != null) { - toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); + // toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); + toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, toDoProvider.notificationsCount); } else {} }).catchError((err) { print(err);