pull/368/head
haroon amjad 1 month ago
parent 7dc8ba1e36
commit de75c6adc1

@ -31,6 +31,7 @@ import 'package:hmg_patient_app_new/features/habib_wallet/habib_wallet_view_mode
import 'package:hmg_patient_app_new/features/hmg_services/hmg_services_view_model.dart'; import 'package:hmg_patient_app_new/features/hmg_services/hmg_services_view_model.dart';
import 'package:hmg_patient_app_new/features/medical_file/medical_file_view_model.dart'; import 'package:hmg_patient_app_new/features/medical_file/medical_file_view_model.dart';
import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_view_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_view_model.dart';
import 'package:hmg_patient_app_new/features/prescriptions/prescriptions_view_model.dart';
import 'package:hmg_patient_app_new/features/symptoms_checker/symptoms_checker_view_model.dart'; import 'package:hmg_patient_app_new/features/symptoms_checker/symptoms_checker_view_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/authentication/login.dart'; import 'package:hmg_patient_app_new/presentation/authentication/login.dart';
@ -1280,6 +1281,9 @@ class AuthenticationViewModel extends ChangeNotifier {
getIt.get<HabibWalletViewModel>().setIsWalletAmountToBeLoaded(true); getIt.get<HabibWalletViewModel>().setIsWalletAmountToBeLoaded(true);
getIt.get<InsuranceViewModel>().setIsInsuranceDataToBeLoaded(true); getIt.get<InsuranceViewModel>().setIsInsuranceDataToBeLoaded(true);
getIt.get<HmgServicesViewModel>().setHasVitalSignDataLoaded(false); getIt.get<HmgServicesViewModel>().setHasVitalSignDataLoaded(false);
getIt.get<MedicalFileViewModel>().setIsSickLeavesDataNeedsReloading(true);
getIt.get<MedicalFileViewModel>().setIsMedicalReportsDataNeedsReloading(true);
getIt.get<PrescriptionsViewModel>().setIsPrescriptionDataNeedsReloading(true);
if (isUserAgreedBefore) { if (isUserAgreedBefore) {
LoaderBottomSheet.hideLoader(); LoaderBottomSheet.hideLoader();
navigateToHomeScreen(); navigateToHomeScreen();

@ -168,6 +168,16 @@ class MedicalFileViewModel extends ChangeNotifier {
notifyListeners(); notifyListeners();
} }
setIsSickLeavesDataNeedsReloading(bool value) {
isSickLeavesDataNeedsReloading = value;
notifyListeners();
}
setIsMedicalReportsDataNeedsReloading(bool value) {
isMedicalReportsDataNeedsReloading = value;
notifyListeners();
}
setIsPatientSickLeaveListLoading(bool val) { setIsPatientSickLeaveListLoading(bool val) {
if (val && isSickLeavesDataNeedsReloading) { if (val && isSickLeavesDataNeedsReloading) {
patientSickLeaveList.clear(); patientSickLeaveList.clear();

@ -78,6 +78,11 @@ class PrescriptionsViewModel extends ChangeNotifier {
notifyListeners(); notifyListeners();
} }
void setIsPrescriptionDataNeedsReloading(bool value) {
isPrescriptionsDataNeedsReloading = value;
notifyListeners();
}
Future<bool> checkIfReminderExistForPrescription(int index) async { Future<bool> checkIfReminderExistForPrescription(int index) async {
final item = prescriptionDetailsList[index]; final item = prescriptionDetailsList[index];
// Check device calendar // Check device calendar

@ -819,14 +819,23 @@ class _ImmediateLiveCarePaymentPageState extends State<ImmediateLiveCarePaymentP
await payfortViewModel.getPayfortConfigurations( await payfortViewModel.getPayfortConfigurations(
serviceId: ServiceTypeEnum.liveCareAppointment.getIdFromServiceEnum(), serviceId: ServiceTypeEnum.liveCareAppointment.getIdFromServiceEnum(),
projectId: ApiConsts.appEnvironmentType == AppEnvironmentTypeEnum.uat projectId: ApiConsts.appEnvironmentType == AppEnvironmentTypeEnum.uat
? 15 ? appState.getAuthenticatedUser()!.outSa == 0
? 15
: 2
: appState.getAuthenticatedUser()!.outSa == 0 : appState.getAuthenticatedUser()!.outSa == 0
? 12 ? 12
: 2, : 2,
integrationId: 2); integrationId: 2);
} else { } else {
await paytabsViewModel.setPaymentConfiguration("LiveCare Payment", num.parse((immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.total ?? "0.0")), await paytabsViewModel.setPaymentConfiguration("LiveCare Payment", num.parse((immediateLiveCareViewModel.liveCareImmediateAppointmentFeesList.total ?? "0.0")),
ServiceTypeEnum.liveCareAppointment.getIdFromServiceEnum(), (ApiConsts.appEnvironmentType == AppEnvironmentTypeEnum.uat ? 15 : 12)); ServiceTypeEnum.liveCareAppointment.getIdFromServiceEnum(),
(ApiConsts.appEnvironmentType == AppEnvironmentTypeEnum.uat
? appState.getAuthenticatedUser()!.outSa == 0
? 15
: 2
: appState.getAuthenticatedUser()!.outSa == 0
? 12
: 2));
} }
applePayInsertRequest.clientRequestID = transID; applePayInsertRequest.clientRequestID = transID;
@ -841,7 +850,7 @@ class _ImmediateLiveCarePaymentPageState extends State<ImmediateLiveCarePaymentP
applePayInsertRequest.deviceToken = await Utils.getStringFromPrefs(CacheConst.pushToken); applePayInsertRequest.deviceToken = await Utils.getStringFromPrefs(CacheConst.pushToken);
applePayInsertRequest.voipToken = await Utils.getStringFromPrefs(CacheConst.voipToken); applePayInsertRequest.voipToken = await Utils.getStringFromPrefs(CacheConst.voipToken);
applePayInsertRequest.doctorID = 0; applePayInsertRequest.doctorID = 0;
applePayInsertRequest.projectID = "12"; applePayInsertRequest.projectID = appState.getAuthenticatedUser()!.outSa == 0 ? "12" : "2";
applePayInsertRequest.serviceID = ServiceTypeEnum.liveCareAppointment.getIdFromServiceEnum().toString(); applePayInsertRequest.serviceID = ServiceTypeEnum.liveCareAppointment.getIdFromServiceEnum().toString();
applePayInsertRequest.channelID = 3; applePayInsertRequest.channelID = 3;
applePayInsertRequest.patientID = appState.getAuthenticatedUser()!.patientId.toString(); applePayInsertRequest.patientID = appState.getAuthenticatedUser()!.patientId.toString();

@ -485,8 +485,6 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
dividerColor: AppColors.dividerColor, dividerColor: AppColors.dividerColor,
itemPadding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 14.h), itemPadding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 14.h),
onItemToggled: (index, isExpanded) { onItemToggled: (index, isExpanded) {
debugPrint("Item at index $index is now ${isExpanded ? 'expanded' : 'collapsed'}");
if (index == 0 && isExpanded) { if (index == 0 && isExpanded) {
myAppointmentsViewModel.getPatientMyDoctors(isTop8: true); myAppointmentsViewModel.getPatientMyDoctors(isTop8: true);
prescriptionsViewModel.initPrescriptionsViewModel(); prescriptionsViewModel.initPrescriptionsViewModel();

Loading…
Cancel
Save