Merge branch 'development_v3.3' of http://34.17.52.79/Haroon6138/diplomatic-quarter into dev_v3.13.6

# Conflicts:
#	lib/config/localized_values.dart
#	lib/core/service/client/base_app_client.dart
#	lib/models/Appointments/toDoCountProviderModel.dart
#	lib/pages/MyAppointments/AppointmentDetails.dart
#	lib/pages/MyAppointments/MyAppointments.dart
#	lib/pages/ToDoList/ObGyne/ObGyne-TimeSlots.dart
#	lib/pages/ToDoList/ToDo.dart
#	lib/pages/login/login.dart
#	lib/services/authentication/auth_provider.dart
#	lib/widgets/drawer/app_drawer_widget.dart
merge-update-with-lab-changes
Sultan khan 2 years ago
commit 4b28581c55

@ -21,11 +21,11 @@ var PACKAGES_ORDER_HISTORY = '/api/orders/items';
var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// var BASE_URL = 'http://10.50.100.198:2018/'; // var BASE_URL = 'http://10.50.100.198:2018/';
// var BASE_URL = 'http://10.50.100.198:4422/'; // var BASE_URL = 'http://10.50.100.198:4422/';
//var BASE_URL = 'https://uat.hmgwebservices.com/'; var BASE_URL = 'https://uat.hmgwebservices.com/';
// var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/';
// var BASE_URL = 'http://10.20.200.111:1010/'; // var BASE_URL = 'http://10.20.200.111:1010/';
// var BASE_URL = 'https://uat.hmgwebservices.com/'; // var BASE_URL = 'https://uat.hmgwebservices.com/';
var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/';
// var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/';
// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/';
// var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/';
@ -343,7 +343,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari
var CHANNEL = 3; var CHANNEL = 3;
var GENERAL_ID = 'Cs2020@2016\$2958'; var GENERAL_ID = 'Cs2020@2016\$2958';
var IP_ADDRESS = '10.20.10.20'; var IP_ADDRESS = '10.20.10.20';
var VERSION_ID = 11.7; var VERSION_ID = 11.8;
var SETUP_ID = '91877'; var SETUP_ID = '91877';
var LANGUAGE = 2; var LANGUAGE = 2;
// var PATIENT_OUT_SA = 0; // var PATIENT_OUT_SA = 0;

@ -1949,6 +1949,6 @@ const Map localizedValues = {
"receive": {"en": "Receive", "ar": "تجهيز"}, "receive": {"en": "Receive", "ar": "تجهيز"},
"PRO": {"en": "PRO", "ar": "علاقات المرضى"}, "PRO": {"en": "PRO", "ar": "علاقات المرضى"},
"patientRelationOffice": {"en": "Patient Relation Office", "ar": "علاقات المرضى"}, "patientRelationOffice": {"en": "Patient Relation Office", "ar": "علاقات المرضى"},
"upcoming": {"en": "Upcoming", "ar": "المواعيد القادمة"},
"noUpcomingAppointment": {"en": "No upcoming appointments", "ar": "لا توجد مواعيد القادمة"},
}; };

@ -188,7 +188,7 @@ class BaseAppClient {
// body['IdentificationNo'] = 1023854217; // body['IdentificationNo'] = 1023854217;
// body['MobileNo'] = "531940021"; // body['MobileNo'] = "531940021";
// body['PatientID'] = 1014144; //3844083 // body['PatientID'] = 291367; //3844083
// body['TokenID'] = "@dm!n"; // body['TokenID'] = "@dm!n";
// Patient ID: 3027574 // Patient ID: 3027574
@ -867,7 +867,7 @@ class BaseAppClient {
Provider.of<ToDoCountProviderModel>(AppGlobal.context, listen: false); Provider.of<ToDoCountProviderModel>(AppGlobal.context, listen: false);
_vitalSignService.weightKg = ""; _vitalSignService.weightKg = "";
_vitalSignService.heightCm = ""; _vitalSignService.heightCm = "";
model.setState(0, false, ""); model.setState(0, 0, false, null);
Navigator.of(AppGlobal.context).pushReplacementNamed(HOME); Navigator.of(AppGlobal.context).pushReplacementNamed(HOME);
} }

