|
|
|
@ -78,7 +78,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
|
|
|
|
List<PatientAppointmentHistoryResponseModel> patientUpcomingAppointmentsHistoryList = [];
|
|
|
|
List<PatientAppointmentHistoryResponseModel> patientUpcomingAppointmentsHistoryList = [];
|
|
|
|
List<PatientAppointmentHistoryResponseModel> patientArrivedAppointmentsHistoryList = [];
|
|
|
|
List<PatientAppointmentHistoryResponseModel> patientArrivedAppointmentsHistoryList = [];
|
|
|
|
|
|
|
|
|
|
|
|
List<PatientAppointmentHistoryResponseModel> patientAllArrivedAppointmentsHistoryList = [];
|
|
|
|
// List<PatientAppointmentHistoryResponseModel> patientAllArrivedAppointmentsHistoryList = [];
|
|
|
|
|
|
|
|
|
|
|
|
List<PatientAppointmentHistoryResponseModel> patientMyDoctorsList = [];
|
|
|
|
List<PatientAppointmentHistoryResponseModel> patientMyDoctorsList = [];
|
|
|
|
|
|
|
|
|
|
|
|
@ -174,7 +174,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
|
|
|
|
patientAppointmentsHistoryList.clear();
|
|
|
|
patientAppointmentsHistoryList.clear();
|
|
|
|
patientUpcomingAppointmentsHistoryList.clear();
|
|
|
|
patientUpcomingAppointmentsHistoryList.clear();
|
|
|
|
patientArrivedAppointmentsHistoryList.clear();
|
|
|
|
patientArrivedAppointmentsHistoryList.clear();
|
|
|
|
patientAllArrivedAppointmentsHistoryList.clear();
|
|
|
|
// patientAllArrivedAppointmentsHistoryList.clear();
|
|
|
|
patientEyeMeasurementsAppointmentsHistoryList.clear();
|
|
|
|
patientEyeMeasurementsAppointmentsHistoryList.clear();
|
|
|
|
isMyAppointmentsLoading = true;
|
|
|
|
isMyAppointmentsLoading = true;
|
|
|
|
isTimeLineAppointmentsLoading = true;
|
|
|
|
isTimeLineAppointmentsLoading = true;
|
|
|
|
@ -290,7 +290,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
|
|
|
|
patientAppointmentsByHospital.clear();
|
|
|
|
patientAppointmentsByHospital.clear();
|
|
|
|
patientAppointmentsViewList.clear();
|
|
|
|
patientAppointmentsViewList.clear();
|
|
|
|
|
|
|
|
|
|
|
|
patientAllArrivedAppointmentsHistoryList.clear();
|
|
|
|
// patientAllArrivedAppointmentsHistoryList.clear();
|
|
|
|
filteredAppointmentList.clear();
|
|
|
|
filteredAppointmentList.clear();
|
|
|
|
patientAppointmentsHistoryList.clear();
|
|
|
|
patientAppointmentsHistoryList.clear();
|
|
|
|
patientUpcomingAppointmentsHistoryList.clear();
|
|
|
|
patientUpcomingAppointmentsHistoryList.clear();
|
|
|
|
@ -329,7 +329,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
|
|
|
|
isMyAppointmentsLoading = false;
|
|
|
|
isMyAppointmentsLoading = false;
|
|
|
|
isAppointmentDataToBeLoaded = false;
|
|
|
|
isAppointmentDataToBeLoaded = false;
|
|
|
|
if (!isForTimeLine) {
|
|
|
|
if (!isForTimeLine) {
|
|
|
|
patientAllArrivedAppointmentsHistoryList = apiResponse.data!;
|
|
|
|
// patientAllArrivedAppointmentsHistoryList = apiResponse.data!;
|
|
|
|
isArrivedAppointmentDataLoaded = true;
|
|
|
|
isArrivedAppointmentDataLoaded = true;
|
|
|
|
isFullArrivedAppointmentsLoaded = true;
|
|
|
|
isFullArrivedAppointmentsLoaded = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -383,7 +383,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
|
|
|
|
// Handle error
|
|
|
|
// Handle error
|
|
|
|
} else if (apiResponse.messageStatus == 1) {
|
|
|
|
} else if (apiResponse.messageStatus == 1) {
|
|
|
|
patientArrivedAppointmentsHistoryList = apiResponse.data!;
|
|
|
|
patientArrivedAppointmentsHistoryList = apiResponse.data!;
|
|
|
|
patientAllArrivedAppointmentsHistoryList = apiResponse.data!;
|
|
|
|
// patientAllArrivedAppointmentsHistoryList = apiResponse.data!;
|
|
|
|
isArrivedAppointmentDataLoaded = true;
|
|
|
|
isArrivedAppointmentDataLoaded = true;
|
|
|
|
isFullArrivedAppointmentsLoaded = true;
|
|
|
|
isFullArrivedAppointmentsLoaded = true;
|
|
|
|
|
|
|
|
|
|
|
|
@ -414,9 +414,9 @@ class MyAppointmentsViewModel extends ChangeNotifier {
|
|
|
|
availableFilters.add(AppointmentListingFilters.LIVECARE);
|
|
|
|
availableFilters.add(AppointmentListingFilters.LIVECARE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (filteredAppointmentList.any((element) => element.isLiveCareAppointment == false)) {
|
|
|
|
// if (filteredAppointmentList.any((element) => element.isLiveCareAppointment == false)) {
|
|
|
|
availableFilters.add(AppointmentListingFilters.WALKIN);
|
|
|
|
// availableFilters.add(AppointmentListingFilters.WALKIN);
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
if (filteredAppointmentList.any((element) => AppointmentType.isArrived(element) == true)) {
|
|
|
|
if (filteredAppointmentList.any((element) => AppointmentType.isArrived(element) == true)) {
|
|
|
|
availableFilters.add(AppointmentListingFilters.ARRIVED);
|
|
|
|
availableFilters.add(AppointmentListingFilters.ARRIVED);
|
|
|
|
@ -853,15 +853,15 @@ class MyAppointmentsViewModel extends ChangeNotifier {
|
|
|
|
selectedFilter = [];
|
|
|
|
selectedFilter = [];
|
|
|
|
// if(previouslySelectedTab == selectedTabIndex ) return;
|
|
|
|
// if(previouslySelectedTab == selectedTabIndex ) return;
|
|
|
|
switch (index) {
|
|
|
|
switch (index) {
|
|
|
|
|
|
|
|
// case 0:
|
|
|
|
|
|
|
|
// filteredAppointmentList.clear();
|
|
|
|
|
|
|
|
// filteredAppointmentList.addAll(patientAppointmentsHistoryList);
|
|
|
|
|
|
|
|
// break;
|
|
|
|
case 0:
|
|
|
|
case 0:
|
|
|
|
filteredAppointmentList.clear();
|
|
|
|
|
|
|
|
filteredAppointmentList.addAll(patientAppointmentsHistoryList);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
|
|
|
|
filteredAppointmentList.clear();
|
|
|
|
filteredAppointmentList.clear();
|
|
|
|
filteredAppointmentList.addAll(patientUpcomingAppointmentsHistoryList);
|
|
|
|
filteredAppointmentList.addAll(patientUpcomingAppointmentsHistoryList);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
case 1:
|
|
|
|
filteredAppointmentList.clear();
|
|
|
|
filteredAppointmentList.clear();
|
|
|
|
filteredAppointmentList.addAll(patientArrivedAppointmentsHistoryList);
|
|
|
|
filteredAppointmentList.addAll(patientArrivedAppointmentsHistoryList);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
@ -887,11 +887,12 @@ class MyAppointmentsViewModel extends ChangeNotifier {
|
|
|
|
this.end = end;
|
|
|
|
this.end = end;
|
|
|
|
isDateFilterSelected = true;
|
|
|
|
isDateFilterSelected = true;
|
|
|
|
List<PatientAppointmentHistoryResponseModel> sourceList = [];
|
|
|
|
List<PatientAppointmentHistoryResponseModel> sourceList = [];
|
|
|
|
|
|
|
|
// if (selectedTabIndex == 0) {
|
|
|
|
|
|
|
|
// sourceList = patientAppointmentsHistoryList;
|
|
|
|
|
|
|
|
// } else
|
|
|
|
if (selectedTabIndex == 0) {
|
|
|
|
if (selectedTabIndex == 0) {
|
|
|
|
sourceList = patientAppointmentsHistoryList;
|
|
|
|
|
|
|
|
} else if (selectedTabIndex == 1) {
|
|
|
|
|
|
|
|
sourceList = patientUpcomingAppointmentsHistoryList;
|
|
|
|
sourceList = patientUpcomingAppointmentsHistoryList;
|
|
|
|
} else if (selectedTabIndex == 2) {
|
|
|
|
} else if (selectedTabIndex == 1) {
|
|
|
|
sourceList = patientArrivedAppointmentsHistoryList;
|
|
|
|
sourceList = patientArrivedAppointmentsHistoryList;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// if (isDateFilterSelected) sourceList = filteredAppointmentList;
|
|
|
|
// if (isDateFilterSelected) sourceList = filteredAppointmentList;
|
|
|
|
|