From cb4ee05b409c0f8ce21cb4e609faaf99e400c160 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 31 Dec 2020 17:52:32 +0200 Subject: [PATCH] working on ucaf --- lib/config/localized_values.dart | 1 + lib/core/service/patient-ucaf-service.dart | 5 ++++ .../viewModel/patient-ucaf-viewmodel.dart | 9 ++++++ lib/locator.dart | 4 +++ lib/routes.dart | 3 ++ .../profile/UCAF/UCAF-input-screen.dart | 28 +++++++++++++++++++ lib/util/translations_delegate_base.dart | 1 + .../profile/profile_medical_info_widget.dart | 9 ++++++ 8 files changed, 60 insertions(+) create mode 100644 lib/core/service/patient-ucaf-service.dart create mode 100644 lib/core/viewModel/patient-ucaf-viewmodel.dart create mode 100644 lib/screens/patients/profile/UCAF/UCAF-input-screen.dart diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index c84307a5..453cef8f 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -401,4 +401,5 @@ const Map> localizedValues = { 'dietTypeRemarks': {'en': "Remarks on diet type", 'ar': 'ملاحظات على نوع النظام الغذائي'}, 'save': {'en': "SAVE", 'ar': 'حفظ'}, 'postPlansEstimatedCost': {'en': "POST PLANS & ESTIMATED COST", 'ar': 'خطط البريد والتكلفة المقدرة'}, + 'ucaf': {'en': "UCAF", 'ar': 'UCAF'}, }; diff --git a/lib/core/service/patient-ucaf-service.dart b/lib/core/service/patient-ucaf-service.dart new file mode 100644 index 00000000..e776720c --- /dev/null +++ b/lib/core/service/patient-ucaf-service.dart @@ -0,0 +1,5 @@ +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; + +class UcafService extends BaseService { + +} \ No newline at end of file diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart new file mode 100644 index 00000000..cf11854b --- /dev/null +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -0,0 +1,9 @@ +import 'package:doctor_app_flutter/core/service/patient-ucaf-service.dart'; +import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; + +import '../../locator.dart'; + +class UcafViewModel extends BaseViewModel { + + UcafService _ucafService = locator(); +} \ No newline at end of file diff --git a/lib/locator.dart b/lib/locator.dart index 0b932a62..7225f1d9 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -14,6 +14,7 @@ import 'core/service/SOAP_service.dart'; import 'core/service/patient-admission-request-service.dart'; import 'core/service/doctor_reply_service.dart'; import 'core/service/medicine_service.dart'; +import 'core/service/patient-ucaf-service.dart'; import 'core/service/patient-vital-signs-service.dart'; import 'core/service/patient-doctor-referral-service.dart'; import 'core/service/referral_patient_service.dart'; @@ -23,6 +24,7 @@ import 'core/viewModel/SOAP_view_model.dart'; import 'core/viewModel/doctor_replay_view_model.dart'; import 'core/viewModel/medicine_view_model.dart'; import 'core/viewModel/patient-admission-request-viewmodel.dart'; +import 'core/viewModel/patient-ucaf-viewmodel.dart'; import 'core/viewModel/patient-vital-sign-viewmodel.dart'; import 'core/viewModel/patient-referral-viewmodel.dart'; import 'core/viewModel/referral_view_model.dart'; @@ -48,6 +50,7 @@ void setupLocator() { locator.registerLazySingleton(() => ProcedureService()); locator.registerLazySingleton(() => VitalSignsService()); locator.registerLazySingleton(() => AdmissionRequestService()); + locator.registerLazySingleton(() => UcafService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); @@ -64,4 +67,5 @@ void setupLocator() { locator.registerFactory(() => ProcedureViewModel()); locator.registerFactory(() => VitalSignsViewModel()); locator.registerFactory(() => AdmissionRequestViewModel()); + locator.registerFactory(() => UcafViewModel()); } diff --git a/lib/routes.dart b/lib/routes.dart index ff03096f..a8def67f 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/root_page.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/UCAF/UCAF-input-screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/insurance_approvals_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/patient_orders_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/progress_note_screen.dart'; @@ -88,6 +89,7 @@ const String UPDATE_EPISODE = 'patients/create-episode'; const String PATIENT_ADMISSION_REQUEST = 'patients/admission-request'; const String PATIENT_ADMISSION_REQUEST_2 = 'patients/admission-request-second'; const String PATIENT_ADMISSION_REQUEST_3 = 'patients/admission-request-third'; +const String PATIENT_UCAF_REQUEST = 'patients/ucaf'; const String BODY_MEASUREMENTS = 'patients/body-measurements'; const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details'; @@ -149,4 +151,5 @@ var routes = { // LIVECARE_END_DIALOG: (_) => EndCallDialogBox() MY_REFERRAL_DETAIL: (_) => MyReferralDetailScreen(), + PATIENT_UCAF_REQUEST: (_) => UCAFInputScreen(), }; diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart new file mode 100644 index 00000000..f48fadb0 --- /dev/null +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -0,0 +1,28 @@ +import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; + +class UCAFInputScreen extends StatefulWidget { + @override + _UCAFInputScreenState createState() => _UCAFInputScreenState(); +} + +class _UCAFInputScreenState extends State { + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + final screenSize = MediaQuery.of(context).size; + + return BaseView( + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).ucaf, + body: Container(), + ), + ); + } +} diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 7e61362b..a67463a0 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -438,6 +438,7 @@ class TranslationBase { String get dietTypeRemarks => localizedValues['dietTypeRemarks'][locale.languageCode]; String get save => localizedValues['save'][locale.languageCode]; String get postPlansEstimatedCost => localizedValues['postPlansEstimatedCost'][locale.languageCode]; + String get ucaf => localizedValues['ucaf'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 78334e5f..dd12e6cf 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -137,6 +137,15 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).patientSick, nameLine2: TranslationBase.of(context).leave, icon: 'sick_leaves_icons.png')), + Visibility( + visible: selectedPatientType != 0 && selectedPatientType != 5, + child: PatientProfileButton( + key: key, + patient: patient, + route: PATIENT_UCAF_REQUEST, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).ucaf, + icon: 'lab.png')), ]); } }