|
|
|
|
@ -45,7 +45,6 @@ class MedicalFileViewModel extends ChangeNotifier {
|
|
|
|
|
List<SickLeaveList> patientSickLeavesViewList = [];
|
|
|
|
|
|
|
|
|
|
bool isSickLeavesSortByClinic = true;
|
|
|
|
|
|
|
|
|
|
bool isSickLeavesDataNeedsReloading = true;
|
|
|
|
|
|
|
|
|
|
List<GetAllergiesResponseModel> patientAllergiesList = [];
|
|
|
|
|
@ -61,6 +60,7 @@ class MedicalFileViewModel extends ChangeNotifier {
|
|
|
|
|
List<MedicalReportList> patientMedicalReportsViewList = [];
|
|
|
|
|
|
|
|
|
|
bool isMedicalReportsSortByClinic = true;
|
|
|
|
|
bool isMedicalReportsDataNeedsReloading = true;
|
|
|
|
|
|
|
|
|
|
List<PatientAppointmentHistoryResponseModel> patientMedicalReportAppointmentHistoryList = [];
|
|
|
|
|
PatientAppointmentHistoryResponseModel? patientMedicalReportSelectedAppointment;
|
|
|
|
|
@ -192,7 +192,7 @@ class MedicalFileViewModel extends ChangeNotifier {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setIsPatientMedicalReportsLoading(bool val) {
|
|
|
|
|
if (val) {
|
|
|
|
|
if (val && isMedicalReportsDataNeedsReloading) {
|
|
|
|
|
onMedicalReportTabChange(0);
|
|
|
|
|
patientMedicalReportList.clear();
|
|
|
|
|
patientMedicalReportsByClinic.clear();
|
|
|
|
|
@ -200,8 +200,8 @@ class MedicalFileViewModel extends ChangeNotifier {
|
|
|
|
|
patientMedicalReportsViewList.clear();
|
|
|
|
|
patientMedicalReportPDFBase64 = "";
|
|
|
|
|
isMedicalReportsSortByClinic = true;
|
|
|
|
|
isPatientMedicalReportsListLoading = val;
|
|
|
|
|
}
|
|
|
|
|
isPatientMedicalReportsListLoading = val;
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -373,6 +373,10 @@ class MedicalFileViewModel extends ChangeNotifier {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<void> getPatientMedicalReportList({Function(dynamic)? onSuccess, Function(String)? onError}) async {
|
|
|
|
|
if (!isMedicalReportsDataNeedsReloading) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
patientMedicalReportList.clear();
|
|
|
|
|
patientMedicalReportRequestedList.clear();
|
|
|
|
|
patientMedicalReportReadyList.clear();
|
|
|
|
|
@ -385,6 +389,7 @@ class MedicalFileViewModel extends ChangeNotifier {
|
|
|
|
|
(failure) async => await errorHandlerService.handleError(
|
|
|
|
|
failure: failure,
|
|
|
|
|
onOkPressed: () {
|
|
|
|
|
isMedicalReportsDataNeedsReloading = true;
|
|
|
|
|
onError!(failure.message);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
@ -400,6 +405,7 @@ class MedicalFileViewModel extends ChangeNotifier {
|
|
|
|
|
}
|
|
|
|
|
onMedicalReportTabChange(0);
|
|
|
|
|
isPatientMedicalReportsListLoading = false;
|
|
|
|
|
isMedicalReportsDataNeedsReloading = false;
|
|
|
|
|
notifyListeners();
|
|
|
|
|
if (onSuccess != null) {
|
|
|
|
|
onSuccess(apiResponse);
|
|
|
|
|
|