From 19d981d9e0e97494e79a97930a598824a121c99f Mon Sep 17 00:00:00 2001 From: RoaaGhali98 Date: Tue, 18 Jan 2022 23:28:21 +0200 Subject: [PATCH 1/5] Wrapping the Row cards with CustomRow in intervention_medication.dart and intervention_medication_history_screen.dart and fix the accept or reject issue, fix the lable in intervention_medication_history_screen.dart and edit the initial date in pharmacy_intervention_screen.dart --- .../intervention_medication_view_model.dart | 2 + .../accept_or_reject_req_model.dart | 5 + .../intervention_medication.dart | 123 +++++------------- ...ntervention_medication_history_screen.dart | 95 ++++---------- .../pharmacy_intervention_screen.dart | 25 ++-- 5 files changed, 74 insertions(+), 176 deletions(-) diff --git a/lib/core/viewModel/profile/intervention_medication_view_model.dart b/lib/core/viewModel/profile/intervention_medication_view_model.dart index c6e2dbff..ea93a7d9 100644 --- a/lib/core/viewModel/profile/intervention_medication_view_model.dart +++ b/lib/core/viewModel/profile/intervention_medication_view_model.dart @@ -113,6 +113,7 @@ class InterventionMedicationViewModel extends BaseViewModel { int prescriptionNo, int orderNo, int interventionStatus, + int status, }) async { AcceptOrRejectReqModel acceptOrRejectReqModel = AcceptOrRejectReqModel( projectID: 15, @@ -131,6 +132,7 @@ class InterventionMedicationViewModel extends BaseViewModel { memberID: 2804, //memberId, interventionStatus: interventionStatus, + status: status ); hasError = false; setState(ViewState.BusyLocal); diff --git a/lib/screens/patients/profile/pharmacy-intervention-model/accept_or_reject_req_model.dart b/lib/screens/patients/profile/pharmacy-intervention-model/accept_or_reject_req_model.dart index b3660d59..67b234de 100644 --- a/lib/screens/patients/profile/pharmacy-intervention-model/accept_or_reject_req_model.dart +++ b/lib/screens/patients/profile/pharmacy-intervention-model/accept_or_reject_req_model.dart @@ -11,6 +11,7 @@ class AcceptOrRejectReqModel { int lineItemNo; bool patientOutSA; int interventionStatus; + int status; AcceptOrRejectReqModel( {this.patientID, @@ -25,6 +26,7 @@ class AcceptOrRejectReqModel { this.lineItemNo, this.patientOutSA, this.interventionStatus, + this.status }); AcceptOrRejectReqModel.fromJson(Map json) { @@ -40,6 +42,8 @@ class AcceptOrRejectReqModel { lineItemNo = json['LineItemNo']; patientOutSA = json['PatientOutSA']; interventionStatus = json['InterventionStatus']; + status = json['Status']; + } Map toJson() { @@ -56,6 +60,7 @@ class AcceptOrRejectReqModel { data['LineItemNo'] = this.lineItemNo; data['PatientOutSA'] = this.patientOutSA; data['InterventionStatus'] = this.interventionStatus; + data['Status'] = this.status; return data; } } \ No newline at end of file diff --git a/lib/screens/patients/profile/pharmacy-intervention/intervention_medication.dart b/lib/screens/patients/profile/pharmacy-intervention/intervention_medication.dart index bb38b28a..3944d2b8 100644 --- a/lib/screens/patients/profile/pharmacy-intervention/intervention_medication.dart +++ b/lib/screens/patients/profile/pharmacy-intervention/intervention_medication.dart @@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; +import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import '../../../../core/viewModel/profile/intervention_medication_view_model.dart'; @@ -102,22 +103,11 @@ class _InterventionMedicationScreenState CrossAxisAlignment .start, children: [ - Row( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - AppText( - model - .allInterventionList[ - index] - .cS, - fontWeight: - FontWeight.w600, - fontSize: 14, - ), - ], - ), + CustomRow( + valueSize: 14, + label: '', + value: model.allInterventionList[index].cS, + ) ], ), ), @@ -142,6 +132,7 @@ class _InterventionMedicationScreenState fontWeight: FontWeight.w600, fontSize: 14, + color: Color(0xFF2B353E), ), ], ), @@ -152,91 +143,39 @@ class _InterventionMedicationScreenState SizedBox( height: 8, ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - 'Description: ', - fontSize: 12, - ), - Expanded( - child: AppText( - model - .allInterventionList[ - index] - .description, - fontSize: 12, - isCopyable: true, - ), - ), - ]), + CustomRow( + labelSize: 12, + valueSize: 12, + label: 'Description: ', + value: model.allInterventionList[index].description, + ), SizedBox( height: 8, ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - 'Medication: ', - fontSize: 12, - ), - Expanded( - child: AppText( - model - .allInterventionList[ - index] - .medication, - fontSize: 12, - isCopyable: true, - ), - ), - ]), + CustomRow( + labelSize: 12, + valueSize: 12, + label: 'Medication: ', + value: model.allInterventionList[index].medication, + ), SizedBox( height: 8, ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - 'Doctor Comments: ', - fontSize: 12, - ), - Expanded( - child: AppText( - model - .allInterventionList[ - index] - .doctorComments, - fontSize: 12, - isCopyable: true, - ), - ), - ]), + CustomRow( + labelSize: 12, + valueSize: 12, + label: 'Doctor Comments: ', + value: model.allInterventionList[index].doctorComments, + ), SizedBox( height: 8, ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - 'Status Description: ', - fontSize: 12, - ), - Expanded( - child: AppText( - model - .allInterventionList[ - index] - .statusDescription, - fontSize: 12, - isCopyable: true, - ), - ), - ]), + CustomRow( + labelSize: 12, + valueSize: 12, + label: 'Status Description: ', + value: model.allInterventionList[index].statusDescription, + ), ], ), SizedBox( diff --git a/lib/screens/patients/profile/pharmacy-intervention/intervention_medication_history_screen.dart b/lib/screens/patients/profile/pharmacy-intervention/intervention_medication_history_screen.dart index c7aaceeb..e1c0de4b 100644 --- a/lib/screens/patients/profile/pharmacy-intervention/intervention_medication_history_screen.dart +++ b/lib/screens/patients/profile/pharmacy-intervention/intervention_medication_history_screen.dart @@ -19,6 +19,7 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import '../../../../config/config.dart'; import '../../../../core/viewModel/profile/intervention_medication_view_model.dart'; +import '../../../../widgets/shared/user-guid/CusomRow.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); @@ -102,20 +103,11 @@ class _InterventionMedicationHistoryScreenState extends State - InterventionMedicationScreen(patient,previousModel: model,)), + InterventionMedicationScreen( + patient, + previousModel: model, + )), ); }, ), From fdc39f28e3a59a403dd1964d157c5439f11c3cfa Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Wed, 19 Jan 2022 12:08:06 +0200 Subject: [PATCH 2/5] small change --- .../intervention_medication_history_screen.dart | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/lib/screens/patients/profile/pharmacy-intervention/intervention_medication_history_screen.dart b/lib/screens/patients/profile/pharmacy-intervention/intervention_medication_history_screen.dart index e1c0de4b..2ceab871 100644 --- a/lib/screens/patients/profile/pharmacy-intervention/intervention_medication_history_screen.dart +++ b/lib/screens/patients/profile/pharmacy-intervention/intervention_medication_history_screen.dart @@ -104,10 +104,10 @@ class _InterventionMedicationHistoryScreenState extends State Date: Wed, 19 Jan 2022 12:11:05 +0200 Subject: [PATCH 3/5] Replace static data --- .../intervention_medication_view_model.dart | 44 +++++++------------ 1 file changed, 15 insertions(+), 29 deletions(-) diff --git a/lib/core/viewModel/profile/intervention_medication_view_model.dart b/lib/core/viewModel/profile/intervention_medication_view_model.dart index ea93a7d9..5f220bdd 100644 --- a/lib/core/viewModel/profile/intervention_medication_view_model.dart +++ b/lib/core/viewModel/profile/intervention_medication_view_model.dart @@ -44,14 +44,10 @@ class InterventionMedicationViewModel extends BaseViewModel { }) async { InterventionMedicationReqModel interventionMedicationReqModel = InterventionMedicationReqModel( - projectID: 15, - //projectId, - patientID: 79941, - //patientId, - fromDate: "\/Date(1488322922)\/", - //AppDateUtils.convertDateToServerFormat(fromDate), - toDate: - "\/Date(1635886800000)\/", //AppDateUtils.convertDateToServerFormat(toDate), + projectID: projectId, + patientID: patientId, + fromDate: AppDateUtils.convertDateToServerFormat(fromDate), + toDate: AppDateUtils.convertDateToServerFormat(toDate), ); hasError = false; setState(ViewState.Busy); @@ -75,15 +71,11 @@ class InterventionMedicationViewModel extends BaseViewModel { InterventionMedicationHistoryReqModel interventionMedicationHistoryReqModel = InterventionMedicationHistoryReqModel( - projectID: 15, - //projectId, - patientID: 79941, - //patientId, - admissionNo: 2018013900, - //admissionNo, - prescriptionNo: 2045165, - //prescriptionNo, - orderNo: 1171570, //orderNo, + projectID: projectId, + patientID: patientId, + admissionNo: admissionNo, + prescriptionNo: prescriptionNo, + orderNo: orderNo, ); hasError = false; if (isBusyLocal) @@ -116,21 +108,15 @@ class InterventionMedicationViewModel extends BaseViewModel { int status, }) async { AcceptOrRejectReqModel acceptOrRejectReqModel = AcceptOrRejectReqModel( - projectID: 15, - //projectId, - patientID: 79941, - //patientID, - admissionNo: 2018013900, - //admissionNo, - prescriptionNo: 2045165, - //prescriptionNo, - orderNo: 1171570, - //orderNo, + projectID: projectId, + patientID: patientID, + admissionNo: admissionNo, + prescriptionNo: prescriptionNo, + orderNo: orderNo, accessLevel: 4, lineItemNo: 1, remarks: remarks, - memberID: 2804, - //memberId, + memberID: memberId, interventionStatus: interventionStatus, status: status ); From 8464c70f35fb82bee48de5a3fe402cd9d44856be Mon Sep 17 00:00:00 2001 From: RoaaGhali98 Date: Wed, 19 Jan 2022 12:14:04 +0200 Subject: [PATCH 4/5] 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); From 90c74c2f0651fd04bf80d8701549e3ccd12bbefe Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Wed, 19 Jan 2022 12:41:23 +0200 Subject: [PATCH 5/5] small fix issues --- .../profile/intervention_medication_view_model.dart | 4 ++-- .../pharmacy_intervention_screen.dart | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/core/viewModel/profile/intervention_medication_view_model.dart b/lib/core/viewModel/profile/intervention_medication_view_model.dart index 1caa36a9..9c456a2a 100644 --- a/lib/core/viewModel/profile/intervention_medication_view_model.dart +++ b/lib/core/viewModel/profile/intervention_medication_view_model.dart @@ -22,8 +22,8 @@ class InterventionMedicationViewModel extends BaseViewModel { List filterData = []; - DateTime selectedFromDate; - DateTime selectedToDate; + DateTime selectedFromDate = DateTime.now(); + DateTime selectedToDate = DateTime.now().add(Duration(days: 1)); PatiantInformtion patient; bool hasError = false; diff --git a/lib/screens/patients/profile/pharmacy-intervention/pharmacy_intervention_screen.dart b/lib/screens/patients/profile/pharmacy-intervention/pharmacy_intervention_screen.dart index 2ce150d8..f7e2d7ba 100644 --- a/lib/screens/patients/profile/pharmacy-intervention/pharmacy_intervention_screen.dart +++ b/lib/screens/patients/profile/pharmacy-intervention/pharmacy_intervention_screen.dart @@ -85,9 +85,8 @@ class _PharmacyInterventionScreenState child: TextField( decoration: textFieldSelectorDecoration( TranslationBase.of(context).fromDate, - model.selectedFromDate != null - ? "${AppDateUtils.convertStringToDateFormat(model.selectedFromDate.toString(), "yyyy-MM-dd")}" - : "${AppDateUtils.convertStringToDateFormat(DateTime.now().toString(), "yyyy-MM-dd")}", + "${AppDateUtils.convertStringToDateFormat(model.selectedFromDate.toString(), "yyyy-MM-dd")}" + , true, suffixIcon: Icon( Icons.calendar_today, @@ -122,9 +121,8 @@ class _PharmacyInterventionScreenState child: TextField( decoration: textFieldSelectorDecoration( TranslationBase.of(context).toDate, - model.selectedToDate != null - ? "${AppDateUtils.convertStringToDateFormat(model.selectedToDate.toString(), "yyyy-MM-dd")}" - : "${AppDateUtils.convertStringToDateFormat(DateTime.now().add(Duration(days: 1)).toString(), "yyyy-MM-dd")}", + "${AppDateUtils.convertStringToDateFormat(model.selectedToDate.toString(), "yyyy-MM-dd")}" + , true, suffixIcon: Icon( Icons.calendar_today,