From 2f77592bac3f869bb74e226342a5cfabeb71c04a Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Thu, 10 Dec 2020 15:40:21 +0200 Subject: [PATCH] fix Prescriptions Service and design issues --- lib/config/localized_values.dart | 4 ++++ .../model/prescriptions/request_prescription_report.dart | 2 +- lib/core/service/medical/prescriptions_service.dart | 1 + lib/core/viewModels/medical/prescriptions_view_model.dart | 3 ++- lib/core/viewModels/medical/radiology_view_model.dart | 4 ++-- .../medical/prescriptions/prescription_items_page.dart | 8 ++++++++ lib/pages/medical/radiology/radiology_details_page.dart | 1 + lib/pages/pharmacies/pharmacies_list_screen.dart | 4 ++-- lib/uitl/translations_delegate_base.dart | 1 + lib/widgets/pharmacy/drug_item.dart | 1 + 10 files changed, 23 insertions(+), 6 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 313cbbb2..1cdecf5b 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1192,4 +1192,8 @@ const Map localizedValues = { "en": "Dr. ", "ar": "الدكتور." }, + "sendSuc":{ + "en":"A copy has been sent to the email", + "ar":"تم إرسال نسخة إلى البريد الإلكتروني" + }, }; diff --git a/lib/core/model/prescriptions/request_prescription_report.dart b/lib/core/model/prescriptions/request_prescription_report.dart index df901a99..c8323740 100644 --- a/lib/core/model/prescriptions/request_prescription_report.dart +++ b/lib/core/model/prescriptions/request_prescription_report.dart @@ -82,7 +82,7 @@ class RequestPrescriptionReport { data['EpisodeID'] = this.episodeID; data['ClinicID'] = this.clinicID; data['ProjectID'] = this.projectID; - // data['DischargeNo'] = this.dischargeNo; + data['DischargeNo'] = this.dischargeNo; return data; } } diff --git a/lib/core/service/medical/prescriptions_service.dart b/lib/core/service/medical/prescriptions_service.dart index d6ad3732..e9741a7f 100644 --- a/lib/core/service/medical/prescriptions_service.dart +++ b/lib/core/service/medical/prescriptions_service.dart @@ -72,6 +72,7 @@ class PrescriptionsService extends BaseService { prescriptionReportEnhList.clear(); if(prescriptions.isInOutPatient){ response['ListPRM'].forEach((prescriptions) { + prescriptionReportList.add(PrescriptionReport.fromJson(prescriptions)); prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(prescriptions)); }); }else{ diff --git a/lib/core/viewModels/medical/prescriptions_view_model.dart b/lib/core/viewModels/medical/prescriptions_view_model.dart index 1cd934e2..2c32a081 100644 --- a/lib/core/viewModels/medical/prescriptions_view_model.dart +++ b/lib/core/viewModels/medical/prescriptions_view_model.dart @@ -119,6 +119,7 @@ class PrescriptionsViewModel extends BaseViewModel { int patientID, String clinicName, String doctorName, + String mes, int projectID}) async { setState(ViewState.BusyLocal); await _prescriptionsService.sendPrescriptionEmail( @@ -128,7 +129,7 @@ class PrescriptionsViewModel extends BaseViewModel { setState(ViewState.ErrorLocal); AppToast.showErrorToast(message: error); } else { - AppToast.showSuccessToast(message: 'A copy has been sent to the e-mail'); + AppToast.showSuccessToast(message: mes); setState(ViewState.Idle); } } diff --git a/lib/core/viewModels/medical/radiology_view_model.dart b/lib/core/viewModels/medical/radiology_view_model.dart index 26d40361..076707dc 100644 --- a/lib/core/viewModels/medical/radiology_view_model.dart +++ b/lib/core/viewModels/medical/radiology_view_model.dart @@ -80,7 +80,7 @@ class RadiologyViewModel extends BaseViewModel { } sendRadReportEmail( - {FinalRadiology finalRadiology}) async { + {FinalRadiology finalRadiology,String mes}) async { setState(ViewState.BusyLocal); await _radiologyService.sendRadReportEmail( finalRadiology: finalRadiology @@ -89,7 +89,7 @@ class RadiologyViewModel extends BaseViewModel { error = _radiologyService.error; AppToast.showErrorToast(message: error); } else { - AppToast.showSuccessToast(message: 'A copy has been sent to the email'); + AppToast.showSuccessToast(message: mes); } setState(ViewState.Idle); } diff --git a/lib/pages/medical/prescriptions/prescription_items_page.dart b/lib/pages/medical/prescriptions/prescription_items_page.dart index 696ea2db..5037a195 100644 --- a/lib/pages/medical/prescriptions/prescription_items_page.dart +++ b/lib/pages/medical/prescriptions/prescription_items_page.dart @@ -63,6 +63,7 @@ class PrescriptionItemsPage extends StatelessWidget { height: 70, ), ), + SizedBox(width: 10,), Expanded( child: Padding( padding: const EdgeInsets.all(8.0), @@ -121,6 +122,7 @@ class PrescriptionItemsPage extends StatelessWidget { height: 70, ), ), + SizedBox(width: 10,), Expanded( child: Padding( padding: const EdgeInsets.all(8.0), @@ -133,6 +135,11 @@ class PrescriptionItemsPage extends StatelessWidget { ), ), ), + Icon( + Icons.arrow_forward_ios, + size: 18, + color: Colors.grey[500], + ) ], ), ), @@ -157,6 +164,7 @@ class PrescriptionItemsPage extends StatelessWidget { patientID: prescriptions.patientID, clinicName: prescriptions.companyName, doctorName: prescriptions.doctorName, + mes: TranslationBase.of(context).sendSuc, projectID: prescriptions.projectID), loading: model.state == ViewState.BusyLocal, ), diff --git a/lib/pages/medical/radiology/radiology_details_page.dart b/lib/pages/medical/radiology/radiology_details_page.dart index b0f97534..f4e9f0e5 100644 --- a/lib/pages/medical/radiology/radiology_details_page.dart +++ b/lib/pages/medical/radiology/radiology_details_page.dart @@ -60,6 +60,7 @@ class RadiologyDetailsPage extends StatelessWidget { width: MediaQuery.of(context).size.width * 0.8, child: Button( onTap: () => model.sendRadReportEmail( + mes: TranslationBase.of(context).sendSuc, finalRadiology: finalRadiology), label: TranslationBase.of(context).sendCopyRad, loading: model.state == ViewState.BusyLocal, diff --git a/lib/pages/pharmacies/pharmacies_list_screen.dart b/lib/pages/pharmacies/pharmacies_list_screen.dart index dc69a3e2..ce042462 100644 --- a/lib/pages/pharmacies/pharmacies_list_screen.dart +++ b/lib/pages/pharmacies/pharmacies_list_screen.dart @@ -146,7 +146,7 @@ class PharmaciesList extends StatelessWidget { child: InkWell( child: Icon( Icons.phone, - color: Colors.red, + color: Theme.of(context).primaryColor, ), onTap: () => launch("tel://" + model.pharmacyList[index].phoneNumber), @@ -157,7 +157,7 @@ class PharmaciesList extends StatelessWidget { child: InkWell( child: Icon( Icons.local_pharmacy, - color: Colors.red, + color: Theme.of(context).primaryColor, ), onTap: () { MapsLauncher.launchCoordinates( diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 53ae86d4..31523ec5 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -949,6 +949,7 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get notActive => localizedValues['not-active'][locale.languageCode]; String get cardDetail => localizedValues['card-detail'][locale.languageCode]; String get dr => localizedValues['Dr'][locale.languageCode]; + String get sendSuc => localizedValues['sendSuc'][locale.languageCode]; } diff --git a/lib/widgets/pharmacy/drug_item.dart b/lib/widgets/pharmacy/drug_item.dart index 05f6ef4c..7736e089 100644 --- a/lib/widgets/pharmacy/drug_item.dart +++ b/lib/widgets/pharmacy/drug_item.dart @@ -50,6 +50,7 @@ class _MedicineItemWidgetState extends State { ), ), ), + SizedBox(width: 10,), Expanded( child: Center( child: Padding(