From 13c879654b353f377ee75dda50a495f9c149c0e6 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 26 Jan 2021 10:35:23 +0200 Subject: [PATCH 1/7] DA-250: fix age --- lib/screens/patients/patients_screen.dart | 6 +++--- lib/util/date-utils.dart | 18 +++++++++++++++++ .../profile/patient_profile_widget.dart | 20 ++----------------- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 4fcabf07..1a55153e 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -17,6 +17,7 @@ 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/translations_delegate_base.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'; @@ -615,9 +616,8 @@ class _PatientsScreenState extends State { .white, ), AppText( - item - .age - .toString(), + " ${DateUtils.getAgeByBirthday(item.dateofBirth)}", + fontSize: 1.8 * SizeConfig .textMultiplier, diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index c414cd51..bfa406c6 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -216,5 +216,23 @@ class DateUtils { return 12; } } + + static String getAgeByBirthday(dynamic birthday){ + // https://leechy.dev/calculate-dates-diff-in-dart + DateTime birthDate = DateUtils.getDateTimeFromServerFormat(birthday); + final now = DateTime.now(); + int years = now.year - birthDate .year; + int months = now.month - birthDate.month; + int days = now.day - birthDate.day; + if (months < 0 || (months == 0 && days < 0)) { + years--; + months += (days < 0 ? 11 : 12); + } + if (days < 0) { + final monthAgo = new DateTime(now.year, now.month - 1, birthDate.day); + days = now.difference(monthAgo).inDays + 1; + } + return "$years Yr $months Mnth $days Day"; + } } diff --git a/lib/widgets/patients/profile/patient_profile_widget.dart b/lib/widgets/patients/profile/patient_profile_widget.dart index 225decf4..b8fcf89c 100644 --- a/lib/widgets/patients/profile/patient_profile_widget.dart +++ b/lib/widgets/patients/profile/patient_profile_widget.dart @@ -18,23 +18,7 @@ import './profile_medical_info_widget.dart'; class PatientProfileWidget extends StatelessWidget { PatiantInformtion patient; - String getPatientAge(dynamic birthday){ - // https://leechy.dev/calculate-dates-diff-in-dart - DateTime birthDate = DateUtils.getDateTimeFromServerFormat(birthday); - final now = DateTime.now(); - int years = now.year - birthDate .year; - int months = now.month - birthDate.month; - int days = now.day - birthDate.day; - if (months < 0 || (months == 0 && days < 0)) { - years--; - months += (days < 0 ? 11 : 12); - } - if (days < 0) { - final monthAgo = new DateTime(now.year, now.month - 1, birthDate.day); - days = now.difference(monthAgo).inDays + 1; - } - return "$years Yr $months Mnth $days Day"; - } + @override Widget build(BuildContext context) { @@ -133,7 +117,7 @@ class PatientProfileWidget extends StatelessWidget { height: 4, ), AppText( - "${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${getPatientAge(patient.dateofBirth)/*patient.age*/}", + "${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${DateUtils.getAgeByBirthday(patient.dateofBirth)/*patient.age*/}", fontWeight: FontWeight.normal, fontSize: 1.6 * SizeConfig.textMultiplier, ), From b9eaee188727fe31a69e15e8d429fa73d6080683 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 26 Jan 2021 10:46:14 +0200 Subject: [PATCH 2/7] fix design --- .../profile/patient_orders_screen.dart | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/lib/screens/patients/profile/patient_orders_screen.dart b/lib/screens/patients/profile/patient_orders_screen.dart index 09834d50..d193b6ef 100644 --- a/lib/screens/patients/profile/patient_orders_screen.dart +++ b/lib/screens/patients/profile/patient_orders_screen.dart @@ -128,18 +128,24 @@ class _PatientsOrdersState extends State { ), ), children: [ - Divider( - color: Colors.black, - height: 20, - thickness: 1, - indent: 0, - endIndent: 0, - ), - AppText( - notesList[index]["Notes"], - margin: 5, - ) - ], + Divider( + color: Colors.black, + height: 20, + thickness: 1, + indent: 0, + endIndent: 0, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + notesList[index]["Notes"], + margin: 5, + ), + ], + ) + ], ), ], )); From 905818b5322c51c0fd2af2dfc7f7bfa37479c199 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 26 Jan 2021 12:44:06 +0200 Subject: [PATCH 3/7] add admission no to orders --- lib/screens/patients/profile/patient_orders_screen.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/screens/patients/profile/patient_orders_screen.dart b/lib/screens/patients/profile/patient_orders_screen.dart index d193b6ef..a7182546 100644 --- a/lib/screens/patients/profile/patient_orders_screen.dart +++ b/lib/screens/patients/profile/patient_orders_screen.dart @@ -117,6 +117,12 @@ class _PatientsOrdersState extends State { marginBottom: 5, fontWeight: FontWeight.bold, ), + AppText( + notesList[index] + ["AdmissionNo"], + marginLeft: 10, + color: Colors.grey[600], + ), AppText( convertDateFormat( notesList[index] From 913ffc30523db97ca18c3c87630113025b976231 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 26 Jan 2021 15:44:22 +0200 Subject: [PATCH 4/7] Fix DA-260,DA-267 --- ios/Runner/GoogleService-Info.plist | 36 +++++++++++++++++++ lib/config/localized_values.dart | 2 +- .../soap_update/update_assessment_page.dart | 6 ++++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 ios/Runner/GoogleService-Info.plist diff --git a/ios/Runner/GoogleService-Info.plist b/ios/Runner/GoogleService-Info.plist new file mode 100644 index 00000000..0c093a2a --- /dev/null +++ b/ios/Runner/GoogleService-Info.plist @@ -0,0 +1,36 @@ + + + + + CLIENT_ID + 864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r.apps.googleusercontent.com + REVERSED_CLIENT_ID + com.googleusercontent.apps.864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r + API_KEY + AIzaSyA_6ayGCk4fly7o7eTVBrj9kuHBYHMAOfs + GCM_SENDER_ID + 864393916058 + PLIST_VERSION + 1 + BUNDLE_ID + com.cloud.diplomaticquarterapp + PROJECT_ID + diplomaticquarter-d2385 + STORAGE_BUCKET + diplomaticquarter-d2385.appspot.com + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:864393916058:ios:13f787bbfe6051f8b97923 + DATABASE_URL + https://diplomaticquarter-d2385.firebaseio.com + + \ No newline at end of file diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ad82f0eb..1a62467c 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -215,7 +215,7 @@ const Map> localizedValues = { 'en': 'Please fill all fields..!', 'ar': 'الرجاء ملأ جميع الحقول..!' }, - 'replay2': {'en': 'Replay', 'ar': 'رد الطبيب'}, + 'replay2': {'en': 'Reply', 'ar': 'رد الطبيب'}, 'logout': {'en': 'Logout', 'ar': 'تسجيل خروج'}, 'pharmaciesList': {'en': 'Pharmacies List', 'ar': 'قائمة الصيدليات'}, 'price': {'en': 'Price', 'ar': 'السعر'}, diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index e6e1a908..bafa5af4 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -309,6 +309,12 @@ class _UpdateAssessmentPageState extends State { SizedBox( height: 6, ), + AppText( + TranslationBase.of(context).remarks, + fontWeight: FontWeight + .bold, + fontSize: 16, + ), Container( width: MediaQuery .of(context) From d7c3024baf4a86ed80c9c140dc63356b3ccaa706 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 26 Jan 2021 15:44:55 +0200 Subject: [PATCH 5/7] remove GoogleService-Info.plist --- ios/Runner/GoogleService-Info.plist | 36 ----------------------------- 1 file changed, 36 deletions(-) delete mode 100644 ios/Runner/GoogleService-Info.plist diff --git a/ios/Runner/GoogleService-Info.plist b/ios/Runner/GoogleService-Info.plist deleted file mode 100644 index 0c093a2a..00000000 --- a/ios/Runner/GoogleService-Info.plist +++ /dev/null @@ -1,36 +0,0 @@ - - - - - CLIENT_ID - 864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r.apps.googleusercontent.com - REVERSED_CLIENT_ID - com.googleusercontent.apps.864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r - API_KEY - AIzaSyA_6ayGCk4fly7o7eTVBrj9kuHBYHMAOfs - GCM_SENDER_ID - 864393916058 - PLIST_VERSION - 1 - BUNDLE_ID - com.cloud.diplomaticquarterapp - PROJECT_ID - diplomaticquarter-d2385 - STORAGE_BUCKET - diplomaticquarter-d2385.appspot.com - IS_ADS_ENABLED - - IS_ANALYTICS_ENABLED - - IS_APPINVITE_ENABLED - - IS_GCM_ENABLED - - IS_SIGNIN_ENABLED - - GOOGLE_APP_ID - 1:864393916058:ios:13f787bbfe6051f8b97923 - DATABASE_URL - https://diplomaticquarter-d2385.firebaseio.com - - \ No newline at end of file From c065dbbdb3b115f7f46850dd3166c09e7762e226 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 26 Jan 2021 16:07:16 +0200 Subject: [PATCH 6/7] Fixed DA:266 --- lib/config/localized_values.dart | 4 ++ lib/util/translations_delegate_base.dart | 2 + .../soap_update/update_assessment_page.dart | 56 +++++++++++++++---- 3 files changed, 50 insertions(+), 12 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 1a62467c..a9498b2a 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -666,4 +666,8 @@ const Map> localizedValues = { 'en': "You have to add chief complaint fields correctly .", 'ar': "يجب عليك إضافة حقول شكوى الرئيس بشكل صحيح" }, + 'ICDName': { + 'en': "ICDName", + 'ar': "اسم ال ICD" + }, }; diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 2c3be5b1..c3c40e36 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1036,6 +1036,8 @@ class TranslationBase { String get chiefComplaintErrorMsg => localizedValues['chiefComplaintErrorMsg'][locale.languageCode]; +String get ICDName => + localizedValues['ICDName'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index bafa5af4..61bf27f3 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -210,7 +210,7 @@ class _UpdateAssessmentPageState extends State { assessment.createdOn !=null?DateTime.parse(assessment.createdOn).day.toString():DateTime.now().day.toString(), fontWeight: FontWeight .bold, - fontSize: 16, + fontSize: 13, ), AppText( Helpers.getMonth(assessment.createdOn !=null?DateTime.parse(assessment.createdOn).month:DateTime.now().month).toUpperCase(), @@ -225,6 +225,32 @@ class _UpdateAssessmentPageState extends State { crossAxisAlignment: CrossAxisAlignment .start, children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).ICDName +" : ", + fontWeight: FontWeight + .bold, + fontSize: 13, + ), + Container( + width: MediaQuery + .of(context) + .size + .width * 0.29, + child: AppText( + assessment + .selectedICD.description + .toString(), + fontSize: 10, + color: Colors.grey, + ), + ), + ], + ), Row( mainAxisAlignment: MainAxisAlignment.start, @@ -233,7 +259,7 @@ class _UpdateAssessmentPageState extends State { TranslationBase.of(context).appointmentNo, fontWeight: FontWeight .bold, - fontSize: 16, + fontSize: 13, ), AppText( assessment @@ -248,15 +274,21 @@ class _UpdateAssessmentPageState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ + AppText( + TranslationBase.of(context).condition + " : ", + fontWeight: FontWeight + .bold, + fontSize: 13, + ), AppText( projectViewModel.isArabic?assessment .selectedDiagnosisCondition .nameAr : assessment .selectedDiagnosisCondition .nameEn, - fontWeight: FontWeight - .bold, - fontSize: 16, + fontSize: 10, + color: Colors.grey, + ), ], ), @@ -268,7 +300,7 @@ class _UpdateAssessmentPageState extends State { TranslationBase.of(context).dType+' : ', fontWeight: FontWeight .bold, - fontSize: 16, + fontSize: 13, ), AppText( projectViewModel.isArabic?assessment @@ -290,7 +322,7 @@ class _UpdateAssessmentPageState extends State { TranslationBase.of(context).doc, fontWeight: FontWeight .bold, - fontSize: 16, + fontSize: 13, ), AppText( assessment.doctorName??'', @@ -310,16 +342,16 @@ class _UpdateAssessmentPageState extends State { height: 6, ), AppText( - TranslationBase.of(context).remarks, + TranslationBase.of(context).remarks + " : ", fontWeight: FontWeight .bold, - fontSize: 16, + fontSize: 13, ), Container( width: MediaQuery .of(context) .size - .width * 0.5, + .width * 0.38, child: AppText( assessment.remark ?? "", fontSize: 10, @@ -341,7 +373,7 @@ class _UpdateAssessmentPageState extends State { "ICD : ".toUpperCase(), fontWeight: FontWeight .bold, - fontSize: 16, + fontSize: 13, ), Container( child: AppText( @@ -526,7 +558,7 @@ class _AddAssessmentDetailsState extends State { AppText( TranslationBase.of(context).addAssessmentDetails.toUpperCase(), fontWeight: FontWeight.bold, - fontSize: 16, + fontSize: 13, ), SizedBox( height: 16, From fd17fc46082dbbd60d799ef81deb2bfe844931e7 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 26 Jan 2021 16:22:06 +0200 Subject: [PATCH 7/7] enforce user to add date in case referral --- lib/screens/patients/patient_search_screen.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 726e5050..39f7fe65 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -76,7 +76,9 @@ class _PatientSearchScreenState extends State { if ((_patientSearchFormValues.From == "0" || _patientSearchFormValues.To == "0") && - _selectedType == "7") { + _selectedType == "7" || ((_patientSearchFormValues.From == "0" || + _patientSearchFormValues.To == "0") && + _selectedType == "6") ) { // helpers.showErrorToast("Please Choose The Dates"); } else { setState(() {