From aa7f69cfc4cc78306a0e998e64c0cd11220112a2 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 25 Feb 2026 13:46:41 +0300 Subject: [PATCH] updates --- lib/client/base_app_client.dart | 9 ++++++++- lib/core/viewModel/PatientSearchViewModel.dart | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index f2985d97..49e693f3 100755 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -43,7 +43,14 @@ class BaseAppClient { bool callLog = true; try { Map? profile = await sharedPref.getObj(DOCTOR_PROFILE); - if (body?['MemberID'] == null) body?['MemberID'] = HospitalsService.memberId; // changed from null; because create update episode not working + + if (profile != null) { + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + if (body?['MemberID'] == null) + body?['MemberID'] = HospitalsService.memberId.isNotEmpty ? HospitalsService.memberId : doctorProfile.doctorID; // changed from null; because create update episode not working + } + + // if (body?['MemberID'] == null) body?['MemberID'] = HospitalsService.memberId; // changed from null; because create update episode not working String? token = await sharedPref.getString(TOKEN); if(!isCustomRequest) { diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 2ac5973d..0656f73f 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -65,6 +65,7 @@ class PatientSearchViewModel extends BaseViewModel { await getDoctorProfile(isGetProfile: true); patientSearchRequestModel.loginDoctorID = doctorProfile!.doctorID; patientSearchRequestModel.doctorID = doctorProfile!.doctorID; + patientSearchRequestModel.clinicID = doctorProfile!.clinicID; // Added clinic filter to avoid fetching all based on DoctorIDh await _outPatientService.getOutPatient(patientSearchRequestModel); if (_outPatientService.hasError) { error = _outPatientService.error;