|
|
|
@ -127,6 +127,8 @@ class MyAppointmentsViewModel extends ChangeNotifier {
|
|
|
|
|
|
|
|
|
|
|
|
initAppointmentsViewModel() {
|
|
|
|
initAppointmentsViewModel() {
|
|
|
|
if (isAppointmentDataToBeLoaded) {
|
|
|
|
if (isAppointmentDataToBeLoaded) {
|
|
|
|
|
|
|
|
// Default view is grouped by clinic on first open.
|
|
|
|
|
|
|
|
isAppointmentsSortByClinic = true;
|
|
|
|
patientAppointmentsHistoryList.clear();
|
|
|
|
patientAppointmentsHistoryList.clear();
|
|
|
|
patientUpcomingAppointmentsHistoryList.clear();
|
|
|
|
patientUpcomingAppointmentsHistoryList.clear();
|
|
|
|
patientArrivedAppointmentsHistoryList.clear();
|
|
|
|
patientArrivedAppointmentsHistoryList.clear();
|
|
|
|
@ -269,6 +271,9 @@ class MyAppointmentsViewModel extends ChangeNotifier {
|
|
|
|
patientAppointmentsHistoryList.addAll(patientArrivedAppointmentsHistoryList);
|
|
|
|
patientAppointmentsHistoryList.addAll(patientArrivedAppointmentsHistoryList);
|
|
|
|
filteredAppointmentList.addAll(patientAppointmentsHistoryList);
|
|
|
|
filteredAppointmentList.addAll(patientAppointmentsHistoryList);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Build grouped list immediately so the UI has data for the default (By Clinic) view.
|
|
|
|
|
|
|
|
_groupAppointmentsByClinicAndHospital();
|
|
|
|
|
|
|
|
|
|
|
|
if (patientArrivedAppointmentsHistoryList.isNotEmpty) {
|
|
|
|
if (patientArrivedAppointmentsHistoryList.isNotEmpty) {
|
|
|
|
if (Utils.isDateToday(DateUtil.convertStringToDate(patientArrivedAppointmentsHistoryList.first.appointmentDate))) {
|
|
|
|
if (Utils.isDateToday(DateUtil.convertStringToDate(patientArrivedAppointmentsHistoryList.first.appointmentDate))) {
|
|
|
|
// getPatientAppointmentQueueDetails(appointmentNo: patientArrivedAppointmentsHistoryList.first.appointmentNo, patientID: patientArrivedAppointmentsHistoryList.first.patientID);
|
|
|
|
// getPatientAppointmentQueueDetails(appointmentNo: patientArrivedAppointmentsHistoryList.first.appointmentNo, patientID: patientArrivedAppointmentsHistoryList.first.patientID);
|
|
|
|
@ -280,6 +285,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
|
|
|
|
print('Arrived Appointments: ${patientArrivedAppointmentsHistoryList.length}');
|
|
|
|
print('Arrived Appointments: ${patientArrivedAppointmentsHistoryList.length}');
|
|
|
|
print('All Appointments: ${patientAppointmentsHistoryList.length}');
|
|
|
|
print('All Appointments: ${patientAppointmentsHistoryList.length}');
|
|
|
|
getFiltersForSelectedAppointmentList(filteredAppointmentList);
|
|
|
|
getFiltersForSelectedAppointmentList(filteredAppointmentList);
|
|
|
|
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void getFiltersForSelectedAppointmentList(List<PatientAppointmentHistoryResponseModel> filteredAppointmentList) {
|
|
|
|
void getFiltersForSelectedAppointmentList(List<PatientAppointmentHistoryResponseModel> filteredAppointmentList) {
|
|
|
|
|