|
|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/core/app_state.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/core/utils/date_util.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/core/utils/utils.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/features/my_appointments/models/appointemnet_filters.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/ask_doctor_request_type_response_model.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/get_tamara_installments_details_response_model.dart';
|
|
|
|
|
@ -226,7 +227,10 @@ class MyAppointmentsViewModel extends ChangeNotifier {
|
|
|
|
|
filteredAppointmentList.addAll(patientAppointmentsHistoryList);
|
|
|
|
|
|
|
|
|
|
if (patientArrivedAppointmentsHistoryList.isNotEmpty) {
|
|
|
|
|
getPatientAppointmentQueueDetails(appointmentNo: patientArrivedAppointmentsHistoryList.first.appointmentNo, patientID: patientArrivedAppointmentsHistoryList.first.patientID);
|
|
|
|
|
if (Utils.isDateToday(DateUtil.convertStringToDate(patientArrivedAppointmentsHistoryList.first.appointmentDate))) {
|
|
|
|
|
// getPatientAppointmentQueueDetails(appointmentNo: patientArrivedAppointmentsHistoryList.first.appointmentNo, patientID: patientArrivedAppointmentsHistoryList.first.patientID);
|
|
|
|
|
getPatientAppointmentQueueDetails();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
print('Upcoming Appointments: ${patientUpcomingAppointmentsHistoryList.length}');
|
|
|
|
|
@ -670,10 +674,11 @@ class MyAppointmentsViewModel extends ChangeNotifier {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<void> getPatientAppointmentQueueDetails({required int appointmentNo, required int patientID, Function(dynamic)? onSuccess, Function(String)? onError}) async {
|
|
|
|
|
Future<void> getPatientAppointmentQueueDetails({Function(dynamic)? onSuccess, Function(String)? onError}) async {
|
|
|
|
|
isAppointmentQueueDetailsLoading = true;
|
|
|
|
|
notifyListeners();
|
|
|
|
|
final result = await myAppointmentsRepo.getPatientAppointmentQueueDetails(appointmentNo: appointmentNo, patientID: patientID);
|
|
|
|
|
final result = await myAppointmentsRepo.getPatientAppointmentQueueDetails(
|
|
|
|
|
appointmentNo: patientArrivedAppointmentsHistoryList.first.appointmentNo, patientID: patientArrivedAppointmentsHistoryList.first.patientID);
|
|
|
|
|
|
|
|
|
|
isAppointmentQueueDetailsLoading = false;
|
|
|
|
|
|
|
|
|
|
@ -692,7 +697,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
|
|
|
|
|
isPatientHasQueueAppointment = true;
|
|
|
|
|
patientQueueDetailsList = apiResponse.data!;
|
|
|
|
|
for (var element in patientQueueDetailsList) {
|
|
|
|
|
if (element.patientID == patientID) {
|
|
|
|
|
if (element.patientID == patientArrivedAppointmentsHistoryList.first.patientID) {
|
|
|
|
|
currentPatientQueueDetails = element;
|
|
|
|
|
currentQueueStatus = element.callType!;
|
|
|
|
|
// currentQueueStatus = 2;
|
|
|
|
|
@ -701,7 +706,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
|
|
|
|
|
}
|
|
|
|
|
// patientQueueDetailsList.first.callType = 1;
|
|
|
|
|
|
|
|
|
|
patientQueueDetailsList.removeWhere((element) => element.patientID == patientID);
|
|
|
|
|
patientQueueDetailsList.removeWhere((element) => element.patientID == patientArrivedAppointmentsHistoryList.first.patientID);
|
|
|
|
|
} else {
|
|
|
|
|
isPatientHasQueueAppointment = false;
|
|
|
|
|
}
|
|
|
|
|
|