diff --git a/lib/screens/pharmacy_intervention/viewmodel/pharmacy_intervention_view_model.dart b/lib/screens/pharmacy_intervention/viewmodel/pharmacy_intervention_view_model.dart index f360447a..a0449fea 100644 --- a/lib/screens/pharmacy_intervention/viewmodel/pharmacy_intervention_view_model.dart +++ b/lib/screens/pharmacy_intervention/viewmodel/pharmacy_intervention_view_model.dart @@ -95,6 +95,10 @@ class PharmacyInterventionViewModel extends BaseViewModel { NursingStation? nursingStations; + PharmacyInterventionViewModel(){ + getDoctorProfile(); + } + // InterventionHistoryList? interventionHistoryList = InterventionHistoryList.fromJson({ // "entityList": [ // { @@ -568,8 +572,10 @@ class PharmacyInterventionViewModel extends BaseViewModel { String successMessage = '' }) async { Map? user = await sharedPref.getObj(LOGGED_IN_USER); - var userId = user?['List_MemberInformation'][0]['MemberID']; - + var userId = user?['List_MemberInformation'][0]['MemberID'] ?? doctorProfile?.doctorID; + if(userId == null) { + return; + } var requestJson = { "PatientID":currentlySelectedMedication?.patientID ?? '', 'AdmissionNo': currentlySelectedMedication?.admissionNo.toString() ?? '',