@ -39,7 +39,7 @@ class NotificationViewModel extends BaseViewModel {
await authService.getDashboard().then((value) { await authService.getDashboard().then((value) {
var notificationCount = ''; var notificationCount = '';
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, true, notificationCount); model.setState(model.count, 0, true, notificationCount);
sharedPref.setString(NOTIFICATION_COUNT, notificationCount); sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
}); });

@ -1,20 +1,25 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
class ToDoCountProviderModel with ChangeNotifier { class ToDoCountProviderModel with ChangeNotifier {
int? _count; int? _count;
int? _ancillaryCount;
String? _notificationsCount; String? _notificationsCount;
bool? _isShowBadge = false; bool? _isShowBadge = false;
int get count => _count == null ? 0 : _count!;
String get notificationsCount => _notificationsCount == null ? "0" : _notificationsCount!; 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!; bool get isShowBadge => _isShowBadge!;
void setState(int count, bool isShowBadge, String notifCount) { void setState(int? count, int? ancillaryCount, bool? isShowBadge, String? notifCount) {
_count = count; _count = count;
_isShowBadge = isShowBadge; _isShowBadge = isShowBadge;
_notificationsCount = notifCount; _notificationsCount = notifCount;
_ancillaryCount = ancillaryCount;
notifyListeners(); notifyListeners();
} }
} }

