|
|
|
|
@ -42,7 +42,7 @@ class MedicalFileViewModel extends ChangeNotifier {
|
|
|
|
|
|
|
|
|
|
bool isSickLeavesSortByClinic = true;
|
|
|
|
|
|
|
|
|
|
// bool isSickLeavesDataNeedsReloading = true;
|
|
|
|
|
bool isSickLeavesDataNeedsReloading = true;
|
|
|
|
|
|
|
|
|
|
List<GetAllergiesResponseModel> patientAllergiesList = [];
|
|
|
|
|
|
|
|
|
|
@ -165,15 +165,15 @@ class MedicalFileViewModel extends ChangeNotifier {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setIsPatientSickLeaveListLoading(bool val) {
|
|
|
|
|
// if (val && isSickLeavesDataNeedsReloading) {
|
|
|
|
|
patientSickLeaveList.clear();
|
|
|
|
|
patientSickLeavesByClinic.clear();
|
|
|
|
|
if (val && isSickLeavesDataNeedsReloading) {
|
|
|
|
|
patientSickLeaveList.clear();
|
|
|
|
|
patientSickLeavesByClinic.clear();
|
|
|
|
|
patientSickLeavesByHospital.clear();
|
|
|
|
|
patientSickLeavesViewList.clear();
|
|
|
|
|
patientSickLeavePDFBase64 = "";
|
|
|
|
|
isSickLeavesSortByClinic = true;
|
|
|
|
|
isPatientSickLeaveListLoading = val;
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -282,9 +282,9 @@ class MedicalFileViewModel extends ChangeNotifier {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<void> getPatientSickLeaveList({Function(dynamic)? onSuccess, Function(String)? onError}) async {
|
|
|
|
|
// if (!isSickLeavesDataNeedsReloading) {
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
if (!isSickLeavesDataNeedsReloading) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
patientSickLeaveList.clear();
|
|
|
|
|
notifyListeners();
|
|
|
|
|
@ -300,6 +300,7 @@ class MedicalFileViewModel extends ChangeNotifier {
|
|
|
|
|
// ),
|
|
|
|
|
(failure) async {
|
|
|
|
|
isPatientSickLeaveListLoading = false;
|
|
|
|
|
isSickLeavesDataNeedsReloading = true;
|
|
|
|
|
notifyListeners();
|
|
|
|
|
},
|
|
|
|
|
(apiResponse) {
|
|
|
|
|
@ -330,7 +331,7 @@ class MedicalFileViewModel extends ChangeNotifier {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
patientSickLeavesViewList = patientSickLeavesByClinic;
|
|
|
|
|
// isSickLeavesDataNeedsReloading = false;
|
|
|
|
|
isSickLeavesDataNeedsReloading = false;
|
|
|
|
|
|
|
|
|
|
notifyListeners();
|
|
|
|
|
if (onSuccess != null) {
|
|
|
|
|
|