sickleave & medical report fixes

haroon_dev
haroon amjad 2 days ago
parent c2028841c5
commit 84224ae61b

@ -195,7 +195,7 @@ class ApiClientImp implements ApiClient {
}
// body['TokenID'] = "@dm!n";
// body['PatientID'] = 4773715;
// body['PatientID'] = 4774018;
// body['PatientTypeID'] = 1;
// body['PatientOutSA'] = 0;
// body['SessionID'] = "45786230487560q";

@ -183,7 +183,7 @@ class EmergencyServicesRepoImp implements EmergencyServicesRepo {
@override
Future<Either<Failure, GenericApiModel<List<HospitalsModel>>>> getProjectList() async {
Map<String, dynamic> request = {};
Map<String, dynamic> request = {'IsOnlineCheckIn': false, 'IsAdvancePayment': false, 'IsForER': true};
try {
GenericApiModel<List<HospitalsModel>>? apiResponse;

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

@ -17,6 +17,7 @@ import 'package:hmg_patient_app_new/presentation/medical_report/widgets/patient_
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart';
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart';
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
@ -251,46 +252,21 @@ class _MedicalReportsPageState extends State<MedicalReportsPage> {
],
),
SizedBox(height: 8.h),
Row(
Wrap(
alignment: WrapAlignment.start,
direction: Axis.horizontal,
spacing: 6.h,
runSpacing: 6.h,
children: [
CustomButton(
text: DateUtil.formatDateToDate(DateUtil.convertStringToDate(report.appointmentDate), false),
onPressed: () {},
backgroundColor: AppColors.greyColor,
borderColor: AppColors.greyColor,
textColor: AppColors.blackColor,
fontSize: 10,
fontWeight: FontWeight.w500,
borderRadius: 8,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 24.h,
AppCustomChipWidget(
labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(report.appointmentDate), false),
),
SizedBox(width: 8.h),
CustomButton(
text: medicalFileVM.isMedicalReportsSortByClinic ? report.projectName! : report.clinicDescription!,
onPressed: () {},
backgroundColor: AppColors.greyColor,
borderColor: AppColors.greyColor,
textColor: AppColors.blackColor,
fontSize: 10,
fontWeight: FontWeight.w500,
borderRadius: 8,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 24.h,
),
SizedBox(width: 8.h),
CustomButton(
text: report.statusDesc!,
onPressed: () {},
backgroundColor: AppColors.greyColor,
borderColor: AppColors.greyColor,
textColor: AppColors.blackColor,
fontSize: 10,
fontWeight: FontWeight.w500,
borderRadius: 8,
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
height: 24.h,
AppCustomChipWidget(
labelText: medicalFileVM.isMedicalReportsSortByClinic ? report.projectName! : report.clinicDescription!,
),
report.statusDesc != null ? AppCustomChipWidget(
labelText: report.statusDesc ?? "test",
) : SizedBox.shrink(),
],
),
SizedBox(height: 8.h),

Loading…
Cancel
Save