|
|
|
@ -41,7 +41,7 @@ class MedicalFileViewModel extends ChangeNotifier {
|
|
|
|
List<SickLeaveList> patientSickLeavesViewList = [];
|
|
|
|
List<SickLeaveList> patientSickLeavesViewList = [];
|
|
|
|
|
|
|
|
|
|
|
|
bool isSickLeavesSortByClinic = true;
|
|
|
|
bool isSickLeavesSortByClinic = true;
|
|
|
|
bool isSickLeavesDataNeedsReloading = true;
|
|
|
|
// bool isSickLeavesDataNeedsReloading = true;
|
|
|
|
|
|
|
|
|
|
|
|
List<GetAllergiesResponseModel> patientAllergiesList = [];
|
|
|
|
List<GetAllergiesResponseModel> patientAllergiesList = [];
|
|
|
|
|
|
|
|
|
|
|
|
@ -164,7 +164,7 @@ class MedicalFileViewModel extends ChangeNotifier {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
setIsPatientSickLeaveListLoading(bool val) {
|
|
|
|
setIsPatientSickLeaveListLoading(bool val) {
|
|
|
|
if (val && isSickLeavesDataNeedsReloading) {
|
|
|
|
// if (val && isSickLeavesDataNeedsReloading) {
|
|
|
|
patientSickLeaveList.clear();
|
|
|
|
patientSickLeaveList.clear();
|
|
|
|
patientSickLeavesByClinic.clear();
|
|
|
|
patientSickLeavesByClinic.clear();
|
|
|
|
patientSickLeavesByHospital.clear();
|
|
|
|
patientSickLeavesByHospital.clear();
|
|
|
|
@ -172,7 +172,7 @@ class MedicalFileViewModel extends ChangeNotifier {
|
|
|
|
patientSickLeavePDFBase64 = "";
|
|
|
|
patientSickLeavePDFBase64 = "";
|
|
|
|
isSickLeavesSortByClinic = true;
|
|
|
|
isSickLeavesSortByClinic = true;
|
|
|
|
isPatientSickLeaveListLoading = val;
|
|
|
|
isPatientSickLeaveListLoading = val;
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
notifyListeners();
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -268,11 +268,13 @@ class MedicalFileViewModel extends ChangeNotifier {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Future<void> getPatientSickLeaveList({Function(dynamic)? onSuccess, Function(String)? onError}) async {
|
|
|
|
Future<void> getPatientSickLeaveList({Function(dynamic)? onSuccess, Function(String)? onError}) async {
|
|
|
|
if (!isSickLeavesDataNeedsReloading) {
|
|
|
|
// if (!isSickLeavesDataNeedsReloading) {
|
|
|
|
return;
|
|
|
|
// return;
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
patientSickLeaveList.clear();
|
|
|
|
patientSickLeaveList.clear();
|
|
|
|
|
|
|
|
notifyListeners();
|
|
|
|
|
|
|
|
|
|
|
|
final result = await medicalFileRepo.getPatientSickLeavesList();
|
|
|
|
final result = await medicalFileRepo.getPatientSickLeavesList();
|
|
|
|
|
|
|
|
|
|
|
|
result.fold(
|
|
|
|
result.fold(
|
|
|
|
@ -314,7 +316,7 @@ class MedicalFileViewModel extends ChangeNotifier {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
patientSickLeavesViewList = patientSickLeavesByClinic;
|
|
|
|
patientSickLeavesViewList = patientSickLeavesByClinic;
|
|
|
|
isSickLeavesDataNeedsReloading = false;
|
|
|
|
// isSickLeavesDataNeedsReloading = false;
|
|
|
|
|
|
|
|
|
|
|
|
notifyListeners();
|
|
|
|
notifyListeners();
|
|
|
|
if (onSuccess != null) {
|
|
|
|
if (onSuccess != null) {
|
|
|
|
@ -353,6 +355,11 @@ class MedicalFileViewModel extends ChangeNotifier {
|
|
|
|
|
|
|
|
|
|
|
|
Future<void> getPatientMedicalReportList({Function(dynamic)? onSuccess, Function(String)? onError}) async {
|
|
|
|
Future<void> getPatientMedicalReportList({Function(dynamic)? onSuccess, Function(String)? onError}) async {
|
|
|
|
patientMedicalReportList.clear();
|
|
|
|
patientMedicalReportList.clear();
|
|
|
|
|
|
|
|
patientMedicalReportRequestedList.clear();
|
|
|
|
|
|
|
|
patientMedicalReportReadyList.clear();
|
|
|
|
|
|
|
|
patientMedicalReportCancelledList.clear();
|
|
|
|
|
|
|
|
notifyListeners();
|
|
|
|
|
|
|
|
|
|
|
|
final result = await medicalFileRepo.getPatientMedicalReportsList();
|
|
|
|
final result = await medicalFileRepo.getPatientMedicalReportsList();
|
|
|
|
|
|
|
|
|
|
|
|
result.fold(
|
|
|
|
result.fold(
|
|
|
|
|