From 8464c70f35fb82bee48de5a3fe402cd9d44856be Mon Sep 17 00:00:00 2001 From: RoaaGhali98 Date: Wed, 19 Jan 2022 12:14:04 +0200 Subject: [PATCH] Replace static data --- .../intervention_medication_view_model.dart | 62 +++++++++++-------- 1 file changed, 37 insertions(+), 25 deletions(-) diff --git a/lib/core/viewModel/profile/intervention_medication_view_model.dart b/lib/core/viewModel/profile/intervention_medication_view_model.dart index 5f220bdd..1caa36a9 100644 --- a/lib/core/viewModel/profile/intervention_medication_view_model.dart +++ b/lib/core/viewModel/profile/intervention_medication_view_model.dart @@ -37,17 +37,21 @@ class InterventionMedicationViewModel extends BaseViewModel { _interventionMedicationService.allInterventionHistoryList; Future getInterventionMedication({ + int projectId, int patientId, DateTime fromDate, DateTime toDate, + }) async { InterventionMedicationReqModel interventionMedicationReqModel = InterventionMedicationReqModel( - projectID: projectId, - patientID: patientId, - fromDate: AppDateUtils.convertDateToServerFormat(fromDate), - toDate: AppDateUtils.convertDateToServerFormat(toDate), + + projectID: projectId, + patientID: patientId, + fromDate: AppDateUtils.convertDateToServerFormat(fromDate), + toDate: AppDateUtils.convertDateToServerFormat(toDate), + ); hasError = false; setState(ViewState.Busy); @@ -62,20 +66,24 @@ class InterventionMedicationViewModel extends BaseViewModel { } Future getInterventionMedicationHistory( - {int projectId, - int patientId, - int admissionNo, - int prescriptionNo, - int orderNo, + { + int projectId, + int patientId, + int admissionNo, + int prescriptionNo, + int orderNo, + bool isBusyLocal = false}) async { InterventionMedicationHistoryReqModel interventionMedicationHistoryReqModel = InterventionMedicationHistoryReqModel( - projectID: projectId, - patientID: patientId, - admissionNo: admissionNo, - prescriptionNo: prescriptionNo, - orderNo: orderNo, + + projectID: projectId, + patientID: patientId, + admissionNo: admissionNo, + prescriptionNo: prescriptionNo, + orderNo: orderNo, + ); hasError = false; if (isBusyLocal) @@ -97,6 +105,7 @@ class InterventionMedicationViewModel extends BaseViewModel { } Future setAcceptedOrRejected({ + String remarks, int memberId, int projectId, @@ -106,19 +115,22 @@ class InterventionMedicationViewModel extends BaseViewModel { int orderNo, int interventionStatus, int status, + }) async { AcceptOrRejectReqModel acceptOrRejectReqModel = AcceptOrRejectReqModel( - projectID: projectId, - patientID: patientID, - admissionNo: admissionNo, - prescriptionNo: prescriptionNo, - orderNo: orderNo, - accessLevel: 4, - lineItemNo: 1, - remarks: remarks, - memberID: memberId, - interventionStatus: interventionStatus, - status: status + + projectID: projectId, + patientID: patientID, + admissionNo: admissionNo, + prescriptionNo: prescriptionNo, + orderNo: orderNo, + accessLevel: 4, + lineItemNo: 1, + remarks: remarks, + memberID: memberId, + interventionStatus: interventionStatus, + status: status + ); hasError = false; setState(ViewState.BusyLocal);