From e67233bb21d40144791adc960a74aa328d0a75c1 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 17 Jan 2021 16:28:48 +0200 Subject: [PATCH 1/2] medical dile & Order Procedure translation --- lib/config/localized_values.dart | 33 ++- lib/screens/dashboard_screen.dart | 2 +- .../medical-file/medical_file_details.dart | 58 ++-- .../medical-file/medical_file_page.dart | 22 +- .../prescription/add_prescription_form.dart | 22 +- .../entity_list_checkbox_search_widget.dart | 3 +- lib/screens/procedures/procedure_screen.dart | 276 +++++++++++------- lib/util/translations_delegate_base.dart | 43 ++- .../profile/profile_medical_info_widget.dart | 103 +++---- 9 files changed, 356 insertions(+), 206 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 4ad53ebe..2b6b86de 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -536,9 +536,32 @@ const Map> localizedValues = { 'en': "There is no Chief Complaint", 'ar': "ليس هناك شكوى رئيس" }, - 'addAssessment': {'en': "Add ASSESSMENT", 'ar':"أضف التقييم" }, - 'assessment': {'en': "ASSESSMENT", 'ar':" التقييم" }, - 'physicalSystemExamination': {'en': "Physical/System Examination", 'ar':" الفحص البدني / النظام" }, - 'searchExamination': {'en': "Search Examination", 'ar':"فحص البحث" }, - 'addExamination': {'en': "Add Examination", 'ar':"اضافه" }, + 'addAssessment': {'en': "Add ASSESSMENT", 'ar': "أضف التقييم"}, + 'assessment': {'en': "ASSESSMENT", 'ar': " التقييم"}, + 'physicalSystemExamination': { + 'en': "Physical/System Examination", + 'ar': " الفحص البدني / النظام" + }, + 'searchExamination': {'en': "Search Examination", 'ar': "فحص البحث"}, + 'addExamination': {'en': "Add Examination", 'ar': "اضافه"}, + 'medicalReport': {'en': "medical Report", 'ar': "تقرير طبي"}, + 'visitDate': {'en': "Visit Date", 'ar': "تاريخ الزيارة"}, + 'test': {'en': "Procedures/Test", 'ar': "عمليات/تحاليل"}, + 'regular': {'en': "Regular", 'ar': "اعتيادي"}, + 'addMoreProcedure': { + 'en': "Add More Procedures", + 'ar': "اضف المزيد من العمليات" + }, + 'searchProcedures': {'en': "Search Procedures", 'ar': "البحث في العمليات"}, + 'selectProcedures': {'en': "Select procedure", 'ar': "اختر العملية"}, + 'procedureCategorise': { + 'en': "Select Procedure Category", + 'ar': "اختر صنف العمليات " + }, + 'addSelectedProcedures': { + 'en': "add Selected Procedures", + 'ar': "اضافة العمليات المختارة " + }, + 'updateProcedure': {'en': "Update Procedure", 'ar': "تحديث العملية"}, + 'orderProcedure': {'en': "order procedure", 'ar': "طلب العمليات"}, }; diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 20f22382..7187641d 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -78,7 +78,7 @@ class _DashboardScreenState extends State { currentFocus.unfocus(); } return BaseView( - onModelReady: (model) => model.getDashboard(), + //onModelReady: (model) => model.getDashboard(), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index e11201e5..d445f471 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -66,7 +66,7 @@ class _MedicalFileDetailsState extends State { (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold( isShowAppBar: true, - appBarTitle: 'medical file'.toUpperCase(), + appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(), body: NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( @@ -141,7 +141,8 @@ class _MedicalFileDetailsState extends State { Row( children: [ AppText( - 'Visit Date : ', + TranslationBase.of(context).visitDate + + ": ", fontWeight: FontWeight.w700, ), if (model.medicalFileList.length != 0 && @@ -174,7 +175,8 @@ class _MedicalFileDetailsState extends State { Row( children: [ AppText( - 'Doctor : '.toUpperCase(), + TranslationBase.of(context).doctorName + + ": ".toUpperCase(), fontWeight: FontWeight.w700, ), if (model.medicalFileList.length != 0 && @@ -203,7 +205,8 @@ class _MedicalFileDetailsState extends State { Row( children: [ AppText( - 'Clinic : ', + TranslationBase.of(context).clinicName + + ": ", fontWeight: FontWeight.w700, ), if (model.medicalFileList.length != 0 && @@ -229,7 +232,8 @@ class _MedicalFileDetailsState extends State { Row( children: [ AppText( - 'Episode Number : ', + TranslationBase.of(context).episode + + ": ", fontWeight: FontWeight.w700, ), if (model.medicalFileList.length != 0 && @@ -277,7 +281,8 @@ class _MedicalFileDetailsState extends State { Row( children: [ Texts( - 'History of present illness' + TranslationBase.of(context) + .historyOfPresentIllness .toUpperCase(), variant: isHistoryExpand ? "bodyText" @@ -376,7 +381,10 @@ class _MedicalFileDetailsState extends State { children: [ Row( children: [ - Texts('assessment'.toUpperCase(), + Texts( + TranslationBase.of(context) + .assessment + .toUpperCase(), variant: isAssessmentExpand ? "bodyText" : '', @@ -554,7 +562,8 @@ class _MedicalFileDetailsState extends State { Row( children: [ Texts( - 'Test / procedures' + TranslationBase.of(context) + .test .toUpperCase(), variant: isProcedureExpand ? "bodyText" @@ -638,18 +647,22 @@ class _MedicalFileDetailsState extends State { ), Row( children: [ - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstProcedure[index] - .procName, - fontWeight: - FontWeight.w700, + Expanded( + child: AppText( + model + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstProcedure[ + index] + .procName, + fontWeight: + FontWeight.w700, + ), ) ], ), @@ -717,7 +730,10 @@ class _MedicalFileDetailsState extends State { children: [ Row( children: [ - Texts('physical exam'.toUpperCase(), + Texts( + TranslationBase.of(context) + .physicalSystemExamination + .toUpperCase(), variant: isPhysicalExam ? "bodyText" : '', diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index 1e3b4739..069dfbc2 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -27,7 +27,7 @@ class _MedicalFilePageState extends State { (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold( isShowAppBar: true, - appBarTitle: 'medical Report'.toUpperCase(), + appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(), body: NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( @@ -93,6 +93,7 @@ class _MedicalFilePageState extends State { if (model.medicalFileList.length != 0) ListView.builder( //physics: , + physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model @@ -108,7 +109,8 @@ class _MedicalFilePageState extends State { Row( children: [ AppText( - 'Branch : ', + TranslationBase.of(context).branch + + ": ", fontWeight: FontWeight.w700, ), AppText(model @@ -121,13 +123,19 @@ class _MedicalFilePageState extends State { Row( children: [ AppText( - 'Doctor : '.toUpperCase(), + TranslationBase.of(context) + .doctorName + .toUpperCase() + + ": ", fontWeight: FontWeight.w700, ), Expanded( child: AppText( - model.medicalFileList[0].entityList[0] - .timelines[index].doctorName, + model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .doctorName, fontWeight: FontWeight.w700, ), ), @@ -136,7 +144,9 @@ class _MedicalFilePageState extends State { Row( children: [ AppText( - 'Clinic : ', + TranslationBase.of(context) + .clinicName + + ": ", fontWeight: FontWeight.w700, ), AppText( diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 1b4d7e2d..c8ff6ce2 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -92,6 +92,7 @@ class PrescriptionFormWidget extends StatefulWidget { } class _PrescriptionFormWidgetState extends State { + int selectedType; TextEditingController durationController = TextEditingController(); TextEditingController strengthController = TextEditingController(); TextEditingController routeController = TextEditingController(); @@ -126,6 +127,7 @@ class _PrescriptionFormWidgetState extends State { @override void initState() { super.initState(); + selectedType = 1; referToList = List(); strengthList = List(); routeList = List(); @@ -251,6 +253,12 @@ class _PrescriptionFormWidgetState extends State { referToList.add(urgentOrder); } + setSelectedType(int val) { + setState(() { + selectedType = val; + }); + } + @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; @@ -343,10 +351,22 @@ class _PrescriptionFormWidgetState extends State { child: Row( children: [ AppText('Order Type'), - Radio(), + Radio( + activeColor: Color(0xFFB9382C), + value: 0, + groupValue: selectedType, + onChanged: (value) { + setSelectedType(value); + }, + ), Text('Regular'), Radio( + activeColor: Color(0xFFB9382C), + groupValue: selectedType, value: 1, + onChanged: (value) { + setSelectedType(value); + }, ), Text('Urgent'), ], diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index 0a04124f..4f236a4b 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; @@ -61,7 +62,7 @@ class _EntityListCheckboxSearchWidgetState child: ListView( children: [ TextFields( - hintText: 'Search Procedure', + hintText: TranslationBase.of(context).searchProcedures, suffixIcon: EvaIcons.search, onChanged: (value) { filterSearchResults(value); diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 6955508c..31eb99e9 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -33,8 +33,15 @@ class ProcedureScreen extends StatefulWidget { } class _ProcedureScreenState extends State { + int selectedType = 0; int testNum = 1; PatiantInformtion patient; + setSelectedType(int val) { + setState(() { + selectedType = val; + }); + } + TextEditingController procedureController = TextEditingController(); @override Widget build(BuildContext context) { @@ -45,7 +52,7 @@ class _ProcedureScreenState extends State { builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( isShowAppBar: true, - appBarTitle: 'ORDER PROCEDURE', + appBarTitle: TranslationBase.of(context).orderProcedure, body: NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( @@ -199,7 +206,8 @@ class _ProcedureScreenState extends State { .spaceBetween, children: [ AppText( - ' Add more procedure', + TranslationBase.of(context) + .addMoreProcedure, fontWeight: FontWeight.w100, fontSize: 12.5, ), @@ -275,7 +283,10 @@ class _ProcedureScreenState extends State { Row( children: [ AppText( - 'Code #: ', + TranslationBase.of( + context) + .codeNo + + " : ", fontWeight: FontWeight .w700, @@ -297,7 +308,10 @@ class _ProcedureScreenState extends State { width: 12.0, ), AppText( - 'Order Type: ', + TranslationBase.of( + context) + .orderType + + " : ", fontWeight: FontWeight .w700, @@ -312,8 +326,8 @@ class _ProcedureScreenState extends State { : 'Urgent', fontSize: 13.0, - color: Colors - .red, + color: Color( + 0xFFB9382C), ), ], ), @@ -342,7 +356,10 @@ class _ProcedureScreenState extends State { Row( children: [ AppText( - 'Price: ', + TranslationBase.of( + context) + .price + + " : ", fontWeight: FontWeight .w700, @@ -409,6 +426,12 @@ class _ProcedureScreenState extends State { onTap: () { updateProcedureForm( context, + remarks: model + .procedureList[ + 0] + .entityList[ + index] + .remarks, procedureName: model .procedureList[ 0] @@ -452,6 +475,109 @@ class _ProcedureScreenState extends State { )), ); } + + void updateProcedureForm(context, + {String procedureName, + PatiantInformtion patient, + String procedureId, + String remarks, + String categoreId}) { + ProcedureViewModel model = ProcedureViewModel(); + TextEditingController remarksController = TextEditingController(); + TextEditingController orderController = TextEditingController(); + showModalBottomSheet( + context: context, + isScrollControlled: true, + builder: (BuildContext bc) { + return Container( + height: MediaQuery.of(context).size.height * 0.55, + child: Form( + child: Padding( + padding: + EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + procedureName.toUpperCase(), + fontWeight: FontWeight.w700, + ), + SizedBox( + height: 30.0, + ), + Container( + child: Row( + children: [ + AppText(TranslationBase.of(context).orderType), + Radio( + activeColor: Color(0xFFB9382C), + value: 0, + groupValue: selectedType, + onChanged: (value) { + setSelectedType(value); + }, + ), + Text(TranslationBase.of(context).regular), + Radio( + activeColor: Color(0xFFB9382C), + groupValue: selectedType, + value: 1, + onChanged: (value) { + setSelectedType(value); + }, + ), + Text(TranslationBase.of(context).urgent), + ], + ), + ), + SizedBox( + height: 12.0, + ), + Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: remarks, + controller: remarksController, + maxLines: 5, + minLines: 3, + ), + ), + SizedBox( + height: 100.0, + ), + Container( + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: TranslationBase.of(context) + .updateProcedure + .toUpperCase(), + onPressed: () { + Navigator.pop(context); + updateProcedure( + categorieId: categoreId, + procedureId: procedureId, + patient: patient, + model: model, + remarks: remarksController.text); + // authorizationForm(context); + }, + ), + ], + ), + ), + ], + ), + ), + )); + }); + } } postProcedure( @@ -553,6 +679,7 @@ class AddSelectedProcedure extends StatefulWidget { } class _AddSelectedProcedureState extends State { + int selectedType; ProcedureViewModel model; PatiantInformtion patient; _AddSelectedProcedureState({this.patient, this.model}); @@ -560,6 +687,12 @@ class _AddSelectedProcedureState extends State { TextEditingController remarksController = TextEditingController(); List entityList = List(); dynamic selectedCategory; + setSelectedType(int val) { + setState(() { + selectedType = val; + }); + } + @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; @@ -582,11 +715,13 @@ class _AddSelectedProcedureState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - 'Search Procedure Category'.toUpperCase(), + TranslationBase.of(context) + .selectProcedures + .toUpperCase(), fontWeight: FontWeight.w900, ), SizedBox( - height: 5.0, + height: 10.0, ), Container( height: screenSize.height * 0.070, @@ -620,7 +755,8 @@ class _AddSelectedProcedureState extends State { : null, child: TextField( decoration: textFieldSelectorDecoration( - 'Procedure Categorey', + TranslationBase.of(context) + .procedureCategorise, selectedCategory != null ? selectedCategory['categoryName'] : null, @@ -665,21 +801,36 @@ class _AddSelectedProcedureState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: 'Order Type'.toUpperCase(), - controller: procedureController, + child: Row( + children: [ + AppText( + TranslationBase.of(context).orderType), + Radio( + activeColor: Color(0xFFB9382C), + value: 0, + groupValue: selectedType, + onChanged: (value) { + setSelectedType(value); + }, + ), + Text(TranslationBase.of(context).regular), + Radio( + activeColor: Color(0xFFB9382C), + groupValue: selectedType, + value: 1, + onChanged: (value) { + setSelectedType(value); + }, + ), + Text(TranslationBase.of(context).urgent), + ], ), ), SizedBox( height: 15.0, ), TextFields( - hintText: 'Remarks', + hintText: TranslationBase.of(context).remarks, controller: remarksController, minLines: 3, maxLines: 5, @@ -694,8 +845,8 @@ class _AddSelectedProcedureState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: - 'add Selected Procedures'.toUpperCase(), + title: TranslationBase.of(context) + .addSelectedProcedures, onPressed: () { Navigator.pop(context); postProcedure( @@ -761,86 +912,3 @@ class _AddSelectedProcedureState extends State { ); } } - -void updateProcedureForm(context, - {String procedureName, - PatiantInformtion patient, - String procedureId, - String categoreId}) { - ProcedureViewModel model = ProcedureViewModel(); - TextEditingController remarksController = TextEditingController(); - TextEditingController orderController = TextEditingController(); - showModalBottomSheet( - context: context, - isScrollControlled: true, - builder: (BuildContext bc) { - return Container( - height: MediaQuery.of(context).size.height * 0.55, - child: Form( - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - procedureName.toUpperCase(), - fontWeight: FontWeight.w700, - ), - SizedBox( - height: 30.0, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: 'Order ', - controller: orderController, - ), - ), - SizedBox( - height: 12.0, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: 'Remarks', - controller: remarksController, - maxLines: 5, - minLines: 3, - ), - ), - SizedBox( - height: 100.0, - ), - Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: 'Update procedure'.toUpperCase(), - onPressed: () { - Navigator.pop(context); - updateProcedure( - categorieId: categoreId, - procedureId: procedureId, - patient: patient, - model: model, - remarks: remarksController.text); - // authorizationForm(context); - }, - ), - ], - ), - ), - ], - ), - ), - )); - }); -} diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index e6b5dbd5..4c03e7b4 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -544,20 +544,47 @@ class TranslationBase { localizedValues['referralEmptyMsg'][locale.languageCode]; String get referralSuccessMsg => localizedValues['referralSuccessMsg'][locale.languageCode]; - String get diagnoseType => localizedValues['diagnoseType'][locale.languageCode]; + String get diagnoseType => + localizedValues['diagnoseType'][locale.languageCode]; String get condition => localizedValues['condition'][locale.languageCode]; String get id => localizedValues['id'][locale.languageCode]; String get quantity => localizedValues['quantity'][locale.languageCode]; String get codeNo => localizedValues['codeNo'][locale.languageCode]; String get covered => localizedValues['covered'][locale.languageCode]; - String get approvalRequired => localizedValues['approvalRequired'][locale.languageCode]; - String get uncoveredByDoctor => localizedValues['uncoveredByDoctor'][locale.languageCode]; - String get addAssessment => localizedValues['addAssessment'][locale.languageCode]; + String get approvalRequired => + localizedValues['approvalRequired'][locale.languageCode]; + String get uncoveredByDoctor => + localizedValues['uncoveredByDoctor'][locale.languageCode]; + String get addAssessment => + localizedValues['addAssessment'][locale.languageCode]; String get assessment => localizedValues['assessment'][locale.languageCode]; - String get chiefComplaintEmptyMsg => localizedValues['chiefComplaintEmptyMsg'][locale.languageCode]; - String get physicalSystemExamination => localizedValues['physicalSystemExamination'][locale.languageCode]; - String get searchExamination => localizedValues['searchExamination'][locale.languageCode]; - String get addExamination => localizedValues['addExamination'][locale.languageCode]; + String get chiefComplaintEmptyMsg => + localizedValues['chiefComplaintEmptyMsg'][locale.languageCode]; + String get physicalSystemExamination => + localizedValues['physicalSystemExamination'][locale.languageCode]; + String get searchExamination => + localizedValues['searchExamination'][locale.languageCode]; + String get addExamination => + localizedValues['addExamination'][locale.languageCode]; + String get medicalReport => + localizedValues['medicalReport'][locale.languageCode]; + String get visitDate => localizedValues['visitDate'][locale.languageCode]; + String get test => localizedValues['test'][locale.languageCode]; + String get addMoreProcedure => + localizedValues['addMoreProcedure'][locale.languageCode]; + String get regular => localizedValues['regular'][locale.languageCode]; + String get searchProcedures => + localizedValues['searchProcedures'][locale.languageCode]; + String get procedureCategorise => + localizedValues['procedureCategorise'][locale.languageCode]; + String get selectProcedures => + localizedValues['selectProcedures'][locale.languageCode]; + String get addSelectedProcedures => + localizedValues['addSelectedProcedures'][locale.languageCode]; + String get updateProcedure => + localizedValues['updateProcedure'][locale.languageCode]; + String get orderProcedure => + localizedValues['orderProcedure'][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 c39c7c95..5c26a39a 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -19,7 +19,7 @@ import '../../shared/app_texts_widget.dart'; class ProfileMedicalInfoWidget extends StatelessWidget { ProfileMedicalInfoWidget({Key key, this.patient, this.patientType}); PatiantInformtion patient; - String patientType; + String patientType; @override Widget build(BuildContext context) { return SliverGrid.count( @@ -28,38 +28,39 @@ class ProfileMedicalInfoWidget extends StatelessWidget { crossAxisCount: 2, childAspectRatio: 1.5, children: [ - if(int.parse(patientType) ==7) - PatientProfileButton( - key: key, - patient: patient, - nameLine1: TranslationBase.of(context).createNew, - nameLine2: TranslationBase.of(context).episode, - route: CREATE_EPISODE, - icon: 'create-episod.png'), - if(int.parse(patientType) ==7) - PatientProfileButton( - key: key, - patient: patient, - nameLine1: TranslationBase.of(context).update, - nameLine2: TranslationBase.of(context).episode, - route: UPDATE_EPISODE, - icon: 'modilfy-episode.png'), + if (int.parse(patientType) == 7) + PatientProfileButton( + key: key, + patient: patient, + nameLine1: TranslationBase.of(context).createNew, + nameLine2: TranslationBase.of(context).episode, + route: CREATE_EPISODE, + icon: 'create-episod.png'), + if (int.parse(patientType) == 7) + PatientProfileButton( + key: key, + patient: patient, + nameLine1: TranslationBase.of(context).update, + nameLine2: TranslationBase.of(context).episode, + route: UPDATE_EPISODE, + icon: 'modilfy-episode.png'), PatientProfileButton( key: key, patient: patient, nameLine1: TranslationBase.of(context).vital, nameLine2: TranslationBase.of(context).signs, - route: (selectedPatientType == 6 || selectedPatientType == 7) ? PATIENT_VITAL_SIGN : VITAL_SIGN_DETAILS, + route: (selectedPatientType == 6 || selectedPatientType == 7) + ? PATIENT_VITAL_SIGN + : VITAL_SIGN_DETAILS, icon: 'heartbeat.png'), - if(selectedPatientType != 7) - PatientProfileButton( - key: key, - patient: patient, - route: LAB_ORDERS, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'lab.png'), - + if (selectedPatientType != 7) + PatientProfileButton( + key: key, + patient: patient, + route: LAB_ORDERS, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'lab.png'), PatientProfileButton( key: key, patient: patient, @@ -87,63 +88,47 @@ class ProfileMedicalInfoWidget extends StatelessWidget { key: key, patient: patient, route: ORDER_PRESCRIPTION, - nameLine1: 'Order', - nameLine2: 'Prescription', + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, icon: 'lab.png'), PatientProfileButton( key: key, patient: patient, route: ORDER_PROCEDURE, - nameLine1: 'Order Test', - nameLine2: 'Or Procedures', + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, icon: 'lab.png'), - if(selectedPatientType == 7) + if (selectedPatientType == 7) PatientProfileButton( key: key, patient: patient, route: REFER_PATIENT_TO_DOCTOR, - nameLine1: TranslationBase - .of(context) - .myReferral, - nameLine2: TranslationBase - .of(context) - .patient, + nameLine1: TranslationBase.of(context).myReferral, + nameLine2: TranslationBase.of(context).patient, icon: 'note.png'), - if(selectedPatientType != 0 && selectedPatientType != 5) + if (selectedPatientType != 0 && selectedPatientType != 5) PatientProfileButton( key: key, patient: patient, route: PATIENT_ORDERS, - nameLine1: TranslationBase - .of(context) - .orders, - nameLine2: TranslationBase - .of(context) - .list, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).list, icon: 'radiology-1.png'), - if(selectedPatientType != 0 && selectedPatientType != 5) + if (selectedPatientType != 0 && selectedPatientType != 5) PatientProfileButton( key: key, patient: patient, route: ADD_SICKLEAVE, - nameLine1: TranslationBase - .of(context) - .patientSick, - nameLine2: TranslationBase - .of(context) - .leave, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, icon: 'sick_leaves_icons.png'), - if( selectedPatientType == 7) + if (selectedPatientType == 7) PatientProfileButton( key: key, patient: patient, route: PATIENT_UCAF_REQUEST, - nameLine1: TranslationBase - .of(context) - .patient, - nameLine2: TranslationBase - .of(context) - .ucaf, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).ucaf, icon: 'lab.png'), ]); } From 1fa52e0394b141aef371c73e6708c21695c6b7ea Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 17 Jan 2021 16:39:20 +0200 Subject: [PATCH 2/2] medical dile & Order Procedure translation --- lib/config/localized_values.dart | 18 ++----------- lib/util/translations_delegate_base.dart | 15 ++++------- .../profile/profile_medical_info_widget.dart | 25 +++++++++++++------ pubspec.lock | 2 +- 4 files changed, 25 insertions(+), 35 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 426a309b..df7cea74 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -587,14 +587,8 @@ const Map> localizedValues = { 'en': "There is no detail for this patient", 'ar': "لا توجد تفاصيل لهذا المريض" }, - "systolic-lng": { - "en": "Systolic", - "ar": "الإنقباض" - }, - "diastolic-lng": { - "en": "Diastolic", - "ar": "الإنبساط" - }, + "systolic-lng": {"en": "Systolic", "ar": "الإنقباض"}, + "diastolic-lng": {"en": "Diastolic", "ar": "الإنبساط"}, "mass": {"en": "Mass", "ar": "كتلة"}, "temp-c": {"en": "°C", "ar": "°س"}, "bpm": {"en": "bpm", "ar": "نبضة"}, @@ -603,14 +597,6 @@ const Map> localizedValues = { "body": {"en": "Body \n Mass", "ar": "كتلة\nالجسم"}, 'respirationRate': {'en': 'Respiration Rate', 'ar': 'معدل التنفس'}, 'heart': {'en': 'Heart', 'ar': 'قلب'}, - 'addAssessment': {'en': "Add ASSESSMENT", 'ar': "أضف التقييم"}, - 'assessment': {'en': "ASSESSMENT", 'ar': " التقييم"}, - 'physicalSystemExamination': { - 'en': "Physical/System Examination", - 'ar': " الفحص البدني / النظام" - }, - 'searchExamination': {'en': "Search Examination", 'ar': "فحص البحث"}, - 'addExamination': {'en': "Add Examination", 'ar': "اضافه"}, 'medicalReport': {'en': "medical Report", 'ar': "تقرير طبي"}, 'visitDate': {'en': "Visit Date", 'ar': "تاريخ الزيارة"}, 'test': {'en': "Procedures/Test", 'ar': "عمليات/تحاليل"}, diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index aae8e091..c3df9d86 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -612,8 +612,10 @@ class TranslationBase { String get doc => localizedValues['doc'][locale.languageCode]; String get patientNoDetailErrMsg => localizedValues['patientNoDetailErrMsg'][locale.languageCode]; - String get systolicLng => localizedValues['systolic-lng'][locale.languageCode]; - String get diastolicLng => localizedValues['diastolic-lng'][locale.languageCode]; + String get systolicLng => + localizedValues['systolic-lng'][locale.languageCode]; + String get diastolicLng => + localizedValues['diastolic-lng'][locale.languageCode]; String get mass => localizedValues['mass'][locale.languageCode]; String get tempC => localizedValues['temp-c'][locale.languageCode]; String get bpm => localizedValues['bpm'][locale.languageCode]; @@ -624,14 +626,7 @@ class TranslationBase { String get respirationRate => localizedValues['respirationRate'][locale.languageCode]; String get heart => localizedValues['heart'][locale.languageCode]; - String get chiefComplaintEmptyMsg => - localizedValues['chiefComplaintEmptyMsg'][locale.languageCode]; - String get physicalSystemExamination => - localizedValues['physicalSystemExamination'][locale.languageCode]; - String get searchExamination => - localizedValues['searchExamination'][locale.languageCode]; - String get addExamination => - localizedValues['addExamination'][locale.languageCode]; + String get medicalReport => localizedValues['medicalReport'][locale.languageCode]; String get visitDate => localizedValues['visitDate'][locale.languageCode]; diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index ad813be0..6085f938 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -27,8 +27,11 @@ class ProfileMedicalInfoWidget extends StatelessWidget { ProfileMedicalInfoWidget( {Key key, this.patient, this.patientType, this.from, this.to}); + String from; + String to; + PatiantInformtion patient; - String patientType; + String patientType; @override Widget build(BuildContext context) { return BaseView( @@ -43,7 +46,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, - isDisable: patient.episodeNo != 0 ? true : false,nameLine1: TranslationBase.of(context).createNew, + isDisable: patient.episodeNo != 0 ? true : false, + nameLine1: TranslationBase.of(context).createNew, nameLine2: TranslationBase.of(context).episode, route: CREATE_EPISODE, onTap: () async { @@ -55,15 +59,18 @@ class ProfileMedicalInfoWidget extends StatelessWidget { Navigator.of(context).pushNamed(CREATE_EPISODE, arguments: {'patient': patient}); }, - isLoading: model.state == ViewState.BusyLocal,icon: 'create-episod.png'), + isLoading: model.state == ViewState.BusyLocal, + icon: 'create-episod.png'), if (int.parse(patientType) == 7) PatientProfileButton( key: key, patient: patient, - isDisable: patient.episodeNo == 0 ? true : false,nameLine1: TranslationBase.of(context).update, + isDisable: patient.episodeNo == 0 ? true : false, + nameLine1: TranslationBase.of(context).update, nameLine2: TranslationBase.of(context).episode, route: UPDATE_EPISODE, - icon: 'modilfy-episode.png'),if (int.parse(patientType) == 7) + icon: 'modilfy-episode.png'), + if (int.parse(patientType) == 7) PatientProfileButton( key: key, patient: patient, @@ -71,9 +78,11 @@ class ProfileMedicalInfoWidget extends StatelessWidget { to: to, nameLine1: TranslationBase.of(context).vital, nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS /* PATIENT_VITAL_SIGN - */, - icon: 'heartbeat.png'), + route: + VITAL_SIGN_DETAILS /* PATIENT_VITAL_SIGN + */ + , + icon: 'heartbeat.png'), if (selectedPatientType != 7) PatientProfileButton( key: key, diff --git a/pubspec.lock b/pubspec.lock index 77edb88a..9d63a65c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -510,7 +510,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.2" + version: "0.6.3-nullsafety.1" json_annotation: dependency: transitive description: