Compare commits

...

3 Commits

@ -407,7 +407,8 @@ class AuthenticationViewModel extends BaseViewModel {
logout({bool isFromLogin = false}) async {
localToken = "";
String? lang = await sharedPref.getString(APP_Language);
await Utils.clearSharedPref();
//COMMENTED THE NOT TO CLEAR THE SHARED PREF
// await Utils.clearSharedPref();
doctorProfile = null;
sharedPref.setString(APP_Language, lang ?? 'en');
deleteUser();

@ -78,7 +78,6 @@ class PharmacyInterventionService extends BaseService {
}, onFailure: (String error, int statusCode) {
hasError = true;
DrAppToastMsg.showErrorToast(error);
super.error = super.error ?? "" + "\n" + error;
}, body: {});
return success;
@ -97,8 +96,6 @@ class PharmacyInterventionService extends BaseService {
}, onFailure: (String error, int statusCode) {
hasError = true;
DrAppToastMsg.showErrorToast(error);
super.error = super.error! + "\n" + error;
}, body: {});
return success;
}
@ -125,9 +122,6 @@ class PharmacyInterventionService extends BaseService {
}, onFailure: (String error, int statusCode) {
hasError = true;
DrAppToastMsg.showErrorToast(error);
super.error = super.error! + "\n" + error;
}, body: request);
return result;
}
@ -139,11 +133,10 @@ class PharmacyInterventionService extends BaseService {
var result = false;
await baseAppClient.post(UPDATE_INFECTIOUS_STATUS,
onSuccess: (dynamic response, int statusCode) {
result = response['IsAccepted'];
result = response['IsAccepted'] ?? false;
}, onFailure: (String error, int statusCode) {
hasError = true;
DrAppToastMsg.showErrorToast(error);
super.error = super.error! + "\n" + error;
}, body: request);
return result;
}
@ -158,8 +151,6 @@ class PharmacyInterventionService extends BaseService {
}, onFailure: (String error, int statusCode) {
hasError = true;
DrAppToastMsg.showErrorToast(error);
super.error = super.error! + "\n" + error;
}, body: {});
return station;
}

@ -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<String, dynamic>? 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() ?? '',

Loading…
Cancel
Save