From d5d57e7997be8a67d007c07c9b943d49270294ac Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 2 May 2021 13:20:28 +0300 Subject: [PATCH 01/31] fix new design issue --- ios/Podfile.lock | 2 +- lib/config/config.dart | 2 +- lib/config/localized_values.dart | 2 +- lib/landing_page.dart | 2 +- lib/screens/doctor/doctor_reply_screen.dart | 2 +- .../out_patient/out_patient_screen.dart | 42 +++++++++++++++---- .../assessment/add_assessment_details.dart | 1 + .../update_Chief_complaints.dart | 42 ++++++++++++------- lib/widgets/shared/app_drawer_widget.dart | 4 -- lib/widgets/shared/drawer_item_widget.dart | 4 -- 10 files changed, 67 insertions(+), 36 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 878a1850..2f4607e0 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -322,4 +322,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69 -COCOAPODS: 1.10.1 +COCOAPODS: 1.10.0.rc.1 diff --git a/lib/config/config.dart b/lib/config/config.dart index 9596a029..07151d1d 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -336,7 +336,7 @@ const TRANSACTION_NO = 0; const LANGUAGE_ID = 2; const STAMP = '2020-04-27T12:17:17.721Z'; const IP_ADDRESS = '9.9.9.9'; -const VERSION_ID = 5.8; +const VERSION_ID = 5.9; const CHANNEL = 9; const SESSION_ID = 'BlUSkYymTt'; const IS_LOGIN_FOR_DOCTOR_APP = true; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index d5999b21..c2d77da5 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -847,7 +847,7 @@ const Map> localizedValues = { "en": "Apply Reschedule Leave", "ar": "التقدم بطلب أو إعادة جدولة الإجازة" }, - "myQRCode": {"en": "My QR Code", "ar": "My QR Code"}, + "myQRCode": {"en": "My QR Code", "ar": " كود QR "}, "patientIDMobilenational": { "en": "Patient ID, National ID, Mobile Number", "ar": "هوية المريض ، الهوية الوطنية ، رقم الهاتف المحمول" diff --git a/lib/landing_page.dart b/lib/landing_page.dart index 99e1694f..13d4e92b 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -90,7 +90,7 @@ class _LandingPageState extends State { case 2: return TranslationBase.of(context).qr; case 3: - return TranslationBase.of(context).replay; + return TranslationBase.of(context).replay2; } } } diff --git a/lib/screens/doctor/doctor_reply_screen.dart b/lib/screens/doctor/doctor_reply_screen.dart index f522561f..dcbe9667 100644 --- a/lib/screens/doctor/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_reply_screen.dart @@ -34,7 +34,7 @@ class DoctorReplyScreen extends StatelessWidget { }, child: AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).replay2, + appBarTitle: "ghgh",//TranslationBase.of(context).replay2, isShowAppBar: false, body: model.listDoctorWorkingHoursTable.isEmpty ? DrAppEmbeddedError(error: TranslationBase.of(context).noItem) diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index 4d0ce94a..e2e6e94c 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -109,7 +109,7 @@ class _OutPatientsScreenState extends State { baseViewModel: model, body: Column( children: [ - Container( + Container( // color: Colors.red, height: screenSize.height * 0.070, decoration: TextFieldsUtils @@ -155,11 +155,40 @@ class _OutPatientsScreenState extends State { borderRadius: 4, borderWidth: 0), child: Center( - child: AppText( - item, - fontSize: SizeConfig.textMultiplier * 1.8, - color: _isActive ? Colors.white : Color(0xFF2B353E), - fontWeight: FontWeight.w700, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppText( + item, + fontSize: SizeConfig.textMultiplier * 1.8, + color: _isActive ? Colors.white : Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ), + _isActive&&_activeLocation!=0 ?Container( + padding: EdgeInsets.all(2), + margin: EdgeInsets.symmetric(horizontal: 5), + decoration: + new BoxDecoration( + color: Colors.white, + borderRadius: + BorderRadius.circular( + 50), + ), + constraints: BoxConstraints( + minWidth: 20, + minHeight: 20, + ), + child: new Text( + model.filterData.length.toString(), + style: new TextStyle( + color: Colors.red, + fontSize: 10 + ), + textAlign: + TextAlign.center, + ), + ):Container(), + ], ), ), ), @@ -169,7 +198,6 @@ class _OutPatientsScreenState extends State { }).toList(), ), ), - SizedBox(height: 18.5), Container( width: SizeConfig.screenWidth * 0.9, diff --git a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart index 87015bbb..47d639ad 100644 --- a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart +++ b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart @@ -351,6 +351,7 @@ class _AddAssessmentDetailsState extends State { hintText: TranslationBase.of(context).remarks, maxLines: 18, minLines: 5, + inputType: TextInputType.multiline, controller: remarkController, onChanged: (value) { widget.mySelectedAssessment.remark = diff --git a/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart b/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart index 216fbd53..0e5e6ec1 100644 --- a/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart +++ b/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart @@ -40,22 +40,28 @@ class UpdateChiefComplaints extends StatelessWidget { maxLines: 25, minLines: 7, hasBorder: true, - validationError:complaintsControllerError !=''?complaintsControllerError:null , - + inputType: TextInputType.multiline, + validationError: complaintsControllerError != '' + ? complaintsControllerError + : null, ), SizedBox( height: 20, ), AppTextFieldCustom( - hintText: TranslationBase - .of(context) - .historyOfPresentIllness, - controller: illnessController, - maxLines: 25, - minLines: 7, + hintText: TranslationBase + .of(context) + .historyOfPresentIllness, + controller: illnessController, + inputType: TextInputType.multiline, + + maxLines: 25, + minLines: 7, hasBorder: true, - validationError:illnessControllerError !=''?illnessControllerError:null , + validationError: illnessControllerError != '' + ? illnessControllerError + : null, ), SizedBox( height: 10, @@ -67,14 +73,18 @@ class UpdateChiefComplaints extends StatelessWidget { height: 10, ), AppTextFieldCustom( - hintText: TranslationBase - .of(context) - .currentMedications, - controller: medicationController, + hintText: TranslationBase + .of(context) + .currentMedications, + controller: medicationController, maxLines: 25, - minLines: 7, - hasBorder: true, - validationError:medicationControllerError !=''?medicationControllerError:null , + minLines: 7, + hasBorder: true, + inputType: TextInputType.multiline, + + validationError: medicationControllerError != '' + ? medicationControllerError + : null, ), SizedBox( diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 8509bc95..ebb49e6f 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -16,9 +16,6 @@ import 'app_texts_widget.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); -// OWNER : Ibrahim albitar -// DATE : 06-04-2020 -// DESCRIPTION : Custom App Drawer for app. class AppDrawer extends StatefulWidget { @override @@ -26,7 +23,6 @@ class AppDrawer extends StatefulWidget { } class _AppDrawerState extends State { - bool _isInit = true; Helpers helpers = new Helpers(); ProjectViewModel projectsProvider; diff --git a/lib/widgets/shared/drawer_item_widget.dart b/lib/widgets/shared/drawer_item_widget.dart index 6b8e8d48..2b8ce40d 100644 --- a/lib/widgets/shared/drawer_item_widget.dart +++ b/lib/widgets/shared/drawer_item_widget.dart @@ -5,10 +5,6 @@ import 'package:flutter/material.dart'; import '../shared/app_texts_widget.dart'; -// OWNER : Ibrahim albitar -// DATE : 08-04-2020 -// DESCRIPTION : Custom Drawer item for app. - class DrawerItem extends StatefulWidget { final String title; final String subTitle; From 0b473f630f447d590c422803db6ca30bf85ee7d4 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 2 May 2021 15:14:05 +0300 Subject: [PATCH 02/31] translate progress_note_screen --- lib/config/localized_values.dart | 18 +- .../profile/note/progress_note_screen.dart | 340 +++++++++++------- .../patients/profile/note/update_note.dart | 30 +- lib/util/translations_delegate_base.dart | 22 ++ 4 files changed, 261 insertions(+), 149 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index c2d77da5..53981e90 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -654,8 +654,8 @@ const Map> localizedValues = { }, 'progressNoteSOAP': {'en': "Progress Note", 'ar': "ملاحظة التقدم"}, 'addProgressNote': {'en': "Add Progress Note", 'ar': "أضف ملاحظة التقدم"}, - 'createdBy': {'en': "Created By :", 'ar': "أضيفت : "}, - 'editedBy': {'en': "Edited By :", 'ar': "عدلت : "}, + 'createdBy': {'en': "Created By :", 'ar': "أضيفت من قبل : "}, + 'editedBy': {'en': "Edited By :", 'ar': "عدلت من قبل : "}, 'currentMedications': {'en': "Current Medications", 'ar': "الأدوية الحالية"}, 'noItem': { 'en': "No items exists in this list", @@ -783,7 +783,7 @@ const Map> localizedValues = { "open-rad": {"en": "Open Radiology Image", "ar": "فتح صور الاشعة"}, - 'fileNumber': {'en': "File Number: ", 'ar': " :رقم الملف"}, + 'fileNumber': {'en': "File Number: ", 'ar': "رقم الملف : "}, 'searchPatient-name': { 'en': 'Search Name, Medical File, Phone Number', 'ar': "اسم البحث ، الملف الطبي ، رقم الهاتف" @@ -946,4 +946,16 @@ const Map> localizedValues = { "approvals22": {"en": "Approvals", "ar": "التامين"}, "severe": {"en": "Severe", "ar": "الشدة"}, "graphDetails": {"en": "Graph Details", "ar": "تفاصيل الرسم البياني"}, + "addNewOrderSheet": {"en": "Add a New Order Sheet", "ar": "أضف ورقة طلب جديدة"}, + "addNewProgressNote": {"en": "Add a New Progress Note", "ar": "أضف ملاحظة تقدم جديدة"}, + "notePending": {"en": "Pending", "ar": "قيد الانتظار"}, + "noteCanceled": {"en": "Canceled", "ar": "ألغيت"}, + "noteVerified": {"en": "Verified", "ar": "تم التحقق"}, + 'noteVerify': {'en': 'Verify', 'ar': 'تحقق'}, + 'noteConfirm': {'en': 'Confirm', 'ar': 'تاكيد'}, + 'noteAdd': {'en': 'Add ', 'ar': 'اضف '}, + 'noteUpdateْْ': {'en': 'Update ', 'ar': 'تحديت'}, + 'orderSheet': {'en': 'Order Sheet', 'ar': 'ورقة الطلب'}, + + }; diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/note/progress_note_screen.dart index d7506402..173115f9 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/note/progress_note_screen.dart @@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/core/model/note/note_model.dart'; import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/patient/progress_note_request.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; @@ -42,9 +43,10 @@ class _ProgressNoteState extends State { var _isInit = true; bool isDischargedPatient = false; AuthViewModel authProvider; + ProjectViewModel projectViewModel; - - getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { + getProgressNoteList(BuildContext context, PatientViewModel model, + {bool isLocalBusy = false}) async { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String token = await sharedPref.getString(TOKEN); @@ -59,7 +61,10 @@ class _ProgressNoteState extends State { tokenID: token, patientTypeID: patient.patientType, languageID: 2); - model.getPatientProgressNote(progressNoteRequest.toJson(), isLocalBusy: isLocalBusy).then((c) { + model + .getPatientProgressNote(progressNoteRequest.toJson(), + isLocalBusy: isLocalBusy) + .then((c) { notesList = model.patientProgressNoteList; }); } @@ -67,97 +72,124 @@ class _ProgressNoteState extends State { @override Widget build(BuildContext context) { authProvider = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + projectViewModel = Provider.of(context); + final routeArgs = ModalRoute + .of(context) + .settings + .arguments as Map; PatiantInformtion patient = routeArgs['patient']; String arrivalType = routeArgs['arrivalType']; - if(routeArgs.containsKey('isDischargedPatient')) - isDischargedPatient = routeArgs['isDischargedPatient']; + if (routeArgs.containsKey('isDischargedPatient')) + isDischargedPatient = routeArgs['isDischargedPatient']; return BaseView( onModelReady: (model) => getProgressNoteList(context, model), - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - backgroundColor: Theme.of(context).scaffoldBackgroundColor, - // appBarTitle: TranslationBase.of(context).progressNote, - appBar: PatientProfileHeaderNewDesignAppBar( - patient, patient.patientType.toString() ?? '0', arrivalType,isInpatient: true,), - body: model.patientProgressNoteList == null || model.patientProgressNoteList.length == 0 - ? DrAppEmbeddedError( - error: TranslationBase.of(context).errorNoProgressNote) - : Container( - color: Colors.grey[200], + builder: (_, model, w) => + AppScaffold( + baseViewModel: model, + backgroundColor: Theme + .of(context) + .scaffoldBackgroundColor, + // appBarTitle: TranslationBase.of(context).progressNote, + appBar: PatientProfileHeaderNewDesignAppBar( + patient, + patient.patientType.toString() ?? '0', + arrivalType, + isInpatient: true, + ), + body: model.patientProgressNoteList == null || + model.patientProgressNoteList.length == 0 + ? DrAppEmbeddedError( + error: TranslationBase + .of(context) + .errorNoProgressNote) + : Container( + color: Colors.grey[200], child: Column( - children: [ - if(!isDischargedPatient) - AddNewOrder( onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => UpdateNoteOrder( - patientModel: model, - patient: patient, - visitType: widget.visitType, - isUpdate: false, - )), - ); - },label: widget.visitType ==3?'Add a New Order Sheet':'Create a New Progress Note',), - Expanded( - child: Container( - - child: ListView.builder( - itemCount: model.patientProgressNoteList.length, - itemBuilder: (BuildContext ctxt, int index) { - return FractionallySizedBox( - widthFactor: 0.95, - child: CardWithBgWidget( - hasBorder: false, - bgColor: model.patientProgressNoteList[index] - .status == - 1 && - authProvider.doctorProfile.doctorID != - model - .patientProgressNoteList[ - index] - .createdBy - ? Color(0xFFCC9B14):model - .patientProgressNoteList[ - index] - .status == - 4?Colors.red.shade700 - : model - .patientProgressNoteList[ - index] - .status == - 2?Colors.green[600]:Color(0xFFCC9B14), - widget: Column( - children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - if (model - .patientProgressNoteList[ - index] - .status == - 1 && - authProvider - .doctorProfile.doctorID != - model - .patientProgressNoteList[ - index] - .createdBy) - AppText( - 'Pending', - fontWeight: FontWeight.bold, - color: Color(0xFFCC9B14), - fontSize: 12, - ), + children: [ + if (!isDischargedPatient) + AddNewOrder( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + UpdateNoteOrder( + patientModel: model, + patient: patient, + visitType: widget.visitType, + isUpdate: false, + )), + ); + }, + label: widget.visitType == 3 + ? TranslationBase + .of(context) + .addNewOrderSheet + : TranslationBase + .of(context) + .addProgressNote, + ), + Expanded( + child: Container( + child: ListView.builder( + itemCount: model.patientProgressNoteList.length, + itemBuilder: (BuildContext ctxt, int index) { + return FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + bgColor: model.patientProgressNoteList[index] + .status == + 1 && + authProvider.doctorProfile.doctorID != + model + .patientProgressNoteList[ + index] + .createdBy + ? Color(0xFFCC9B14) + : model.patientProgressNoteList[index] + .status == + 4 + ? Colors.red.shade700 + : model.patientProgressNoteList[index] + .status == + 2 + ? Colors.green[600] + : Color(0xFFCC9B14), + widget: Column( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + if (model + .patientProgressNoteList[ + index] + .status == + 1 && + authProvider + .doctorProfile.doctorID != + model + .patientProgressNoteList[ + index] + .createdBy) + AppText( + TranslationBase + .of(context) + .notePending, + fontWeight: FontWeight.bold, + color: Color(0xFFCC9B14), + fontSize: 12, + ), if (model .patientProgressNoteList[ index] .status == 4) AppText( - 'Canceled', + TranslationBase + .of(context) + .noteCanceled, fontWeight: FontWeight.bold, color: Colors.red.shade700, fontSize: 12, @@ -168,7 +200,9 @@ class _ProgressNoteState extends State { .status == 2) AppText( - 'Verified', + TranslationBase + .of(context) + .noteVerified, fontWeight: FontWeight.bold, color: Colors.green[600], fontSize: 12, @@ -229,7 +263,10 @@ class _ProgressNoteState extends State { width: 2, ), AppText( - 'Update', + TranslationBase + .of( + context) + .update, fontSize: 10, color: Colors.white, ), @@ -309,7 +346,10 @@ class _ProgressNoteState extends State { width: 2, ), AppText( - 'Verify', + TranslationBase + .of( + context) + .noteVerify, fontSize: 10, color: Colors.white, ), @@ -325,22 +365,26 @@ class _ProgressNoteState extends State { onTap: () async { showMyDialog( context: context, - actionName: "cancel", + actionName: + TranslationBase + .of( + context) + .cancel, confirmFun: () async { GifLoaderDialogUtils .showMyDialog( context, ); UpdateNoteReqModel - reqModel = - UpdateNoteReqModel( + reqModel = + UpdateNoteReqModel( admissionNo: int .parse(patient - .admissionNo), + .admissionNo), cancelledNote: true, lineItemNo: model .patientProgressNoteList[ - index] + index] .lineItemNo, createdBy: model .patientProgressNoteList[ @@ -398,7 +442,6 @@ class _ProgressNoteState extends State { padding: EdgeInsets.all(6), ), ), - SizedBox( width: 10, ) @@ -428,7 +471,10 @@ class _ProgressNoteState extends State { .start, children: [ AppText( - 'Created By: ', + TranslationBase + .of( + context) + .createdBy, fontSize: 10, ), Expanded( @@ -452,26 +498,34 @@ class _ProgressNoteState extends State { children: [ AppText( model + .patientProgressNoteList[ + index] + .createdOn != + null + ? DateUtils + .getDayMonthYearDateFormatted( + DateUtils + .getDateTimeFromServerFormat( + model .patientProgressNoteList[ - index] - .createdOn != - null - ? DateUtils.getDayMonthYearDateFormatted( - DateUtils.getDateTimeFromServerFormat( - model - .patientProgressNoteList[ - index] - .createdOn)) + index] + .createdOn), + isArabic: + projectViewModel + .isArabic) : DateUtils - .getDayMonthYearDateFormatted( - DateTime.now()), + .getDayMonthYearDateFormatted( + DateTime.now(), + isArabic: + projectViewModel + .isArabic), fontWeight: FontWeight.w600, fontSize: 14, ), AppText( model - .patientProgressNoteList[ - index] + .patientProgressNoteList[ + index] .createdOn != null ? DateUtils.getHour(DateUtils @@ -508,21 +562,21 @@ class _ProgressNoteState extends State { ), ), ]) - ], - ), - SizedBox( - height: 20, - ), - ], - ), + ], + ), + SizedBox( + height: 20, + ), + ], ), - ); - }), - ), + ), + ); + }), ), - ], + ), + ], ), - ), + ), ), ); } @@ -541,38 +595,49 @@ class _ProgressNoteState extends State { isShowAppBar: false, body: Container( color: Colors.white, - child: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ // SizedBox(height: 20,), - SizedBox(height: 10,), + SizedBox( + height: 10, + ), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ AppText( - "Confirm", fontWeight: FontWeight.w600, + TranslationBase + .of(context) + .noteConfirm, + fontWeight: FontWeight.w600, color: Colors.black, - fontSize: 16,), + fontSize: 16, + ), ], ), - SizedBox(height: 10,), + SizedBox( + height: 10, + ), DividerWithSpacesAround(), - SizedBox(height: 12,), + SizedBox( + height: 12, + ), Container( padding: EdgeInsets.all(20), color: Colors.white, child: AppText( - 'Are you sure you want $actionName this order?', + projectViewModel.isArabic?"هل أنت متأكد أنك تريد تنفيذ $actionName هذا الأمر؟":'Are you sure you want $actionName this order?', fontSize: 15, textAlign: TextAlign.center, ), ), - SizedBox(height: 8,), + SizedBox( + height: 8, + ), DividerWithSpacesAround(), FractionallySizedBox( widthFactor: 0.75, @@ -581,22 +646,29 @@ class _ProgressNoteState extends State { children: [ FlatButton( child: AppText( - "Cancel", fontWeight: FontWeight.w600, + TranslationBase + .of(context) + .cancel, + fontWeight: FontWeight.w600, color: Colors.black, - fontSize: 16,),//Text("Cancel"), + fontSize: 16, + ), //Text("Cancel"), onPressed: () { Navigator.of(context).pop(); }), FlatButton( child: AppText( - "Confirm", fontWeight: FontWeight.w600, + TranslationBase + .of(context) + .noteConfirm, + fontWeight: FontWeight.w600, color: Colors.red.shade700, - fontSize: 16,), //Text("Confirm", ), + fontSize: 16, + ), //Text("Confirm", ), onPressed: () async { - await confirmFun(); + await confirmFun(); Navigator.of(context).pop(); }) - ], ), ) @@ -608,8 +680,4 @@ class _ProgressNoteState extends State { ), )); } - - - - } diff --git a/lib/screens/patients/profile/note/update_note.dart b/lib/screens/patients/profile/note/update_note.dart index 207e56a6..673a6e2b 100644 --- a/lib/screens/patients/profile/note/update_note.dart +++ b/lib/screens/patients/profile/note/update_note.dart @@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/core/model/note/note_model.dart'; import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; @@ -22,6 +23,7 @@ import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; import 'package:permission_handler/permission_handler.dart'; +import 'package:provider/provider.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; @@ -51,6 +53,8 @@ class _UpdateNoteOrderState extends State { stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; var event = RobotProvider(); + ProjectViewModel projectViewModel; + TextEditingController progressNoteController = TextEditingController(); setSelectedType(int val) { @@ -74,6 +78,8 @@ class _UpdateNoteOrderState extends State { @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); + if (widget.note != null) { progressNoteController.text = widget.note.notes; } @@ -91,8 +97,10 @@ class _UpdateNoteOrderState extends State { children: [ BottomSheetTitle( title: widget.visitType == 3 - ? (widget.isUpdate ? 'Update' : 'Add') + ' Order Sheet' - : (widget.isUpdate ? 'Update' : 'Add') + ' Progress Note', + ? (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).orderSheet + : (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).progressNote, ), SizedBox( height: 10.0, @@ -106,10 +114,10 @@ class _UpdateNoteOrderState extends State { children: [ AppTextFieldCustom( hintText: widget.visitType == 3 - ? (widget.isUpdate ? 'Update' : 'Add') + - ' Order Sheet' - : (widget.isUpdate ? 'Update' : 'Add') + - ' Progress Note', + ? (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).orderSheet + : (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).progressNote, //TranslationBase.of(context).addProgressNote, controller: progressNoteController, maxLines: 35, @@ -124,8 +132,8 @@ class _UpdateNoteOrderState extends State { : null, ), Positioned( - top: 0, //MediaQuery.of(context).size.height * 0, - right: 15, + top: -2, //MediaQuery.of(context).size.height * 0, + right: projectViewModel.isArabic? MediaQuery.of(context).size.width * 0.75 : 15, child: IconButton( icon: Icon( DoctorApp.speechtotext, @@ -155,8 +163,10 @@ class _UpdateNoteOrderState extends State { children: [ AppButton( title: widget.visitType == 3 - ? (widget.isUpdate ? 'Update' : 'Add') + ' Order Sheet' - : (widget.isUpdate ? 'Update' : 'Add') + ' Progress Note', + ? (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).orderSheet + : (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).progressNote, color: Color(0xff359846), // disabled: progressNoteController.text.isEmpty, fontWeight: FontWeight.w700, diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index cc6513d0..0519d99e 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1303,6 +1303,28 @@ class TranslationBase { String get severe => localizedValues["severe"][locale.languageCode]; String get graphDetails => localizedValues["graphDetails"][locale.languageCode]; + String get addNewOrderSheet => + localizedValues["addNewOrderSheet"][locale.languageCode]; + String get addNewProgressNote => + localizedValues["addNewProgressNote"][locale.languageCode]; + String get notePending => + localizedValues["notePending"][locale.languageCode]; + String get noteCanceled => + localizedValues["noteCanceled"][locale.languageCode]; + String get noteVerified => + localizedValues["noteVerified"][locale.languageCode]; + String get noteVerify => + localizedValues["noteVerify"][locale.languageCode]; + String get noteConfirm => + localizedValues["noteConfirm"][locale.languageCode]; + String get noteAdd => + localizedValues["noteAdd"][locale.languageCode]; + + String get noteUpdate => + localizedValues["noteUpdate"][locale.languageCode]; + + String get orderSheet => + localizedValues["orderSheet"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From 989774a0b3c2031a73845a116260fddcc1b78cea Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 2 May 2021 17:12:24 +0300 Subject: [PATCH 03/31] Fix patient card and add the discharged in Patient referral page --- lib/client/base_app_client.dart | 2 +- lib/config/config.dart | 2 +- .../patients/DischargedPatientPage.dart | 32 ++-- .../referral/patient_referral_screen.dart | 35 ++++- lib/widgets/patients/PatientCard.dart | 147 +++++++++--------- .../shared/buttons/app_buttons_widget.dart | 2 +- lib/widgets/shared/card_with_bg_widget.dart | 20 +-- 7 files changed, 128 insertions(+), 112 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 83dfad00..faef1fca 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -147,7 +147,7 @@ class BaseAppClient { : SETUP_ID; } - body['VersionID'] = 5.8; + body['VersionID'] = VERSION_ID; body['Channel'] = CHANNEL; body['LanguageID'] = languageID == 'ar' ? 1 : 2; diff --git a/lib/config/config.dart b/lib/config/config.dart index 9596a029..07151d1d 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -336,7 +336,7 @@ const TRANSACTION_NO = 0; const LANGUAGE_ID = 2; const STAMP = '2020-04-27T12:17:17.721Z'; const IP_ADDRESS = '9.9.9.9'; -const VERSION_ID = 5.8; +const VERSION_ID = 5.9; const CHANNEL = 9; const SESSION_ID = 'BlUSkYymTt'; const IS_LOGIN_FOR_DOCTOR_APP = true; diff --git a/lib/screens/patients/DischargedPatientPage.dart b/lib/screens/patients/DischargedPatientPage.dart index 28f7b834..23270afc 100644 --- a/lib/screens/patients/DischargedPatientPage.dart +++ b/lib/screens/patients/DischargedPatientPage.dart @@ -26,10 +26,10 @@ class _DischargedPatientState extends State { return BaseView( onModelReady: (model) => model.getDischargedPatient(), builder: (_, model, w) => AppScaffold( - appBarTitle: 'Discharged Patient', - subtitle: "Last Three Months", + //appBarTitle: 'Discharged Patient', + //subtitle: "Last Three Months", backgroundColor: Colors.grey[200], - isShowAppBar: true, + isShowAppBar: false, baseViewModel: model, body: model.myDischargedPatient.isEmpty?Center( child: Column( @@ -53,17 +53,12 @@ class _DischargedPatientState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - SizedBox(height: 12,), + SizedBox(height: 65,), Container( width: double.maxFinite, height: 75, decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: Color(0xffCCCCCC), - ), + borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: Color(0xffCCCCCC),), color: Colors.white), child: Column( crossAxisAlignment: @@ -88,19 +83,17 @@ class _DischargedPatientState extends State { color: Colors.black, ), iconSize: 20, - padding: - EdgeInsets.only( - bottom: 30), + padding: EdgeInsets.only(bottom: 30), ), onChanged: (String str) { model.searchData(str); }), ])), SizedBox(height: 5,), - Expanded( - child: ListView.builder( - itemCount: model.filterData.length, - itemBuilder: (context,index)=>InkWell( + Expanded(child: SingleChildScrollView( + child: Column( + children: [ + ...List.generate(model.filterData.length, (index) => InkWell( onTap: () { Navigator.of(context) .pushNamed( @@ -324,8 +317,9 @@ class _DischargedPatientState extends State { ), ), )), - ), - + ], + ), + )) ], ), ), diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index 6b7f448b..de106524 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils. import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import '../../DischargedPatientPage.dart'; import 'my-referral-inpatient-screen.dart'; class PatientReferralScreen extends StatefulWidget { @@ -24,7 +25,7 @@ class _PatientReferralScreen extends State with SingleTic @override void initState() { super.initState(); - _tabController = TabController(length: 2, vsync: this); + _tabController = TabController(length: 3, vsync: this); _tabController.addListener(_handleTabSelection); } @@ -74,7 +75,7 @@ class _PatientReferralScreen extends State with SingleTic unselectedLabelColor: Colors.grey[800], tabs: [ Container( - width: MediaQuery.of(context).size.width * 0.50, + width: MediaQuery.of(context).size.width * 0.33, height: MediaQuery.of(context).size.height * 0.070, decoration: TextFieldsUtils.containerBorderDecoration( Color(0Xffffffff), Color(0xFFCCCCCC), @@ -101,7 +102,7 @@ class _PatientReferralScreen extends State with SingleTic ), ), Container( - width: MediaQuery.of(context).size.width * 0.50, + width: MediaQuery.of(context).size.width * 0.34, height: MediaQuery.of(context).size.height * 0.070, decoration: TextFieldsUtils.containerBorderDecoration( Color(0Xffffffff), Color(0xFFCCCCCC), @@ -127,6 +128,33 @@ class _PatientReferralScreen extends State with SingleTic ), ), ), + Container( + width: MediaQuery.of(context).size.width * 0.33, + height: MediaQuery.of(context).size.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + Color(0Xffffffff), Color(0xFFCCCCCC), + borderRadius: 4, borderWidth: 0), + child: Center( + child: Container( + height: MediaQuery.of(context).size.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + index == 2 + ? Color(0xFFD02127 ) + : Color(0xFFEAEAEA), + index == 2 ? Color(0xFFD02127) : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), + child: Center( + child: AppText( + 'Discharged', + fontSize: SizeConfig.textMultiplier * 1.8, + color: index == 2 ? Colors.white : Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ), + ), + ), + ), + ), ], ), @@ -143,6 +171,7 @@ class _PatientReferralScreen extends State with SingleTic children: [ ReferredPatientScreen(), MyReferralInPatientScreen(), + DischargedPatient() // MyReferredPatient(), ], ), diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index aa6f114f..e02ebb5b 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.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:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; @@ -32,36 +33,22 @@ class PatientCard extends StatelessWidget { return Container( width: SizeConfig.screenWidth * 0.9, margin: EdgeInsets.all(6), - padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), + padding: EdgeInsets.only(left: 0, right: 5, bottom: 0, top: 0), decoration: BoxDecoration( - borderRadius: BorderRadius.circular(15), + borderRadius: BorderRadius.circular(10), color: Colors.white, ), - child: Stack(children: [ - if (!isInpatient&& !isMyPatient && !isFromSearch) - Container( - height: 160, - width: 5, - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(10), - bottomLeft: Radius.circular(10)), - color: patientInfo.patientStatusType == 43 - ? Colors.green[500] - : Colors.red[800], - )), - if(isMyPatient && !isFromSearch) - Container( - height: 180, - width: 5, - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(10), - bottomLeft: Radius.circular(10)), - color: Colors.green[500] - )), - Container( - padding: EdgeInsets.only(left: 10, right: 0, bottom: 0), + child: CardWithBgWidget( + padding: 0, + marginLeft: (!isMyPatient && isInpatient)?0:10, + marginSymmetric:isFromSearch ? 10 : 0.0, + hasBorder: false, + bgColor:(isMyPatient && !isFromSearch)?Colors.green[500]: patientInfo.patientStatusType == 43 + ? Colors.green[500] + :isMyPatient? Colors.green[500]:isInpatient?Colors.white:!isFromSearch?Colors.red[800]:Colors.white, + widget: Container( + color: Colors.white, + // padding: EdgeInsets.only(left: 10, right: 0, bottom: 0), child: InkWell( child: Column( children: [ @@ -82,7 +69,7 @@ class PatientCard extends StatelessWidget { color: Colors.green, fontWeight: FontWeight.bold, fontFamily: 'Poppins', - fontSize: 12, + fontSize: 10, ), SizedBox(width: 8,), SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),), @@ -92,7 +79,7 @@ class PatientCard extends StatelessWidget { color: patientInfo.status==2? Colors.green:Colors.grey , fontWeight: FontWeight.bold, fontFamily: 'Poppins', - fontSize: 12, + fontSize: 10, ), ], ) @@ -103,7 +90,7 @@ class PatientCard extends StatelessWidget { color: Colors.red[800], fontWeight: FontWeight.bold, fontFamily: 'Poppins', - fontSize: 12, + fontSize: 10, ), SizedBox(width: 8,), SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),), @@ -113,7 +100,7 @@ class PatientCard extends StatelessWidget { color: patientInfo.status==2? Colors.green:Colors.grey , fontWeight: FontWeight.bold, fontFamily: 'Poppins', - fontSize: 12, + fontSize: 10, ), ], ): !isFromSearch && patientInfo.patientStatusType==null ? Row( @@ -151,14 +138,15 @@ class PatientCard extends StatelessWidget { )+" "+ "${DateUtils.getStartTime(patientInfo.startTime)}", fontFamily: 'Poppins', fontWeight: FontWeight.w400, + fontSize: 15, ) : (patientInfo.appointmentDate != null && patientInfo.appointmentDate.isNotEmpty)? AppText( - // - // )+" "+ DateUtils.getTimeHHMMA(DateUtils.convertStringToDate(patientInfo.appointmentDate,)), - " ${DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.appointmentDate,))} ${DateUtils.getStartTime(patientInfo.startTime)}", + + "${DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.appointmentDate,))} ${DateUtils.getStartTime(patientInfo.startTime)}", fontFamily: 'Poppins', fontWeight: FontWeight.w400, + fontSize: 15, ):SizedBox() ], )) @@ -181,29 +169,31 @@ class PatientCard extends StatelessWidget { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Row(children: [ - Container( - width: 170, - child: AppText( - (Helpers.capitalize(patientInfo.firstName) + - " " + - Helpers.capitalize(patientInfo.lastName)), - fontSize: 16, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - textOverflow: TextOverflow.ellipsis, + Expanded( + child: Row(children: [ + Expanded( + // width: MediaQuery.of(context).size.width*0.51, + child: AppText( + (Helpers.capitalize(patientInfo.firstName) + + " " + + Helpers.capitalize(patientInfo.lastName)), + fontSize: 16, + color: Color(0xff2e303a), + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + textOverflow: TextOverflow.ellipsis, + ), ), - ), - patientInfo.gender == 1 - ? Icon( - DoctorApp.male_2, - color: Colors.blue, - ) - : Icon( - DoctorApp.female_1, - color: Colors.pink, - ), - ]), + if (patientInfo.gender == 1) + Icon( + DoctorApp.male_2, + color: Colors.blue, + ) else Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + ]), + ), Row( children: [ AppText( @@ -280,14 +270,14 @@ class PatientCard extends StatelessWidget { text: TranslationBase.of(context) .fileNumber, style: TextStyle( - fontSize: 14, + fontSize: 12, fontFamily: 'Poppins')), new TextSpan( text: patientInfo.patientId.toString(), style: TextStyle( fontWeight: FontWeight.w700, fontFamily: 'Poppins', - fontSize: 15)), + fontSize: 13)), ], ), ), @@ -306,13 +296,13 @@ class PatientCard extends StatelessWidget { text: TranslationBase.of(context).age + " : ", - style: TextStyle(fontSize: 14)), + style: TextStyle(fontSize: 12)), new TextSpan( text: "${DateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}", style: TextStyle( fontWeight: FontWeight.w700, - fontSize: 15)), + fontSize: 13)), ], ), ), @@ -334,28 +324,35 @@ class PatientCard extends StatelessWidget { : TranslationBase.of(context) .admissionDate + " : ", - style: TextStyle(fontSize: 14)), + style: TextStyle(fontSize: 12)), new TextSpan( text: patientInfo.admissionDate == null ? "" : "${DateUtils.convertDateFromServerFormat(patientInfo.admissionDate.toString(), 'yyyy-MM-dd')}", style: TextStyle( fontWeight: FontWeight.w700, - fontSize: 15)), + fontSize: 13)), ]))), if (patientInfo.admissionDate != null) - Row( - children: [ - AppText( - "${TranslationBase.of(context).numOfDays}: ", - fontSize: 15, - ), - AppText( - "${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", - fontSize: 15, - fontWeight: FontWeight.w700), - ], - ), + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: + 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: TranslationBase.of(context).numOfDays + " : ", + style: TextStyle(fontSize: 12)), + new TextSpan( + text: "${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", + style: TextStyle( + fontWeight: FontWeight.w700, + fontSize: 13)), + ]))), ])) ]), @@ -395,7 +392,7 @@ class PatientCard extends StatelessWidget { ), onTap: onTap, )), - ])); + )); } diff --git a/lib/widgets/shared/buttons/app_buttons_widget.dart b/lib/widgets/shared/buttons/app_buttons_widget.dart index 66aaac09..ed3e6e98 100644 --- a/lib/widgets/shared/buttons/app_buttons_widget.dart +++ b/lib/widgets/shared/buttons/app_buttons_widget.dart @@ -49,7 +49,7 @@ class _AppButtonState extends State { @override Widget build(BuildContext context) { return Container( - // height: 60,//MediaQuery.of(context).size.height * 0.075, + // height: MediaQuery.of(context).size.height * 0.075, child: IgnorePointer( ignoring: widget.loading ||widget.disabled, child: RawMaterialButton( diff --git a/lib/widgets/shared/card_with_bg_widget.dart b/lib/widgets/shared/card_with_bg_widget.dart index 3b65bba5..deeff358 100644 --- a/lib/widgets/shared/card_with_bg_widget.dart +++ b/lib/widgets/shared/card_with_bg_widget.dart @@ -3,27 +3,23 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; -/* - *@author: Mohammad Aljammal - *@Date:27/4/2020 - *@param: Widget - *@return: - *@desc: Card With Bg Widget - */ class CardWithBgWidget extends StatelessWidget { final Widget widget; final Color bgColor; final bool hasBorder; + final double padding; + final double marginLeft; + final double marginSymmetric; CardWithBgWidget( - {@required this.widget, this.bgColor, this.hasBorder = true}); + {@required this.widget, this.bgColor, this.hasBorder = true, this.padding = 15.0, this.marginLeft = 10.0, this.marginSymmetric=10.0}); @override Widget build(BuildContext context) { ProjectViewModel projectProvider = Provider.of(context); return Container( - margin: EdgeInsets.symmetric(vertical: 10.0), + margin: EdgeInsets.symmetric(vertical: marginSymmetric), // width: double.infinity, decoration: BoxDecoration( borderRadius: BorderRadius.all( @@ -61,15 +57,15 @@ class CardWithBgWidget extends StatelessWidget { borderRadius: BorderRadius.only( topLeft: Radius.circular(10), bottomLeft: Radius.circular(10),),), - width: 10, + width: 7, ), bottom: 1, top: 1, left: 1, ), Container( - padding: EdgeInsets.all(15.0), - margin: EdgeInsets.only(left: 10), + padding: EdgeInsets.all(padding), + margin: EdgeInsets.only(left: marginLeft), child: widget) ], ), From 7bc897bf39eb90b62b0731ec5ab7b71716f60157 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 2 May 2021 17:13:02 +0300 Subject: [PATCH 04/31] fix profile issue --- lib/client/base_app_client.dart | 2 +- lib/config/localized_values.dart | 15 ++++++---- lib/routes.dart | 6 ++-- ...ile_page.dart => health_summary_page.dart} | 6 ++-- .../profile/in_patient_profile_screen.dart | 4 +-- .../profile_gird_for_InPatient.dart | 30 ++++++++----------- .../profile_gird_for_other.dart | 8 ++--- .../profile_gird_for_search.dart | 8 ++--- lib/screens/sick-leave/add-sickleave.dart | 8 +++-- lib/util/translations_delegate_base.dart | 10 +++++++ .../profile/PatientProfileButton.dart | 4 +-- .../profile/profile_medical_info_widget.dart | 2 +- ...rofile_medical_info_widget_in_patient.dart | 4 +-- .../profile_medical_info_widget_search.dart | 6 ++-- 14 files changed, 61 insertions(+), 52 deletions(-) rename lib/screens/medical-file/{medical_file_page.dart => health_summary_page.dart} (98%) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 83dfad00..faef1fca 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -147,7 +147,7 @@ class BaseAppClient { : SETUP_ID; } - body['VersionID'] = 5.8; + body['VersionID'] = VERSION_ID; body['Channel'] = CHANNEL; body['LanguageID'] = languageID == 'ar' ? 1 : 2; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 53981e90..9aba36b8 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -276,8 +276,8 @@ const Map> localizedValues = { 'age2': {'en': 'Age: ', 'ar': 'العمر: '}, 'replySuccessfully': {'en': 'Reply Successfully', 'ar': 'تم الرد بنجاح'}, "sick-leaves": {"en": "Patient Sick Leave", "ar": "الاجازات المرضية"}, - "patient-sick": {"en": "Patient Sick", "ar": "المرضية"}, - "leave": {"en": "Leave", "ar": "غادر"}, + "patient-sick": {"en": "Patient Sick", "ar": "مرضية"}, + "leave": {"en": "Leave", "ar": "مغادره"}, "submit": {"en": "Submit", "ar": "ارسال"}, "doc-name": {"en": "Doctor Name", "ar": "اسم الطبيب"}, "clinicname": {"en": "Clinic Name", "ar": "اسم العيادة"}, @@ -819,7 +819,7 @@ const Map> localizedValues = { "add-reschedule": {"en": "Add reschedule", "ar": "أضف إعادة الجدولة"}, "update-reschedule": {"en": "Update reschedule", "ar": "تحديث إعادة الجدولة"}, - "sick_leave": {"en": "Sick Leave", "ar": "أجازة مرضية"}, + "sick_leave": {"en": "Sick Leave", "ar": "إجازة مرضية"}, "addSickLeaveRequest": { "en": "Add Sick Leave Request", "ar": "إضافة طلب إجازة مرضية" @@ -928,8 +928,8 @@ const Map> localizedValues = { "newRadiologyOrder": {"en": "New Radiology Order", "ar": "طلب الأشعة الجديد"}, "orderDate": {"en": "Order Date", "ar": "تاريخ الطلب"}, "examType": {"en": "Exam Type", "ar": "نوع الفحص"}, - "health": {"en": "Health", "ar": "التقرير"}, - "summary": {"en": "Summary", "ar": "الصحي"}, + "health": {"en": "Health", "ar": "الصحي"}, + "summary": {"en": "Summary", "ar": "التقرير"}, "applyForNewPrescriptionsOrder": { "en": "Apply for New Prescriptions Order", "ar": "التقدم بطلب للحصول على وصفات طبية جديدة " @@ -956,6 +956,11 @@ const Map> localizedValues = { 'noteAdd': {'en': 'Add ', 'ar': 'اضف '}, 'noteUpdateْْ': {'en': 'Update ', 'ar': 'تحديت'}, 'orderSheet': {'en': 'Order Sheet', 'ar': 'ورقة الطلب'}, + 'order': {'en': 'Order', 'ar': 'الطلب'}, + 'sheet': {'en': 'Sheet', 'ar': 'ورقة'}, + 'medical': {'en': 'Medical', 'ar': 'الطبي'}, + 'report': {'en': 'Report', 'ar': 'التقرير'}, + 'discharge': {'en': 'Discharge', 'ar': 'discharge'}, }; diff --git a/lib/routes.dart b/lib/routes.dart index 97f842f6..44613100 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -1,5 +1,5 @@ import 'package:doctor_app_flutter/root_page.dart'; -import 'package:doctor_app_flutter/screens/medical-file/medical_file_page.dart'; +import 'package:doctor_app_flutter/screens/medical-file/health_summary_page.dart'; import 'package:doctor_app_flutter/screens/patients/ECGPage.dart'; import 'package:doctor_app_flutter/screens/patients/insurance_approval_screen_patient.dart'; import 'package:doctor_app_flutter/screens/patients/profile/UCAF/UCAF-detail-screen.dart'; @@ -37,7 +37,7 @@ const String PATIENTS = 'patients/patients'; const String PATIENTS_PROFILE = 'patients/patients-profile'; const String IN_PATIENTS_PROFILE = 'inpatients/patients-profile'; const String LAB_RESULT = 'patients/lab_result'; -const String MEDICAL_FILE = 'patients/radiology'; +const String HEALTH_SUMMARY = 'patients/health-summary'; const String PROGRESS_NOTE = 'patients/progress-note'; const String ORDER_NOTE = 'patients/order-note'; @@ -70,7 +70,7 @@ var routes = { VERIFICATION_METHODS: (_) => VerificationMethodsScreen(), PATIENTS_PROFILE: (_) => PatientProfileScreen(), LAB_RESULT: (_) => LabsHomePage(), - MEDICAL_FILE: (_) => MedicalFilePage(), + HEALTH_SUMMARY: (_) => HealthSummaryPage(), PROGRESS_NOTE: (_) => ProgressNoteScreen(visitType: 5,), ORDER_NOTE: (_) => ProgressNoteScreen(visitType: 3,), REFER_PATIENT_TO_DOCTOR: (_) => PatientMakeReferralScreen(), diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/health_summary_page.dart similarity index 98% rename from lib/screens/medical-file/medical_file_page.dart rename to lib/screens/medical-file/health_summary_page.dart index b2590296..3096e775 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/health_summary_page.dart @@ -11,12 +11,12 @@ import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; -class MedicalFilePage extends StatefulWidget { +class HealthSummaryPage extends StatefulWidget { @override - _MedicalFilePageState createState() => _MedicalFilePageState(); + _HealthSummaryPageState createState() => _HealthSummaryPageState(); } -class _MedicalFilePageState extends State { +class _HealthSummaryPageState extends State { PatiantInformtion patient; @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/profile/in_patient_profile_screen.dart b/lib/screens/patients/profile/in_patient_profile_screen.dart index bce4c725..8b1c3b7e 100644 --- a/lib/screens/patients/profile/in_patient_profile_screen.dart +++ b/lib/screens/patients/profile/in_patient_profile_screen.dart @@ -141,7 +141,7 @@ class _InPatientProfileScreenState extends Statewith Sin patient: patient, patientType: patientType, arrivalType: arrivalType, - route: MEDICAL_FILE, + route: HEALTH_SUMMARY, nameLine1: "Health", //TranslationBase.of(context).medicalReport, nameLine2: "Summary", @@ -152,7 +152,7 @@ class _InPatientProfileScreenState extends Statewith Sin patientType: patientType, arrivalType: arrivalType, isDisable: true, - route: MEDICAL_FILE, + route: HEALTH_SUMMARY, nameLine1: "Medical", //Health //TranslationBase.of(context).medicalReport, nameLine2: "Report", //Report diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart index 457fe04e..59b3dd2f 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart @@ -146,12 +146,9 @@ class ProfileGridForInPatient extends StatelessWidget { route: ORDER_NOTE, isDischargedPatient: isDischargedPatient, - nameLine1: - "Order", - //"Text", + nameLine1:TranslationBase.of(context).order, nameLine2: - "Sheet", - //TranslationBase.of(context).orders, + TranslationBase.of(context).sheet, icon: 'patient/Progress_notes.png'), PatientProfileButton( @@ -176,11 +173,11 @@ class ProfileGridForInPatient extends StatelessWidget { patient: patient, patientType: patientType, arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: "Health", + route: HEALTH_SUMMARY, + nameLine1: TranslationBase.of(context).health, + nameLine2: TranslationBase.of(context).summary, isInPatient: isInpatient, - nameLine2: "Summary", - //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), PatientProfileButton( @@ -188,15 +185,12 @@ class ProfileGridForInPatient extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, isDisable: true, - route: MEDICAL_FILE, + route: HEALTH_SUMMARY, nameLine1: - "Medical", - //Health - isInPatient: isInpatient, + TranslationBase.of(context).medical, nameLine2: - "Report", - //Report - //TranslationBase.of(context).summaryReport, + TranslationBase.of(context).report, + isInPatient: isInpatient, icon: 'patient/health_summary.png'), PatientProfileButton( @@ -246,8 +240,8 @@ class ProfileGridForInPatient extends StatelessWidget { arrivalType: arrivalType, isDisable: true, route: null, - nameLine1: "Discharge", - nameLine2: "Summery", + nameLine1: TranslationBase.of(context).discharge, + nameLine2: TranslationBase.of(context).report, icon: 'patient/patient_sick_leave.png'), PatientProfileButton( diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart index 5b7112d6..66894e11 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart @@ -131,11 +131,9 @@ class ProfileGridForOther extends StatelessWidget { patientType, arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: "Health", - //TranslationBase.of(context).medicalReport, - nameLine2: "Summary", - //TranslationBase.of(context).summaryReport, + route: HEALTH_SUMMARY, + nameLine1: TranslationBase.of(context).health, + nameLine2: TranslationBase.of(context).summary, icon: 'patient/health_summary.png'), PatientProfileButton( diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart index ed3c4dfd..2d3679cf 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart @@ -80,11 +80,9 @@ class ProfileGridForSearch extends StatelessWidget { patient: patient, patientType: patientType, arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: "Health", - //TranslationBase.of(context).medicalReport, - nameLine2: "Summary", - //TranslationBase.of(context).summaryReport, + route: HEALTH_SUMMARY, + nameLine1: TranslationBase.of(context).health, + nameLine2: TranslationBase.of(context).summary, icon: 'patient/health_summary.png'), PatientProfileButton( isInPatient: isInpatient, diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index 6ee37745..a961c078 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/sick_leave_patient_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; @@ -14,11 +15,15 @@ import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart' import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; +// ignore: must_be_immutable class AddSickLeavScreen extends StatelessWidget { PatiantInformtion patient; @override Widget build(BuildContext context) { + ProjectViewModel projectsProvider = Provider.of(context); + final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; bool isInpatient = routeArgs['isInpatient']; @@ -37,8 +42,6 @@ class AddSickLeavScreen extends StatelessWidget { ), body: SingleChildScrollView( child: Column(children: [ - // PatientProfileHeaderNewDesign( - // patient, routeArgs['patientType'], routeArgs['arrivalType']), patient.patientStatusType == 43 ? Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -48,6 +51,7 @@ class AddSickLeavScreen extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + if(!projectsProvider.isArabic) AppText( TranslationBase.of(context).patient, fontWeight: FontWeight.bold, diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 0519d99e..8bf49397 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1325,6 +1325,16 @@ class TranslationBase { String get orderSheet => localizedValues["orderSheet"][locale.languageCode]; + String get order => + localizedValues["order"][locale.languageCode]; + String get sheet => + localizedValues["sheet"][locale.languageCode]; + String get medical => + localizedValues["medical"][locale.languageCode]; + String get report => + localizedValues["report"][locale.languageCode]; + String get discharge => + localizedValues["discharge"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index 9a027e36..f7c60623 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -77,7 +77,7 @@ class PatientProfileButton extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - this.nameLine1, + !projectsProvider.isArabic?this.nameLine1: nameLine2, color: Colors.black, /*Color(0xFFB9382C),*/ fontWeight: FontWeight.w600, @@ -85,7 +85,7 @@ class PatientProfileButton extends StatelessWidget { fontSize: SizeConfig.textMultiplier * 1.5, ), AppText( - this.nameLine2, + !projectsProvider.isArabic? this.nameLine2:nameLine1, color: Colors.black, fontWeight: FontWeight.w600, textAlign: TextAlign.left, diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index a469138c..c5417d85 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -52,7 +52,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { patient: patient, patientType: patientType, arrivalType: arrivalType, - route: MEDICAL_FILE, + route: HEALTH_SUMMARY, nameLine1: "Health" ,//TranslationBase.of(context).medicalReport, nameLine2: "Summary",//TranslationBase.of(context).summaryReport, icon: 'patient/health_summary.png'), diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart b/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart index eea3bfbb..17feaf0a 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart @@ -113,7 +113,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { patient: patient, patientType: patientType, arrivalType: arrivalType, - route: MEDICAL_FILE, + route: HEALTH_SUMMARY, nameLine1: "Health", //TranslationBase.of(context).medicalReport, nameLine2: "Summary", @@ -125,7 +125,7 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, isDisable: true, - route: MEDICAL_FILE, + route: HEALTH_SUMMARY, nameLine1: "Medical", //Health //TranslationBase.of(context).medicalReport, nameLine2: "Report", //Report diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart index c03367bc..ac33eb82 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -173,7 +173,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { patient: patient, patientType: patientType, arrivalType: arrivalType, - route: MEDICAL_FILE, + route: HEALTH_SUMMARY, nameLine1: "Health", //TranslationBase.of(context).medicalReport, nameLine2: "Summary", @@ -185,7 +185,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { patientType: patientType, arrivalType: arrivalType, isDisable: true, - route: MEDICAL_FILE, + route: HEALTH_SUMMARY, nameLine1: "Medical", //Health //TranslationBase.of(context).medicalReport, nameLine2: "Report", //Report @@ -256,7 +256,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { patient: patient, patientType: patientType, arrivalType: arrivalType, - route: MEDICAL_FILE, + route: HEALTH_SUMMARY, nameLine1: "Health", //TranslationBase.of(context).medicalReport, nameLine2: From 6153c81aa42715cca24aa7ce514e478ae032f7f0 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 2 May 2021 17:14:58 +0300 Subject: [PATCH 05/31] small fix --- lib/screens/doctor/doctor_reply_screen.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/screens/doctor/doctor_reply_screen.dart b/lib/screens/doctor/doctor_reply_screen.dart index dcbe9667..f522561f 100644 --- a/lib/screens/doctor/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_reply_screen.dart @@ -34,7 +34,7 @@ class DoctorReplyScreen extends StatelessWidget { }, child: AppScaffold( baseViewModel: model, - appBarTitle: "ghgh",//TranslationBase.of(context).replay2, + appBarTitle: TranslationBase.of(context).replay2, isShowAppBar: false, body: model.listDoctorWorkingHoursTable.isEmpty ? DrAppEmbeddedError(error: TranslationBase.of(context).noItem) From b43b7cafccfaef849c2b710abcb0ad87d723489a Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sun, 2 May 2021 17:26:19 +0300 Subject: [PATCH 06/31] working on in-patient screen design --- lib/config/config.dart | 2 +- lib/config/localized_values.dart | 1 + lib/core/service/patientInPatientService.dart | 8 +- .../viewModel/PatientSearchViewModel.dart | 120 ++++----- .../patients/DischargedPatientPage.dart | 10 +- lib/screens/patients/InPatientPage.dart | 164 ++++++++++++ .../patients/PatientsInPatientScreen.dart | 251 +++++++----------- .../profile_gird_for_InPatient.dart | 2 +- lib/util/translations_delegate_base.dart | 4 +- .../profile/PatientProfileButton.dart | 6 +- pubspec.lock | 8 +- 11 files changed, 352 insertions(+), 224 deletions(-) create mode 100644 lib/screens/patients/InPatientPage.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 9596a029..62625b40 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -336,7 +336,7 @@ const TRANSACTION_NO = 0; const LANGUAGE_ID = 2; const STAMP = '2020-04-27T12:17:17.721Z'; const IP_ADDRESS = '9.9.9.9'; -const VERSION_ID = 5.8; +const VERSION_ID = 6.0; const CHANNEL = 9; const SESSION_ID = 'BlUSkYymTt'; const IS_LOGIN_FOR_DOCTOR_APP = true; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index d5999b21..b975f6d9 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -946,4 +946,5 @@ const Map> localizedValues = { "approvals22": {"en": "Approvals", "ar": "التامين"}, "severe": {"en": "Severe", "ar": "الشدة"}, "graphDetails": {"en": "Graph Details", "ar": "تفاصيل الرسم البياني"}, + "discharged": {"en": "Discharged", "ar": "المصرف"}, }; diff --git a/lib/core/service/patientInPatientService.dart b/lib/core/service/patientInPatientService.dart index 3e0ba4a4..6ec77514 100644 --- a/lib/core/service/patientInPatientService.dart +++ b/lib/core/service/patientInPatientService.dart @@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; class PatientInPatientService extends BaseService { List inPatientList = List(); + List myInPatientList = List(); Future getInPatientList( PatientSearchRequestModel requestModel, bool isMyInpatient) async { @@ -21,9 +22,14 @@ class PatientInPatientService extends BaseService { GET_PATIENT_IN_PATIENT_LIST, onSuccess: (dynamic response, int statusCode) { inPatientList.clear(); + myInPatientList.clear(); response['List_MyInPatient'].forEach((v) { - inPatientList.add(PatiantInformtion.fromJson(v)); + PatiantInformtion patient = PatiantInformtion.fromJson(v); + inPatientList.add(patient); + if(patient.doctorId == doctorProfile.doctorID){ + myInPatientList.add(patient); + } }); }, onFailure: (String error, int statusCode) { diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 8192b1a8..edf9142a 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -9,7 +9,7 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; import '../../locator.dart'; import 'base_view_model.dart'; -class PatientSearchViewModel extends BaseViewModel{ +class PatientSearchViewModel extends BaseViewModel { OutPatientService _outPatientService = locator(); List get patientList => _outPatientService.patientList; @@ -24,10 +24,14 @@ class PatientSearchViewModel extends BaseViewModel{ if (strExist) { filterData = []; for (var i = 0; i < _outPatientService.patientList.length; i++) { - String firstName = _outPatientService.patientList[i].firstName.toUpperCase(); - String lastName = _outPatientService.patientList[i].lastName.toUpperCase(); - String mobile = _outPatientService.patientList[i].mobileNumber.toUpperCase(); - String patientID = _outPatientService.patientList[i].patientId.toString(); + String firstName = + _outPatientService.patientList[i].firstName.toUpperCase(); + String lastName = + _outPatientService.patientList[i].lastName.toUpperCase(); + String mobile = + _outPatientService.patientList[i].mobileNumber.toUpperCase(); + String patientID = + _outPatientService.patientList[i].patientId.toString(); if (firstName.contains(str.toUpperCase()) || lastName.contains(str.toUpperCase()) || @@ -43,19 +47,19 @@ class PatientSearchViewModel extends BaseViewModel{ } } - getOutPatient(PatientSearchRequestModel patientSearchRequestModel , {bool isLocalBusy = false}) async { - if(isLocalBusy) { + getOutPatient(PatientSearchRequestModel patientSearchRequestModel, + {bool isLocalBusy = false}) async { + if (isLocalBusy) { setState(ViewState.BusyLocal); } else { setState(ViewState.Busy); } - await getDoctorProfile(isGetProfile: true); + await getDoctorProfile(isGetProfile: true); patientSearchRequestModel.doctorID = doctorProfile.doctorID; - await _outPatientService.getOutPatient( - patientSearchRequestModel); + await _outPatientService.getOutPatient(patientSearchRequestModel); if (_outPatientService.hasError) { error = _outPatientService.error; - if(isLocalBusy) { + if (isLocalBusy) { setState(ViewState.ErrorLocal); } else { setState(ViewState.Error); @@ -66,10 +70,11 @@ class PatientSearchViewModel extends BaseViewModel{ } } - getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel, {bool isLocalBusy = false}) async { + getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel, + {bool isLocalBusy = false}) async { setState(ViewState.Busy); - await _outPatientService.getPatientFileInformation( - patientSearchRequestModel); + await _outPatientService + .getPatientFileInformation(patientSearchRequestModel); if (_outPatientService.hasError) { error = _outPatientService.error; setState(ViewState.Error); @@ -79,30 +84,21 @@ class PatientSearchViewModel extends BaseViewModel{ } } - - - getPatientBasedOnDate ( - {item, PatientSearchRequestModel patientSearchRequestModel, PatientType selectedPatientType, - bool isSearchWithKeyInfo })async { + getPatientBasedOnDate( + {item, + PatientSearchRequestModel patientSearchRequestModel, + PatientType selectedPatientType, + bool isSearchWithKeyInfo}) async { String dateTo; String dateFrom; if (item == 'Previous') { - - selectedFromDate = DateTime(DateTime.now().year, DateTime.now().month-1, - DateTime.now().day); - selectedToDate = DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day-1); - dateTo = DateUtils.convertDateToFormat( - selectedToDate, - 'yyyy-MM-dd'); - dateFrom = DateUtils.convertDateToFormat( - selectedFromDate, - 'yyyy-MM-dd'); - - + selectedFromDate = DateTime( + DateTime.now().year, DateTime.now().month - 1, DateTime.now().day); + selectedToDate = DateTime( + DateTime.now().year, DateTime.now().month, DateTime.now().day - 1); + dateTo = DateUtils.convertDateToFormat(selectedToDate, 'yyyy-MM-dd'); + dateFrom = DateUtils.convertDateToFormat(selectedFromDate, 'yyyy-MM-dd'); } else if (item == 'Next Week') { - - dateTo = DateUtils.convertDateToFormat( DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 6), @@ -117,76 +113,78 @@ class PatientSearchViewModel extends BaseViewModel{ DateTime( DateTime.now().year, DateTime.now().month, DateTime.now().day), 'yyyy-MM-dd'); - dateTo= DateUtils.convertDateToFormat( + dateTo = DateUtils.convertDateToFormat( DateTime( DateTime.now().year, DateTime.now().month, DateTime.now().day), 'yyyy-MM-dd'); } PatientSearchRequestModel currentModel = PatientSearchRequestModel(); - currentModel.patientID = patientSearchRequestModel.patientID; - currentModel.firstName = patientSearchRequestModel.firstName; - currentModel.lastName = patientSearchRequestModel.lastName; + currentModel.patientID = patientSearchRequestModel.patientID; + currentModel.firstName = patientSearchRequestModel.firstName; + currentModel.lastName = patientSearchRequestModel.lastName; currentModel.middleName = patientSearchRequestModel.middleName; currentModel.doctorID = patientSearchRequestModel.doctorID; currentModel.from = dateFrom; currentModel.to = dateTo; await getOutPatient(currentModel, isLocalBusy: true); filterData = _outPatientService.patientList; - } + PatientInPatientService _inPatientService = + locator(); + List get inPatientList => _inPatientService.inPatientList; - PatientInPatientService _inPatientService = - locator(); + List get myIinPatientList => + _inPatientService.myInPatientList; - List get _inPatientList => _inPatientService.inPatientList; List filteredInPatientItems = List(); Future getInPatientList(PatientSearchRequestModel requestModel, - {bool isMyInpatient = false, bool isFirstTime = true}) async { - await getDoctorProfile(); - if (isFirstTime) + {bool isMyInpatient = false}) async { + await getDoctorProfile(); setState(ViewState.Busy); - else - setState(ViewState.BusyLocal); - await _inPatientService.getInPatientList(requestModel, false); + + if (inPatientList.length == 0) + await _inPatientService.getInPatientList(requestModel, false); if (_inPatientService.hasError) { error = _inPatientService.error; setState(ViewState.Error); } else { filteredInPatientItems.clear(); - if (_inPatientList.length > 0) - filteredInPatientItems.addAll(_inPatientList); + if (inPatientList.length > 0) + filteredInPatientItems.addAll(inPatientList); setState(ViewState.Idle); } } + void clearPatientList(){ + _inPatientService.inPatientList = []; + _inPatientService.myInPatientList = []; + } + void filterSearchResults(String query) { var strExist = query.length > 0 ? true : false; if (strExist) { filteredInPatientItems = []; - for (var i = 0; i < _inPatientList.length; i++) { - String firstName = _inPatientList[i].firstName.toUpperCase(); - String lastName = _inPatientList[i].lastName.toUpperCase(); - String mobile = _inPatientList[i].mobileNumber.toUpperCase(); - String patientID = _inPatientList[i].patientId.toString(); + for (var i = 0; i < inPatientList.length; i++) { + String firstName = inPatientList[i].firstName.toUpperCase(); + String lastName = inPatientList[i].lastName.toUpperCase(); + String mobile = inPatientList[i].mobileNumber.toUpperCase(); + String patientID = inPatientList[i].patientId.toString(); if (firstName.contains(query.toUpperCase()) || lastName.contains(query.toUpperCase()) || mobile.contains(query) || patientID.contains(query)) { - filteredInPatientItems.add(_inPatientList[i]); + filteredInPatientItems.add(inPatientList[i]); } } notifyListeners(); } else { - if (_inPatientList.length > 0) - filteredInPatientItems.clear(); - filteredInPatientItems.addAll(_inPatientList); + if (inPatientList.length > 0) filteredInPatientItems.clear(); + filteredInPatientItems.addAll(inPatientList); notifyListeners(); } } - - } diff --git a/lib/screens/patients/DischargedPatientPage.dart b/lib/screens/patients/DischargedPatientPage.dart index 28f7b834..8e183ca8 100644 --- a/lib/screens/patients/DischargedPatientPage.dart +++ b/lib/screens/patients/DischargedPatientPage.dart @@ -29,12 +29,15 @@ class _DischargedPatientState extends State { appBarTitle: 'Discharged Patient', subtitle: "Last Three Months", backgroundColor: Colors.grey[200], - isShowAppBar: true, + isShowAppBar: false, baseViewModel: model, - body: model.myDischargedPatient.isEmpty?Center( + body: model.myDischargedPatient.isEmpty? Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ + Container( + height: MediaQuery.of(context).size.height * 0.070, + ), SizedBox( height: 100, ), @@ -53,6 +56,9 @@ class _DischargedPatientState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ + Container( + height: MediaQuery.of(context).size.height * 0.070, + ), SizedBox(height: 12,), Container( width: double.maxFinite, diff --git a/lib/screens/patients/InPatientPage.dart b/lib/screens/patients/InPatientPage.dart new file mode 100644 index 00000000..e26a5d9a --- /dev/null +++ b/lib/screens/patients/InPatientPage.dart @@ -0,0 +1,164 @@ +import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.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/patients/PatientCard.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; +import 'package:flutter/material.dart'; + +import '../../routes.dart'; + +class InPatientPage extends StatefulWidget { + + final bool isMyInPatient; + + InPatientPage(this.isMyInPatient); + + @override + _InPatientPageState createState() => _InPatientPageState(); +} + +class _InPatientPageState extends State { + TextEditingController _searchController = TextEditingController(); + PatientSearchRequestModel requestModel = PatientSearchRequestModel(); + + @override + void dispose() { + _searchController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getInPatientList(requestModel), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + height: MediaQuery.of(context).size.height * 0.070, + ), + Container( + margin: EdgeInsets.all(16.0), + child: AppTextFieldCustom( + hintText: TranslationBase.of(context).searchPatientName, + isTextFieldHasSuffix: true, + suffixIcon: IconButton( + icon: Icon( + Icons.search, + color: Colors.black, + ), + onPressed: () {}, + ), + controller: _searchController, + onChanged: (value) { + model.filterSearchResults(value); + }), + ), + model.filteredInPatientItems.length > 0 + ? Expanded( + child: Container( + margin: EdgeInsets.symmetric(horizontal: 16.0), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ...List.generate( + model.filteredInPatientItems.length, (index) { + if (!widget.isMyInPatient) + return PatientCard( + patientInfo: + model.filteredInPatientItems[index], + patientType: "1", + arrivalType: "1", + isInpatient: true, + isMyPatient: model + .filteredInPatientItems[index] + .doctorId == + model.doctorProfile.doctorID, + onTap: () { + FocusScopeNode currentFocus = + FocusScope.of(context); + if (!currentFocus.hasPrimaryFocus) { + currentFocus.unfocus(); + } + + Navigator.of(context).pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": model + .filteredInPatientItems[index], + "patientType": "1", + "from": "0", + "to": "0", + "isSearch": false, + "isInpatient": true, + "arrivalType": "1", + }); + }, + ); + else if (model.filteredInPatientItems[index] + .doctorId == + model.doctorProfile.doctorID && + widget.isMyInPatient) + return PatientCard( + patientInfo: + model.filteredInPatientItems[index], + patientType: "1", + arrivalType: "1", + isInpatient: true, + isMyPatient: model + .filteredInPatientItems[index] + .doctorId == + model.doctorProfile.doctorID, + onTap: () { + FocusScopeNode currentFocus = + FocusScope.of(context); + if (!currentFocus.hasPrimaryFocus) { + currentFocus.unfocus(); + } + + Navigator.of(context).pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": model + .filteredInPatientItems[index], + "patientType": "1", + "from": "0", + "to": "0", + "isSearch": false, + "isInpatient": true, + "arrivalType": "1", + }); + }, + ); + else + return SizedBox(); + }), + SizedBox( + height: 15, + ) + ], + ), + ), + ), + ) + : Expanded( + child: SingleChildScrollView( + child: Container( + child: ErrorMessage( + error: + TranslationBase.of(context).noDataAvailable)), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index 7d41b3cb..cdd8b357 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -15,22 +15,36 @@ import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils. import 'package:flutter/material.dart'; import '../../routes.dart'; +import 'DischargedPatientPage.dart'; +import 'InPatientPage.dart'; class PatientInPatientScreen extends StatefulWidget { @override _PatientInPatientScreenState createState() => _PatientInPatientScreenState(); } -class _PatientInPatientScreenState extends State { - PatientSearchRequestModel requestModel = PatientSearchRequestModel(); +class _PatientInPatientScreenState extends State with SingleTickerProviderStateMixin{ + + TabController _tabController; int _activeTab = 0; - TextEditingController _searchController = TextEditingController(); + @override + void initState() { + super.initState(); + _tabController = TabController(length: 3, vsync: this); + _tabController.addListener(_handleTabSelection); + } @override void dispose() { - _searchController.dispose(); super.dispose(); + _tabController.dispose(); + } + + _handleTabSelection() { + setState(() { + _activeTab = _tabController.index; + }); } @override @@ -38,7 +52,7 @@ class _PatientInPatientScreenState extends State { final screenSize = MediaQuery.of(context).size; return BaseView( - onModelReady: (model) => model.getInPatientList(requestModel), + onModelReady: (model) => model.clearPatientList(), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, @@ -71,168 +85,107 @@ class _PatientInPatientScreenState extends State { ]), ), ), - tabsBar(context, screenSize, model), - Container( - margin: EdgeInsets.all(16.0), - child: AppTextFieldCustom( - hintText: TranslationBase.of(context) - .searchPatientName, - isTextFieldHasSuffix: true, - suffixIcon: IconButton( - icon: Icon( - Icons.search, - color: Colors.black, - ), - onPressed: () {}, - ), - controller: _searchController, - onChanged: (value) { - model.filterSearchResults(value); - }), - ), - model.filteredInPatientItems.length > 0 - ? Expanded( - child: Container( - margin: EdgeInsets.symmetric(horizontal: 16.0), - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // const SizedBox( - // height: 16, - // ), - ...List.generate(model.filteredInPatientItems.length, (index) { - if(_activeTab == 0) - return PatientCard( - patientInfo: model.filteredInPatientItems[index], - patientType: "1", - arrivalType: "1", - isInpatient: true, - isMyPatient: model.filteredInPatientItems[index].doctorId==model.doctorProfile.doctorID, - onTap: () { - FocusScopeNode currentFocus = FocusScope.of(context); - if (!currentFocus.hasPrimaryFocus) { - currentFocus.unfocus(); - } - - Navigator.of(context) - .pushNamed(PATIENTS_PROFILE, arguments: { - "patient": model.filteredInPatientItems[index], - "patientType": "1", - "from": "0", - "to": "0", - "isSearch": false, - "isInpatient": true, - "arrivalType": "1", - }); - }, - ); - else if(model.filteredInPatientItems[index].doctorId==model.doctorProfile.doctorID && _activeTab==1) - return PatientCard( - patientInfo: model.filteredInPatientItems[index], - patientType: "1", - arrivalType: "1", - isInpatient: true, - isMyPatient: model.filteredInPatientItems[index].doctorId==model.doctorProfile.doctorID, - onTap: () { - FocusScopeNode currentFocus = FocusScope.of(context); - if (!currentFocus.hasPrimaryFocus) { - currentFocus.unfocus(); - } - - Navigator.of(context) - .pushNamed(PATIENTS_PROFILE, arguments: { - "patient": model.filteredInPatientItems[index], - "patientType": "1", - "from": "0", - "to": "0", - "isSearch": false, - "isInpatient": true, - "arrivalType": "1", - }); - }, - ); - else return SizedBox(); - }), - SizedBox(height: 15,) - ], + Expanded( + child: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(MediaQuery.of(context).size.height * 0.070), + child: Container( + height: MediaQuery.of(context).size.height * 0.070, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.5), //width: 0.7 ), + color: Colors.white), + child: Center( + child: TabBar( + isScrollable: false, + controller: _tabController, + indicatorColor: Colors.transparent, + indicatorWeight: 1.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Theme.of(context).primaryColor, + labelPadding: EdgeInsets.only(top: 0, left:0, right: 0,bottom: 0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + tabWidget(screenSize, _activeTab == 0, TranslationBase.of(context).inPatientAll.toUpperCase(), counter: model.inPatientList.length), + tabWidget(screenSize, _activeTab == 1, TranslationBase.of(context).inPatient.toUpperCase(), counter: model.myIinPatientList.length), + tabWidget(screenSize, _activeTab == 2, TranslationBase.of(context).discharged.toUpperCase()), + ], ), ), - ) - : Expanded( - child: SingleChildScrollView( - child: Container( - child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable)), ), ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + InPatientPage(false), + InPatientPage(true), + DischargedPatient(), + ], + ), + ), + ], + ), + ), + ), ], ), ), ); } - Widget tabsBar( - BuildContext context, Size screenSize, PatientSearchViewModel model) { - List _tabs = [ - TranslationBase.of(context).inPatientAll.toUpperCase(), - TranslationBase.of(context).inPatient.toUpperCase(), - ]; - - return Container( - height: screenSize.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - Color(0Xffffffff), Color(0xFFCCCCCC), - borderRadius: 4, borderWidth: 0), - child: Row( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: _tabs.map((item) { - bool _isActive = _tabs[_activeTab] == item ? true : false; + Widget tabWidget(Size screenSize, bool isActive, String title, {int counter = -1}){ - return Expanded( - child: InkWell( - onTap: () async { - setState(() { - _activeTab = _tabs.indexOf(item); - }); - FocusScopeNode currentFocus = FocusScope.of(context); - if (!currentFocus.hasPrimaryFocus) { - currentFocus.unfocus(); - } - if (_activeTab==0) { - GifLoaderDialogUtils.showMyDialog( - context); - await model.getInPatientList(requestModel, - isMyInpatient: _activeTab == 1, isFirstTime: false); - GifLoaderDialogUtils.hideDialog( - context); - } - }, - child: Center( - child: Container( - height: screenSize.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - _isActive - ? Color(0xFFD02127 /*B8382B*/) - : Color(0xFFEAEAEA), - _isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), - borderRadius: 4, - borderWidth: 0), - child: Center( + return Center( + child: Container( + height: screenSize.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + isActive + ? Color(0xFFD02127 /*B8382B*/) + : Color(0xFFEAEAEA), + isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppText( + title, + fontSize: SizeConfig.textMultiplier * 1.8, + color: isActive ? Colors.white : Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ), + if (counter != -1) + Container( + margin: EdgeInsets.all(4), + width: 15, + height: 15, + decoration: BoxDecoration( + color: isActive + ? Colors.white + : Color(0xFFD02127), + shape: BoxShape.circle, + ), + child: Center( + child: FittedBox( child: AppText( - item, - fontSize: SizeConfig.textMultiplier * 1.8, - color: _isActive ? Colors.white : Color(0xFF2B353E), + "$counter", + fontSize: SizeConfig.textMultiplier * 1.5, + color: !isActive ? Colors.white : Color(0xFFD02127), fontWeight: FontWeight.w700, ), ), ), ), - ), - ); - }).toList(), + ], + ), ), ); } diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart index 457fe04e..51aa78d4 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart @@ -39,7 +39,7 @@ class ProfileGridForInPatient extends StatelessWidget { NeverScrollableScrollPhysics(), crossAxisSpacing: 10, mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, + childAspectRatio: 1 / 1.02, crossAxisCount: 3, children: [ PatientProfileButton( diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index cc6513d0..6413865b 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1301,8 +1301,8 @@ class TranslationBase { String get insurance22 => localizedValues["insurance22"][locale.languageCode]; String get approvals22 => localizedValues["approvals22"][locale.languageCode]; String get severe => localizedValues["severe"][locale.languageCode]; - String get graphDetails => - localizedValues["graphDetails"][locale.languageCode]; + String get graphDetails => localizedValues["graphDetails"][locale.languageCode]; + String get discharged => localizedValues["discharged"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index 9a027e36..7907cac1 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -47,8 +47,8 @@ class PatientProfileButton extends StatelessWidget { ProjectViewModel projectsProvider = Provider.of(context); return new Container( - margin: new EdgeInsets.symmetric(horizontal: 4.0), - padding: EdgeInsets.fromLTRB(10, 10, 10, 5), + margin: EdgeInsets.symmetric(horizontal: 0.0), + padding: EdgeInsets.symmetric(horizontal: 4), child: InkWell( onTap: isDisable ? null @@ -72,7 +72,7 @@ class PatientProfileButton extends StatelessWidget { )), Container( alignment: projectsProvider.isArabic ? Alignment.topRight : Alignment.topLeft, - padding: EdgeInsets.all(5), + padding: EdgeInsets.symmetric(horizontal: 8), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ diff --git a/pubspec.lock b/pubspec.lock index e9386145..9d52ce65 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -566,7 +566,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3-nullsafety.1" + version: "0.6.2" json_annotation: dependency: transitive description: @@ -608,7 +608,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.4" + version: "1.3.0-nullsafety.3" mime: dependency: transitive description: @@ -900,7 +900,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.2" + version: "1.10.0-nullsafety.1" sticky_headers: dependency: "direct main" description: @@ -1091,5 +1091,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <=2.11.0-213.1.beta" + dart: ">=2.10.0 <2.11.0" flutter: ">=1.22.0 <2.0.0" From c6ac82981332272b2ff0c8b792a5b8e2d8194210 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 2 May 2021 17:38:57 +0300 Subject: [PATCH 07/31] hot fixes in PatientReferralScreen --- lib/screens/home/home_screen.dart | 78 ------------------- .../patients/DischargedPatientPage.dart | 13 ++-- .../ReferralDischargedPatientPage.dart | 2 +- .../referral/patient_referral_screen.dart | 4 +- 4 files changed, 10 insertions(+), 87 deletions(-) diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 36f86c85..e95f1d1e 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -655,84 +655,6 @@ class _HomeScreenState extends State { ); }, ), - // HomePageCard( - // color: Colors.red[800], - // margin: EdgeInsets.all(5), - // child: Column( - // mainAxisAlignment: - // MainAxisAlignment.center, - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // Padding( - // padding: EdgeInsets.only( - // top: 10, left: 10, right: 0), - // child: Icon( - // DoctorApp.discharge_patients, - // size: 35, - // color: Colors.white, - // )), - // Container( - // padding: EdgeInsets.all(10), - // child: AppText( - // 'Discharged Patients', - // color: Colors.white, - // textAlign: TextAlign.start, - // fontSize: 15, - // )) - // ], - // ), - // hasBorder: false, - // onTap: () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => - // DischargedPatient(), - // // MyReferredPatient(), - // ), - // ); - // }, - // ), - // HomePageCard( - // color: Colors.grey[300], - // margin: EdgeInsets.all(5), - // child: Column( - // mainAxisAlignment: - // MainAxisAlignment.center, - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // Padding( - // padding: EdgeInsets.only( - // top: 10, left: 10, right: 0), - // child: Icon( - // DoctorApp.referral_discharge, - // size: 35, - // color: Colors.black, - // )), - // Container( - // padding: EdgeInsets.all(10), - // child: AppText( - // 'Referral Discharged', - // color: Colors.black, - // textAlign: TextAlign.start, - // fontSize: 15, - // )) - // ], - // ), - // hasBorder: false, - // onTap: () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => - // ReferralDischargedPatientPage(), - // // MyReferredPatient(), - // ), - // ); - // }, - // ), HomePageCard( color: Color(0xffD02127), margin: EdgeInsets.all(5), diff --git a/lib/screens/patients/DischargedPatientPage.dart b/lib/screens/patients/DischargedPatientPage.dart index 0d0682dc..e4138305 100644 --- a/lib/screens/patients/DischargedPatientPage.dart +++ b/lib/screens/patients/DischargedPatientPage.dart @@ -103,10 +103,10 @@ class _DischargedPatientState extends State { }), ])), SizedBox(height: 5,), - Expanded( - child: ListView.builder( - itemCount: model.filterData.length, - itemBuilder: (context,index)=>InkWell( + Expanded(child: SingleChildScrollView( + child: Column( + children: [ + ...List.generate(model.filterData.length, (index) => InkWell( onTap: () { Navigator.of(context) .pushNamed( @@ -330,8 +330,9 @@ class _DischargedPatientState extends State { ), ), )), - ), - + ], + ), + )) ], ), ), diff --git a/lib/screens/patients/ReferralDischargedPatientPage.dart b/lib/screens/patients/ReferralDischargedPatientPage.dart index 6da969d1..b9860af8 100644 --- a/lib/screens/patients/ReferralDischargedPatientPage.dart +++ b/lib/screens/patients/ReferralDischargedPatientPage.dart @@ -25,7 +25,7 @@ class _ReferralDischargedPatientPageState extends State AppScaffold( appBarTitle: 'Referral Discharged ', backgroundColor: Colors.grey[200], - isShowAppBar: true, + isShowAppBar: false, baseViewModel: model, body: model.myDischargeReferralPatient.isEmpty?Center( child: Column( diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index de106524..c5aaed7a 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -9,7 +9,7 @@ import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils. import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import '../../DischargedPatientPage.dart'; +import '../../ReferralDischargedPatientPage.dart'; import 'my-referral-inpatient-screen.dart'; class PatientReferralScreen extends StatefulWidget { @@ -171,7 +171,7 @@ class _PatientReferralScreen extends State with SingleTic children: [ ReferredPatientScreen(), MyReferralInPatientScreen(), - DischargedPatient() + ReferralDischargedPatientPage() // MyReferredPatient(), ], ), From eb74002cf05cf12532960dcc7c50736749717d3b Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sun, 2 May 2021 17:45:49 +0300 Subject: [PATCH 08/31] hot fix --- lib/config/localized_values.dart | 4 ++-- lib/screens/patients/PatientsInPatientScreen.dart | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index d9c6e936..183b2a0f 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -47,9 +47,9 @@ const Map> localizedValues = { 'radiology': {'en': 'Radiology', 'ar': 'الأشعة'}, 'service': {'en': 'Service', 'ar': 'خدمة'}, 'referral': {'en': 'Referral', 'ar': 'الإحالة'}, - 'inPatient': {'en': 'My InPatients', 'ar': 'المريض الداخلي'}, + 'inPatient': {'en': 'My Patients', 'ar': 'مرضاي'}, 'inPatientLabel': {'en': 'InPatients', 'ar': 'المريض الداخلي'}, - 'inPatientAll': {'en': 'All InPatients', 'ar': 'كل المرضى الداخليين'}, + 'inPatientAll': {'en': 'All Patients', 'ar': 'كل المرضى'}, 'operations': {'en': 'Operations', 'ar': 'عمليات'}, 'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'}, 'searchMedicine': {'en': 'Search Medicines', 'ar': 'بحث عن الدواء'}, diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index cdd8b357..1a12c414 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -110,9 +110,9 @@ class _PatientInPatientScreenState extends State with Si labelPadding: EdgeInsets.only(top: 0, left:0, right: 0,bottom: 0), unselectedLabelColor: Colors.grey[800], tabs: [ - tabWidget(screenSize, _activeTab == 0, TranslationBase.of(context).inPatientAll.toUpperCase(), counter: model.inPatientList.length), - tabWidget(screenSize, _activeTab == 1, TranslationBase.of(context).inPatient.toUpperCase(), counter: model.myIinPatientList.length), - tabWidget(screenSize, _activeTab == 2, TranslationBase.of(context).discharged.toUpperCase()), + tabWidget(screenSize, _activeTab == 0, TranslationBase.of(context).inPatientAll, counter: model.inPatientList.length), + tabWidget(screenSize, _activeTab == 1, TranslationBase.of(context).inPatient, counter: model.myIinPatientList.length), + tabWidget(screenSize, _activeTab == 2, TranslationBase.of(context).discharged), ], ), ), @@ -158,7 +158,7 @@ class _PatientInPatientScreenState extends State with Si children: [ AppText( title, - fontSize: SizeConfig.textMultiplier * 1.8, + fontSize: SizeConfig.textMultiplier * 1.6, color: isActive ? Colors.white : Color(0xFF2B353E), fontWeight: FontWeight.w700, ), From 8e4d9d96929a63caaf311dcc1e64fd528c0325af Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 2 May 2021 21:16:25 +0300 Subject: [PATCH 09/31] hot fix --- lib/core/viewModel/PatientSearchViewModel.dart | 1 + lib/screens/patients/out_patient/out_patient_screen.dart | 3 ++- lib/widgets/shared/text_fields/app-textfield-custom.dart | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 8192b1a8..36d51248 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -86,6 +86,7 @@ class PatientSearchViewModel extends BaseViewModel{ bool isSearchWithKeyInfo })async { String dateTo; String dateFrom; + // TODO Fix this in Arabic if (item == 'Previous') { selectedFromDate = DateTime(DateTime.now().year, DateTime.now().month-1, diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index e2e6e94c..f9e4bfd7 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; @@ -164,7 +165,7 @@ class _OutPatientsScreenState extends State { color: _isActive ? Colors.white : Color(0xFF2B353E), fontWeight: FontWeight.w700, ), - _isActive&&_activeLocation!=0 ?Container( + _isActive&&_activeLocation!=0&&model.state == ViewState.Idle ?Container( padding: EdgeInsets.all(2), margin: EdgeInsets.symmetric(horizontal: 5), decoration: diff --git a/lib/widgets/shared/text_fields/app-textfield-custom.dart b/lib/widgets/shared/text_fields/app-textfield-custom.dart index 12eaaa7c..da92f574 100644 --- a/lib/widgets/shared/text_fields/app-textfield-custom.dart +++ b/lib/widgets/shared/text_fields/app-textfield-custom.dart @@ -37,7 +37,7 @@ class AppTextFieldCustom extends StatefulWidget { this.suffixIcon, this.dropDownColor, this.enabled = true, - this.inputType = TextInputType.text, + this.inputType, this.minLines = 1, this.maxLines = 1, this.inputFormatters, @@ -106,7 +106,7 @@ class _AppTextFieldCustomState extends State { color: Color(0xFF575757), ), controller: widget.controller, - keyboardType: widget.inputType, + keyboardType: widget.inputType?? (widget.maxLines == 1 ? TextInputType.text : TextInputType.multiline), enabled: widget.enabled, minLines: widget.minLines, maxLines: widget.maxLines, From 6fba03ed690137493111d7de5069f1ed6708c985 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 3 May 2021 11:58:50 +0300 Subject: [PATCH 10/31] design fixes --- .../viewModel/PatientSearchViewModel.dart | 13 +- lib/screens/patients/InPatientPage.dart | 190 +++++----- .../patients/PatientsInPatientScreen.dart | 13 +- .../PatientProfileCardModel.dart | 25 ++ .../profile_gird_for_InPatient.dart | 349 ++++++------------ .../profile/PatientProfileButton.dart | 78 ++-- pubspec.lock | 7 + pubspec.yaml | 1 + 8 files changed, 302 insertions(+), 374 deletions(-) create mode 100644 lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index edf9142a..3c8d7180 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -151,13 +151,20 @@ class PatientSearchViewModel extends BaseViewModel { error = _inPatientService.error; setState(ViewState.Error); } else { - filteredInPatientItems.clear(); - if (inPatientList.length > 0) - filteredInPatientItems.addAll(inPatientList); + // setDefaultInPatientList(); setState(ViewState.Idle); } } + Future setDefaultInPatientList() async { + setState(ViewState.BusyLocal); + await getDoctorProfile(); + filteredInPatientItems.clear(); + if (inPatientList.length > 0) + filteredInPatientItems.addAll(inPatientList); + setState(ViewState.Idle); + } + void clearPatientList(){ _inPatientService.inPatientList = []; _inPatientService.myInPatientList = []; diff --git a/lib/screens/patients/InPatientPage.dart b/lib/screens/patients/InPatientPage.dart index e26a5d9a..1b42d305 100644 --- a/lib/screens/patients/InPatientPage.dart +++ b/lib/screens/patients/InPatientPage.dart @@ -1,17 +1,16 @@ -import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.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/patients/PatientCard.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; import '../../routes.dart'; class InPatientPage extends StatefulWidget { - final bool isMyInPatient; InPatientPage(this.isMyInPatient); @@ -22,7 +21,6 @@ class InPatientPage extends StatefulWidget { class _InPatientPageState extends State { TextEditingController _searchController = TextEditingController(); - PatientSearchRequestModel requestModel = PatientSearchRequestModel(); @override void dispose() { @@ -33,7 +31,9 @@ class _InPatientPageState extends State { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getInPatientList(requestModel), + onModelReady: (model) async { + await model.setDefaultInPatientList(); + }, builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, @@ -62,100 +62,100 @@ class _InPatientPageState extends State { ), model.filteredInPatientItems.length > 0 ? Expanded( - child: Container( - margin: EdgeInsets.symmetric(horizontal: 16.0), - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ...List.generate( - model.filteredInPatientItems.length, (index) { - if (!widget.isMyInPatient) - return PatientCard( - patientInfo: - model.filteredInPatientItems[index], - patientType: "1", - arrivalType: "1", - isInpatient: true, - isMyPatient: model - .filteredInPatientItems[index] - .doctorId == - model.doctorProfile.doctorID, - onTap: () { - FocusScopeNode currentFocus = - FocusScope.of(context); - if (!currentFocus.hasPrimaryFocus) { - currentFocus.unfocus(); - } + child: Container( + margin: EdgeInsets.symmetric(horizontal: 16.0), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ...List.generate( + model.filteredInPatientItems.length, (index) { + if (!widget.isMyInPatient) + return PatientCard( + patientInfo: + model.filteredInPatientItems[index], + patientType: "1", + arrivalType: "1", + isInpatient: true, + isMyPatient: model + .filteredInPatientItems[index] + .doctorId == + model.doctorProfile.doctorID, + onTap: () { + FocusScopeNode currentFocus = + FocusScope.of(context); + if (!currentFocus.hasPrimaryFocus) { + currentFocus.unfocus(); + } - Navigator.of(context).pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": model - .filteredInPatientItems[index], - "patientType": "1", - "from": "0", - "to": "0", - "isSearch": false, - "isInpatient": true, - "arrivalType": "1", - }); - }, - ); - else if (model.filteredInPatientItems[index] - .doctorId == - model.doctorProfile.doctorID && - widget.isMyInPatient) - return PatientCard( - patientInfo: - model.filteredInPatientItems[index], - patientType: "1", - arrivalType: "1", - isInpatient: true, - isMyPatient: model - .filteredInPatientItems[index] - .doctorId == - model.doctorProfile.doctorID, - onTap: () { - FocusScopeNode currentFocus = - FocusScope.of(context); - if (!currentFocus.hasPrimaryFocus) { - currentFocus.unfocus(); - } + Navigator.of(context).pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": model + .filteredInPatientItems[index], + "patientType": "1", + "from": "0", + "to": "0", + "isSearch": false, + "isInpatient": true, + "arrivalType": "1", + }); + }, + ); + else if (model.filteredInPatientItems[index] + .doctorId == + model.doctorProfile.doctorID && + widget.isMyInPatient) + return PatientCard( + patientInfo: + model.filteredInPatientItems[index], + patientType: "1", + arrivalType: "1", + isInpatient: true, + isMyPatient: model + .filteredInPatientItems[index] + .doctorId == + model.doctorProfile.doctorID, + onTap: () { + FocusScopeNode currentFocus = + FocusScope.of(context); + if (!currentFocus.hasPrimaryFocus) { + currentFocus.unfocus(); + } - Navigator.of(context).pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": model - .filteredInPatientItems[index], - "patientType": "1", - "from": "0", - "to": "0", - "isSearch": false, - "isInpatient": true, - "arrivalType": "1", - }); - }, - ); - else - return SizedBox(); - }), - SizedBox( - height: 15, - ) - ], - ), - ), - ), - ) + Navigator.of(context).pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": model + .filteredInPatientItems[index], + "patientType": "1", + "from": "0", + "to": "0", + "isSearch": false, + "isInpatient": true, + "arrivalType": "1", + }); + }, + ); + else + return SizedBox(); + }), + SizedBox( + height: 15, + ) + ], + ), + ), + ), + ) : Expanded( - child: SingleChildScrollView( - child: Container( - child: ErrorMessage( - error: - TranslationBase.of(context).noDataAvailable)), - ), - ), + child: SingleChildScrollView( + child: Container( + child: ErrorMessage( + error: + TranslationBase.of(context).noDataAvailable)), + ), + ), ], ), ), diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index 1a12c414..6f2bafd9 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -1,20 +1,13 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.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/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart'; 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/errors/error_message.dart'; -import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; -import '../../routes.dart'; import 'DischargedPatientPage.dart'; import 'InPatientPage.dart'; @@ -50,9 +43,13 @@ class _PatientInPatientScreenState extends State with Si @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; + PatientSearchRequestModel requestModel = PatientSearchRequestModel(); return BaseView( - onModelReady: (model) => model.clearPatientList(), + onModelReady: (model) async { + model.clearPatientList(); + model.getInPatientList(requestModel); + }, builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, diff --git a/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart b/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart new file mode 100644 index 00000000..3b566d81 --- /dev/null +++ b/lib/screens/patients/profile/profile_screen/PatientProfileCardModel.dart @@ -0,0 +1,25 @@ +class PatientProfileCardModel { + final String nameLine1; + final String nameLine2; + final dynamic route; + final String icon; + final bool isInPatient; + final bool isDisable; + final bool isLoading; + final Function onTap; + final bool isDischargedPatient; + final bool isSelectInpatient; + + PatientProfileCardModel( + this.nameLine1, + this.nameLine2, + this.route, + this.icon, { + this.isInPatient = false, + this.isDisable = false, + this.isLoading = false, + this.onTap, + this.isDischargedPatient = false, + this.isSelectInpatient = false, + }); +} diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart index e137730c..1df7d236 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart @@ -1,7 +1,9 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/PatientProfileCardModel.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import '../../../../routes.dart'; @@ -17,252 +19,135 @@ class ProfileGridForInPatient extends StatelessWidget { String from; String to; - ProfileGridForInPatient( + ProfileGridForInPatient( {Key key, this.patient, this.patientType, this.arrivalType, this.height, - this.isInpatient, this.from,this.to, this.isDischargedPatient, this.isFromSearch}) + this.isInpatient, + this.from, + this.to, + this.isDischargedPatient, + this.isFromSearch}) : super(key: key); @override Widget build(BuildContext context) { + final List cardsList = [ + PatientProfileCardModel( + TranslationBase.of(context).vital, + TranslationBase.of(context).signs, + VITAL_SIGN_DETAILS, + 'patient/vital_signs.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).lab, + TranslationBase.of(context).result, + LAB_RESULT, + 'patient/lab_results.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).radiology, + TranslationBase.of(context).result, + RADIOLOGY_PATIENT, + 'patient/health_summary.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).patient, + TranslationBase.of(context).prescription, + ORDER_PRESCRIPTION_NEW, + 'patient/order_prescription.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).progress, + TranslationBase.of(context).note, + PROGRESS_NOTE, + 'patient/Progress_notes.png', + isInPatient: isInpatient, + isDischargedPatient: isDischargedPatient), + PatientProfileCardModel( + TranslationBase.of(context).order, + TranslationBase.of(context).sheet, + ORDER_NOTE, + 'patient/Progress_notes.png', + isInPatient: isInpatient, + isDischargedPatient: isDischargedPatient), + PatientProfileCardModel( + TranslationBase.of(context).orders, + TranslationBase.of(context).procedures, + ORDER_PROCEDURE, + 'patient/Order_Procedures.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).health, + TranslationBase.of(context).summary, + HEALTH_SUMMARY, + 'patient/health_summary.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).medical, + TranslationBase.of(context).report, + HEALTH_SUMMARY, + 'patient/health_summary.png', + isInPatient: isInpatient, + isDisable: true), + PatientProfileCardModel( + TranslationBase.of(context).referral, + TranslationBase.of(context).patient, + REFER_IN_PATIENT_TO_DOCTOR, + 'patient/refer_patient.png', + isInPatient: isInpatient, + isDisable: isDischargedPatient || isFromSearch, + ), + PatientProfileCardModel( + TranslationBase.of(context).insurance, + TranslationBase.of(context).approvals, + PATIENT_INSURANCE_APPROVALS_NEW, + 'patient/vital_signs.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).discharge, + TranslationBase.of(context).report, + null, + 'patient/patient_sick_leave.png', + isInPatient: isInpatient, + isDisable: true), + PatientProfileCardModel( + TranslationBase.of(context).patientSick, + TranslationBase.of(context).leave, + ADD_SICKLEAVE, + 'patient/patient_sick_leave.png', + isInPatient: isInpatient, + ), + ]; + return Padding( - padding: - const EdgeInsets.symmetric( - vertical: 15.0, - horizontal: 15), - child: GridView.count( + padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), + child: StaggeredGridView.countBuilder( shrinkWrap: true, - physics: - NeverScrollableScrollPhysics(), + physics: NeverScrollableScrollPhysics(), crossAxisSpacing: 10, mainAxisSpacing: 10, - childAspectRatio: 1 / 1.02, crossAxisCount: 3, - children: [ - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: - TranslationBase - .of( - context) - .vital, - nameLine2: - TranslationBase - .of( - context) - .signs, - route: VITAL_SIGN_DETAILS, - isInPatient: true, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - isInPatient: true, - nameLine1: - TranslationBase - .of( - context) - .lab, - nameLine2: - TranslationBase - .of( - context) - .result, - icon: - 'patient/lab_results.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: - TranslationBase - .of( - context) - .radiology, - nameLine2: - TranslationBase - .of( - context) - .result, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - isInPatient: isInpatient, - patientType: patientType, - arrivalType: arrivalType, - route: - ORDER_PRESCRIPTION_NEW, - isSelectInpatient: true, - nameLine1: - TranslationBase - .of( - context) - .patient, - nameLine2: - TranslationBase - .of( - context) - .prescription, - icon: - 'patient/order_prescription.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PROGRESS_NOTE, - isInPatient: isInpatient, - isDischargedPatient: - isDischargedPatient, - nameLine1: - TranslationBase - .of( - context) - .progress, - nameLine2: - TranslationBase - .of( - context) - .note, - icon: - 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - isInPatient: isInpatient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_NOTE, - isDischargedPatient: - isDischargedPatient, - nameLine1:TranslationBase.of(context).order, - nameLine2: - TranslationBase.of(context).sheet, - icon: - 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - isInPatient: isInpatient, - nameLine1: - TranslationBase - .of( - context) - .orders, - nameLine2: - TranslationBase - .of( - context) - .procedures, - icon: - 'patient/Order_Procedures.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: HEALTH_SUMMARY, - nameLine1: TranslationBase.of(context).health, - nameLine2: TranslationBase.of(context).summary, - isInPatient: isInpatient, - - icon: - 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: HEALTH_SUMMARY, - nameLine1: - TranslationBase.of(context).medical, - nameLine2: - TranslationBase.of(context).report, - isInPatient: isInpatient, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: - REFER_IN_PATIENT_TO_DOCTOR, - isInPatient: true, - isDisable: - isDischargedPatient || - isFromSearch, - nameLine1: - TranslationBase - .of( - context) - .referral, - nameLine2: - TranslationBase - .of( - context) - .patient, - icon: - 'patient/refer_patient.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: - PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: - TranslationBase - .of( - context) - .insurance, - nameLine2: - TranslationBase - .of( - context) - .approvals, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: null, - nameLine1: TranslationBase.of(context).discharge, - nameLine2: TranslationBase.of(context).report, - icon: - 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: - TranslationBase - .of( - context) - .patientSick, - nameLine2: - TranslationBase - .of( - context) - .leave, - icon: - 'patient/patient_sick_leave.png'), - ], + itemCount: cardsList.length, + staggeredTileBuilder: (int index) => StaggeredTile.fit(1), + itemBuilder: (BuildContext context, int index) => PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: cardsList[index].nameLine1, + nameLine2: cardsList[index].nameLine2, + route: cardsList[index].route, + icon: cardsList[index].icon, + isInPatient: cardsList[index].isInPatient, + isDischargedPatient: cardsList[index].isDischargedPatient, + isDisable: cardsList[index].isDisable, + onTap: cardsList[index].onTap, + isLoading: cardsList[index].isLoading, + ), ), ); } diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index b2df6218..0c2fd2f9 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -24,31 +24,33 @@ class PatientProfileButton extends StatelessWidget { final Function onTap; final bool isDischargedPatient; final bool isSelectInpatient; - PatientProfileButton( - {Key key, - this.patient, - this.patientType, - this.arrivalType, - this.nameLine1, - this.nameLine2, - this.icon, - this.route, - this.isDisable = false, - this.onTap, - this.isLoading = false, - this.from, - this.to, - this.isInPatient = false, this.isDischargedPatient=false, this.isSelectInpatient = false, - }) - : super(key: key); + + PatientProfileButton({ + Key key, + this.patient, + this.patientType, + this.arrivalType, + this.nameLine1, + this.nameLine2, + this.icon, + this.route, + this.isDisable = false, + this.onTap, + this.isLoading = false, + this.from, + this.to, + this.isInPatient = false, + this.isDischargedPatient = false, + this.isSelectInpatient = false, + }) : super(key: key); @override Widget build(BuildContext context) { ProjectViewModel projectsProvider = Provider.of(context); - return new Container( - margin: EdgeInsets.symmetric(horizontal: 0.0), - padding: EdgeInsets.symmetric(horizontal: 4), + return Container( + margin: EdgeInsets.symmetric(horizontal: 0.0), + padding: EdgeInsets.symmetric(horizontal: 8, vertical: 16), child: InkWell( onTap: isDisable ? null @@ -59,25 +61,30 @@ class PatientProfileButton extends StatelessWidget { }, child: Column(children: [ Container( + padding: EdgeInsets.fromLTRB(8, 0, 8, 8), child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - child: new Image.asset( - url + icon, - width: 50, - height: 50, - ),) - ], - )), + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + child: new Image.asset( + url + icon, + width: 30, + height: 30, + fit: BoxFit.contain, + ), + ) + ], + )), Container( - alignment: projectsProvider.isArabic ? Alignment.topRight : Alignment.topLeft, + alignment: projectsProvider.isArabic + ? Alignment.topRight + : Alignment.topLeft, padding: EdgeInsets.symmetric(horizontal: 8), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - !projectsProvider.isArabic?this.nameLine1: nameLine2, + !projectsProvider.isArabic ? this.nameLine1 : nameLine2, color: Colors.black, /*Color(0xFFB9382C),*/ fontWeight: FontWeight.w600, @@ -85,7 +92,7 @@ class PatientProfileButton extends StatelessWidget { fontSize: SizeConfig.textMultiplier * 1.5, ), AppText( - !projectsProvider.isArabic? this.nameLine2:nameLine1, + !projectsProvider.isArabic ? this.nameLine2 : nameLine1, color: Colors.black, fontWeight: FontWeight.w600, textAlign: TextAlign.left, @@ -118,8 +125,7 @@ class PatientProfileButton extends StatelessWidget { } void navigator(BuildContext context, route) { - if(route == null) - return; + if (route == null) return; if (from == null) { from = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); @@ -127,7 +133,7 @@ class PatientProfileButton extends StatelessWidget { if (to == null) { to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); } - if(arrivalType == null){ + if (arrivalType == null) { arrivalType = "0"; } Navigator.of(context).pushNamed(route, arguments: { diff --git a/pubspec.lock b/pubspec.lock index 9d52ce65..ee31002d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -445,6 +445,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.11" + flutter_staggered_grid_view: + dependency: "direct main" + description: + name: flutter_staggered_grid_view + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.4" flutter_svg: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 58dd50be..b4532e42 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -41,6 +41,7 @@ dependencies: eva_icons_flutter: ^2.0.0 font_awesome_flutter: ^8.11.0 dropdown_search: ^0.4.8 + flutter_staggered_grid_view: ^0.3.2 expandable: ^4.1.4 From 7559ab31c0e3182ccd0d802a25f981ddc98fe96a Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 3 May 2021 12:45:15 +0300 Subject: [PATCH 11/31] fix out patient + fix steper in arabic --- .../viewModel/PatientSearchViewModel.dart | 8 +-- .../out_patient/out_patient_screen.dart | 2 +- .../shared_soap_widgets/SOAP_step_header.dart | 1 - .../shared_soap_widgets/steps_widget.dart | 52 ++++++++++++------- 4 files changed, 37 insertions(+), 26 deletions(-) diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 36d51248..5b5a99a3 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; @@ -83,11 +84,10 @@ class PatientSearchViewModel extends BaseViewModel{ getPatientBasedOnDate ( {item, PatientSearchRequestModel patientSearchRequestModel, PatientType selectedPatientType, - bool isSearchWithKeyInfo })async { + bool isSearchWithKeyInfo,OutPatientFilterType outPatientFilterType })async { String dateTo; String dateFrom; - // TODO Fix this in Arabic - if (item == 'Previous') { + if (OutPatientFilterType.Previous == outPatientFilterType) { selectedFromDate = DateTime(DateTime.now().year, DateTime.now().month-1, DateTime.now().day); @@ -101,7 +101,7 @@ class PatientSearchViewModel extends BaseViewModel{ 'yyyy-MM-dd'); - } else if (item == 'Next Week') { + } else if (OutPatientFilterType.NextWeek == outPatientFilterType) { dateTo = DateUtils.convertDateToFormat( diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index f9e4bfd7..3052c77d 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -142,7 +142,7 @@ class _OutPatientsScreenState extends State { selectedPatientType: widget.selectedPatientType, patientSearchRequestModel: widget .patientSearchRequestModel, - isSearchWithKeyInfo: widget.isSearchWithKeyInfo); + isSearchWithKeyInfo: widget.isSearchWithKeyInfo, outPatientFilterType: outPatientFilterType); GifLoaderDialogUtils.hideDialog(context); }, child: Center( diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart index da1abd28..85614b6d 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_step_header.dart @@ -33,7 +33,6 @@ class SOAPStepHeader extends StatelessWidget { child: StepsWidget( index: currentIndex, changeCurrentTab: changePageViewIndex, - height: 100, ), ), SizedBox( diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart index 059674a8..c5c2e8ca 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart +++ b/lib/screens/patients/profile/soap_update/shared_soap_widgets/steps_widget.dart @@ -20,23 +20,26 @@ class StepsWidget extends StatelessWidget { ? Stack( children: [ Container( - height: height == 0 ? 150 : height, + height: height == 0 ? 100 : height, width: MediaQuery.of(context).size.width * 0.9, color: Colors.transparent, ), Positioned( top: 30 - , - child: Center( - child: Container( - width: MediaQuery.of(context).size.width * 0.9, - child: Divider( - color: Colors.grey, - height: 0.75, - thickness: 0.75, - ), + , + child: Center( + child: Container( + width: MediaQuery + .of(context) + .size + .width * 0.9, + child: Divider( + color: Colors.grey, + height: 0.75, + thickness: 0.75, ), - )), + ), + ),), Positioned( top: 10, left: 0, @@ -260,17 +263,26 @@ class StepsWidget extends StatelessWidget { : Stack( children: [ Container( - height: height == 0 ? 150 : height, - width: MediaQuery.of(context).size.width, + height: height == 0 ? 100 : height, + width: MediaQuery.of(context).size.width * 0.9, color: Colors.transparent, + ), + Positioned( + top: 30 + , child: Center( - child: Divider( - color: Colors.grey, - height: 0.75, - thickness: 0.75, + child: Container( + width: MediaQuery + .of(context) + .size + .width * 0.9, + child: Divider( + color: Colors.grey, + height: 0.75, + thickness: 0.75, + ), ), - ), - ), + ),), Positioned( top: 10, right: 0, @@ -303,7 +315,7 @@ class StepsWidget extends StatelessWidget { color: Colors.white, )), ), - SizedBox(height: 5), + SizedBox(height: 3), Column( children: [ AppText( From c3c4b662711df3c8660b460c7ba8b75e431798a6 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 3 May 2021 13:18:55 +0300 Subject: [PATCH 12/31] refactor search file name --- lib/routes.dart | 2 - lib/screens/home/home_screen.dart | 7 +- .../search_medicine_patient_screen.dart | 112 -- .../out_patient/out_patient_screen.dart | 4 +- ...header.dart => patient_search_header.dart} | 4 +- ...dart => patient_search_result_screen.dart} | 105 +- ...en_new.dart => patient_search_screen.dart} | 123 +- .../patients/patient_search_screen.dart | 641 ----------- lib/screens/patients/patients_screen.dart | 1005 ----------------- 9 files changed, 26 insertions(+), 1977 deletions(-) delete mode 100644 lib/screens/medicine/search_medicine_patient_screen.dart rename lib/screens/patients/patient_search/{header.dart => patient_search_header.dart} (88%) rename lib/screens/patients/patient_search/{patients_screen_new.dart => patient_search_result_screen.dart} (64%) rename lib/screens/patients/patient_search/{patient_search_screen_new.dart => patient_search_screen.dart} (56%) delete mode 100644 lib/screens/patients/patient_search_screen.dart delete mode 100644 lib/screens/patients/patients_screen.dart diff --git a/lib/routes.dart b/lib/routes.dart index 44613100..2684cd82 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -17,7 +17,6 @@ import 'package:doctor_app_flutter/screens/sick-leave/show-sickleave.dart'; import './screens/auth/login_screen.dart'; import './screens/auth/verification_methods_screen.dart'; -import './screens/patients/patients_screen.dart'; import 'screens/patients/profile/profile_screen/patient_profile_screen.dart'; import './screens/patients/profile/vital_sign/vital_sign_details_screen.dart'; import 'landing_page.dart'; @@ -66,7 +65,6 @@ var routes = { ROOT: (_) => RootPage(), HOME: (_) => LandingPage(), LOGIN: (_) => Loginsreen(), - PATIENTS: (_) => PatientsScreen(), VERIFICATION_METHODS: (_) => VerificationMethodsScreen(), PATIENTS_PROFILE: (_) => PatientProfileScreen(), LAB_RESULT: (_) => LabsHomePage(), diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 36f86c85..f6f1d85b 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -19,9 +19,8 @@ import 'package:doctor_app_flutter/screens/patients/DischargedPatientPage.dart'; import 'package:doctor_app_flutter/screens/patients/PatientsInPatientScreen.dart'; import 'package:doctor_app_flutter/screens/patients/ReferralDischargedPatientPage.dart'; import 'package:doctor_app_flutter/screens/patients/out_patient/out_patient_screen.dart'; -import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_screen_new.dart'; -import 'package:doctor_app_flutter/screens/patients/patient_search/patients_screen_new.dart'; -import 'package:doctor_app_flutter/screens/patients/patient_search_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_result_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; @@ -782,7 +781,7 @@ class _HomeScreenState extends State { context, MaterialPageRoute( builder: (context) => - PatientSearchScreenNew(), + PatientSearchScreen(), )); }, ), diff --git a/lib/screens/medicine/search_medicine_patient_screen.dart b/lib/screens/medicine/search_medicine_patient_screen.dart deleted file mode 100644 index d80c065b..00000000 --- a/lib/screens/medicine/search_medicine_patient_screen.dart +++ /dev/null @@ -1,112 +0,0 @@ -import 'dart:ui'; - -import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart'; -import 'package:doctor_app_flutter/screens/patients/patient_search_screen.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -class SearchMedicinePatientScreen extends StatefulWidget { - @override - _SearchMedicinePatientScreen createState() => _SearchMedicinePatientScreen(); -} - -class _SearchMedicinePatientScreen extends State - with SingleTickerProviderStateMixin { - TabController _tabController; - var activeIndex = 0; - @override - void initState() { - super.initState(); - _tabController = TabController(length: 2, vsync: this); - } - - @override - void dispose() { - super.dispose(); - _tabController.dispose(); - } - - @override - @override - Widget build(BuildContext context) { - return AppScaffold( - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).searchmedicinepatient, - body: Scaffold( - extendBodyBehindAppBar: true, - appBar: PreferredSize( - preferredSize: Size.fromHeight(65.0), - child: Center( - child: Container( - height: 60.0, - margin: EdgeInsets.only(top: 10.0), - width: MediaQuery.of(context).size.width * 0.92, // 0.9, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor, - width: 0.9), //width: 0.7 - ), - color: Colors.white), - child: TabBar( - isScrollable: true, - onTap: (index) { - setState(() { - activeIndex = index; - }); - }, - controller: _tabController, - indicatorWeight: 5.0, - indicatorSize: TabBarIndicatorSize.tab, - indicatorColor: Colors.red[800], - labelColor: Theme.of(context).primaryColor, - labelPadding: - EdgeInsets.only(top: 4.0, left: 30.0, right: 30.0), - unselectedLabelColor: Colors.grey[800], - tabs: [ - Container( - width: MediaQuery.of(context).size.width * 0.35, - child: Center( - child: AppText( - TranslationBase.of(context).searchPatient, - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 14, - ), - ), - ), - Container( - width: MediaQuery.of(context).size.width * 0.35, - child: Center( - child: AppText( - TranslationBase.of(context).searchMedicine, - fontWeight: FontWeight.bold, - fontSize: 14, - color: Colors.black), - ), - ), - ], - ), - ), - ), - ), - body: Column( - children: [ - Expanded( - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [ - PatientSearchScreen(), - MedicineSearchScreen() - ], - ), - ) - ], - ), - )); - } -} diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index 3052c77d..8d1d2eb8 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -10,7 +10,7 @@ import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/patients/patient_search/header.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -103,7 +103,7 @@ class _OutPatientsScreenState extends State { builder: (_, model, w) => AppScaffold( appBarTitle: "Search Patient", isShowAppBar: true, - appBar: HeaderInSearch( + appBar: PatientSearchHeader( title: "My Out patient", ), diff --git a/lib/screens/patients/patient_search/header.dart b/lib/screens/patients/patient_search/patient_search_header.dart similarity index 88% rename from lib/screens/patients/patient_search/header.dart rename to lib/screens/patients/patient_search/patient_search_header.dart index 0fbcdf1a..b9afab7d 100644 --- a/lib/screens/patients/patient_search/header.dart +++ b/lib/screens/patients/patient_search/patient_search_header.dart @@ -2,10 +2,10 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; -class HeaderInSearch extends StatelessWidget with PreferredSizeWidget { +class PatientSearchHeader extends StatelessWidget with PreferredSizeWidget { final String title; - const HeaderInSearch({Key key, this.title}) : super(key: key); + const PatientSearchHeader({Key key, this.title}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patient_search_result_screen.dart similarity index 64% rename from lib/screens/patients/patient_search/patients_screen_new.dart rename to lib/screens/patients/patient_search/patient_search_result_screen.dart index 7074bda9..0f536fcd 100644 --- a/lib/screens/patients/patient_search/patients_screen_new.dart +++ b/lib/screens/patients/patient_search/patient_search_result_screen.dart @@ -8,26 +8,19 @@ import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/patients/patient_search/header.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart'; 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/errors/error_message.dart'; -import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; // ignore: must_be_immutable -class PatientsScreenNew extends StatefulWidget { - final patientSearchForm; - final selectedType; - final isAppbar; - final arrivalType; - final isView; +class PatientsSearchResultScreen extends StatefulWidget { final PatientType selectedPatientType; final PatientSearchRequestModel patientSearchRequestModel; final bool isSearchWithKeyInfo; @@ -37,29 +30,27 @@ class PatientsScreenNew extends StatefulWidget { final String searchKey; - PatientsScreenNew( - {this.patientSearchForm, - this.selectedType, - this.isAppbar = true, - this.arrivalType, - this.isView, + PatientsSearchResultScreen( + { this.selectedPatientType, this.patientSearchRequestModel, this.isSearchWithKeyInfo = true, this.isSearch = false, - this.isInpatient = false, this.searchKey, this.isSearchAndOut=false}); + this.isInpatient = false, + this.searchKey, + this.isSearchAndOut = false}); @override - _PatientsScreenNewState createState() => _PatientsScreenNewState(); + _PatientsSearchResultScreenState createState() => + _PatientsSearchResultScreenState(); } -class _PatientsScreenNewState extends State { +class _PatientsSearchResultScreenState + extends State { int clinicId; AuthViewModel authProvider; - List _locations = []; //['All', 'Today', 'Tomorrow', 'Next Week']; - int _activeLocation = 0; String patientType; String patientTypeTitle; var selectedFilter = 1; @@ -74,14 +65,6 @@ class _PatientsScreenNewState extends State { @override Widget build(BuildContext context) { authProvider = Provider.of(context); - _locations = [ - TranslationBase.of(context).today, - TranslationBase.of(context).tomorrow, - TranslationBase.of(context).nextWeek, - ]; - final screenSize = MediaQuery.of(context).size; - - return BaseView( onModelReady: (model) async { if(!widget.isSearchWithKeyInfo && widget.selectedPatientType == PatientType.OutPatient) { @@ -95,72 +78,12 @@ class _PatientsScreenNewState extends State { builder: (_, model, w) => AppScaffold( appBarTitle: "Search Patient", isShowAppBar: true, - appBar: !widget.isSearch && !widget.isInpatient?HeaderInSearch( - title: "My Out patient", - ):HeaderInSearch( - title: "Search for ${widget.searchKey}", - ), + appBar: PatientSearchHeader( + title: "Search for ${widget.searchKey}", + ), baseViewModel: model, body: Column( children: [ - if(!widget.isInpatient && !widget.isSearch) - Container( - // color: Colors.red, - height: screenSize.height * 0.070, - decoration: TextFieldsUtils - .containerBorderDecoration( - Color(0Xffffffff), - Color(0xFFCCCCCC), - borderRadius: 4, - borderWidth: 0), - child: Row( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: _locations.map((item) { - bool _isActive = _locations[_activeLocation] == item - ? true - : false; - - return Expanded( - child: InkWell( - onTap: () async { - setState(() { - _activeLocation = _locations.indexOf(item); - }); - GifLoaderDialogUtils.showMyDialog(context); - await model.getPatientBasedOnDate(item: item, - selectedPatientType: widget.selectedPatientType, - patientSearchRequestModel: widget - .patientSearchRequestModel, - isSearchWithKeyInfo: widget.isSearchWithKeyInfo); - GifLoaderDialogUtils.hideDialog(context); - }, - child: Center( - child: Container( - height: screenSize.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - _isActive - ? Color(0xFFD02127 /*B8382B*/) - : Color(0xFFEAEAEA), - _isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), - borderRadius: 4, - borderWidth: 0), - child: Center( - child: AppText( - item, - fontSize: SizeConfig.textMultiplier * 1.8, - color: _isActive ? Colors.white : Color(0xFF2B353E), - fontWeight: FontWeight.w700, - ), - ), - ), - ), - ), - ); - }).toList(), - ), - ), - SizedBox(height: 18.5), Container( width: SizeConfig.screenWidth * 0.9, diff --git a/lib/screens/patients/patient_search/patient_search_screen_new.dart b/lib/screens/patients/patient_search/patient_search_screen.dart similarity index 56% rename from lib/screens/patients/patient_search/patient_search_screen_new.dart rename to lib/screens/patients/patient_search/patient_search_screen.dart index 5270511d..dc6d3587 100644 --- a/lib/screens/patients/patient_search/patient_search_screen_new.dart +++ b/lib/screens/patients/patient_search/patient_search_screen.dart @@ -4,11 +4,10 @@ import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/patients/patient_search/patients_screen_new.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_result_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; 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/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; @@ -17,12 +16,12 @@ import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; -class PatientSearchScreenNew extends StatefulWidget { +class PatientSearchScreen extends StatefulWidget { @override - _PatientSearchScreenNewState createState() => _PatientSearchScreenNewState(); + _PatientSearchScreenState createState() => _PatientSearchScreenState(); } -class _PatientSearchScreenNewState extends State { +class _PatientSearchScreenState extends State { bool showOther = false; bool isFormSubmitted = false; TextEditingController patientFileInfoController = TextEditingController(); @@ -57,46 +56,6 @@ class _PatientSearchScreenNewState extends State { SizedBox( height: 16, ), - // AppText( - // 'Patient Type', - // fontWeight: FontWeight.w600, - // ), - // Row( - // children: [ - // Row( - // children: [ - // Radio( - // activeColor: Color(0xFFB9382C), - // value: PatientType.inPatient, - // groupValue: selectedPatientType, - // onChanged: (value) { - // setState(() { - // selectedPatientType = - // PatientType.inPatient; - // }); - // }, - // ), - // Text('InPatient'), - // ], - // ), - // Row( - // children: [ - // Radio( - // activeColor: Color(0xFFB9382C), - // value: PatientType.OutPatient, - // groupValue: selectedPatientType, - // onChanged: (value) { - // setState(() { - // selectedPatientType = - // PatientType.OutPatient; - // }); - // }, - // ), - // Text('OutPatient'), - // ], - // ), - // ], - // ), SizedBox( height: 10, ), @@ -133,78 +92,6 @@ class _PatientSearchScreenNewState extends State { SizedBox( height: 5, ), - // Row( - // mainAxisAlignment: MainAxisAlignment.end, - // crossAxisAlignment: CrossAxisAlignment.center, - // children: [ - // InkWell( - // child: this.showOther == false - // ? AppText( - // TranslationBase.of(context) - // .searchWithOther, - // color: Colors.red, - // fontWeight: FontWeight.bold, - // ) - // : AppText( - // TranslationBase.of(context) - // .hideOtherCriteria, - // color: Colors.red, - // fontWeight: FontWeight.bold), - // onTap: () { - // setState(() { - // this.showOther = !this.showOther; - // }); - // }, - // ) - // ], - // ), - // SizedBox( - // height: 30, - // ), - // if (showOther) - // Column( - // children: [ - // AppTextFieldCustom( - // hintText: - // TranslationBase.of(context).firstName, - // controller: firstNameInfoController, - // maxLines: 1, - // minLines: 1, - // hasBorder: true, - // onChanged: (_) {}, - // // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , - // ), - // SizedBox( - // height: 10, - // ), - // AppTextFieldCustom( - // hintText: - // TranslationBase.of(context).middleName, - // controller: middleNameInfoController, - // maxLines: 1, - // minLines: 1, - // onChanged: (_) {}, - // hasBorder: true, - // // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , - // ), - // SizedBox( - // height: 10, - // ), - // AppTextFieldCustom( - // hintText: - // TranslationBase.of(context).lastName, - // controller: lastNameFileInfoController, - // maxLines: 1, - // minLines: 1, - // onChanged: (_) {}, - // hasBorder: true, - // // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , - // ), - // SizedBox( - // height: 10, - // ), - // ], - // ), SizedBox( height: MediaQuery.of(context).size.height * 0.12, ), @@ -301,7 +188,7 @@ class _PatientSearchScreenNewState extends State { Navigator.push( context, MaterialPageRoute( - builder: (BuildContext context) => PatientsScreenNew( + builder: (BuildContext context) => PatientsSearchResultScreen( selectedPatientType: selectedPatientType, patientSearchRequestModel: patientSearchRequestModel, isSearchWithKeyInfo: diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart deleted file mode 100644 index 88b8547b..00000000 --- a/lib/screens/patients/patient_search_screen.dart +++ /dev/null @@ -1,641 +0,0 @@ -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/patient_model.dart'; -import 'package:doctor_app_flutter/routes.dart'; -import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; -import 'package:doctor_app_flutter/util/helpers.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/rendering.dart'; -import 'package:flutter/services.dart'; -import 'package:hexcolor/hexcolor.dart'; -import 'package:provider/provider.dart'; - -import '../../config/config.dart'; -import '../../config/size_config.dart'; -import '../../lookups/patient_lookup.dart'; -import '../../widgets/patients/dynamic_elements.dart'; -import '../../widgets/shared/app_scaffold_widget.dart'; -import '../../widgets/shared/app_texts_widget.dart'; -import '../../widgets/shared/buttons/app_buttons_widget.dart'; -import '../../widgets/shared/rounded_container_widget.dart'; -import '../../widgets/shared/text_fields/app_text_form_field.dart'; - -DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); -Helpers helpers = Helpers(); - -// OWNER : Ibrahim albitar -// DATE : 19-04-2020 -// DESCRIPTION : Patient Search Screen. - -class PatientSearchScreen extends StatefulWidget { - @override - _PatientSearchScreenState createState() => _PatientSearchScreenState(); -} - -class _PatientSearchScreenState extends State { - String _selectedType = '1'; - String _selectedLocation = '1'; - String error = ''; - ProjectViewModel projectsProvider; - String itemText = ''; - String itemText2 = ''; - final GlobalKey _formKey = GlobalKey(); - bool _autoValidate = false; - bool onlyArrived = true; - bool isView = false; - bool isFormSubmitted = false; - - FocusNode _nodeText1 = FocusNode(); - FocusNode _nodeText2 = FocusNode(); - FocusNode _nodeText3 = FocusNode(); - - var _patientSearchFormValues = PatientModel( - FirstName: "0", - MiddleName: "0", - LastName: "0", - PatientMobileNumber: "0", - PatientIdentificationID: "0", - MobileNo: '0', - PatientID: 0, - From: "0", - To: "0", - LanguageID: 2, - stamp: "2020-03-02T13:56:39.170Z", - IPAdress: "11.11.11.11", - VersionID: 5.8, - Channel: 9, - TokenID: "2Fi7HoIHB0eDyekVa6tCJg==", - SessionID: "5G0yXn0Jnq", - IsLoginForDoctorApp: true, - IdentificationNo: '0', - PatientOutSA: false); - - void _validateInputs() async { - setState(() { - isFormSubmitted = true; - }); - - try { - if (_formKey.currentState.validate()) { - _formKey.currentState.save(); - - if ((_patientSearchFormValues.From == "0" || - _patientSearchFormValues.To == "0") && - _selectedType == "7" || - ((_patientSearchFormValues.From == "0" || - _patientSearchFormValues.To == "0") && - _selectedType == "6")) { - // Helpers.showErrorToast("Please Choose The Dates"); - } else { - setState(() { - isFormSubmitted = false; - }); - Navigator.of(context).pushNamed(PATIENTS, arguments: { - "patientSearchForm": _patientSearchFormValues, - "selectedType": _selectedType, - "isSearch": true, - "isView": isView - }); - } - } else { - setState(() { - _autoValidate = true; - }); - } - } catch (err) { - error = err.toString(); - } - } - - handelCatchErrorCase(err) { - //isLoading = false; - //isError = true; - error = Helpers.generateContactAdminMsg(err); - //notifyListeners(); - throw err; - } - - @override - Widget build(BuildContext context) { - projectsProvider = Provider.of(context); - return GestureDetector( - onTap: () { - FocusScope.of(context).requestFocus(new FocusNode()); - }, - child: AppScaffold( - appBarTitle: TranslationBase.of(context).searchPatient, - isShowAppBar: true, - body: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - RoundedContainer( - showBorder: false, - child: Column( - children: [ - Column( - children: [ - // Container( - // child: Icon( - // DoctorApp.search_patient_1, - // size: 100, - // color: Colors.black, - // ), - // margin: EdgeInsets.only(top: 10), - // ), - // Padding( - // padding: const EdgeInsets.only(top: 12.0), - // child: AppText( - // TranslationBase.of(context) - // .searchPatientImageCaptionTitle - // .toUpperCase(), - // fontWeight: FontWeight.bold, - // fontSize: SizeConfig.heightMultiplier * 2.5, - // ), - // ), - // Padding( - // padding: const EdgeInsets.only(top: 5.0), - // child: AppText( - // TranslationBase.of(context) - // .searchPatientImageCaptionBody, - // fontSize: SizeConfig.heightMultiplier * 2, - // ), - // ) - ], - ), - Container( - padding: EdgeInsets.all(15), - width: SizeConfig.screenWidth * 1, - child: Form( - key: _formKey, - autovalidate: _autoValidate, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 15, - ), - if (_selectedType != '7') - Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - labelText: TranslationBase.of(context) - .patpatientIDMobilenationalientID, - borderColor: Colors.white, - textInputType: TextInputType.number, - textInputAction: TextInputAction.done, - inputFormatter: ONLY_NUMBERS, - focusNode: _nodeText1, - onSaved: (value) { - if (value != null && value != '') { - if (value.length == 10 && - (value[0] == '2' || - value[0] == '1')) { - _patientSearchFormValues - .IdentificationNo = value; - _patientSearchFormValues.Searchtype = 2; - _patientSearchFormValues.setPatientID = - 0; - } else if ((value.length == 10 || - value.length == 9) && - ((value[0] == '0' && - value[1] == '5') || - value[0] == '5')) { - _patientSearchFormValues.MobileNo = - value; - _patientSearchFormValues.Searchtype = 0; - } else { - _patientSearchFormValues.setPatientID = - int.parse(value); - _patientSearchFormValues.Searchtype = 1; - } - } - - // else{ - - // } - - // value == null || value == '' - // ? _patientSearchFormValues.setPatientID = - // 0 - // : _patientSearchFormValues.setPatientID = - // int.parse(value); - - // if (value != null && - // value.toString().trim().isEmpty) { - // _patientSearchFormValues.setPatientID = 0; - // } - }, - ), - ), - SizedBox( - height: 10, - ), - // Row( - // mainAxisAlignment: MainAxisAlignment.end, - // children: [ - // InkWell( - // child: this.isView == false - // ? AppText( - // TranslationBase.of(context) - // .searchWithOther, - // color: Colors.red, - // fontWeight: FontWeight.bold, - // ) - // : AppText( - // TranslationBase.of(context) - // .hideOtherCriteria, - // color: Colors.red, - // fontWeight: FontWeight.bold), - // onTap: () { - // setState(() { - // this.isView = !this.isView; - // }); - // }, - // ) - // ], - // ), - isView == true - ? Column(children: [ - SizedBox( - height: 10, - ), - Container( - height: 65.0, - decoration: ShapeDecoration( - shape: RoundedRectangleBorder( - side: BorderSide( - width: 1.0, - style: BorderStyle.solid, - color: HexColor("#CCCCCC")), - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - ), - ), - width: double.infinity, - child: Padding( - padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier * - 0.9, - bottom: SizeConfig.widthMultiplier * - 0.9, - right: - SizeConfig.widthMultiplier * 3, - left: - SizeConfig.widthMultiplier * 3), - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - // add Expanded to have your dropdown button fill remaining space - child: - DropdownButtonHideUnderline( - child: DropdownButton( - isExpanded: true, - value: _selectedType, - iconSize: 25, - elevation: 16, - selectedItemBuilder: - (BuildContext context) { - return PATIENT_TYPE_Des.map( - (item) { - return Row( - mainAxisSize: - MainAxisSize.max, - children: [ - !projectsProvider - .isArabic - ? AppText( - item['text'], - fontSize: SizeConfig - .textMultiplier * - 2.1, - ) - : AppText( - item['text_ar'], - fontSize: SizeConfig - .textMultiplier * - 2.1, - ), - ], - ); - }).toList(); - }, - onChanged: (String newValue) => - { - setState(() { - _selectedType = newValue; - selectedPatientType = - int.parse( - _selectedType); - }) - }, - items: PATIENT_TYPE_Des.map( - (item) { - !projectsProvider.isArabic - ? itemText = item['text'] - : itemText = - item['text_ar']; - return DropdownMenuItem( - child: Text( - itemText, - textAlign: TextAlign.end, - ), - value: item['val'], - ); - }).toList(), - )), - ), - ], - ), - ), - ), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - labelText: TranslationBase.of(context) - .firstName, - borderColor: Colors.white, - onSaved: (value) { - value == null || value == '' - ? _patientSearchFormValues - .setFirstName = "0" - : _patientSearchFormValues - .setFirstName = value; - - if (value != null && - value - .toString() - .trim() - .isEmpty) { - _patientSearchFormValues - .setFirstName = "0"; - } - }, - // validator: (value) { - // return TextValidator().validateName(value); - // }, - inputFormatter: ONLY_LETTERS), - ), - SizedBox( - height: 10, - ), - if (_selectedType != '7') - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - labelText: TranslationBase.of(context) - .phoneNumber, - borderColor: Colors.white, - textInputType: TextInputType.number, - textInputAction: TextInputAction.done, - inputFormatter: ONLY_NUMBERS, - focusNode: _nodeText1, - onSaved: (value) { - value == null || value == '' - ? _patientSearchFormValues - .setPatientMobileNumber = - "0" - : _patientSearchFormValues - .setPatientMobileNumber = - value; - - if (value != null && - value - .toString() - .trim() - .isEmpty) { - _patientSearchFormValues - .setPatientMobileNumber = "0"; - } - }, - ), - ), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - labelText: TranslationBase.of(context) - .middleName, - borderColor: Colors.white, - onSaved: (value) { - value == null || value == '' - ? _patientSearchFormValues - .setMiddleName = "0" - : _patientSearchFormValues - .setMiddleName = value; - if (value != null && - value - .toString() - .trim() - .isEmpty) { - _patientSearchFormValues - .setMiddleName = "0"; - } - }, - // validator: (value) { - // return TextValidator().validateName(value); - // }, - inputFormatter: ONLY_LETTERS), - ), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - labelText: TranslationBase.of(context) - .lastName, - borderColor: Colors.white, - onSaved: (value) { - value == null || value == '' - ? _patientSearchFormValues - .setLastName = "0" - : _patientSearchFormValues - .setLastName = value; - if (value != null && - value - .toString() - .trim() - .isEmpty) { - _patientSearchFormValues - .setLastName = "0"; - } - }, - inputFormatter: ONLY_LETTERS), - ), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - labelText: TranslationBase.of(context) - .patientID, - borderColor: Colors.white, - textInputType: TextInputType.number, - inputFormatter: ONLY_NUMBERS, - focusNode: _nodeText2, - onSaved: (value) { - value == null || value == '' - ? _patientSearchFormValues - .setPatientID = 0 - : _patientSearchFormValues - .setPatientID = - int.parse(value); - if (value != null && - value - .trim() - .toString() - .isEmpty) { - _patientSearchFormValues - .setPatientID = 0; - } - }), - ), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - labelText: TranslationBase.of(context) - .patientFile, - borderColor: Colors.white, - textInputType: TextInputType.number, - focusNode: _nodeText3, - inputFormatter: ONLY_NUMBERS, - onSaved: (value) {}, - ), - ), - (!(_selectedType == '2' || - _selectedType == '4')) - ? DynamicElements( - _patientSearchFormValues, - isFormSubmitted) - : SizedBox( - height: 0, - ), - SizedBox( - height: 10, - ), - Container( - child: Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: - HexColor("#CCCCCC"))), - height: 25, - width: 25, - child: Checkbox( - value: onlyArrived, - checkColor: HexColor("#2A930A"), - activeColor: Colors.white, - onChanged: (bool newValue) { - setState(() { - onlyArrived = newValue; - }); - }), - ), - SizedBox( - width: 12, - ), - AppText( - TranslationBase.of(context) - .onlyArrivedPatient, - fontSize: - SizeConfig.textMultiplier * - 2), - ])), - SizedBox( - height: 10, - ), - ]) - : SizedBox( - height: 0, - ), - ], - ), - ), - ), - ], - ), - ), - Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: TranslationBase.of(context).search, - color: Colors.red[800], - onPressed: () { - _validateInputs(); - }, - ), - ], - ), - ), - ], - ), - ]), - ), - ); - } -} diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart deleted file mode 100644 index 586d0238..00000000 --- a/lib/screens/patients/patients_screen.dart +++ /dev/null @@ -1,1005 +0,0 @@ -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; -import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart'; -import 'package:doctor_app_flutter/models/patient/patient_model.dart'; -import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart'; -import 'package:doctor_app_flutter/routes.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/util/date-utils.dart'; -import 'package:doctor_app_flutter/util/helpers.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart'; -import 'package:doctor_app_flutter/widgets/patients/clinic_list_dropdwon.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; -import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; -import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; -import 'package:intl/intl.dart'; -import 'package:provider/provider.dart'; - -import '../../config/size_config.dart'; -import '../../widgets/shared/app_scaffold_widget.dart'; - -class PatientsScreen extends StatefulWidget { - final patientSearchForm; - final selectedType; - final isAppbar; - final arrivalType; - final isView; - PatientsScreen( - {this.patientSearchForm, - this.selectedType, - this.isAppbar = true, - this.arrivalType, - this.isView}); - @override - _PatientsScreenState createState() => _PatientsScreenState(); -} - -class _PatientsScreenState extends State { - List lItems; - - List parsed; - - List date; - List unFilterDate; - - int clinicId; - AuthViewModel authProvider; - - Color sideColor = Colors.black; - List responseModelList; - List responseModelList2; - final String url = "assets/images/"; - final String avatarMale = "user_male.svg"; //'working_male.svg';//'user.svg'; - final String avatarFemale = 'user_female.svg'; - final String assetName = 'assets/image.svg'; - - List _locations = []; //['All', 'Today', 'Tomorrow', 'Next Week']; - - int _activeLocation = 0; - bool isInpatient = false; - bool _isInit = true; - String patientType; - bool isSearch = false; - String patientTypeTitle; - var _isLoading = true; - var selectedFilter = 1; - bool _isError = false; - String error = ""; - String arrivalType; - ProjectViewModel projectsProvider; - var isView; - final _controller = TextEditingController(); - - PatientModel patient; - var _patientSearchFormValues = PatientModel( - FirstName: "0", - MiddleName: "0", - LastName: "0", - PatientMobileNumber: "0", - PatientIdentificationID: "0", - PatientID: 0, - From: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') - .toString(), - To: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') - .toString(), - LanguageID: 2, - stamp: "2020-03-02T13:56:39.170Z", - IPAdress: "11.11.11.11", - VersionID: 5.5, - Channel: 9, - TokenID: "2Fi7HoIHB0eDyekVa6tCJg==", - SessionID: "5G0yXn0Jnq", - IsLoginForDoctorApp: true, - PatientOutSA: false); - searchData(String str) { - this.responseModelList = this.responseModelList2; - var strExist = str.length > 0 ? true : false; - if (strExist) { - List filterData = []; - - for (var i = 0; i < responseModelList2.length; i++) { - String firstName = responseModelList[i].firstName.toUpperCase(); - String lastName = responseModelList[i].lastName.toUpperCase(); - String mobile = responseModelList[i].mobileNumber.toUpperCase(); - String patientID = responseModelList[i].patientId.toString(); - - if (firstName.contains(str.toUpperCase()) || - lastName.contains(str.toUpperCase()) || - mobile.contains(str) || - patientID.contains(str)) { - filterData.add(responseModelList[i]); - } - } - - setState(() { - this.responseModelList = filterData; - }); - } else { - setState(() { - this.responseModelList = this.responseModelList2; - }); - } - } - - convertDate(String str) { - String timeConvert; - const start = "/Date("; - - const end = "+0300)"; - - final startIndex = str.indexOf(start); - - final endIndex = str.indexOf(end, startIndex + start.length); - - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(str.substring(startIndex + start.length, endIndex))); - - String newDateformat = date.year.toString() + - "/" + - date.month.toString().padLeft(2, '0') + - "/" + - date.day.toString().padLeft(2, '0') + - " " + - "-" + - " " + - date.hour.toString().padLeft(2, '0') + - ":" + - date.minute.toString().toString().padLeft(2, '0'); - - return newDateformat.toString(); - } - - convertDateFormat(String str) { - String timeConvert; - const start = "/Date("; - const end = "+0300)"; - - final startIndex = str.indexOf(start); - final endIndex = str.indexOf(end, startIndex + start.length); - - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(str.substring(startIndex + start.length, endIndex))); - String newDate = date.year.toString() + - "-" + - date.month.toString().padLeft(2, '0') + - "-" + - date.day.toString().padLeft(2, '0'); - - return newDate.toString(); - } - - filterBooking(String str) { - this.responseModelList = this.responseModelList2; - - var strExist = str.length > 0 ? true : false; - if (true) { - List filterDate = []; - String patiantAppointment = ""; - for (var i = 0; i < responseModelList2.length; i++) { - try { - if (responseModelList[i].appointmentDate == "") { - patiantAppointment = responseModelList[i].arrivedOn; - } else { - patiantAppointment = - convertDateFormat(responseModelList[i].appointmentDate); - } - if (patiantAppointment != null) { - String dateAppointment = checkDate(patiantAppointment); - - if (dateAppointment.contains(str) || str == 'All') { - filterDate.add(responseModelList[i]); - } - } - } catch (e) { - print(e); - } - } - - setState(() { - this.responseModelList = filterDate; - }); - } else { - setState(() { - this.responseModelList = this.responseModelList2; - }); - } - } - - String checkDate(String dateString) { - DateTime checkedTime = DateTime.parse(dateString); - DateTime currentTime = DateTime.now(); - - if ((currentTime.year == checkedTime.year) && - (currentTime.month == checkedTime.month) && - (currentTime.day == checkedTime.day)) { - return TranslationBase.of(context).today; - } else if ((currentTime.year == checkedTime.year) && - (currentTime.month == checkedTime.month)) { - if ((currentTime.day - checkedTime.day) == 1) { - return TranslationBase.of(context).yesterday; - } else if ((currentTime.day - checkedTime.day) == -1) { - return TranslationBase.of(context).tomorrow; - } - - if ((currentTime.day - checkedTime.day) <= -2) { - return TranslationBase.of(context).nextWeek; - } else { - return TranslationBase.of(context).all; - } - } - return TranslationBase.of(context).all; - } - - @override - Widget build(BuildContext context) { - authProvider = Provider.of(context); - _locations = [ - TranslationBase.of(context).today, - TranslationBase.of(context).tomorrow, - TranslationBase.of(context).nextWeek, - ]; - //TranslationBase.of(context).all, - projectsProvider = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - - patient = widget.patientSearchForm != null - ? widget.patientSearchForm - : routeArgs['patientSearchForm']; - - patientType = widget.selectedType != null - ? widget.selectedType - : routeArgs['selectedType']; - arrivalType = widget.arrivalType != null - ? widget.arrivalType - : routeArgs['arrivalType']; - if (routeArgs != null && routeArgs.containsKey("isSearch")) { - isSearch = routeArgs['isSearch']; - } - if (routeArgs != null && routeArgs.containsKey("isSearch")) { - isView = routeArgs['isView']; - //patient.Searchtype = 1; - } - if (routeArgs != null && routeArgs.containsKey('activeFilter')) { - _activeLocation = routeArgs['activeFilter']; - } - if (routeArgs != null && routeArgs.containsKey('isInpatient')) { - isInpatient = routeArgs['isInpatient']; - } - - if (!projectsProvider.isArabic) - patientTypeTitle = SERVICES_PATIANT_HEADER[int.parse(patientType)]; - else - patientTypeTitle = SERVICES_PATIANT_HEADER_AR[int.parse(patientType)]; - - return BaseView( - onModelReady: (model) { - // TODO : change all the logic here to make it work with the model and remove future - int val2 = int.parse(patientType); - GetPatientArrivalListRequestModel getPatientArrivalListRequestModel; - if (val2 == 7) { - getPatientArrivalListRequestModel = GetPatientArrivalListRequestModel( - from: patient.From, - to: patient.To, - pageIndex: 0, - pageSize: 0, - patientMRN: patient.getPatientID); - } - - model - .getPatientList( - val2 == 7 - ? getPatientArrivalListRequestModel.toJson() - : patient, - patientType, - isView: isView) - .then((res) { - setState(() { - if (res != null && res['MessageStatus'] == 1) { - if (val2 == 7) { - if (res[SERVICES_PATIANT2[val2]] == null) { - _isError = true; - _isLoading = false; - this.error = error.toString(); - } else { - var localList = []; - if (res["patientArrivalList"]["entityList"] == null) { - res["patientArrivalList"]["entityList"] = []; - } - res["patientArrivalList"]["entityList"].forEach((v) { - Map mergedPatient = { - ...v, - ...v["patientDetails"] - }; - localList.add(mergedPatient); - }); - lItems = localList; - } - } else { - if (isView == false && val2 == 1) { - lItems = res['GetPatientFileInformation_PRMList'] - .where((i) => - i['PatientTypeDescription'] == 'Permanent File') - .toList(); - } else { - lItems = res[SERVICES_PATIANT2[val2]]; - } - } - parsed = lItems; - responseModelList = new ModelResponse.fromJson(parsed).list; - if (val2 == 7) { - responseModelList.sort((a, b) { - if (b.startTime != null && b.startTime != null) { - try { - DateTime now = DateTime.now(); - DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm"); - String formattedDate = - DateFormat('yyyy-MM-dd ' + a.startTime).format(now); - DateTime dateTimeA = dateFormat.parse(formattedDate); - String formattedDateB = - DateFormat('yyyy-MM-dd ' + b.startTime).format(now); - DateTime dateTimeB = dateFormat.parse(formattedDateB); - var adate = dateTimeA; //a.startTime; - var bdate = dateTimeB; - return adate.compareTo(bdate); - } on Exception catch (_) { - print('never reached'); - var adate = a.startTime; //a.startTime; - var bdate = b.startTime; - return adate.compareTo(bdate); - } - } else { - var adate = convertDateFormat(a.appointmentDate); - var bdate = convertDateFormat(b.appointmentDate); - return bdate.compareTo(adate); - } - }); - } - responseModelList2 = responseModelList; - _isError = false; - } else { - _isError = true; - error = model.error ?? - res['ErrorEndUserMessage'] ?? - res['ErrorMessage']; - } - - _isLoading = false; - }); - }).catchError((error) { - setState(() { - _isError = true; - _isLoading = false; - this.error = error.toString(); - }); - }); - }, - builder: (_, model, w) => AppScaffold( - appBarTitle: isSearch? "Search Patient": patientTypeTitle, - isShowAppBar: widget.isAppbar, - isLoading: _isLoading, - body: _isLoading - ? Container() - : _isError - ? DrAppEmbeddedError(error: error) - : lItems == null || lItems.length == 0 - ? Column( - children: [ - Column(children: [ - // Container( - // width: SizeConfig.screenWidth * 0.9, - // height: 75, - // decoration: BoxDecoration( - // borderRadius: - // BorderRadius.all(Radius.circular(6.0)), - // border: Border.all( - // width: 1.0, - // color: HexColor("#CCCCCC"), - // ), - // color: Colors.white), - // child: Column( - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // Padding( - // padding: EdgeInsets.only( - // left: 10, top: 10), - // child: AppText( - // TranslationBase.of(context) - // .searchPatientName, - // fontSize: 13, - // )), - // AppTextFormField( - // // focusNode: focusProject, - // controller: _controller, - // borderColor: Colors.white, - // prefix: IconButton( - // icon: Icon( - // DoctorApp.filter_1, - // color: Colors.black, - // ), - // iconSize: 20, - // padding: - // EdgeInsets.only(bottom: 30), - // ), - // onChanged: (String str) { - // this.searchData(str); - // }), - // ])), - - // Container( - // width: SizeConfig.screenWidth * 0.9, - // height: SizeConfig.screenHeight * 0.08, - // child: TextField( - // controller: _controller, - // onChanged: (String str) { - // this.searchData(str); - // }, - // decoration: buildInputDecoration( - // context, - // TranslationBase.of(context) - // .searchPatientName), - // ), - // ), - SizedBox( - height: 10.0, - ), - if (int.parse(patientType) == 7) - Container( - padding: EdgeInsets.all(5), - decoration: BoxDecoration( - color: Colors.white, - border: Border.all(color: Colors.grey), - borderRadius: BorderRadius.circular(10)), - child: ClinicList( - clinicId: clinicId, - onClinicChange: (newValue) { - clinicId = newValue; - changeClinic(newValue, context, model); - }, - )), - Padding( - padding: EdgeInsets.only( - top: MediaQuery.of(context).size.height * - 0.03), - // child: _locationBar(context) - child: - SERVICES_PATIANT2[int.parse(patientType)] == - "List_MyOutPatient" - ? _locationBar(context, model) - : Container(), - ) - ]), - Container( - margin: EdgeInsets.only( - top: MediaQuery.of(context).size.height * 0.10), - child: Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context) - .youDontHaveAnyPatient), - ) - ], - ), - ), - ), - ], - ) - : Container( - color: Colors.grey[200], - child: ListView( - scrollDirection: Axis.vertical, - children: [ - Container( - child: lItems == null - ? Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Container( - child: Center( - child: Padding( - padding: const EdgeInsets.fromLTRB( - 0, 0, 0, 0), //250 - child: - DrAppCircularProgressIndeicator(), - )), - ), - ], - ) - : Column( - children: [ - SizedBox(height: 18.5), - - Container( - width: SizeConfig.screenWidth * 0.9, - height: 75, - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"), - ), - color: Colors.white), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only( - left: 10, top: 10), - child: AppText( - TranslationBase.of( - context) - .searchPatientName, - fontSize: 13, - )), - AppTextFormField( - // focusNode: focusProject, - controller: _controller, - borderColor: Colors.white, - prefix: IconButton( - icon: Icon( - DoctorApp.filter_1, - color: Colors.black, - ), - iconSize: 20, - padding: - EdgeInsets.only( - bottom: 30), - ), - onChanged: (String str) { - this.searchData(str); - }), - ])), - // Container( - // width: SizeConfig.screenWidth * 0.9, - // height: - // SizeConfig.screenHeight * 0.08, - // child: TextField( - // controller: _controller, - // onChanged: (String str) { - // this.searchData(str); - // }, - // decoration: buildInputDecoration( - // context, - // TranslationBase.of(context) - // .searchPatientName), - // ), - // ), - SizedBox( - height: 10.0, - ), - // if (int.parse(patientType) == 7) - // Container( - // padding: EdgeInsets.all(5), - // decoration: BoxDecoration( - // color: Colors.white, - // border: Border.all( - // color: Colors.grey), - // borderRadius: - // BorderRadius.circular(10)), - // child: ClinicList( - // clinicId: clinicId, - // onClinicChange: (newValue) { - // clinicId = newValue; - // changeClinic( - // newValue, context, model); - // }, - // )), - Padding( - padding: EdgeInsets.only( - top: MediaQuery.of(context) - .size - .height * - 0.03), - // child: _locationBar(context) - child: SERVICES_PATIANT2[ - int.parse(patientType)] == - "List_MyOutPatient" - ? _locationBar(context, model) - : Container(), - ), - SizedBox( - height: 10.0, - ), - Container( - child: (responseModelList.length > - 0) - ? Column( - // mainAxisAlignment: MainAxisAlignment.center, - children: responseModelList - .map((PatiantInformtion - item) { - return PatientCard( - patientInfo: item, - patientType: - patientType, - arrivalType: - arrivalType, - isInpatient: - isInpatient, - onTap: () { - Navigator.of(context) - .pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": item, - "patientType": - patientType, - "from": patient - .getFrom, - "to": patient - .getTo, - "isSearch": - isSearch, - "isInpatient": - isInpatient, - "arrivalType": - arrivalType, - "isInpatient": - isInpatient - }); - }, - ); - }).toList(), - ) - : Center( - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - SizedBox( - height: 100, - ), - Image.asset( - 'assets/images/no-data.png'), - Padding( - padding: - const EdgeInsets - .all(8.0), - child: AppText( - TranslationBase.of( - context) - .youDontHaveAnyPatient), - ) - ], - ), - )), - ], - ), - ) - ], - ), - ), - ), - ); - } - - changeClinic(clinicId, BuildContext context, model) async { - GifLoaderDialogUtils.showMyDialog(context); - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); - ProfileReqModel docInfo = new ProfileReqModel( - doctorID: doctorProfile.doctorID, - clinicID: clinicId, - license: true, - projectID: doctorProfile.projectID, - tokenID: '', - languageID: 2); - - authProvider - .getDocProfiles(docInfo.toJson(), allowChangeProfile: false) - .then((profileList) async { - print(profileList['DoctorProfileList'][0]); - int val2 = int.parse(patientType); - - GetPatientArrivalListRequestModel getPatientArrivalListRequestModel = - GetPatientArrivalListRequestModel( - from: patient.From, - to: patient.To, - clinicID: profileList['DoctorProfileList'][0]['ClinicID'], - doctorID: - profileList['DoctorProfileList'][0]['DoctorID'].toString(), - patientMRN: patient.getPatientID, - pageIndex: 0, - pageSize: 0); - - model - .getPatientList( - getPatientArrivalListRequestModel.toJson(), patientType) - .then((res) { - setState(() { - if (res != null && res['MessageStatus'] == 1) { - if (val2 == 7) { - if (res[SERVICES_PATIANT2[val2]] == null) { - _isError = true; - _isLoading = false; - this.error = error.toString(); - } else { - var localList = []; - if (res["patientArrivalList"]["entityList"] == null) { - res["patientArrivalList"]["entityList"] = []; - } - res["patientArrivalList"]["entityList"].forEach((v) { - Map mergedPatient = { - ...v, - ...v["patientDetails"] - }; - localList.add(mergedPatient); - }); - lItems = localList; - } - } - parsed = lItems; - responseModelList = new ModelResponse.fromJson(parsed).list; - responseModelList.sort((a, b) { - DateTime now = DateTime.now(); - DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm"); - String formattedDate = - DateFormat('yyyy-MM-dd ' + a.startTime).format(now); - DateTime dateTimeA = dateFormat.parse(formattedDate); - String formattedDateB = - DateFormat('yyyy-MM-dd ' + b.startTime).format(now); - DateTime dateTimeB = dateFormat.parse(formattedDateB); - var adate = dateTimeA; //a.startTime; - var bdate = dateTimeB; - return adate.compareTo(bdate); - }); - responseModelList2 = responseModelList; - _isError = false; - } else { - _isError = true; - error = model.error ?? - res['ErrorEndUserMessage'] ?? - res['ErrorMessage']; - } - - _isLoading = false; - }); - GifLoaderDialogUtils.hideDialog(context); - }).catchError((error) { - Helpers.showErrorToast(error.toString()); - GifLoaderDialogUtils.hideDialog(context); - }); - }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - Helpers.showErrorToast(err); - }); - } - - Widget _locationBar(BuildContext _context, model) { - return Container( - height: MediaQuery.of(context).size.height * 0.0619, - width: SizeConfig.screenWidth * 0.94, - decoration: BoxDecoration( - color: Color(0Xffffffff), - borderRadius: BorderRadius.circular(12.5), - // border: Border.all( - // width: 0.5, - // ), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: _locations.map((item) { - bool _isActive = _locations[_activeLocation] == item ? true : false; - return Column(mainAxisSize: MainAxisSize.min, children: [ - InkWell( - child: Center( - child: Container( - height: MediaQuery.of(context).size.height * 0.058, - width: SizeConfig.screenWidth * 0.2334, - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - bottomRight: Radius.circular(12.5), - topRight: Radius.circular(12.5), - topLeft: Radius.circular(9.5), - bottomLeft: Radius.circular(9.5)), - color: _isActive ? HexColor("#B8382B") : Colors.white, - ), - child: Center( - child: Text( - item, - style: TextStyle( - fontSize: 12, - color: _isActive - ? Colors.white - : Colors.black, //Colors.black, - - fontWeight: FontWeight.normal, - ), - ), - )), - ), - onTap: () { - //filterBooking(item.toString()); - - setState(() { - _activeLocation = _locations.indexOf(item); - }); - filterPatient(item.toString(), model); - }), - _isActive - ? Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - bottomRight: Radius.circular(10), - topRight: Radius.circular(10)), - color: Colors.white), - alignment: Alignment.center, - height: 1, - width: SizeConfig.screenWidth * 0.23, - ) - : Container() - ]); - }).toList(), - ), - ); - } - - filterPatient(item, model) { - if (item == 'Tomorrow') { - _patientSearchFormValues.To = DateUtils.convertDateToFormat( - DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day + 1), - 'yyyy-MM-dd'); - _patientSearchFormValues.From = DateUtils.convertDateToFormat( - DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day + 1), - 'yyyy-MM-dd'); - } else if (item == 'Next Week') { - _patientSearchFormValues.From = DateUtils.convertDateToFormat( - DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day + 1), - 'yyyy-MM-dd'); - - _patientSearchFormValues.To = DateUtils.convertDateToFormat( - DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day + 6), - 'yyyy-MM-dd'); - } else { - _patientSearchFormValues.From = DateUtils.convertDateToFormat( - DateTime( - DateTime.now().year, DateTime.now().month, DateTime.now().day), - 'yyyy-MM-dd'); - _patientSearchFormValues.To = DateUtils.convertDateToFormat( - DateTime( - DateTime.now().year, DateTime.now().month, DateTime.now().day), - 'yyyy-MM-dd'); - } - searchPatient(model); - // Navigator.of(context).pop(); - // Navigator.of(context).pushNamed(PATIENTS, arguments: { - // "patientSearchForm": _patientSearchFormValues, - // "selectedType": "7", - // "arrivalType": "1", - // "activeFilter": _activeLocation - // }); - } - - searchPatient(model) { - GifLoaderDialogUtils.showMyDialog(context); - int val2 = int.parse(patientType); - GetPatientArrivalListRequestModel getPatientArrivalListRequestModel; - if (val2 == 0) { - patient = PatientModel( - From: _patientSearchFormValues.From, - To: _patientSearchFormValues.To, - FirstName: "0", - MiddleName: "0", - LastName: "0", - PatientMobileNumber: "0", - PatientIdentificationID: "0", - PatientID: 0, - ); - } - - model - .getPatientList( - val2 == 7 ? getPatientArrivalListRequestModel.toJson() : patient, - patientType, - isView: isView) - .then((res) { - setState(() { - GifLoaderDialogUtils.hideDialog(context); - if (res != null && res['MessageStatus'] == 1) { - if (val2 == 7) { - if (res[SERVICES_PATIANT2[val2]] == null) { - _isError = true; - _isLoading = false; - this.error = error.toString(); - } else { - var localList = []; - if (res["patientArrivalList"]["entityList"] == null) { - res["patientArrivalList"]["entityList"] = []; - } - res["patientArrivalList"]["entityList"].forEach((v) { - Map mergedPatient = { - ...v, - ...v["patientDetails"] - }; - localList.add(mergedPatient); - }); - lItems = localList; - } - } else { - if (isView == false && val2 == 1) { - lItems = res['GetPatientFileInformation_PRMList'] - .where((i) => i['PatientTypeDescription'] == 'Permanent File') - .toList(); - } else { - lItems = res[SERVICES_PATIANT2[val2]]; - } - } - parsed = lItems; - responseModelList = new ModelResponse.fromJson(parsed).list; - if (val2 == 7) { - responseModelList.sort((a, b) { - if (b.startTime != null && b.startTime != null) { - try { - DateTime now = DateTime.now(); - DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm"); - String formattedDate = - DateFormat('yyyy-MM-dd ' + a.startTime).format(now); - DateTime dateTimeA = dateFormat.parse(formattedDate); - String formattedDateB = - DateFormat('yyyy-MM-dd ' + b.startTime).format(now); - DateTime dateTimeB = dateFormat.parse(formattedDateB); - var adate = dateTimeA; //a.startTime; - var bdate = dateTimeB; - return adate.compareTo(bdate); - } on Exception catch (_) { - print('never reached'); - var adate = a.startTime; //a.startTime; - var bdate = b.startTime; - return adate.compareTo(bdate); - } - } else { - var adate = convertDateFormat(a.appointmentDate); - var bdate = convertDateFormat(b.appointmentDate); - return bdate.compareTo(adate); - } - }); - } - responseModelList2 = responseModelList; - _isError = false; - } else { - _isError = true; - error = - model.error ?? res['ErrorEndUserMessage'] ?? res['ErrorMessage']; - } - - _isLoading = false; - }); - }).catchError((error) { - GifLoaderDialogUtils.hideDialog(context); - setState(() { - _isError = true; - _isLoading = false; - this.error = error.toString(); - }); - }); - } -} From 802bd83ddd00c2a3fe32f05e5d57cea18898d418 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 3 May 2021 14:48:37 +0300 Subject: [PATCH 13/31] design-changes --- lib/config/localized_values.dart | 14 +- lib/screens/home/home_page_card.dart | 14 +- lib/screens/home/home_screen.dart | 9 - .../ReferralDischargedPatientDetails.dart | 2 +- .../profile/UCAF/UCAF-input-screen.dart | 10 +- .../profile_gird_for_other.dart | 376 +++++------------- .../profile_gird_for_search.dart | 222 +++++------ .../referral/patient_referral_screen.dart | 2 +- .../referral_patient_detail_in-paint.dart | 2 +- .../referral/referred-patient-screen.dart | 2 +- .../referred_patient_detail_in-paint.dart | 4 +- lib/util/translations_delegate_base.dart | 5 +- .../profile/PatientProfileButton.dart | 13 +- 13 files changed, 238 insertions(+), 437 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 183b2a0f..d8427557 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -756,12 +756,12 @@ const Map> localizedValues = { 'ar': "الإجازة المرضية في حالة الانتظار لهذا المريض" }, 'no-clinic': {'en': "No Clinic", 'ar': "لا عيادة"}, - 'otherStatistic': {'en': "Other Statistics", 'ar': "دیگر شماریات"}, - 'ptientsreferral': {'en': "Patient's Referrals", 'ar': "مریض کا حوالہ"}, - 'arrivalpatient': {'en': "Arrival Patients", 'ar': "مریضوں کی آمد"}, + 'otherStatistic': {'en': "Other Statistics", 'ar': "إحصائيات أخرى"}, + 'ptientsreferral': {'en': "Patient's Referrals", 'ar': "إحالات المريض"}, + 'arrivalpatient': {'en': "Arrival Patients", 'ar': "المرضى القادمون"}, 'searchmedicinepatient': { 'en': "Search patient or Medicines", - 'ar': "مریض یا دوائیں تلاش کریں" + 'ar': "ابحث عن المريض أو الأدوية" }, 'appointmentDate': {'en': "Appointment Date", 'ar': "تاريخ الموعد"}, 'arrived_p': {'en': "Arrived", 'ar': "وصل"}, @@ -859,7 +859,7 @@ const Map> localizedValues = { "numOfDays": {"en": "Number of Days", "ar": "عدد الأيام"}, "replayBefore": {"en": "Replay Before", "ar": "رد قبل"}, "try-saying": {"en": "Try saying something", "ar": 'حاول قول شيء ما'}, - "refClinic": {"en": "Ref Clinic", "ar": "Ref Clinic"}, + "refClinic": {"en": "Ref Clinic", "ar": "العيادة المرجعية"}, "acknowledged": {"en": "Acknowledged", "ar": "إقرار"}, "didntCatch": { "en": "Didn't catch that. Try Speaking again", @@ -961,5 +961,7 @@ const Map> localizedValues = { 'medical': {'en': 'Medical', 'ar': 'الطبي'}, 'report': {'en': 'Report', 'ar': 'التقرير'}, 'discharge': {'en': 'Discharge', 'ar': 'discharge'}, - "discharged": {"en": "Discharged", "ar": "المصرف"}, + "discharged": {"en": "Discharged", "ar": "المفرغين"}, + "none": {"en": "None", "ar": "لا شيء"}, + "notRepliedYet": {"en": "Not Replied yet", "ar": "لم يرد بعد"}, }; diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index ffe56fd0..2f85ff89 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -8,8 +8,6 @@ class HomePageCard extends StatelessWidget { @required this.child, this.onTap, Key key, - this.width, - this.height, this.color, this.opacity = 0.4, this.margin}) @@ -18,8 +16,6 @@ class HomePageCard extends StatelessWidget { final String imageName; final Widget child; final Function onTap; - final double width; - final double height; final Color color; final double opacity; final EdgeInsets margin; @@ -28,12 +24,10 @@ class HomePageCard extends StatelessWidget { return InkWell( onTap: onTap, child: Container( - width: width != null ? width : MediaQuery.of(context).size.width * 0.28, - height: height != null - ? height - : MediaQuery.of(context).orientation == Orientation.portrait - ? MediaQuery.of(context).size.height * 0.18 - : MediaQuery.of(context).size.height * 0.36, + width: 100, + height: MediaQuery.of(context).orientation == Orientation.portrait + ? 130 + : 250, margin: this.margin, decoration: BoxDecoration( color: !hasBorder diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index e95f1d1e..a6e4e258 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -520,15 +520,6 @@ class _HomeScreenState extends State { page: PatientInPatientScreen(), ), ); - // getRequestHeader(true); - // Navigator.of(context) - // .pushNamed(PATIENTS, arguments: { - // "patientSearchForm": - // _patientSearchFormValues, - // "selectedType": "1", - // "arrivalType": "1", - // "isInpatient": true - // }); }, ), HomePageCard( diff --git a/lib/screens/patients/ReferralDischargedPatientDetails.dart b/lib/screens/patients/ReferralDischargedPatientDetails.dart index 0b664d4b..b1829126 100644 --- a/lib/screens/patients/ReferralDischargedPatientDetails.dart +++ b/lib/screens/patients/ReferralDischargedPatientDetails.dart @@ -509,7 +509,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { CrossAxisAlignment.start, children: [ AppText( - "Dr ${referredPatient.referringDoctorName}", + "${TranslationBase.of(context).dr} ${referredPatient.referringDoctorName}", fontFamily: 'Poppins', fontWeight: FontWeight.w800, fontSize: 1.5 * diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index 137b4ed5..5c16d063 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -325,7 +325,7 @@ class _UCAFInputScreenState extends State { ), AppTextFieldCustom( hintText: TranslationBase.of(context).other, - dropDownText: "None", + dropDownText: TranslationBase.of(context).none, enabled: false, ), SizedBox( @@ -333,7 +333,7 @@ class _UCAFInputScreenState extends State { ), AppTextFieldCustom( hintText: TranslationBase.of(context).how, - dropDownText: "None", + dropDownText: TranslationBase.of(context).none, enabled: false, ), SizedBox( @@ -345,7 +345,7 @@ class _UCAFInputScreenState extends State { child: AppTextFieldCustom( hintText: TranslationBase.of(context).when, - dropDownText: "None", + dropDownText: TranslationBase.of(context).none, enabled: false, ), ), @@ -356,7 +356,7 @@ class _UCAFInputScreenState extends State { child: AppTextFieldCustom( hintText: TranslationBase.of(context).where, - dropDownText: "None", + dropDownText: TranslationBase.of(context).none, enabled: false, ), ), @@ -369,7 +369,7 @@ class _UCAFInputScreenState extends State { height: screenSize.height * 0.1, hintText: TranslationBase.of(context) .specifyPossibleLineManagement, - dropDownText: "None", + dropDownText: TranslationBase.of(context).none, enabled: false, minLines: 4, maxLines: 6, diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart index 66894e11..86ccd6d1 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart @@ -1,7 +1,9 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/PatientProfileCardModel.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import '../../../../routes.dart'; @@ -15,290 +17,128 @@ class ProfileGridForOther extends StatelessWidget { String from; String to; - ProfileGridForOther( + ProfileGridForOther( {Key key, this.patient, this.patientType, this.arrivalType, this.height, - this.isInpatient, this.from,this.to}) + this.isInpatient, + this.from, + this.to}) : super(key: key); @override Widget build(BuildContext context) { + final List cardsList = [ + PatientProfileCardModel( + TranslationBase.of(context).vital, + TranslationBase.of(context).signs, + VITAL_SIGN_DETAILS, + 'patient/vital_signs.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).lab, + TranslationBase.of(context).result, + LAB_RESULT, + 'patient/lab_results.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).radiology, + TranslationBase.of(context).service, + RADIOLOGY_PATIENT, + 'patient/health_summary.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).orders, + TranslationBase.of(context).prescription, + ORDER_PRESCRIPTION_NEW, + 'patient/order_prescription.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).health, + TranslationBase.of(context).summary, + HEALTH_SUMMARY, + 'patient/health_summary.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).patient, + "ECG", + PATIENT_ECG, + 'patient/patient_sick_leave.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).orders, + TranslationBase.of(context).procedures, + ORDER_PROCEDURE, + 'patient/Order_Procedures.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).insurance, + TranslationBase.of(context).service, + PATIENT_INSURANCE_APPROVALS_NEW, + 'patient/vital_signs.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).patientSick, + TranslationBase.of(context).leave, + ADD_SICKLEAVE, + 'patient/patient_sick_leave.png', + isInPatient: isInpatient), + if (patient.appointmentNo != null && patient.appointmentNo != 0) + PatientProfileCardModel( + TranslationBase.of(context).patient, + TranslationBase.of(context).ucaf, + PATIENT_UCAF_REQUEST, + 'patient/ucaf.png', + isInPatient: isInpatient, + isDisable: patient.patientStatusType != 43 ? true : false), + if (patient.appointmentNo != null && patient.appointmentNo != 0) + PatientProfileCardModel( + TranslationBase.of(context).referral, + TranslationBase.of(context).patient, + REFER_PATIENT_TO_DOCTOR, + 'patient/refer_patient.png', + isInPatient: isInpatient, + isDisable: patient.patientStatusType != 43 ? true : false), + if (patient.appointmentNo != null && patient.appointmentNo != 0) + PatientProfileCardModel( + TranslationBase.of(context).admission, + TranslationBase.of(context).request, + PATIENT_ADMISSION_REQUEST, + 'patient/admission_req.png', + isInPatient: isInpatient, + isDisable: patient.patientStatusType != 43 ? true : false), + ]; + return Column( children: [ Padding( - padding: const EdgeInsets - .symmetric( - vertical: 15.0, - horizontal: 15), - child: GridView.count( + padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), + child: StaggeredGridView.countBuilder( shrinkWrap: true, - physics: - NeverScrollableScrollPhysics(), + physics: NeverScrollableScrollPhysics(), crossAxisSpacing: 10, mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, crossAxisCount: 3, - children: [ - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - from: from, - to: to, - nameLine1: - TranslationBase.of( - context) - .vital, - nameLine2: - TranslationBase.of( - context) - .signs, - route: - VITAL_SIGN_DETAILS, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: LAB_RESULT, - nameLine1: - TranslationBase.of( - context) - .lab, - nameLine2: - TranslationBase.of( - context) - .result, - icon: - 'patient/lab_results.png'), - PatientProfileButton( - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - isInPatient: - isInpatient, - route: - RADIOLOGY_PATIENT, - nameLine1: - TranslationBase.of( - context) - .radiology, - nameLine2: - TranslationBase.of( - context) - .service, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - ORDER_PRESCRIPTION_NEW, - nameLine1: - TranslationBase.of( - context) - .orders, - nameLine2: - TranslationBase.of( - context) - .prescription, - icon: - 'patient/order_prescription.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: HEALTH_SUMMARY, - nameLine1: TranslationBase.of(context).health, - nameLine2: TranslationBase.of(context).summary, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: PATIENT_ECG, - nameLine1: - TranslationBase.of( - context) - .patient, - nameLine2: "ECG", - icon: - 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - ORDER_PROCEDURE, - nameLine1: - TranslationBase.of( - context) - .orders, - nameLine2: - TranslationBase.of( - context) - .procedures, - icon: - 'patient/Order_Procedures.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: - TranslationBase.of( - context) - .insurance, - nameLine2: - TranslationBase.of( - context) - .service, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: ADD_SICKLEAVE, - nameLine1: - TranslationBase.of( - context) - .patientSick, - nameLine2: - TranslationBase.of( - context) - .leave, - icon: - 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != - null && - patient.appointmentNo != - 0) - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - PATIENT_UCAF_REQUEST, - isDisable: - patient.patientStatusType != - 43 - ? true - : false, - nameLine1: - TranslationBase.of( - context) - .patient, - nameLine2: - TranslationBase.of( - context) - .ucaf, - icon: - 'patient/ucaf.png'), - if (patient.appointmentNo != - null && - patient.appointmentNo != - 0) - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - REFER_PATIENT_TO_DOCTOR, - isDisable: patient - .patientStatusType != - 43 - ? true - : false, - nameLine1: - TranslationBase.of( - context) - .referral, - nameLine2: - TranslationBase.of( - context) - .patient, - icon: - 'patient/refer_patient.png'), - if (patient.appointmentNo != - null && - patient.appointmentNo != - 0) - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - PATIENT_ADMISSION_REQUEST, - isDisable: - patient.patientStatusType != - 43 - ? true - : false, - nameLine1: - TranslationBase.of( - context) - .admission, - nameLine2: - TranslationBase.of( - context) - .request, - icon: - 'patient/admission_req.png'), - ], + itemCount: cardsList.length, + staggeredTileBuilder: (int index) => StaggeredTile.fit(1), + itemBuilder: (BuildContext context, int index) => PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: cardsList[index].nameLine1, + nameLine2: cardsList[index].nameLine2, + route: cardsList[index].route, + icon: cardsList[index].icon, + isInPatient: cardsList[index].isInPatient, + isDischargedPatient: cardsList[index].isDischargedPatient, + isDisable: cardsList[index].isDisable, + onTap: cardsList[index].onTap, + isLoading: cardsList[index].isLoading, + ), ), ), ], diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart index 2d3679cf..9c9f7d36 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_search.dart @@ -1,7 +1,9 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/PatientProfileCardModel.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import '../../../../routes.dart'; @@ -25,135 +27,115 @@ class ProfileGridForSearch extends StatelessWidget { @override Widget build(BuildContext context) { + final List cardsList = [ + PatientProfileCardModel( + TranslationBase.of(context).vital, + TranslationBase.of(context).signs, + VITAL_SIGN_DETAILS, + 'patient/vital_signs.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).lab, + TranslationBase.of(context).result, + LAB_RESULT, + 'patient/lab_results.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).radiology, + TranslationBase.of(context).service, + RADIOLOGY_PATIENT, + 'patient/health_summary.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).orders, + TranslationBase.of(context).prescription, + ORDER_PRESCRIPTION_NEW, + 'patient/order_prescription.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).health, + TranslationBase.of(context).summary, + HEALTH_SUMMARY, + 'patient/health_summary.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).patient, + "ECG", + PATIENT_ECG, + 'patient/patient_sick_leave.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).orders, + TranslationBase.of(context).procedures, + ORDER_PROCEDURE, + 'patient/Order_Procedures.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).insurance, + TranslationBase.of(context).service, + PATIENT_INSURANCE_APPROVALS_NEW, + 'patient/vital_signs.png', + isInPatient: isInpatient), + PatientProfileCardModel( + TranslationBase.of(context).patientSick, + TranslationBase.of(context).leave, + ADD_SICKLEAVE, + 'patient/patient_sick_leave.png', + isInPatient: isInpatient), + if (patient.appointmentNo != null && patient.appointmentNo != 0) + PatientProfileCardModel( + TranslationBase.of(context).patient, + TranslationBase.of(context).ucaf, + PATIENT_UCAF_REQUEST, + 'patient/ucaf.png', + isInPatient: isInpatient, + isDisable: patient.patientStatusType != 43 ? true : false), + if (patient.appointmentNo != null && patient.appointmentNo != 0) + PatientProfileCardModel( + TranslationBase.of(context).referral, + TranslationBase.of(context).patient, + REFER_PATIENT_TO_DOCTOR, + 'patient/refer_patient.png', + isInPatient: isInpatient, + isDisable: patient.patientStatusType != 43 ? true : false), + if (patient.appointmentNo != null && patient.appointmentNo != 0) + PatientProfileCardModel( + TranslationBase.of(context).admission, + TranslationBase.of(context).request, + PATIENT_ADMISSION_REQUEST, + 'patient/admission_req.png', + isInPatient: isInpatient, + isDisable: patient.patientStatusType != 43 ? true : false), + ]; + return Column( children: [ Padding( padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), - child: GridView.count( + child: StaggeredGridView.countBuilder( shrinkWrap: true, physics: NeverScrollableScrollPhysics(), crossAxisSpacing: 10, mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, crossAxisCount: 3, - children: [ - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: HEALTH_SUMMARY, - nameLine1: TranslationBase.of(context).health, - nameLine2: TranslationBase.of(context).summary, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, - nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != null && patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_UCAF_REQUEST, - isDisable: patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, - icon: 'patient/ucaf.png'), - if (patient.appointmentNo != null && patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_PATIENT_TO_DOCTOR, - isDisable: patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - if (patient.appointmentNo != null && patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ADMISSION_REQUEST, - isDisable: patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, - icon: 'patient/admission_req.png'), - ], + itemCount: cardsList.length, + staggeredTileBuilder: (int index) => StaggeredTile.fit(1), + itemBuilder: (BuildContext context, int index) => PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: cardsList[index].nameLine1, + nameLine2: cardsList[index].nameLine2, + route: cardsList[index].route, + icon: cardsList[index].icon, + isInPatient: cardsList[index].isInPatient, + isDischargedPatient: cardsList[index].isDischargedPatient, + isDisable: cardsList[index].isDisable, + onTap: cardsList[index].onTap, + isLoading: cardsList[index].isLoading, + ), ), ), ], diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index c5aaed7a..de1d5958 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -146,7 +146,7 @@ class _PatientReferralScreen extends State with SingleTic borderWidth: 0), child: Center( child: AppText( - 'Discharged', + TranslationBase.of(context).discharged, fontSize: SizeConfig.textMultiplier * 1.8, color: index == 2 ? Colors.white : Color(0xFF2B353E), fontWeight: FontWeight.w700, diff --git a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart index cc2c7136..aff9091e 100644 --- a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart @@ -403,7 +403,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { CrossAxisAlignment.start, children: [ AppText( - "Dr ${referredPatient.referringDoctorName}", + "${TranslationBase.of(context).dr} ${referredPatient.referringDoctorName}", fontFamily: 'Poppins', fontWeight: FontWeight.w800, fontSize: 1.5 * diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart index 23bbb2b9..4b06b6b9 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -103,7 +103,7 @@ class ReferredPatientScreen extends StatelessWidget { .getReferredPatientItem(index) .doctorImageURL, referralDoctorName: - "Dr. ${model.getReferredPatientItem(index).referralDoctorName}", + "${TranslationBase.of(context).dr} ${model.getReferredPatientItem(index).referralDoctorName}", clinicDescription: model .getReferredPatientItem(index) .referralClinicDescription, diff --git a/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart index a9ca6c27..a37803dd 100644 --- a/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart @@ -407,7 +407,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { CrossAxisAlignment.start, children: [ AppText( - "Dr ${referredPatient.referralDoctorName}", + "${TranslationBase.of(context).dr} ${referredPatient.referralDoctorName}", fontFamily: 'Poppins', fontWeight: FontWeight.w800, fontSize: 1.5 * @@ -517,7 +517,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { referredPatient .referredDoctorRemarks.isNotEmpty ? referredPatient.referredDoctorRemarks - : " Not Replied yet", + : TranslationBase.of(context).notRepliedYet, fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.6 * SizeConfig.textMultiplier, diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index f42437c2..f972f14f 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1333,8 +1333,9 @@ class TranslationBase { localizedValues["medical"][locale.languageCode]; String get report => localizedValues["report"][locale.languageCode]; - String get discharge => - localizedValues["discharge"][locale.languageCode]; + String get discharge => localizedValues["discharge"][locale.languageCode]; + String get none => localizedValues["none"][locale.languageCode]; + String get notRepliedYet => localizedValues["notRepliedYet"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index 0c2fd2f9..dc1a9910 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -85,15 +85,14 @@ class PatientProfileButton extends StatelessWidget { children: [ AppText( !projectsProvider.isArabic ? this.nameLine1 : nameLine2, - color: Colors.black, - /*Color(0xFFB9382C),*/ + color: Color(0xFF2B353E), fontWeight: FontWeight.w600, textAlign: TextAlign.left, fontSize: SizeConfig.textMultiplier * 1.5, ), AppText( !projectsProvider.isArabic ? this.nameLine2 : nameLine1, - color: Colors.black, + color: Color(0xFF2B353E), fontWeight: FontWeight.w600, textAlign: TextAlign.left, fontSize: SizeConfig.textMultiplier * 1.5, @@ -112,14 +111,6 @@ class PatientProfileButton extends StatelessWidget { color: Color(0xffBBBBBB), width: 1, )), - /*boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.2), - spreadRadius: 5, - blurRadius: 7, - offset: Offset(0, 3), // changes position of shadow - ), - ],*/ ), ); } From 5a421847163ddaa7e23bffbdc4e7cbc9cf0816d4 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 3 May 2021 21:04:06 +0300 Subject: [PATCH 14/31] voice commad updated --- lib/config/localized_values.dart | 11 +- .../patients/profile/note/update_note.dart | 213 ++++++++++-------- .../referral/AddReplayOnReferralPatient.dart | 84 ++++--- .../refer-patient-screen-in-patient.dart | 167 ++++++++------ lib/util/translations_delegate_base.dart | 41 ++-- 5 files changed, 299 insertions(+), 217 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index d8427557..a5398db9 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -946,8 +946,14 @@ const Map> localizedValues = { "approvals22": {"en": "Approvals", "ar": "التامين"}, "severe": {"en": "Severe", "ar": "الشدة"}, "graphDetails": {"en": "Graph Details", "ar": "تفاصيل الرسم البياني"}, - "addNewOrderSheet": {"en": "Add a New Order Sheet", "ar": "أضف ورقة طلب جديدة"}, - "addNewProgressNote": {"en": "Add a New Progress Note", "ar": "أضف ملاحظة تقدم جديدة"}, + "addNewOrderSheet": { + "en": "Add a New Order Sheet", + "ar": "أضف ورقة طلب جديدة" + }, + "addNewProgressNote": { + "en": "Add a New Progress Note", + "ar": "أضف ملاحظة تقدم جديدة" + }, "notePending": {"en": "Pending", "ar": "قيد الانتظار"}, "noteCanceled": {"en": "Canceled", "ar": "ألغيت"}, "noteVerified": {"en": "Verified", "ar": "تم التحقق"}, @@ -964,4 +970,5 @@ const Map> localizedValues = { "discharged": {"en": "Discharged", "ar": "المفرغين"}, "none": {"en": "None", "ar": "لا شيء"}, "notRepliedYet": {"en": "Not Replied yet", "ar": "لم يرد بعد"}, + "clearText": {"en": "Clear Text", "ar": "نص واضح"}, }; diff --git a/lib/screens/patients/profile/note/update_note.dart b/lib/screens/patients/profile/note/update_note.dart index 673a6e2b..b2e36d8f 100644 --- a/lib/screens/patients/profile/note/update_note.dart +++ b/lib/screens/patients/profile/note/update_note.dart @@ -97,10 +97,14 @@ class _UpdateNoteOrderState extends State { children: [ BottomSheetTitle( title: widget.visitType == 3 - ? (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).orderSheet - : (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).progressNote, + ? (widget.isUpdate + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).orderSheet + : (widget.isUpdate + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).progressNote, ), SizedBox( height: 10.0, @@ -114,10 +118,18 @@ class _UpdateNoteOrderState extends State { children: [ AppTextFieldCustom( hintText: widget.visitType == 3 - ? (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).orderSheet - : (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).progressNote, + ? (widget.isUpdate + ? TranslationBase.of(context) + .noteUpdate + : TranslationBase.of(context) + .noteAdd) + + TranslationBase.of(context).orderSheet + : (widget.isUpdate + ? TranslationBase.of(context) + .noteUpdate + : TranslationBase.of(context) + .noteAdd) + + TranslationBase.of(context).progressNote, //TranslationBase.of(context).addProgressNote, controller: progressNoteController, maxLines: 35, @@ -132,19 +144,23 @@ class _UpdateNoteOrderState extends State { : null, ), Positioned( - top: -2, //MediaQuery.of(context).size.height * 0, - right: projectViewModel.isArabic? MediaQuery.of(context).size.width * 0.75 : 15, - child: IconButton( - icon: Icon( - DoctorApp.speechtotext, - color: Colors.black, - ), - onPressed: () { - initSpeechState() - .then((value) => {onVoiceText()}); - }, - ), - ) + top: + -2, //MediaQuery.of(context).size.height * 0, + right: projectViewModel.isArabic + ? MediaQuery.of(context).size.width * 0.75 + : 15, + child: Column( + children: [ + IconButton( + icon: Icon(DoctorApp.speechtotext, + color: Colors.black, size: 35), + onPressed: () { + initSpeechState() + .then((value) => {onVoiceText()}); + }, + ), + ], + )) ], ), ], @@ -161,77 +177,98 @@ class _UpdateNoteOrderState extends State { child: Wrap( alignment: WrapAlignment.center, children: [ - AppButton( - title: widget.visitType == 3 - ? (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).orderSheet - : (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).progressNote, - color: Color(0xff359846), - // disabled: progressNoteController.text.isEmpty, - fontWeight: FontWeight.w700, - onPressed: () async { - setState(() { - isSubmitted = true; - }); - if (progressNoteController.text.trim().isNotEmpty) { - GifLoaderDialogUtils.showMyDialog(context); - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - - DoctorProfileModel doctorProfile = - DoctorProfileModel.fromJson(profile); - - if (widget.isUpdate) { - UpdateNoteReqModel reqModel = UpdateNoteReqModel( - admissionNo: int.parse(widget.patient.admissionNo), - cancelledNote: false, - lineItemNo: widget.note.lineItemNo, - createdBy: widget.note.createdBy, - notes: progressNoteController.text, - verifiedNote: false, - patientTypeID: widget.patient.patientType, - patientOutSA: false, - ); - await widget.patientModel - .updatePatientProgressNote(reqModel); - } else { - CreateNoteModel reqModel = CreateNoteModel( - admissionNo: int.parse(widget.patient.admissionNo), - createdBy: doctorProfile.doctorID, - visitType: widget.visitType, - patientID: widget.patient.patientId, - nursingRemarks: ' ', - patientTypeID: widget.patient.patientType, - patientOutSA: false, - notes: progressNoteController.text); + progressNoteController.text.isEmpty + ? SizedBox() + : Container( + margin: EdgeInsets.all(5), + child: Expanded( + child: AppButton( + title: TranslationBase.of(context).clearText, + onPressed: () { + setState(() { + progressNoteController.text = ''; + }); + }, + )), + ), + Container( + margin: EdgeInsets.all(5), + child: AppButton( + title: widget.visitType == 3 + ? (widget.isUpdate + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).orderSheet + : (widget.isUpdate + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).progressNote, + color: Color(0xff359846), + // disabled: progressNoteController.text.isEmpty, + fontWeight: FontWeight.w700, + onPressed: () async { + setState(() { + isSubmitted = true; + }); + if (progressNoteController.text.trim().isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - await widget.patientModel - .createPatientProgressNote(reqModel); - } + DoctorProfileModel doctorProfile = + DoctorProfileModel.fromJson(profile); - if (widget.patientModel.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(widget.patientModel.error); - } else { - ProgressNoteRequest progressNoteRequest = - ProgressNoteRequest( - visitType: widget.visitType, - // if equal 5 then this will return progress note + if (widget.isUpdate) { + UpdateNoteReqModel reqModel = UpdateNoteReqModel( + admissionNo: int.parse(widget.patient.admissionNo), + cancelledNote: false, + lineItemNo: widget.note.lineItemNo, + createdBy: widget.note.createdBy, + notes: progressNoteController.text, + verifiedNote: false, + patientTypeID: widget.patient.patientType, + patientOutSA: false, + ); + await widget.patientModel + .updatePatientProgressNote(reqModel); + } else { + CreateNoteModel reqModel = CreateNoteModel( admissionNo: int.parse(widget.patient.admissionNo), - projectID: widget.patient.projectId, + createdBy: doctorProfile.doctorID, + visitType: widget.visitType, + patientID: widget.patient.patientId, + nursingRemarks: ' ', patientTypeID: widget.patient.patientType, - languageID: 2); - await widget.patientModel - .getPatientProgressNote(progressNoteRequest.toJson()); - } - GifLoaderDialogUtils.hideDialog(context); - DrAppToastMsg.showSuccesToast( - "Your Order added Successfully"); - Navigator.of(context).pop(); - } else { - Helpers.showErrorToast("You cant add only spaces"); - } - }), + patientOutSA: false, + notes: progressNoteController.text); + + await widget.patientModel + .createPatientProgressNote(reqModel); + } + + if (widget.patientModel.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(widget.patientModel.error); + } else { + ProgressNoteRequest progressNoteRequest = + ProgressNoteRequest( + visitType: widget.visitType, + // if equal 5 then this will return progress note + admissionNo: + int.parse(widget.patient.admissionNo), + projectID: widget.patient.projectId, + patientTypeID: widget.patient.patientType, + languageID: 2); + await widget.patientModel.getPatientProgressNote( + progressNoteRequest.toJson()); + } + GifLoaderDialogUtils.hideDialog(context); + DrAppToastMsg.showSuccesToast( + "Your Order added Successfully"); + Navigator.of(context).pop(); + } else { + Helpers.showErrorToast("You cant add only spaces"); + } + })), ], ), ), @@ -278,7 +315,7 @@ class _UpdateNoteOrderState extends State { setState(() { SpeechToText.closeAlertDialog(context); speech.stop(); - progressNoteController.text = reconizedWord; + progressNoteController.text += reconizedWord + '\n'; }); } else { print(result.finalResult); diff --git a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart index fd5ec6bb..06f426d1 100644 --- a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart @@ -19,7 +19,6 @@ import 'package:permission_handler/permission_handler.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; - class AddReplayOnReferralPatient extends StatefulWidget { final PatientReferralViewModel patientReferralViewModel; final MyReferralPatientModel myReferralInPatientModel; @@ -33,8 +32,8 @@ class AddReplayOnReferralPatient extends StatefulWidget { _AddReplayOnReferralPatientState(); } -class _AddReplayOnReferralPatientState extends State { - +class _AddReplayOnReferralPatientState + extends State { bool isSubmitted = false; stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; @@ -46,7 +45,6 @@ class _AddReplayOnReferralPatientState extends State super.initState(); } - @override Widget build(BuildContext context) { return AppScaffold( @@ -84,12 +82,13 @@ class _AddReplayOnReferralPatientState extends State : null, ), Positioned( - top: 0,//MediaQuery.of(context).size.height * 0, + top: 0, //MediaQuery.of(context).size.height * 0, right: 15, child: IconButton( icon: Icon( DoctorApp.speechtotext, color: Colors.black, + size: 35, ), onPressed: () { onVoiceText(); @@ -112,32 +111,53 @@ class _AddReplayOnReferralPatientState extends State child: Wrap( alignment: WrapAlignment.center, children: [ - AppButton( - title: 'Submit Replay', - color: Color(0xff359846), - fontWeight: FontWeight.w700, - onPressed: () async { - setState(() { - isSubmitted = true; - }); - if (progressNoteController.text.isNotEmpty) { - GifLoaderDialogUtils.showMyDialog(context); - await widget.patientReferralViewModel.replay(progressNoteController.text.trim(), widget.myReferralInPatientModel); - if (widget.patientReferralViewModel.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(widget.patientReferralViewModel.error); - } else { - GifLoaderDialogUtils.hideDialog(context); - DrAppToastMsg.showSuccesToast("Your Replay Added Successfully"); - Navigator.of(context).pop(); - Navigator.of(context).pop(); - } - }else { - Helpers.showErrorToast("You can't add empty replay"); - setState(() { - isSubmitted = false; - }); - } - }), + progressNoteController.text.isEmpty + ? SizedBox() + : Container( + margin: EdgeInsets.all(5), + child: Expanded( + child: AppButton( + title: TranslationBase.of(context).clearText, + onPressed: () { + setState(() { + progressNoteController.text = ''; + }); + }, + )), + ), + Container( + margin: EdgeInsets.all(5), + child: AppButton( + title: 'Submit Replay', + color: Color(0xff359846), + fontWeight: FontWeight.w700, + onPressed: () async { + setState(() { + isSubmitted = true; + }); + if (progressNoteController.text.isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); + await widget.patientReferralViewModel.replay( + progressNoteController.text.trim(), + widget.myReferralInPatientModel); + if (widget.patientReferralViewModel.state == + ViewState.ErrorLocal) { + Helpers.showErrorToast( + widget.patientReferralViewModel.error); + } else { + GifLoaderDialogUtils.hideDialog(context); + DrAppToastMsg.showSuccesToast( + "Your Replay Added Successfully"); + Navigator.of(context).pop(); + Navigator.of(context).pop(); + } + } else { + Helpers.showErrorToast("You can't add empty replay"); + setState(() { + isSubmitted = false; + }); + } + })), ], ), ), @@ -179,7 +199,7 @@ class _AddReplayOnReferralPatientState extends State if (result.finalResult == true) { setState(() { SpeechToText.closeAlertDialog(context); - progressNoteController.text = reconizedWord; + progressNoteController.text += reconizedWord + '\n'; }); } } diff --git a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart index 38182570..cc491cf2 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart @@ -22,6 +22,7 @@ import 'package:intl/intl.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; + class PatientMakeInPatientReferralScreen extends StatefulWidget { @override _PatientMakeInPatientReferralScreenState createState() => @@ -104,7 +105,7 @@ class _PatientMakeInPatientReferralScreenState setState(() { SpeechToText.closeAlertDialog(context); speech.stop(); - _remarksController.text = reconizedWord; + _remarksController.text += reconizedWord + '\n'; }); } else { print(result.finalResult); @@ -140,13 +141,17 @@ class _PatientMakeInPatientReferralScreenState final screenSize = MediaQuery.of(context).size; return BaseView( - onModelReady: (model) => model.getReferralFrequencyList(), + onModelReady: (model) => model.getReferralFrequencyList(), builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).referPatient, isShowAppBar: true, appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType, arrivalType,isInpatient: isInpatient,), + patient, + patientType, + arrivalType, + isInpatient: isInpatient, + ), body: SingleChildScrollView( child: Container( child: Column( @@ -466,19 +471,21 @@ class _PatientMakeInPatientReferralScreenState Stack( children: [ AppTextFieldCustom( - hintText:"Remarks", + hintText: "Remarks", controller: _remarksController, inputType: TextInputType.multiline, minLines: 4, maxLines: 6, ), Positioned( - top: 0, //MediaQuery.of(context).size.height * 0, + top: + 0, //MediaQuery.of(context).size.height * 0, right: 15, child: IconButton( icon: Icon( DoctorApp.speechtotext, color: Colors.black, + size: 35, ), onPressed: () { initSpeechState() @@ -493,73 +500,91 @@ class _PatientMakeInPatientReferralScreenState ) ], ), - Container( - margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), - child: AppButton( - title: TranslationBase.of(context).refer, - fontWeight: FontWeight.w700, - color: Color(0XFF359846), - onPressed: () async{ - setState(() { - if (_referTo == null) { - branchError = - TranslationBase.of(context).fieldRequired; - } else { - branchError = null; - } - if (_selectedBranch == null) { - hospitalError = - TranslationBase.of(context).fieldRequired; - } else { - hospitalError = null; - } - if (_selectedClinic == null) { - clinicError = - TranslationBase.of(context).fieldRequired; - } else { - clinicError = null; - } - if (_selectedDoctor == null) { - doctorError = - TranslationBase.of(context).fieldRequired; - } else { - doctorError = null; - } - if (_selectedFrequency == null) { - frequencyError = - TranslationBase.of(context).fieldRequired; - } else { - frequencyError = null; - } - }); - if (_selectedFrequency == null || - _selectedBranch == null || - _selectedClinic == null || - _selectedDoctor == null || - _remarksController.text == null || - _extController.text == null) return;{ - - await model.makeInPatientReferral( - patient: patient, - projectID: _selectedBranch['facilityId'], - clinicID: _selectedClinic['ClinicID'], - doctorID: _selectedDoctor['DoctorID'], - frequencyCode: _selectedFrequency['ParameterCode'], - ext: _extController.text, - remarks: _remarksController.text, - priority: _activePriority, - referralDate: appointmentDate - ); - if(model.state == ViewState.ErrorLocal) - DrAppToastMsg.showErrorToast(model.error); - else{ - DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsg); - Navigator.pop(context); - } - + Column( + children: [ + _remarksController.text.isEmpty + ? SizedBox() + : Container( + margin: EdgeInsets.all(5), + child: Expanded( + child: AppButton( + title: TranslationBase.of(context).clearText, + onPressed: () { + setState(() { + _remarksController.text = ''; + }); + }, + ))), + Container( + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: AppButton( + title: TranslationBase.of(context).refer, + fontWeight: FontWeight.w700, + color: Color(0XFF359846), + onPressed: () async { + setState(() { + if (_referTo == null) { + branchError = + TranslationBase.of(context).fieldRequired; + } else { + branchError = null; + } + if (_selectedBranch == null) { + hospitalError = + TranslationBase.of(context).fieldRequired; + } else { + hospitalError = null; + } + if (_selectedClinic == null) { + clinicError = + TranslationBase.of(context).fieldRequired; + } else { + clinicError = null; + } + if (_selectedDoctor == null) { + doctorError = + TranslationBase.of(context).fieldRequired; + } else { + doctorError = null; + } + if (_selectedFrequency == null) { + frequencyError = + TranslationBase.of(context).fieldRequired; + } else { + frequencyError = null; + } + }); + if (_selectedFrequency == null || + _selectedBranch == null || + _selectedClinic == null || + _selectedDoctor == null || + _remarksController.text == null || + _extController.text == null) return; + { + await model.makeInPatientReferral( + patient: patient, + projectID: _selectedBranch['facilityId'], + clinicID: _selectedClinic['ClinicID'], + doctorID: _selectedDoctor['DoctorID'], + frequencyCode: + _selectedFrequency['ParameterCode'], + ext: _extController.text, + remarks: _remarksController.text, + priority: _activePriority, + referralDate: appointmentDate); + if (model.state == ViewState.ErrorLocal) + DrAppToastMsg.showErrorToast(model.error); + else { + DrAppToastMsg.showSuccesToast( + TranslationBase.of(context) + .referralSuccessMsg); + Navigator.pop(context); + } } - }, - ), + }, + ), + ) + ], ) ], ), diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index f972f14f..ba69e104 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1301,41 +1301,34 @@ class TranslationBase { String get insurance22 => localizedValues["insurance22"][locale.languageCode]; String get approvals22 => localizedValues["approvals22"][locale.languageCode]; String get severe => localizedValues["severe"][locale.languageCode]; - String get graphDetails => localizedValues["graphDetails"][locale.languageCode]; + String get graphDetails => + localizedValues["graphDetails"][locale.languageCode]; String get discharged => localizedValues["discharged"][locale.languageCode]; String get addNewOrderSheet => localizedValues["addNewOrderSheet"][locale.languageCode]; String get addNewProgressNote => localizedValues["addNewProgressNote"][locale.languageCode]; - String get notePending => - localizedValues["notePending"][locale.languageCode]; + String get notePending => localizedValues["notePending"][locale.languageCode]; String get noteCanceled => localizedValues["noteCanceled"][locale.languageCode]; String get noteVerified => localizedValues["noteVerified"][locale.languageCode]; - String get noteVerify => - localizedValues["noteVerify"][locale.languageCode]; - String get noteConfirm => - localizedValues["noteConfirm"][locale.languageCode]; - String get noteAdd => - localizedValues["noteAdd"][locale.languageCode]; - - String get noteUpdate => - localizedValues["noteUpdate"][locale.languageCode]; - - String get orderSheet => - localizedValues["orderSheet"][locale.languageCode]; - String get order => - localizedValues["order"][locale.languageCode]; - String get sheet => - localizedValues["sheet"][locale.languageCode]; - String get medical => - localizedValues["medical"][locale.languageCode]; - String get report => - localizedValues["report"][locale.languageCode]; + String get noteVerify => localizedValues["noteVerify"][locale.languageCode]; + String get noteConfirm => localizedValues["noteConfirm"][locale.languageCode]; + String get noteAdd => localizedValues["noteAdd"][locale.languageCode]; + + String get noteUpdate => localizedValues["noteUpdate"][locale.languageCode]; + + String get orderSheet => localizedValues["orderSheet"][locale.languageCode]; + String get order => localizedValues["order"][locale.languageCode]; + String get sheet => localizedValues["sheet"][locale.languageCode]; + String get medical => localizedValues["medical"][locale.languageCode]; + String get report => localizedValues["report"][locale.languageCode]; String get discharge => localizedValues["discharge"][locale.languageCode]; String get none => localizedValues["none"][locale.languageCode]; - String get notRepliedYet => localizedValues["notRepliedYet"][locale.languageCode]; + String get notRepliedYet => + localizedValues["notRepliedYet"][locale.languageCode]; + String get clearText => localizedValues["clearText"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From f84bc6da9d4c7057c6b2837da53c70d4db9b96b8 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 4 May 2021 10:31:11 +0300 Subject: [PATCH 15/31] voice command uodated --- lib/screens/patients/profile/note/update_note.dart | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/screens/patients/profile/note/update_note.dart b/lib/screens/patients/profile/note/update_note.dart index b2e36d8f..8997dd07 100644 --- a/lib/screens/patients/profile/note/update_note.dart +++ b/lib/screens/patients/profile/note/update_note.dart @@ -181,15 +181,14 @@ class _UpdateNoteOrderState extends State { ? SizedBox() : Container( margin: EdgeInsets.all(5), - child: Expanded( - child: AppButton( + child: AppButton( title: TranslationBase.of(context).clearText, onPressed: () { setState(() { progressNoteController.text = ''; }); }, - )), + ), ), Container( margin: EdgeInsets.all(5), From 81d518e7252c5e7b9aa7a347c019607cc96c5528 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Tue, 4 May 2021 11:45:49 +0300 Subject: [PATCH 16/31] hot fix --- lib/config/localized_values.dart | 4 ++-- lib/screens/patients/PatientsInPatientScreen.dart | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index a5398db9..5d2b2de8 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -47,9 +47,9 @@ const Map> localizedValues = { 'radiology': {'en': 'Radiology', 'ar': 'الأشعة'}, 'service': {'en': 'Service', 'ar': 'خدمة'}, 'referral': {'en': 'Referral', 'ar': 'الإحالة'}, - 'inPatient': {'en': 'My Patients', 'ar': 'مرضاي'}, + 'inPatient': {'en': 'My InPatients', 'ar': 'مرضاي'}, 'inPatientLabel': {'en': 'InPatients', 'ar': 'المريض الداخلي'}, - 'inPatientAll': {'en': 'All Patients', 'ar': 'كل المرضى'}, + 'inPatientAll': {'en': 'All InPatients', 'ar': 'كل المرضى'}, 'operations': {'en': 'Operations', 'ar': 'عمليات'}, 'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'}, 'searchMedicine': {'en': 'Search Medicines', 'ar': 'بحث عن الدواء'}, diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index 6f2bafd9..75b65847 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -76,7 +76,6 @@ class _PatientInPatientScreenState extends State with Si fontSize: SizeConfig.textMultiplier * 2.8, fontWeight: FontWeight.bold, color: Color(0xFF2B353E), - fontFamily: 'Poppins', ), ), ]), @@ -155,7 +154,7 @@ class _PatientInPatientScreenState extends State with Si children: [ AppText( title, - fontSize: SizeConfig.textMultiplier * 1.6, + fontSize: SizeConfig.textMultiplier * 1.5, color: isActive ? Colors.white : Color(0xFF2B353E), fontWeight: FontWeight.w700, ), From 583edfed89e57cf969dcfbd47d5695488fa1d43a Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 4 May 2021 11:54:54 +0300 Subject: [PATCH 17/31] fix out patient number --- lib/screens/patients/out_patient/out_patient_screen.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index 8d1d2eb8..c8d197de 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -132,7 +132,7 @@ class _OutPatientsScreenState extends State { onTap: () async { setState(() { _activeLocation = _times.indexOf(item); - outPatientFilterType= _activeLocation==0?OutPatientFilterType.Previous:_activeLocation==0?OutPatientFilterType.Today:OutPatientFilterType.NextWeek; + outPatientFilterType= _activeLocation==0?OutPatientFilterType.Previous:_activeLocation==1?OutPatientFilterType.Today:OutPatientFilterType.NextWeek; _controller.text=""; }); model.searchData(""); From 302294afada420888f4b926d2448e07de956bc81 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 4 May 2021 12:12:06 +0300 Subject: [PATCH 18/31] session issue fix --- lib/util/helpers.dart | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 13b7b2ae..3e410c86 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -1,6 +1,7 @@ import 'package:connectivity/connectivity.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/doctor/list_doctor_working_hours_table_model.dart'; import 'package:doctor_app_flutter/screens/auth/login_screen.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; @@ -16,6 +17,7 @@ import '../util/dr_app_toast_msg.dart'; import 'dr_app_shared_pref.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + class Helpers { static int cupertinoPickerIndex = 0; @@ -82,7 +84,6 @@ class Helpers { style: TextStyle(fontSize: SizeConfig.textMultiplier * 2), ); }).toList(), - itemExtent: 25, looping: false, onSelectedItemChanged: (int index) { @@ -100,6 +101,7 @@ class Helpers { DrAppToastMsg.showErrorToast(localMsg); } + static Future checkConnection() async { ConnectivityResult connectivityResult = await (Connectivity().checkConnectivity()); @@ -144,8 +146,13 @@ class Helpers { String lang = await sharedPref.getString(APP_Language); await clearSharedPref(); sharedPref.setString(APP_Language, lang); - Navigator.pushAndRemoveUntil(AppGlobal.CONTEX, FadePage(page: Loginsreen(),), (r) => false); - + ProjectViewModel().isLogin = false; + Navigator.pushAndRemoveUntil( + AppGlobal.CONTEX, + FadePage( + page: Loginsreen(), + ), + (r) => false); } navigateToUpdatePage(String message, String androidLink, iosLink) { @@ -158,7 +165,7 @@ class Helpers { iosLink: iosLink, ), ), - (r) => false); + (r) => false); } static String parseHtmlString(String htmlString) { From c4a6d9ad6f4bafd5ffb24dde83cb330d927d2fbb Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 4 May 2021 12:58:18 +0300 Subject: [PATCH 19/31] prescription changes --- .../prescription/add_prescription_form.dart | 28 +++++++++++++++---- pubspec.lock | 8 +++--- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 07bf9d81..09d9f29e 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -641,8 +641,14 @@ class _PrescriptionFormWidgetState extends State { context) .route, route != null - ? route[ - 'description'] + ? model.itemMedicineListRoute + .length == + 1 + ? model.itemMedicineListRoute[ + 0][ + 'description'] + : route[ + 'description'] : null, true), enabled: false, @@ -726,8 +732,14 @@ class _PrescriptionFormWidgetState extends State { context) .frequency, frequency != null - ? frequency[ - 'description'] + ? model.itemMedicineList + .length == + 1 + ? model.itemMedicineList[ + 0][ + 'description'] + : frequency[ + 'description'] : null, true), enabled: false, @@ -1382,8 +1394,12 @@ class _PrescriptionFormWidgetState extends State { doseTimeIn: doseTime['id'].toString(), model: widget.model, duration: duration['id'].toString(), - frequency: frequency['parameterCode'].toString(), - route: route['parameterCode'].toString(), + frequency: model.itemMedicineList.length == 1 + ? model.itemMedicineList[0]['parameterCode'] + : frequency['parameterCode'].toString(), + route: model.itemMedicineListRoute.length == 1 + ? model.itemMedicineListRoute[0]['parameterCode'] + : route['parameterCode'].toString(), drugId: _selectedMedication.itemId.toString(), strength: strengthController.text, indication: indicationController.text, diff --git a/pubspec.lock b/pubspec.lock index ee31002d..1a572a0a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -573,7 +573,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: @@ -615,7 +615,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0-nullsafety.4" mime: dependency: transitive description: @@ -907,7 +907,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0-nullsafety.2" sticky_headers: dependency: "direct main" description: @@ -1098,5 +1098,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <2.11.0" + dart: ">=2.10.0 <=2.11.0-213.1.beta" flutter: ">=1.22.0 <2.0.0" From f07208586da07d66344df4e2a07c81d3dfc0625e Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 4 May 2021 16:38:52 +0300 Subject: [PATCH 20/31] Add Prescription changes --- .../prescription/add_prescription_form.dart | 144 +++++++++++------- 1 file changed, 91 insertions(+), 53 deletions(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 09d9f29e..71cdd1e4 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -438,7 +438,7 @@ class _PrescriptionFormWidgetState extends State { width: MediaQuery.of(context) .size .width * - 0.550, + 0.450, child: TextFields( inputFormatters: [ LengthLimitingTextInputFormatter( @@ -513,7 +513,7 @@ class _PrescriptionFormWidgetState extends State { width: MediaQuery.of(context) .size .width * - 0.350, + 0.450, child: InkWell( onTap: model.itemMedicineListUnit != @@ -561,14 +561,13 @@ class _PrescriptionFormWidgetState extends State { child: TextField( decoration: textFieldSelectorDecoration( - TranslationBase.of( - context) - .unit, + 'Select', model.itemMedicineListUnit .length == 1 - ? model.itemMedicineListUnit[ - 0][ + ? units = model + .itemMedicineListUnit[0] + [ 'description'] : units != null @@ -640,16 +639,16 @@ class _PrescriptionFormWidgetState extends State { TranslationBase.of( context) .route, - route != null - ? model.itemMedicineListRoute - .length == - 1 - ? model.itemMedicineListRoute[ - 0][ - 'description'] - : route[ + model.itemMedicineListRoute + .length == + 1 + ? model.itemMedicineListRoute[ + 0] + ['description'] + : route != null + ? route[ 'description'] - : null, + : null, true), enabled: false, ), @@ -731,16 +730,16 @@ class _PrescriptionFormWidgetState extends State { TranslationBase.of( context) .frequency, - frequency != null - ? model.itemMedicineList - .length == - 1 - ? model.itemMedicineList[ - 0][ - 'description'] - : frequency[ + model.itemMedicineList + .length == + 1 + ? model.itemMedicineList[ + 0] + ['description'] + : frequency != null + ? frequency[ 'description'] - : null, + : null, true), enabled: false, ), @@ -1150,12 +1149,13 @@ class _PrescriptionFormWidgetState extends State { formKey.currentState.save(); // Navigator.pop(context); // openDrugToDrug(); - if (route == null || - frequency == null || + if (frequency == null || + strengthController + .text == + null || doseTime == null || duration == null || - selectedDate == null || - units == null) { + selectedDate == null) { DrAppToastMsg.showErrorToast( TranslationBase.of( context) @@ -1218,27 +1218,48 @@ class _PrescriptionFormWidgetState extends State { // // .trim()) // // .toList() // // .join(' '), - // dose: - // strengthController - // .text, - // doseUnit: units[ - // 'parameterCode'] - // .toString(), - // patient: - // widget.patient, + // dose: strengthController + // .text, + // doseUnit: model + // .itemMedicineListUnit + // .length == + // 1 + // ? model + // .itemMedicineListUnit[ + // 0][ + // 'parameterCode'] + // .toString() + // : units['parameterCode'] + // .toString(), + // patient: widget.patient, // doseTimeIn: // doseTime['id'] // .toString(), // model: widget.model, - // duration: - // duration['id'] - // .toString(), - // frequency: frequency[ - // 'parameterCode'] - // .toString(), - // route: route[ - // 'parameterCode'] + // duration: duration['id'] // .toString(), + // frequency: model + // .itemMedicineList + // .length == + // 1 + // ? model + // .itemMedicineList[ + // 0][ + // 'parameterCode'] + // .toString() + // : frequency[ + // 'parameterCode'] + // .toString(), + // route: model.itemMedicineListRoute + // .length == + // 1 + // ? model + // .itemMedicineListRoute[ + // 0][ + // 'parameterCode'] + // .toString() + // : route['parameterCode'] + // .toString(), // drugId: // _selectedMedication // .itemId @@ -1252,8 +1273,7 @@ class _PrescriptionFormWidgetState extends State { // instruction: // instructionController // .text, - // doseTime: - // selectedDate, + // doseTime: selectedDate, // ); } } @@ -1362,7 +1382,7 @@ class _PrescriptionFormWidgetState extends State { children: [ DrugToDrug( widget.patient, - getPriscriptionforDrug(widget.prescriptionList), + getPriscriptionforDrug(widget.prescriptionList, model), model.patientAssessmentList), Container( margin: EdgeInsets.all(SizeConfig.widthMultiplier * 3), @@ -1447,7 +1467,17 @@ class _PrescriptionFormWidgetState extends State { }); } - getPriscriptionforDrug(List prescriptionList) { + // selectedValue(itemMdeicationList,key){ + // // String selected = ""; + // // units[key]=itemMdeicationList.length==1? itemMdeicationList[0][key]:units[key].toString(); + // // + // // selected = units[key]; + // // + // // return selected; + // // } + + getPriscriptionforDrug( + List prescriptionList, MedicineViewModel model) { var prescriptionDetails = []; if (prescriptionList.length > 0) { prescriptionList[0].entityList.forEach((element) { @@ -1471,11 +1501,19 @@ class _PrescriptionFormWidgetState extends State { 'DrugId': _selectedMedication.mediSpanGPICode, 'DrugName': _selectedMedication.description, 'Dose': strengthController.text, - 'DoseType': units['parameterCode'].toString(), - 'Unit': units['description'], - 'FrequencyType': frequency['parameterCode'].toString(), + 'DoseType': model.itemMedicineListUnit.length == 1 + ? model.itemMedicineListUnit[0]['parameterCode'].toString() + : units['parameterCode'].toString(), + 'Unit': model.itemMedicineListUnit.length == 1 + ? model.itemMedicineListUnit[0]['description'] + : units['description'], + 'FrequencyType': model.itemMedicineList.length == 1 + ? model.itemMedicineList[0]['parameterCode'] + : frequency['parameterCode'].toString(), 'Duration': duration['id'].toString(), - 'RouteID': route['parameterCode'].toString(), + 'RouteID': model.itemMedicineListRoute.length == 1 + ? model.itemMedicineListRoute[0]['parameterCode'].toString() + : route['parameterCode'].toString(), 'IsScreen': true }); } From bf86fcc168ab83544da9eea587d6b36e73f72684 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 4 May 2021 17:35:44 +0300 Subject: [PATCH 21/31] fix in note and AddReplayOnReferralPatient --- ios/Podfile.lock | 2 +- lib/client/base_app_client.dart | 3 +-- lib/config/localized_values.dart | 2 +- .../service/DischargedPatientService.dart | 2 +- lib/screens/home/home_page_card.dart | 2 +- .../patients/profile/note/update_note.dart | 9 ++++---- .../referral/AddReplayOnReferralPatient.dart | 22 +++++++++---------- 7 files changed, 20 insertions(+), 22 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 2f4607e0..878a1850 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -322,4 +322,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69 -COCOAPODS: 1.10.0.rc.1 +COCOAPODS: 1.10.1 diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index faef1fca..d6a72ab6 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -88,7 +88,6 @@ class BaseAppClient { onFailure(Helpers.generateContactAdminMsg(), statusCode); } else { var parsed = json.decode(response.body.toString()); - if (parsed['ErrorType'] == 4) { helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], parsed['AndroidLink'], parsed['IOSLink']); @@ -99,7 +98,7 @@ class BaseAppClient { onFailure(getError(parsed), statusCode); } else if (!isAllowAny) { await Helpers.logout(); - Helpers.showErrorToast('Your session expired Please login agian'); + Helpers.showErrorToast('Your session expired Please login again'); } if (isAllowAny) { onFailure(getError(parsed), statusCode); diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 5d2b2de8..77186b0b 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -47,7 +47,7 @@ const Map> localizedValues = { 'radiology': {'en': 'Radiology', 'ar': 'الأشعة'}, 'service': {'en': 'Service', 'ar': 'خدمة'}, 'referral': {'en': 'Referral', 'ar': 'الإحالة'}, - 'inPatient': {'en': 'My InPatients', 'ar': 'مرضاي'}, + 'inPatient': {'en': 'My\n InPatients', 'ar': 'مرضاي'}, 'inPatientLabel': {'en': 'InPatients', 'ar': 'المريض الداخلي'}, 'inPatientAll': {'en': 'All InPatients', 'ar': 'كل المرضى'}, 'operations': {'en': 'Operations', 'ar': 'عمليات'}, diff --git a/lib/core/service/DischargedPatientService.dart b/lib/core/service/DischargedPatientService.dart index 2d43afc6..9b54f308 100644 --- a/lib/core/service/DischargedPatientService.dart +++ b/lib/core/service/DischargedPatientService.dart @@ -44,7 +44,7 @@ class DischargedPatientService extends BaseService { Future gtMyDischargeReferralPatient() async { hasError = false; Map body = Map(); - await getDoctorProfile(); + await getDoctorProfile(isGetProfile: true); body['DoctorID'] = doctorProfile.doctorID; body['FirstName'] = "0"; body['MiddleName'] = "0"; diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index 2f85ff89..fef7dd5b 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -24,7 +24,7 @@ class HomePageCard extends StatelessWidget { return InkWell( onTap: onTap, child: Container( - width: 100, + width: 120, height: MediaQuery.of(context).orientation == Orientation.portrait ? 130 : 250, diff --git a/lib/screens/patients/profile/note/update_note.dart b/lib/screens/patients/profile/note/update_note.dart index 8997dd07..3fde4262 100644 --- a/lib/screens/patients/profile/note/update_note.dart +++ b/lib/screens/patients/profile/note/update_note.dart @@ -173,13 +173,12 @@ class _UpdateNoteOrderState extends State { ), ), bottomSheet: Container( + height: progressNoteController.text.isNotEmpty? 130:70, margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, + child: Column( children: [ - progressNoteController.text.isEmpty - ? SizedBox() - : Container( + if(progressNoteController.text.isNotEmpty) + Container( margin: EdgeInsets.all(5), child: AppButton( title: TranslationBase.of(context).clearText, diff --git a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart index 06f426d1..0626e3e8 100644 --- a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart @@ -22,7 +22,7 @@ import 'package:speech_to_text/speech_to_text.dart' as stt; class AddReplayOnReferralPatient extends StatefulWidget { final PatientReferralViewModel patientReferralViewModel; final MyReferralPatientModel myReferralInPatientModel; - //TODO Jammal + const AddReplayOnReferralPatient( {Key key, this.patientReferralViewModel, this.myReferralInPatientModel}) : super(key: key); @@ -38,7 +38,7 @@ class _AddReplayOnReferralPatientState stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; var event = RobotProvider(); - TextEditingController progressNoteController = TextEditingController(); + TextEditingController replayOnReferralController = TextEditingController(); @override void initState() { requestPermissions(); @@ -71,12 +71,12 @@ class _AddReplayOnReferralPatientState children: [ AppTextFieldCustom( hintText: 'Replay your responses here', - controller: progressNoteController, + controller: replayOnReferralController, maxLines: 35, minLines: 25, hasBorder: true, validationError: - progressNoteController.text.isEmpty && + replayOnReferralController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : null, @@ -107,11 +107,11 @@ class _AddReplayOnReferralPatientState ), ), bottomSheet: Container( + height: replayOnReferralController.text.isNotEmpty? 130:70, margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, + child: Column( children: [ - progressNoteController.text.isEmpty + replayOnReferralController.text.isEmpty ? SizedBox() : Container( margin: EdgeInsets.all(5), @@ -120,7 +120,7 @@ class _AddReplayOnReferralPatientState title: TranslationBase.of(context).clearText, onPressed: () { setState(() { - progressNoteController.text = ''; + replayOnReferralController.text = ''; }); }, )), @@ -135,10 +135,10 @@ class _AddReplayOnReferralPatientState setState(() { isSubmitted = true; }); - if (progressNoteController.text.isNotEmpty) { + if (replayOnReferralController.text.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); await widget.patientReferralViewModel.replay( - progressNoteController.text.trim(), + replayOnReferralController.text.trim(), widget.myReferralInPatientModel); if (widget.patientReferralViewModel.state == ViewState.ErrorLocal) { @@ -199,7 +199,7 @@ class _AddReplayOnReferralPatientState if (result.finalResult == true) { setState(() { SpeechToText.closeAlertDialog(context); - progressNoteController.text += reconizedWord + '\n'; + replayOnReferralController.text += reconizedWord + '\n'; }); } } From a82a3fa38db82ab94ac6c2da623a413ae384f42b Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 4 May 2021 17:50:55 +0300 Subject: [PATCH 22/31] add prescription changes --- lib/screens/prescription/add_prescription_form.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 71cdd1e4..d372e548 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -1152,7 +1152,7 @@ class _PrescriptionFormWidgetState extends State { if (frequency == null || strengthController .text == - null || + "" || doseTime == null || duration == null || selectedDate == null) { From 16519d0ccfaa9106284010279e28d6102f566e27 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 4 May 2021 18:20:30 +0300 Subject: [PATCH 23/31] hot fix --- lib/config/localized_values.dart | 2 +- lib/screens/home/home_screen.dart | 3 +-- lib/screens/patients/PatientsInPatientScreen.dart | 2 +- .../profile/patient-profile-header-new-design-app-bar.dart | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 77186b0b..d09d33f4 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -47,7 +47,7 @@ const Map> localizedValues = { 'radiology': {'en': 'Radiology', 'ar': 'الأشعة'}, 'service': {'en': 'Service', 'ar': 'خدمة'}, 'referral': {'en': 'Referral', 'ar': 'الإحالة'}, - 'inPatient': {'en': 'My\n InPatients', 'ar': 'مرضاي'}, + 'inPatient': {'en': 'InPatients', 'ar': 'مرضاي'}, 'inPatientLabel': {'en': 'InPatients', 'ar': 'المريض الداخلي'}, 'inPatientAll': {'en': 'All InPatients', 'ar': 'كل المرضى'}, 'operations': {'en': 'Operations', 'ar': 'عمليات'}, diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 76dba1cf..79ceddbf 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -503,8 +503,7 @@ class _HomeScreenState extends State { Container( padding: EdgeInsets.all(10), child: AppText( - TranslationBase.of(context) - .inPatient, + "My\n"+TranslationBase.of(context).inPatient, color: Colors.white, textAlign: TextAlign.start, fontSize: 15, diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index 75b65847..e6c28a51 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -107,7 +107,7 @@ class _PatientInPatientScreenState extends State with Si unselectedLabelColor: Colors.grey[800], tabs: [ tabWidget(screenSize, _activeTab == 0, TranslationBase.of(context).inPatientAll, counter: model.inPatientList.length), - tabWidget(screenSize, _activeTab == 1, TranslationBase.of(context).inPatient, counter: model.myIinPatientList.length), + tabWidget(screenSize, _activeTab == 1, "My InPatients", counter: model.myIinPatientList.length), tabWidget(screenSize, _activeTab == 2, TranslationBase.of(context).discharged), ], ), diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart index 3d7638c2..d5c43892 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart @@ -303,7 +303,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget "${TranslationBase.of(context).numOfDays}: ", fontSize: 15, ), - if(isDischargedPatient) + if(isDischargedPatient && patient.dischargeDate!=null) AppText( "${DateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(DateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", fontSize: 15, From eb0fda35551460638b380158717e723981a6081d Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 5 May 2021 12:17:21 +0300 Subject: [PATCH 24/31] hot fix --- .../prescription/add_prescription_form.dart | 33 ++++++------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index d372e548..fd7c09cf 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -385,8 +385,7 @@ class _PrescriptionFormWidgetState extends State { true; visbiltySearch = false; _selectedMedication = - model.allMedicationList[ - index]; + model.allMedicationList[index]; uom = _selectedMedication .uom; }, @@ -406,6 +405,8 @@ class _PrescriptionFormWidgetState extends State { child: Container( child: Column( children: [ + + AppText(_selectedMedication?.description??"",bold: true,), Container( child: Row( children: [ @@ -435,10 +436,7 @@ class _PrescriptionFormWidgetState extends State { child: Row( children: [ Container( - width: MediaQuery.of(context) - .size - .width * - 0.450, + width: MediaQuery.of(context).size.width * 0.35, child: TextFields( inputFormatters: [ LengthLimitingTextInputFormatter( @@ -447,9 +445,7 @@ class _PrescriptionFormWidgetState extends State { // .digitsOnly ], hintText: - TranslationBase.of( - context) - .strength, + TranslationBase.of(context).strength, controller: strengthController, keyboardType: TextInputType @@ -560,20 +556,11 @@ class _PrescriptionFormWidgetState extends State { : null, child: TextField( decoration: - textFieldSelectorDecoration( - 'Select', - model.itemMedicineListUnit - .length == - 1 - ? units = model - .itemMedicineListUnit[0] - [ - 'description'] - : units != - null - ? units[ - 'description'] - : null, + textFieldSelectorDecoration('Select', + + model.itemMedicineListUnit.length == 1 + ? units = model.itemMedicineListUnit[0]['description'] + : units != null ? units['description'].toString() : null, true), enabled: false), ), From 086ca517d20293690381725712c85a5452b22d1a Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 5 May 2021 12:24:30 +0300 Subject: [PATCH 25/31] Add Medical Report Page --- .../profile/medical_report/MedicalReportPage.dart | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 lib/screens/patients/profile/medical_report/MedicalReportPage.dart diff --git a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart new file mode 100644 index 00000000..f31c754e --- /dev/null +++ b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart @@ -0,0 +1,8 @@ +import 'package:flutter/cupertino.dart'; + +class MedicalReportPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Container(); + } +} From e16d91a1b8ef29e0829a47028127d0ca211488bf Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 5 May 2021 12:49:26 +0300 Subject: [PATCH 26/31] add prescription form changes --- .../prescription/add_prescription_form.dart | 45 ++++++++++++++----- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index fd7c09cf..27a9c53f 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -385,7 +385,8 @@ class _PrescriptionFormWidgetState extends State { true; visbiltySearch = false; _selectedMedication = - model.allMedicationList[index]; + model.allMedicationList[ + index]; uom = _selectedMedication .uom; }, @@ -405,8 +406,11 @@ class _PrescriptionFormWidgetState extends State { child: Container( child: Column( children: [ - - AppText(_selectedMedication?.description??"",bold: true,), + AppText( + _selectedMedication?.description ?? + "", + bold: true, + ), Container( child: Row( children: [ @@ -431,12 +435,15 @@ class _PrescriptionFormWidgetState extends State { SizedBox( height: spaceBetweenTextFileds), Container( - height: screenSize.height * 0.070, + height: screenSize.height * 0.076, width: double.infinity, child: Row( children: [ Container( - width: MediaQuery.of(context).size.width * 0.35, + width: MediaQuery.of(context) + .size + .width * + 0.35, child: TextFields( inputFormatters: [ LengthLimitingTextInputFormatter( @@ -445,7 +452,12 @@ class _PrescriptionFormWidgetState extends State { // .digitsOnly ], hintText: - TranslationBase.of(context).strength, + TranslationBase.of( + context) + .strength, + fontWeight: FontWeight.w500, + fontSize: 14.0, + borderWidth: 0.2, controller: strengthController, keyboardType: TextInputType @@ -509,7 +521,7 @@ class _PrescriptionFormWidgetState extends State { width: MediaQuery.of(context) .size .width * - 0.450, + 0.560, child: InkWell( onTap: model.itemMedicineListUnit != @@ -556,11 +568,20 @@ class _PrescriptionFormWidgetState extends State { : null, child: TextField( decoration: - textFieldSelectorDecoration('Select', - - model.itemMedicineListUnit.length == 1 - ? units = model.itemMedicineListUnit[0]['description'] - : units != null ? units['description'].toString() : null, + textFieldSelectorDecoration( + 'Select', + model.itemMedicineListUnit + .length == + 1 + ? units = model + .itemMedicineListUnit[0] + [ + 'description'] + : units != + null + ? units['description'] + .toString() + : null, true), enabled: false), ), From c17d3d63e02af511bd857b50dcc3f3389ba4913e Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 5 May 2021 13:36:35 +0300 Subject: [PATCH 27/31] hot fix --- lib/screens/prescription/add_prescription_form.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 27a9c53f..22e91415 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -435,7 +435,7 @@ class _PrescriptionFormWidgetState extends State { SizedBox( height: spaceBetweenTextFileds), Container( - height: screenSize.height * 0.076, + height: screenSize.height * 0.062, width: double.infinity, child: Row( children: [ From ca11da36b3a4bc3da4c813a10413959163e2a241 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 5 May 2021 14:17:59 +0300 Subject: [PATCH 28/31] hot fix --- lib/screens/prescription/add_prescription_form.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 22e91415..9fcd20cc 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -435,7 +435,11 @@ class _PrescriptionFormWidgetState extends State { SizedBox( height: spaceBetweenTextFileds), Container( - height: screenSize.height * 0.062, + //height: screenSize.height * 0.062, + height: MediaQuery.of(context) + .size + .height * + 0.06, width: double.infinity, child: Row( children: [ From ed8da38bc9dde5aa30d749c52b599c0a598f5409 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 5 May 2021 15:04:41 +0300 Subject: [PATCH 29/31] hot fix --- lib/screens/prescription/add_prescription_form.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 9fcd20cc..91536aeb 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -444,6 +444,10 @@ class _PrescriptionFormWidgetState extends State { child: Row( children: [ Container( + height: MediaQuery.of(context) + .size + .height * + 0.06, width: MediaQuery.of(context) .size .width * @@ -521,6 +525,10 @@ class _PrescriptionFormWidgetState extends State { width: 10.0, ), Container( + height: MediaQuery.of(context) + .size + .height * + 0.06, color: Colors.white, width: MediaQuery.of(context) .size From 68e9470273e259894246c3c2007c167fb9ac8e55 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 5 May 2021 16:06:02 +0300 Subject: [PATCH 30/31] hot fix --- lib/config/config.dart | 2 +- .../prescription/add_prescription_form.dart | 86 ++++++++++--------- .../text_fields/app-textfield-custom.dart | 29 ++++--- 3 files changed, 64 insertions(+), 53 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index b21ee8ed..ec8efe26 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -337,7 +337,7 @@ const TRANSACTION_NO = 0; const LANGUAGE_ID = 2; const STAMP = '2020-04-27T12:17:17.721Z'; const IP_ADDRESS = '9.9.9.9'; -const VERSION_ID = 5.9; +const VERSION_ID = 6.0; const CHANNEL = 9; const SESSION_ID = 'BlUSkYymTt'; const IS_LOGIN_FOR_DOCTOR_APP = true; diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 91536aeb..b9951f8e 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -22,6 +22,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -439,20 +440,20 @@ class _PrescriptionFormWidgetState extends State { height: MediaQuery.of(context) .size .height * - 0.06, + 0.075, width: double.infinity, child: Row( children: [ Container( - height: MediaQuery.of(context) - .size - .height * - 0.06, + // height: MediaQuery.of(context) + // .size + // .height * + // 0.02, width: MediaQuery.of(context) .size .width * 0.35, - child: TextFields( + child: AppTextFieldCustom( inputFormatters: [ LengthLimitingTextInputFormatter( 5), @@ -463,15 +464,16 @@ class _PrescriptionFormWidgetState extends State { TranslationBase.of( context) .strength, - fontWeight: FontWeight.w500, - fontSize: 14.0, - borderWidth: 0.2, + // fontWeight: FontWeight.w500, + // fontSize: 14.0, + // borderWidth: 0.2, + controller: strengthController, - keyboardType: TextInputType - .numberWithOptions( - decimal: true, - ), + // keyboardType: TextInputType + // .numberWithOptions( + // decimal: true, + // ), onChanged: (String value) { setState(() { strengthChar = @@ -486,30 +488,30 @@ class _PrescriptionFormWidgetState extends State { ); } }, - onSubmit: (_) { - if (_selectedMedication != - null && - duration != null && - frequency != null && - strengthController - .text != - null) { - model.getBoxQuantity( - freq: frequency[ - 'parameterCode'], - duration: - duration['id'], - itemCode: - _selectedMedication - .itemId, - strength: double.parse( - strengthController - .text)); - box = model.boxQuintity; - - return; - } - }, + // onClick: (_) { + // if (_selectedMedication != + // null && + // duration != null && + // frequency != null && + // strengthController + // .text != + // null) { + // model.getBoxQuantity( + // freq: frequency[ + // 'parameterCode'], + // duration: + // duration['id'], + // itemCode: + // _selectedMedication + // .itemId, + // strength: double.parse( + // strengthController + // .text)); + // box = model.boxQuintity; + // + // return; + // } + // }, // validator: (value) { // if (value.isEmpty && // strengthController.text.length > @@ -522,13 +524,13 @@ class _PrescriptionFormWidgetState extends State { ), ), SizedBox( - width: 10.0, + width: 5.0, ), Container( - height: MediaQuery.of(context) - .size - .height * - 0.06, + // height: MediaQuery.of(context) + // .size + // .height * + // 0.06, color: Colors.white, width: MediaQuery.of(context) .size diff --git a/lib/widgets/shared/text_fields/app-textfield-custom.dart b/lib/widgets/shared/text_fields/app-textfield-custom.dart index da92f574..e00ffc7b 100644 --- a/lib/widgets/shared/text_fields/app-textfield-custom.dart +++ b/lib/widgets/shared/text_fields/app-textfield-custom.dart @@ -57,7 +57,9 @@ class _AppTextFieldCustomState extends State { return Column( children: [ Container( - height: widget.height != 0 && widget.maxLines == 1 ? widget.height + 8 : null, + height: widget.height != 0 && widget.maxLines == 1 + ? widget.height + 8 + : null, decoration: widget.hasBorder ? TextFieldsUtils.containerBorderDecoration( Color(0Xffffffff), @@ -92,13 +94,16 @@ class _AppTextFieldCustomState extends State { ), widget.dropDownText == null ? Container( - height: widget.height != 0 && widget.maxLines == 1 ? widget.height - 22 : null, - child: TextField( + height: + widget.height != 0 && widget.maxLines == 1 + ? widget.height - 22 + : null, + child: TextField( textAlign: projectViewModel.isArabic ? TextAlign.right : TextAlign.left, - decoration: - TextFieldsUtils.textFieldSelectorDecoration( + decoration: TextFieldsUtils + .textFieldSelectorDecoration( widget.hintText, null, true), style: TextStyle( fontSize: SizeConfig.textMultiplier * 1.7, @@ -106,13 +111,17 @@ class _AppTextFieldCustomState extends State { color: Color(0xFF575757), ), controller: widget.controller, - keyboardType: widget.inputType?? (widget.maxLines == 1 ? TextInputType.text : TextInputType.multiline), + keyboardType: widget.inputType ?? + (widget.maxLines == 1 + ? TextInputType.text + : TextInputType.multiline), enabled: widget.enabled, minLines: widget.minLines, maxLines: widget.maxLines, - inputFormatters: widget.inputFormatters != null - ? widget.inputFormatters - : [], + inputFormatters: + widget.inputFormatters != null + ? widget.inputFormatters + : [], onChanged: (value) { setState(() {}); if (widget.onChanged != null) { @@ -120,7 +129,7 @@ class _AppTextFieldCustomState extends State { } }, ), - ) + ) : AppText( widget.dropDownText, fontFamily: 'Poppins', From d2814f610e480679eeb6e796cbb6e5a30e24c0af Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 5 May 2021 16:28:46 +0300 Subject: [PATCH 31/31] hot fix --- lib/screens/prescription/add_prescription_form.dart | 4 +++- lib/widgets/shared/text_fields/app-textfield-custom.dart | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index b9951f8e..cfb6263b 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -440,7 +440,7 @@ class _PrescriptionFormWidgetState extends State { height: MediaQuery.of(context) .size .height * - 0.075, + 0.0749, width: double.infinity, child: Row( children: [ @@ -454,6 +454,7 @@ class _PrescriptionFormWidgetState extends State { .width * 0.35, child: AppTextFieldCustom( + isPrscription: true, inputFormatters: [ LengthLimitingTextInputFormatter( 5), @@ -464,6 +465,7 @@ class _PrescriptionFormWidgetState extends State { TranslationBase.of( context) .strength, + // fontWeight: FontWeight.w500, // fontSize: 14.0, // borderWidth: 0.2, diff --git a/lib/widgets/shared/text_fields/app-textfield-custom.dart b/lib/widgets/shared/text_fields/app-textfield-custom.dart index e00ffc7b..ded2568d 100644 --- a/lib/widgets/shared/text_fields/app-textfield-custom.dart +++ b/lib/widgets/shared/text_fields/app-textfield-custom.dart @@ -25,6 +25,7 @@ class AppTextFieldCustom extends StatefulWidget { final List inputFormatters; final Function(String) onChanged; final String validationError; + final bool isPrscription; AppTextFieldCustom({ this.height = 0, @@ -43,6 +44,7 @@ class AppTextFieldCustom extends StatefulWidget { this.inputFormatters, this.onChanged, this.validationError, + this.isPrscription = false, }); @override @@ -89,7 +91,9 @@ class _AppTextFieldCustomState extends State { AppText( widget.hintText, color: Color(0xFF2E303A), - fontSize: SizeConfig.textMultiplier * 1.4, + fontSize: widget.isPrscription == false + ? SizeConfig.textMultiplier * 1.3 + : 0, fontWeight: FontWeight.w700, ), widget.dropDownText == null