@ -431,12 +431,13 @@ class _BookConfirmState extends State<BookConfirm> {
} }
getToDoCount() { getToDoCount() {
toDoProvider.setState(0, true, toDoProvider.notificationsCount); toDoProvider.setState(0, 0, true, toDoProvider.notificationsCount);
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
print(res['AppointmentActiveNumber']); print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1) { 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 {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);
@ -444,9 +445,10 @@ class _BookConfirmState extends State<BookConfirm> {
} }
getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) { getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) {
int languageID = projectViewModel.isArabic ? 1 : 2;
String errorMsg = ""; String errorMsg = "";
GifLoaderDialogUtils.showMyDialog(context); 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.selectedBodyPartList.clear();
projectViewModel.laserSelectionDuration = 0; projectViewModel.laserSelectionDuration = 0;
if(res['OnlineCheckInAppointments'].length != 0) { if(res['OnlineCheckInAppointments'].length != 0) {

@ -464,12 +464,13 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
} }
getToDoCount() { getToDoCount() {
toDoProvider.setState(0, true, toDoProvider.notificationsCount); toDoProvider.setState(0, 0, true, toDoProvider.notificationsCount);
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
print(res['AppointmentActiveNumber']); print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1) { 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 {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);
@ -495,8 +496,9 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
} }
getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) { getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) {
int languageID = projectViewModel.isArabic ? 1 : 2;
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getPatientShare(appointmentNo, clinicID, projectID, context).then((res) { service.getPatientShare(appointmentNo, clinicID, projectID, languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(res); print(res);
widget.patientShareResponse = new PatientShareResponse.fromJson(res); widget.patientShareResponse = new PatientShareResponse.fromJson(res);

@ -600,13 +600,14 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
} }
getToDoCount() async { getToDoCount() async {
toDoProvider.setState(0, true, toDoProvider.notificationsCount); toDoProvider.setState(0, 0, true, toDoProvider.notificationsCount);
ClinicListService service = ClinicListService(); ClinicListService service = ClinicListService();
try { try {
var res = await service.getActiveAppointmentNo(context); var res = await service.getActiveAppointmentNo(context);
print(res['AppointmentActiveNumber']); print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1 && res['AppointmentActiveNumber'] != null) { 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 {} } else {}
} catch (ex) { } catch (ex) {
print("getToDoCount:$ex"); print("getToDoCount:$ex");

@ -13,6 +13,7 @@ import 'package:diplomaticquarterapp/models/header_model.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/BookConfirm.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/BookConfirm.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/components/DocAvailableAppointments.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/DocAvailableAppointments.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/SchedulePage.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/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
@ -247,13 +248,21 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
list.add( list.add(
Expanded( Expanded(
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).cancelAppointment, TranslationBase
.of(context)
.cancelAppointment,
() { () {
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(
context: context, context: context,
confirmMessage: TranslationBase.of(context).cancelAppoMsg, confirmMessage: TranslationBase
okText: TranslationBase.of(context).confirm, .of(context)
cancelText: TranslationBase.of(context).cancel_nocaps, .cancelAppoMsg,
okText: TranslationBase
.of(context)
.confirm,
cancelText: TranslationBase
.of(context)
.cancel_nocaps,
okFunction: cancelAppointment, okFunction: cancelAppointment,
cancelFunction: () => {}); cancelFunction: () => {});
dialog.showAlertDialog(context); dialog.showAlertDialog(context);
@ -263,7 +272,8 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
), ),
), ),
); );
} else if (_tabController!.index == 1) { }
else if (_tabController!.index == 1) {
list.add( list.add(
Expanded( Expanded(
child: DefaultButton( child: DefaultButton(
@ -668,11 +678,13 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
} }
getToDoCount() { getToDoCount() {
toDoProvider!.setState(0, true, toDoProvider!.notificationsCount);
toDoProvider!.setState(0, 0, true, toDoProvider!.notificationsCount);
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
if (res['MessageStatus'] == 1) { 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 {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);

@ -25,7 +25,8 @@ import 'package:provider/provider.dart';
import 'AppointmentDetails.dart'; import 'AppointmentDetails.dart';
class MyAppointments extends StatefulWidget { class MyAppointments extends StatefulWidget {
List<AppoitmentAllHistoryResultList> appoList = []; List<AppoitmentAllHistoryResultList> upcomingAppoList = [];
List<AppoitmentAllHistoryResultList> arrivedAppoListNew = [];
List<AppoitmentAllHistoryResultList> bookedAppoList = []; List<AppoitmentAllHistoryResultList> bookedAppoList = [];
List<AppoitmentAllHistoryResultList> confirmedAppoList = []; List<AppoitmentAllHistoryResultList> confirmedAppoList = [];
@ -39,6 +40,9 @@ class MyAppointments extends StatefulWidget {
List<PatientAppointmentList> _patientConfirmedAppointmentListClinic =[]; List<PatientAppointmentList> _patientConfirmedAppointmentListClinic =[];
List<PatientAppointmentList> _patientArrivedAppointmentListClinic =[]; List<PatientAppointmentList> _patientArrivedAppointmentListClinic =[];
List<PatientAppointmentList> _patientBookedAndConfirmedAppointmentListHospital = [];
List<PatientAppointmentList> _patientBookedAndConfirmedAppointmentListClinic = [];
@override @override
_MyAppointmentsState createState() => _MyAppointmentsState(); _MyAppointmentsState createState() => _MyAppointmentsState();
} }
@ -52,7 +56,7 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
FilterType? filterType; FilterType? filterType;
int _currentPage = 0; int _currentPage = 1;
ToDoCountProviderModel? toDoProvider; ToDoCountProviderModel? toDoProvider;
ProjectViewModel? projectViewModel; ProjectViewModel? projectViewModel;
@ -61,7 +65,7 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
void initState() { void initState() {
filterType = FilterType.Clinic; filterType = FilterType.Clinic;
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
if (Provider.of<ProjectViewModel>(context, listen: false).isLogin) getPatientAppointmentHistory(); if (Provider.of<ProjectViewModel>(context, listen: false).isLogin) getPatientAppointmentHistory(true, false);
}); });
imagesInfo.add(ImagesInfo( 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')); 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<MyAppointments> with SingleTickerProvid
showNewAppBar: true, showNewAppBar: true,
backgroundColor: Color(0xffF8F8F8), backgroundColor: Color(0xffF8F8F8),
showNewAppBarTitle: true, showNewAppBarTitle: true,
showDropDown: true, showDropDown: false,
dropdownIndexValue: _currentPage, dropdownIndexValue: _currentPage,
dropDownIndexChange: (index) { dropDownIndexChange: (index) {
setState(() { setState(() {
@ -94,8 +98,8 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
}); });
}, },
dropDownList: [ dropDownList: [
TranslationBase.of(context).booked, // TranslationBase.of(context).booked,
TranslationBase.of(context).confirmed, TranslationBase.of(context).upcoming,
TranslationBase.of(context).arrived, TranslationBase.of(context).arrived,
], ],
description: TranslationBase.of(context).infoMyAppointments, description: TranslationBase.of(context).infoMyAppointments,
@ -115,10 +119,10 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
Padding( Padding(
padding: EdgeInsets.only(left: 21, right: 21), padding: EdgeInsets.only(left: 21, right: 21),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
myRadioButton(TranslationBase.of(context).booked, 0), myRadioButton(TranslationBase.of(context).upcoming, 1),
myRadioButton(TranslationBase.of(context).confirmed, 1), // myRadioButton(TranslationBase.of(context).upcoming, 1),
myRadioButton(TranslationBase.of(context).arrived, 2), myRadioButton(TranslationBase.of(context).arrived, 2),
], ],
), ),
@ -127,7 +131,7 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
? Expanded( ? Expanded(
child: IndexedStack( child: IndexedStack(
index: _currentPage, index: _currentPage,
children: [getBookedAppointments(), getConfirmedAppointments(), getArrivedAppointments()], children: [getBookedAppointments(), getBookedAndConfirmedAppointments(), getArrivedAppointments()],
), ),
) )
: Container(), : Container(),
@ -136,11 +140,14 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
); );
} }
getPatientAppointmentHistory() { getPatientAppointmentHistory(bool isForUpcoming, bool isForArrived) {
int languageID = projectViewModel!.isArabic! ? 1 : 2; int? languageID = projectViewModel!.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
widget.appoList.clear();
widget.upcomingAppoList.clear();
widget.arrivedAppoListNew.clear();
widget.bookedAppoList.clear(); widget.bookedAppoList.clear();
widget.confirmedAppoList.clear(); widget.confirmedAppoList.clear();
widget.arrivedAppoList.clear(); widget.arrivedAppoList.clear();
@ -153,19 +160,23 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
widget._patientConfirmedAppointmentListClinic.clear(); widget._patientConfirmedAppointmentListClinic.clear();
widget._patientArrivedAppointmentListClinic.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); GifLoaderDialogUtils.hideDialog(context);
setState(() { setState(() {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
// setState(() {
if (res['AppoimentAllHistoryResultList'].length != 0) { if (res['AppoimentAllHistoryResultList'].length != 0) {
// isDataLoaded = true;
res['AppoimentAllHistoryResultList'].forEach((v) { 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 {}
// });
} else { } else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }
@ -180,11 +191,12 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
} }
getToDoCount() { getToDoCount() {
toDoProvider!.setState(0, true, "0"); toDoProvider!.setState(0, 0, true, "0");
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
if (res['MessageStatus'] == 1) { 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 {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);
@ -203,8 +215,23 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
return AppointmentType.isBooked(appo); return AppointmentType.isBooked(appo);
} }
sortAppointmentList() { sortAppointmentList(bool isForUpcoming, bool isForArrived) {
widget.appoList.forEach((v) { if (isForArrived) {
widget.arrivedAppoListNew.forEach((v) {
if (isBooked(v)) {
widget.bookedAppoList.add(v);
}
if (isConfirmed(v)) {
widget.confirmedAppoList.add(v);
}
if (isArrived(v)) {
widget.arrivedAppoList.add(v);
}
});
} else {
widget.upcomingAppoList.forEach((v) {
if (isBooked(v)) { if (isBooked(v)) {
widget.bookedAppoList.add(v); widget.bookedAppoList.add(v);
} }
@ -217,6 +244,7 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
widget.arrivedAppoList.add(v); widget.arrivedAppoList.add(v);
} }
}); });
}
widget.bookedAppoList.forEach((element) { widget.bookedAppoList.forEach((element) {
List<PatientAppointmentList> doctorByClinic = widget._patientBookedAppointmentListClinic List<PatientAppointmentList> doctorByClinic = widget._patientBookedAppointmentListClinic
@ -242,6 +270,10 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
} else { } else {
widget._patientBookedAppointmentListHospital.add(PatientAppointmentList(filterName: element.projectName, patientDoctorAppointment: element)); 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) { widget.confirmedAppoList.forEach((element) {
@ -268,6 +300,10 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
} else { } else {
widget._patientConfirmedAppointmentListHospital.add(PatientAppointmentList(filterName: element.projectName, patientDoctorAppointment: element)); 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) { widget.arrivedAppoList.forEach((element) {
@ -295,7 +331,7 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
widget._patientArrivedAppointmentListHospital.add(PatientAppointmentList(filterName: element.projectName, patientDoctorAppointment: element)); widget._patientArrivedAppointmentListHospital.add(PatientAppointmentList(filterName: element.projectName, patientDoctorAppointment: element));
} }
openAppointmentsTab(); // openAppointmentsTab();
}); });
} }
@ -326,6 +362,11 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
return _getAppointment(widget.bookedAppoList.length, (filterType == FilterType.Clinic) ? widget._patientBookedAppointmentListClinic : widget._patientBookedAppointmentListHospital); 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<PatientAppointmentList> _list) { Widget _getAppointment(int _listLength, List<PatientAppointmentList> _list) {
return Container( return Container(
child: Container( child: Container(
@ -341,7 +382,7 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 10.0),
child: Text( 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( style: TextStyle(
fontSize: 16.0, fontSize: 16.0,
), ),
@ -388,7 +429,7 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
), ),
), ),
).then((value) { ).then((value) {
getPatientAppointmentHistory(); getPatientAppointmentHistory(true, false);
}), }),
isInOutPatient: _appointmentResult.isInOutPatient, isInOutPatient: _appointmentResult.isInOutPatient,
name: _appointmentResult.doctorTitle! + " " + _appointmentResult.doctorNameObj!, name: _appointmentResult.doctorTitle! + " " + _appointmentResult.doctorNameObj!,
@ -453,6 +494,12 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
onChanged: (index) { onChanged: (index) {
setState(() { setState(() {
_currentPage = index!; _currentPage = index!;
if (_value == 1) {
getPatientAppointmentHistory(true, false);
}
if (_value == 2) {
getPatientAppointmentHistory(false, true);
}
}); });
//_pageController.animateToPage(index, duration: Duration(milliseconds: 250), curve: Curves.easeInOut); //_pageController.animateToPage(index, duration: Duration(milliseconds: 250), curve: Curves.easeInOut);
}, },

@ -402,13 +402,14 @@ class _CovidTimeSlotsState extends State<ObGyneTimeSlots> with TickerProviderSta
} }
getToDoCount() { getToDoCount() {
toDoProvider!.setState(0, true, toDoProvider!.notificationsCount!); toDoProvider!.setState(0, 0, true, toDoProvider!.notificationsCount);
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(res['AppointmentActiveNumber']); print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1) { 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 {} } else {}
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(
context, context,

@ -883,11 +883,11 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
} }
getToDoCount() { getToDoCount() {
toDoProvider.setState(0, true, "0"); toDoProvider.setState(0, 0, true, "0");
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true, "0"); toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, "0");
} else {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);
@ -942,13 +942,14 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
} }
getPatientShare(context, AppoitmentAllHistoryResultList appo) { getPatientShare(context, AppoitmentAllHistoryResultList appo) {
int languageID = projectViewModel.isArabic ? 1 : 2;
String errorMsg = ""; String errorMsg = "";
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
if (appo.isLiveCareAppointment!) { if (appo.isLiveCareAppointment!) {
getLiveCareAppointmentPatientShare(context, service, appo); getLiveCareAppointmentPatientShare(context, service, appo);
} else { } else {
GifLoaderDialogUtils.showMyDialog(context); 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); GifLoaderDialogUtils.hideDialog(context);
if (res['OnlineCheckInAppointments'].length != 0) { if (res['OnlineCheckInAppointments'].length != 0) {
widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]); widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]);

@ -85,7 +85,7 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
} }
var appoCountProvider = Provider.of<ToDoCountProviderModel>(context); var appoCountProvider = Provider.of<ToDoCountProviderModel>(context);
var userProvider = Provider.of<ToDoCountProviderModel>(context); // var userProvider = Provider.of<ToDoCountProviderModel>(context);
List<Widget> myMedicalList = Utils.myMedicalListHomePage(projectViewModel: projectViewModel, context: context, count: appoCountProvider.count, isLogin: projectViewModel.isLogin); List<Widget> myMedicalList = Utils.myMedicalListHomePage(projectViewModel: projectViewModel, context: context, count: appoCountProvider.count, isLogin: projectViewModel.isLogin);
return Container( return Container(
width: double.infinity, width: double.infinity,

@ -234,13 +234,14 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
} }
getToDoCount() { getToDoCount() {
toDoProvider.setState(0, true, toDoProvider.notificationsCount); toDoProvider.setState(0, 0, true, toDoProvider.notificationsCount);
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(res['AppointmentActiveNumber']); print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1) { 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 {} } else {}
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -437,7 +438,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
setState(() { setState(() {
notificationCount = notificationCount =
value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); 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); sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
}) })
} }
@ -634,7 +635,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
setState(() { setState(() {
if (value != null) { 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, true, notificationCount); model.setState(model.count, 0, true, notificationCount);
sharedPref.setString(NOTIFICATION_COUNT, notificationCount); sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
FlutterAppIconBadge.updateBadge(int.parse(notificationCount)); FlutterAppIconBadge.updateBadge(int.parse(notificationCount));
} }

@ -493,8 +493,9 @@ class _clinic_listState extends State<ClinicList> {
addNewCallForPatientER(String clientRequestID) { addNewCallForPatientER(String clientRequestID) {
LiveCareService service = new LiveCareService(); LiveCareService service = new LiveCareService();
int languageID = projectViewModel.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context); 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); GifLoaderDialogUtils.hideDialog(context);
AppToast.showSuccessToast(message: "New Call has been added successfully"); AppToast.showSuccessToast(message: "New Call has been added successfully");
widget.getLiveCareHistory(); widget.getLiveCareHistory();

@ -728,11 +728,12 @@ class _ConfirmLogin extends State<ConfirmLogin> {
} }
getToDoCount() { getToDoCount() {
toDoProvider.setState(0, true, "0"); toDoProvider.setState(0, 0, true, "0");
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
if (res['MessageStatus'] == 1) { 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 {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);

@ -413,13 +413,14 @@ class _Login extends State<Login> {
} }
getToDoCount() { getToDoCount() {
toDoProvider.setState(0, true, toDoProvider.notificationsCount); toDoProvider.setState(0, 0, true, toDoProvider.notificationsCount);
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
//print(res['AppointmentActiveNumber']); //print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true, // toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount);
toDoProvider.notificationsCount); toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, toDoProvider.notificationsCount);
} else {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);

@ -748,11 +748,12 @@ class _RegisterInfo extends State<RegisterInfo> {
} }
getToDoCount() { getToDoCount() {
toDoProvider.setState(0, true, "0"); toDoProvider.setState(0, 0, true, "0");
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
if (res['MessageStatus'] == 1) { 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 {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);

@ -446,7 +446,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getPatientShare(String appoID, int clinicID, int projectID, BuildContext context) async { Future<Map> getPatientShare(String appoID, int clinicID, int projectID, int languageID, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -471,6 +471,7 @@ class DoctorsListService extends BaseService {
"DeviceTypeID": req.DeviceTypeID, "DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID, "PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType, "PatientTypeID": authUser.patientType,
"LanguageID": languageID,
"PatientType": authUser.patientType "PatientType": authUser.patientType
}; };
@ -607,7 +608,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getPatientAppointmentHistory(bool isActiveAppointment, int languageID, BuildContext context, {bool isForCOC = false}) async { Future<Map> getPatientAppointmentHistory(bool isActiveAppointment, int languageID, BuildContext context, {bool isForCOC = false, isForUpcomming = false, IsForArrived = false}) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -630,7 +631,9 @@ class DoctorsListService extends BaseService {
"PatientTypeID": authUser.patientType, "PatientTypeID": authUser.patientType,
"IsComingFromCOC": isForCOC, "IsComingFromCOC": isForCOC,
"PatientType": authUser.patientType, "PatientType": authUser.patientType,
"LanguageID": languageID "LanguageID": languageID,
"isForUpcomming": isForUpcomming,
"IsForArrived": IsForArrived
}; };
dynamic localRes; dynamic localRes;

@ -627,11 +627,9 @@ class AuthProvider with ChangeNotifier {
await sharedPref.remove(LOGIN_TOKEN_ID); await sharedPref.remove(LOGIN_TOKEN_ID);
await sharedPref.remove(PHARMACY_CUSTOMER_ID); await sharedPref.remove(PHARMACY_CUSTOMER_ID);
await authenticatedUserObject.getUser(); await authenticatedUserObject.getUser();
Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isLogin = Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isLogin = false;
false; var model = Provider.of<ToDoCountProviderModel>(AppGlobal.context, listen: false);
var model = model.setState(0, 0, false, null);
Provider.of<ToDoCountProviderModel>(AppGlobal.context, listen: false);
model.setState(0, false, "");
Navigator.of(AppGlobal.context).pushReplacementNamed(HOME); Navigator.of(AppGlobal.context).pushReplacementNamed(HOME);
} }
} }

@ -209,7 +209,7 @@ class LiveCareService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> addNewCallForPatientER(int serviceID, String clientRequestID, bool isPharma, BuildContext context) async { Future<Map> addNewCallForPatientER(int serviceID, String clientRequestID, int languageID, bool isPharma, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
String? deviceToken; String? deviceToken;
@ -238,6 +238,7 @@ class LiveCareService extends BaseService {
"Age": authUser.age != null ? authUser.age : 0, "Age": authUser.age != null ? authUser.age : 0,
"PatientID": authUser.patientID != null ? authUser.patientID : 0, "PatientID": authUser.patientID != null ? authUser.patientID : 0,
"Gender": authUser.gender != null ? authUser.gender : 0, "Gender": authUser.gender != null ? authUser.gender : 0,
"LanguageID": languageID,
"IsVoip": Platform.isIOS ? true : false "IsVoip": Platform.isIOS ? true : false
}; };

@ -2955,6 +2955,8 @@ class TranslationBase {
String get validInsurance => localizedValues["validInsurance"][locale.languageCode]; String get validInsurance => localizedValues["validInsurance"][locale.languageCode];
String get checkInViaLocation => localizedValues["checkInViaLocation"][locale.languageCode]; String get checkInViaLocation => localizedValues["checkInViaLocation"][locale.languageCode];
String get locationCheckInError => localizedValues["locationCheckInError"][locale.languageCode]; String get locationCheckInError => localizedValues["locationCheckInError"][locale.languageCode];
String get upcoming => localizedValues["upcoming"][locale.languageCode];
String get noUpcomingAppointment => localizedValues["noUpcomingAppointment"][locale.languageCode];
} }

@ -120,7 +120,7 @@ class BottomNavigationItem extends StatelessWidget {
// borderRadius: BorderRadius.circular(8), // borderRadius: BorderRadius.circular(8),
badgeContent: Container( badgeContent: Container(
padding: EdgeInsets.all(2.0), 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)),
), ),
), ),
), ),

@ -762,12 +762,13 @@ class _AppDrawerState extends State<AppDrawer> {
} }
getToDoCount() { getToDoCount() {
toDoProvider!.setState(0, true, toDoProvider!.notificationsCount); toDoProvider!.setState(0, 0, true, toDoProvider!.notificationsCount);
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
print(res['AppointmentActiveNumber']); print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1 && res['AppointmentActiveNumber'] != null) { 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 {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);

Loading…
Cancel
Save