From f6983c138a78033619bc25cb66ff7c3c78f2b606 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 22 Dec 2020 13:33:01 +0200 Subject: [PATCH 1/2] fix issues --- lib/config/config.dart | 2 +- lib/config/localized_values.dart | 5 +- .../medical/my_balance_view_model.dart | 2 - .../insurance_card_update_details.dart | 4 +- .../insurance/insurance_update_screen.dart | 137 ++++++++++++------ .../medical/reports/report_home_page.dart | 1 + lib/uitl/translations_delegate_base.dart | 1 + lib/widgets/others/not_auh_page.dart | 2 +- 8 files changed, 98 insertions(+), 56 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 62eacd03..f42d73c1 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -248,7 +248,7 @@ const UPDATE_HEALTH_TERMS = const CHANNEL = 3; const GENERAL_ID = 'Cs2020@2016\$2958'; const IP_ADDRESS = '10.20.10.20'; -const VERSION_ID = 5.6; +const VERSION_ID = 5.8; const SETUP_ID = '91877'; const LANGUAGE = 2; const PATIENT_OUT_SA = 0; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 4b9c33dd..e354f5da 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1279,6 +1279,9 @@ const Map localizedValues = { "en": "You can still submit, if you don't have Insurance Image", "ar": "لا يزال بإمكانك الإرسال ، إذا لم يكن لديك صورة تأمين" }, - + "info-insur-cards": { + "en": "This service allows you to view all the insurance cards that recorded during your visits to Al Habib Medical Group in addition to:", + "ar": "خدمة بطاقات التامين: هذه الخدمة تمكنك من الاطلاع على جميع بطاقات التامين والتي تم تسجيلها اثناء زياراتك لمجموعة الحبيب الطبية بالاضافة الى:" + }, }; diff --git a/lib/core/viewModels/medical/my_balance_view_model.dart b/lib/core/viewModels/medical/my_balance_view_model.dart index 34244ee1..f9554d94 100644 --- a/lib/core/viewModels/medical/my_balance_view_model.dart +++ b/lib/core/viewModels/medical/my_balance_view_model.dart @@ -88,8 +88,6 @@ class MyBalanceViewModel extends BaseViewModel { Future getBlood() async { setState(ViewState.Busy); await _bloodDetailsService.getAllBloodOrders(); - ; - if (_bloodDetailsService.hasError) { error = _bloodDetailsService.error; setState(ViewState.Error); diff --git a/lib/pages/insurance/insurance_card_update_details.dart b/lib/pages/insurance/insurance_card_update_details.dart index a471fea2..ec367e9f 100644 --- a/lib/pages/insurance/insurance_card_update_details.dart +++ b/lib/pages/insurance/insurance_card_update_details.dart @@ -35,9 +35,7 @@ class InsuranceCardUpdateDetails extends StatelessWidget { AppScaffold( isShowAppBar: true, isShowDecPage: false, - appBarTitle: TranslationBase - .of(context) - .cardDetail, + appBarTitle: TranslationBase.of(context).cardDetail, body: SingleChildScrollView( child: Column( children: [ diff --git a/lib/pages/insurance/insurance_update_screen.dart b/lib/pages/insurance/insurance_update_screen.dart index 8fe82efe..d07569b7 100644 --- a/lib/pages/insurance/insurance_update_screen.dart +++ b/lib/pages/insurance/insurance_update_screen.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/service/insurance_service.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_details.dart'; @@ -25,11 +26,13 @@ class _InsuranceUpdateState extends State with SingleTickerProviderStateMixin { TabController _tabController; InsuranceCardService _insuranceCardService = locator(); - + List imagesInfo = List(); @override void initState() { super.initState(); _tabController = TabController(length: 2, vsync: this); + + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/ar/0.png')); } void dispose() { @@ -43,6 +46,9 @@ class _InsuranceUpdateState extends State builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold( appBarTitle: TranslationBase.of(context).insurCards, + description: TranslationBase.of(context).infoInsurCards, + infoList: TranslationBase.of(context).infoPrescriptionsPoints, + imagesInfo: imagesInfo, isShowAppBar: true, isShowDecPage: true, baseViewModel: model, @@ -107,7 +113,8 @@ class _InsuranceUpdateState extends State children: [ Container( child: model.getAllSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList!=null ?? + .getAllSharedRecordsByStatusList != + null ?? false ? ListView.builder( itemCount: model.getAllSharedRecordsByStatusResponse @@ -202,11 +209,23 @@ class _InsuranceUpdateState extends State onTap: () { getDetails( projectID: 15, - patientIdentificationID: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientIdenficationNumber, - setupID: '010266', - patientID: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].responseID, - name: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientName - ); + patientIdentificationID: model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index] + .patientIdenficationNumber, + setupID: + '010266', + patientID: model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index] + .responseID, + name: model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index] + .patientName); }, ), ), @@ -238,41 +257,45 @@ class _InsuranceUpdateState extends State CrossAxisAlignment.start, mainAxisSize: MainAxisSize.max, children: [ - if(model.user!=null) - Expanded( - flex: 3, - child: Container( - margin: EdgeInsets.only( - top: 2.0, - left: 10.0, - right: 20.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - model.user.firstName??'' + " " + model.user.lastName??'', - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.w500, - ), - SizedBox( - height: 8, - ), - Texts( - TranslationBase.of(context) - .fileno + - ": " + - model.user.patientID - .toString(), - fontSize: 14, - color: Colors.black, - fontWeight: FontWeight.w500, - ) - ], + if (model.user != null) + Expanded( + flex: 3, + child: Container( + margin: EdgeInsets.only( + top: 2.0, + left: 10.0, + right: 20.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + model.user.firstName ?? + '' + + " " + + model.user.lastName ?? + '', + fontSize: 14, + color: Colors.black, + fontWeight: FontWeight.w500, + ), + SizedBox( + height: 8, + ), + Texts( + TranslationBase.of(context) + .fileno + + ": " + + model.user.patientID + .toString(), + fontSize: 14, + color: Colors.black, + fontWeight: FontWeight.w500, + ) + ], + ), ), ), - ), Expanded( flex: 2, child: Container( @@ -290,11 +313,16 @@ class _InsuranceUpdateState extends State getDetails( setupID: '010266', projectID: 15, - patientIdentificationID: model.user.patientIdentificationNo, - patientID: model.user.patientID, - name: model.user.firstName + " " + model.user.lastName - - ); + patientIdentificationID: + model.user + .patientIdentificationNo, + patientID: model + .user.patientID, + name: model.user + .firstName + + " " + + model + .user.lastName); }, ), ), @@ -425,7 +453,12 @@ class _InsuranceUpdateState extends State ); } - getDetails({String setupID, int projectID, String patientIdentificationID,int patientID,String name}) { + getDetails( + {String setupID, + int projectID, + String patientIdentificationID, + int patientID, + String name}) { GifLoaderDialogUtils.showMyDialog(context); _insuranceCardService .getPatientInsuranceDetails( @@ -436,8 +469,16 @@ class _InsuranceUpdateState extends State .then((value) { GifLoaderDialogUtils.hideDialog(context); if (_insuranceCardService.insuranceCardDetails != null) { - Navigator.push(context, - FadePage(page: InsuranceCardUpdateDetails(insuranceCardDetailsModel: _insuranceCardService.insuranceCardDetails,patientID: patientID,patientIdentificationID: patientIdentificationID,name: name,))); + Navigator.push( + context, + FadePage( + page: InsuranceCardUpdateDetails( + insuranceCardDetailsModel: + _insuranceCardService.insuranceCardDetails, + patientID: patientID, + patientIdentificationID: patientIdentificationID, + name: name, + ))); } else { AppToast.showErrorToast(message: _insuranceCardService.error); } diff --git a/lib/pages/medical/reports/report_home_page.dart b/lib/pages/medical/reports/report_home_page.dart index a6d241c2..1e360760 100644 --- a/lib/pages/medical/reports/report_home_page.dart +++ b/lib/pages/medical/reports/report_home_page.dart @@ -57,6 +57,7 @@ class _HomeReportPageState extends State builder: (_, model, widget) => AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).newMedReport, + title: TranslationBase.of(context).medReport, description: TranslationBase.of(context).infoMonthReport, baseViewModel: model, imagesInfo: imagesInfo, diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index ade3128e..5a5ecb2e 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1064,6 +1064,7 @@ class TranslationBase { String get disagree => localizedValues['disagree'][locale.languageCode]; String get requestSent => localizedValues['request-sent'][locale.languageCode]; String get attachInsuraceImage => localizedValues['attach-insurace-image'][locale.languageCode]; + String get infoInsurCards => localizedValues['info-insur-cards'][locale.languageCode]; } diff --git a/lib/widgets/others/not_auh_page.dart b/lib/widgets/others/not_auh_page.dart index 56df1c21..0dbbee43 100644 --- a/lib/widgets/others/not_auh_page.dart +++ b/lib/widgets/others/not_auh_page.dart @@ -73,7 +73,7 @@ class _NotAutPageState extends State { width: 40, height: 40, decoration: BoxDecoration( - borderRadius: BorderRadius.circular(15), + borderRadius: BorderRadius.circular(20), color: Theme.of(context).primaryColor), child: Center( child: Texts('${index+1}',color: Colors.white,), From 4d8f42b517f15ecb0d7f74541d544c0942f8b13b Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 22 Dec 2020 14:25:41 +0200 Subject: [PATCH 2/2] fix issues vital sign issue --- lib/config/localized_values.dart | 2 +- lib/core/service/client/base_app_client.dart | 3 +- lib/core/viewModels/dashboard_view_model.dart | 14 +++--- lib/pages/landing/home_page.dart | 1 - .../vital_sign_item_details_screen.dart | 49 ++----------------- .../others/app_expandable_notifier.dart | 17 ++++--- 6 files changed, 25 insertions(+), 61 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index e354f5da..7c8ce344 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -305,7 +305,7 @@ const Map localizedValues = { "recieved-requests": {"en": "Recieved Requests", "ar": "الطلبات المستلمة"}, "manage-files": {"en": "Manage Family Files", "ar": "إدارة ملفات العائلة"}, 'oxygenation': {'en': 'Oxygenation', 'ar': 'الأوكسجين'}, - 'bodyMeasurements': {'en': 'body Mass', 'ar': 'قياسات الجسم'}, + 'bodyMeasurements': {'en': 'body Mass Index', 'ar': 'مؤشر الكتلة'}, 'temperature': {'en': 'Temperature', 'ar': 'درجة الحرارة'}, 'pulse': {'en': 'Pulse', 'ar': 'النبض'}, 'respiration': {'en': 'Respiration', 'ar': 'التنفس'}, diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 54ba6963..130e4af6 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -133,12 +133,11 @@ class BaseAppClient { parsed['SMSLoginRequired'] == true) { onSuccess(parsed, statusCode); } - else if(parsed['MessageStatus'] == 2){ + else if(parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']){ onFailure( parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); } - else if (!parsed['IsAuthenticated']) { await logout(); diff --git a/lib/core/viewModels/dashboard_view_model.dart b/lib/core/viewModels/dashboard_view_model.dart index 8dad8b82..4f261c65 100644 --- a/lib/core/viewModels/dashboard_view_model.dart +++ b/lib/core/viewModels/dashboard_view_model.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import '../../locator.dart'; class DashboardViewModel extends BaseViewModel { @@ -11,21 +12,22 @@ class DashboardViewModel extends BaseViewModel { String get weightKg => _vitalSignService.weightKg; String get heightCm => _vitalSignService.heightCm; - String booldType=""; + String booldType = "-"; + // ToDoCountProviderModel toDoProvider = // Provider.of(AppGlobal.context); getPatientRadOrders() async { - booldType = await sharedPref.getString(BLOOD_TYPE); if (isLogin && _vitalSignService.weightKg.isEmpty) { - setState(ViewState.Busy); + setState(ViewState.Busy); await _vitalSignService.getPatientRadOrders(); if (_vitalSignService.hasError) { error = _vitalSignService.error; - setState(ViewState.Error); - } else + setState(ViewState.ErrorLocal); + } else { + booldType = await sharedPref.getString(BLOOD_TYPE) ?? "-"; setState(ViewState.Idle); - bloadType = await sharedPref.getString(BLOOD_TYPE) ?? "-"; + } } } diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index f220c3e0..03c803b7 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -54,7 +54,6 @@ class _HomePageState extends State { return BaseView( onModelReady: (model) => model.getPatientRadOrders(), builder: (_, model, wi) => AppScaffold( - isShowDecPage: false, body: Container( width: double.infinity, diff --git a/lib/pages/medical/vital_sign/vital_sign_item_details_screen.dart b/lib/pages/medical/vital_sign/vital_sign_item_details_screen.dart index 0c786f2e..6db865b6 100644 --- a/lib/pages/medical/vital_sign/vital_sign_item_details_screen.dart +++ b/lib/pages/medical/vital_sign/vital_sign_item_details_screen.dart @@ -23,53 +23,14 @@ class VitalSignItemDetailsScreen extends StatelessWidget { case VitalSignDetails.BodyMeasurements: VSchart = [ { - 'name': 'Height', - 'nameAr': 'الطول', + 'name': 'BMI', + 'nameAr': 'مؤشر الكتلة', 'title1': 'Date', - 'title2': 'Cm', - 'title2Ar': 'سم', - 'viewKey': 'HeightCm', - }, - { - 'name': 'Weight Kg', - 'nameAr': 'الوزن كجم', - 'title1': 'Date', - 'title2': 'Kg', - 'title2Ar': 'كجم', - 'viewKey': 'WeightKg', - }, - { - 'name': 'BMI ', - 'nameAr': 'مؤشر كتلة الجسم', - 'title1': 'Date', - 'title2': 'BodyMass', - 'title2Ar': 'كتلة الجسم', + 'title2': 'BMI', + 'title2Ar': 'الكتلة', 'viewKey': 'BodyMassIndex', }, - { - 'name': 'Head Circum Cm', - 'nameAr': 'محيط رأس سم', - 'title1': 'Date', - 'title2': 'Cm', - 'title2Ar': 'سم', - 'viewKey': 'HeadCircumCm', - }, - { - 'name': 'Ideal Body Weight (Lbs)', - 'nameAr': 'وزن الجسم المثالي (رطل)', - 'title1': 'Date', - 'title2': 'Ideal Weight', - 'title2Ar': 'الوزن المثالي', - 'viewKey': 'IdealBodyWeightLbs', - }, - { - 'name': 'Lean Body WeightLbs (Lbs)', - 'nameAr': 'رطل وزن الجسم النحيل (رطل)', - 'title1': 'Date', - 'title2': 'Lean Weight', - 'title2Ar': 'وزن خفيف', - 'viewKey': 'LeanBodyWeightLbs', - } + ]; break; diff --git a/lib/widgets/others/app_expandable_notifier.dart b/lib/widgets/others/app_expandable_notifier.dart index eb422a63..98997ec5 100644 --- a/lib/widgets/others/app_expandable_notifier.dart +++ b/lib/widgets/others/app_expandable_notifier.dart @@ -27,14 +27,21 @@ class AppExpandableNotifier extends StatefulWidget { } class _AppExpandableNotifier extends State { + @override - Widget build(BuildContext context) { + void initState() { setState(() { - if (widget.isExpand == true) { + if (widget.isExpand) { widget.expandFlag = widget.isExpand; widget.controller.expanded = true; } }); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return ExpandableNotifier( child: Padding( padding: const EdgeInsets.only(left: 10, right: 10, top: 4), @@ -90,11 +97,7 @@ class _AppExpandableNotifier extends State { onPressed: () { setState(() { widget.expandFlag = !widget.expandFlag; - if (widget.expandFlag == true) { - widget.controller.expanded = true; - } else { - widget.controller.expanded = false; - } + widget.controller.expanded = widget.expandFlag; }); }), ]),