diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ac638e94..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,4 +597,24 @@ const Map> localizedValues = { "body": {"en": "Body \n Mass", "ar": "كتلة\nالجسم"}, 'respirationRate': {'en': 'Respiration Rate', 'ar': 'معدل التنفس'}, 'heart': {'en': 'Heart', '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 8787eb42..7277bf32 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -116,7 +116,7 @@ class _DashboardScreenState extends State { IsLoginForDoctorApp: true, PatientOutSA: false); 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 8714327d..0b49c257 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -93,6 +93,7 @@ class PrescriptionFormWidget extends StatefulWidget { } class _PrescriptionFormWidgetState extends State { + int selectedType; TextEditingController durationController = TextEditingController(); TextEditingController strengthController = TextEditingController(); TextEditingController routeController = TextEditingController(); @@ -127,6 +128,7 @@ class _PrescriptionFormWidgetState extends State { @override void initState() { super.initState(); + selectedType = 1; referToList = List(); strengthList = List(); routeList = List(); @@ -252,6 +254,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; @@ -344,10 +352,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 ae2adbae..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,6 +626,26 @@ class TranslationBase { String get respirationRate => localizedValues['respirationRate'][locale.languageCode]; String get heart => localizedValues['heart'][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 99d77eed..6085f938 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -27,11 +27,11 @@ class ProfileMedicalInfoWidget extends StatelessWidget { ProfileMedicalInfoWidget( {Key key, this.patient, this.patientType, this.from, this.to}); - PatiantInformtion patient; - String patientType; String from; String to; + PatiantInformtion patient; + String patientType; @override Widget build(BuildContext context) { return BaseView( @@ -78,7 +78,10 @@ class ProfileMedicalInfoWidget extends StatelessWidget { to: to, nameLine1: TranslationBase.of(context).vital, nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS /*PATIENT_VITAL_SIGN*/, + route: + VITAL_SIGN_DETAILS /* PATIENT_VITAL_SIGN + */ + , icon: 'heartbeat.png'), if (selectedPatientType != 7) PatientProfileButton( @@ -117,15 +120,15 @@ 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) PatientProfileButton( diff --git a/pubspec.lock b/pubspec.lock index 55a6e826..d49ad4a1 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: