From f77d4fac66b2e6bc4e58fda44f664ec59628bc8c Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 12 Aug 2020 08:24:41 +0300 Subject: [PATCH] insurance translation --- lib/config/config.dart | 15 +- lib/config/localized_values.dart | 19 ++ lib/core/service/insurance_service.dart | 2 +- .../insurance/insurance_approval_screen.dart | 235 ++++++++++-------- .../insurance/insurance_card_screen.dart | 24 +- lib/uitl/translations_delegate_base.dart | 22 ++ 6 files changed, 191 insertions(+), 126 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 100a493e..a7cb621b 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -13,26 +13,27 @@ const GET_MY_DOCTOR = '/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; const GET_DOCTOR_PROFILE = '/Doctors.svc/REST/GetDocProfiles'; const GET_DOCTOR_RATING = '/Doctors.svc/REST/dr_GetAvgDoctorRating'; - ///Prescriptions const PRESCRIPTIONS = '/Patients.svc/REST/GetPrescriptionApptList'; const GET_PRESCRIPTIONS_ALL_ORDERS = '/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; const GET_PRESCRIPTION_REPORT = '/Patients.svc/REST/INP_GetPrescriptionReport'; const SEND_PRESCRIPTION_EMAIL = '/Notifications.svc/REST/SendPrescriptionEmail'; -const GET_PRESCRIPTION_REPORT_ENH = '/Patients.svc/REST/GetPrescriptionReport_enh'; +const GET_PRESCRIPTION_REPORT_ENH = + '/Patients.svc/REST/GetPrescriptionReport_enh'; ///Lab Order const GET_Patient_LAB_ORDERS = '/Patients.svc/REST/GetPatientLabOrders'; -const GET_Patient_LAB_SPECIAL_RESULT = '/Patients.svc/REST/GetPatientLabSpecialResults'; +const GET_Patient_LAB_SPECIAL_RESULT = + '/Patients.svc/REST/GetPatientLabSpecialResults'; /// const GET_PATIENT_ORDERS = '/Patients.svc/REST/GetPatientRadOrders'; -const GET_PATIENT_ORDERS_DETAILS = '/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead'; +const GET_PATIENT_ORDERS_DETAILS = + '/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead'; const GET_RAD_IMAGE_URL = '/Patients.svc/Rest/GetRadImageURL'; const SEND_RAD_REPORT_EMAIL = '/Notifications.svc/REST/SendRadReportEmail'; - ///Feedback const SEND_FEEDBACK = '/COCWS.svc/REST/InsertCOCItemInSPList'; const GET_STATUS_FOR_COCO = '/COCWS.svc/REST/GetStatusforCOC'; @@ -54,7 +55,7 @@ const SETUP_ID = '91877'; const LANGUAGE = 1; const PATIENT_OUT_SA = 0; const SESSION_ID = 'TMRhVmkGhOsvamErw'; -const IS_DENTAL_ALLOWED_BACKEND = false; +const IS_DENTAL_ALLOWED_BACKEND = false; const PATIENT_TYPE = 1; const PATIENT_TYPE_ID = 1; @@ -88,5 +89,3 @@ class AppGlobal { return request; } } - - diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 69356729..01647ebc 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -161,4 +161,23 @@ const Map> localizedValues = { "recieved-requests": {"en": "Recieved Requests", "ar": "الطلبات المستلمة"}, "manage-files": {"en": "Manage Family Files", "ar": "إدارة ملفات العائلة"}, // "my-family": {"en": "MY FAMILY", "ar": "عائلتي"}, + "approvals": {"en": "Approvals", "ar": "موفقات التأمين"}, + "approvalNo": {"en": "Approval No.: ", "ar": "رقم الموافقة: "}, + "companyName": {"en": "Company Name ", "ar": "اسم الشركة: "}, + "receiptOn": {"en": "Receipt on: ", "ar": "تاريخ الفاتورة: "}, + "expiryDate": {"en": "Expiry Date: ", "ar": "تاريخ الانتهاء: "}, + "procedureName": {"en": "Procedure Name", "ar": "اسم الاجراء"}, + "procedureStatus": {"en": "Procedure Status: ", "ar": "حالة الاجراء"}, + "usageStatus": {"en": "Usage Status", "ar": "جالة الاستخدام"}, + "unusedCount": {"en": "Unused Count: ", "ar": "غير مستخدم: "}, + "totalApproval": { + "en": "Total approval unused", + "ar": "اجمالي الموافقات الغير مستخدمة" + }, + "category": {"en": "Category: ", "ar": "الفئة"}, + "expirationDate": {"en": "Expiration Date: ", "ar": "تاريخ الانتهاء"}, + "patientCard": {"en": "Patient Card ID: ", "ar": "رقم الاشتراك"}, + "policyNumber": {"en": "Policy Number: ", "ar": "رقم بوليصة التاميت:"}, + "seeDetails": {"en": "SEE DETAILS", "ar": "منافعك التامينية"}, + "insuranceCards": {"en": "Insurance Cards", "ar": "بطاقات التأمين"}, }; diff --git a/lib/core/service/insurance_service.dart b/lib/core/service/insurance_service.dart index 9550507a..6f0d2142 100644 --- a/lib/core/service/insurance_service.dart +++ b/lib/core/service/insurance_service.dart @@ -54,7 +54,7 @@ class InsuranceCardService extends BaseService { InsuranceApprovalModel _insuranceApprovalModel = InsuranceApprovalModel( versionID: 5.5, channel: 3, - languageID: 2, + languageID: LANGUAGE_ID, iPAdress: "10.20.10.20", generalid: "Cs2020@2016\$2958", patientOutSA: 0, diff --git a/lib/pages/insurance/insurance_approval_screen.dart b/lib/pages/insurance/insurance_approval_screen.dart index 4bcd7ac9..041adb82 100644 --- a/lib/pages/insurance/insurance_approval_screen.dart +++ b/lib/pages/insurance/insurance_approval_screen.dart @@ -6,6 +6,7 @@ import '../base/base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; class InsuranceApproval extends StatefulWidget { @override @@ -21,7 +22,7 @@ class _InsuranceApprovalState extends State { AppScaffold( isShowAppBar: true, baseViewModel: model, - appBarTitle: 'Approvals', + appBarTitle: TranslationBase.of(context).approvals, body: SingleChildScrollView( child: Container( margin: EdgeInsets.only( @@ -39,10 +40,10 @@ class _InsuranceApprovalState extends State { mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Text( - 'Total approval unused', + TranslationBase.of(context).totalApproval, style: TextStyle( color: Color(0xff60688B), - fontSize: 19.5, + fontSize: 19.0, fontWeight: FontWeight.w600, ), ), @@ -72,7 +73,7 @@ class _InsuranceApprovalState extends State { children: [ ExpansionTile( title: Container( - height: 85.0, + height: 120.0, child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -141,7 +142,7 @@ class _InsuranceApprovalState extends State { model.insuranceApproval[index] .doctorName, style: TextStyle( - fontSize: 15.0, + fontSize: 17.0, fontStyle: FontStyle.italic), ), ], @@ -156,7 +157,8 @@ class _InsuranceApprovalState extends State { CrossAxisAlignment.start, children: [ Text( - 'Approval No.: ' + + TranslationBase.of(context) + .approvalNo + model.insuranceApproval[index] .approvalNo .toString(), @@ -171,7 +173,8 @@ class _InsuranceApprovalState extends State { thickness: 1.0, ), Text( - 'Procedure Status: ' + + TranslationBase.of(context) + .procedureStatus + model.insuranceApproval[index] .approvalStatusDescption, style: TextStyle( @@ -184,7 +187,8 @@ class _InsuranceApprovalState extends State { thickness: 1.0, ), Text( - 'Unused Count: ' + + TranslationBase.of(context) + .unusedCount + model.insuranceApproval[index] .unUsedCount .toString(), @@ -210,7 +214,8 @@ class _InsuranceApprovalState extends State { // fontWeight: FontWeight.w600), // ), Text( - 'Company Name', + TranslationBase.of(context) + .companyName, style: TextStyle( fontWeight: FontWeight.w600, fontSize: 17.5, @@ -223,7 +228,8 @@ class _InsuranceApprovalState extends State { thickness: 1.0, ), Text( - 'Receipt on: ' + + TranslationBase.of(context) + .receiptOn + convertDateFormat(model .insuranceApproval[index] .rceiptOn), @@ -238,7 +244,8 @@ class _InsuranceApprovalState extends State { thickness: 1.0, ), Text( - 'expiryDate: ' + + TranslationBase.of(context) + .expiryDate + convertDateFormat(model .insuranceApproval[index] .expiryDate), @@ -252,107 +259,123 @@ class _InsuranceApprovalState extends State { height: 55.0, thickness: 1.2, ), - Row( - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - Expanded( - flex: 1, - child: Column( - children: [ - Text('Procedure Name '), - Padding( - padding: EdgeInsets.only( - top: SizeConfig - .heightMultiplier * - 3.0), - child: Text( - model - .insuranceApproval[ - index] - .approvalDetails == - null - ? '' - : model - .insuranceApproval[ - index] - .approvalDetails - .procedureName, - style: TextStyle( - fontWeight: - FontWeight.w600, - fontSize: 15.5), + IntrinsicHeight( + child: Row( + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Expanded( + flex: 1, + child: Column( + children: [ + Text(TranslationBase.of( + context) + .procedureName), + Padding( + padding: EdgeInsets.only( + top: SizeConfig + .heightMultiplier * + 3.0), + child: Text( + model + .insuranceApproval[ + index] + .approvalDetails == + null + ? '' + : model + .insuranceApproval[ + index] + .approvalDetails + .procedureName, + style: TextStyle( + fontWeight: + FontWeight.w600, + fontSize: 15.5), + ), ), - ), - ], + ], + ), ), - ), - VerticalDivider( - width: 10.0, - ), - Expanded( - flex: 1, - child: Column( - children: [ - Text('Procedure Status '), - Padding( - padding: EdgeInsets.only( - top: SizeConfig - .heightMultiplier * - 3.0), - child: Text( - model - .insuranceApproval[ - index] - .approvalDetails == - null - ? '' - : model - .insuranceApproval[ - index] - .approvalDetails - .status, - style: TextStyle( - fontSize: 17.5, - fontWeight: - FontWeight.w600), + VerticalDivider( + width: 10.0, + thickness: 1.2, + color: Colors.black, + ), + Expanded( + flex: 1, + child: Column( + children: [ + Text(TranslationBase.of( + context) + .procedureStatus), + Padding( + padding: EdgeInsets.only( + top: SizeConfig + .heightMultiplier * + 3.0), + child: Text( + model + .insuranceApproval[ + index] + .approvalDetails == + null + ? '' + : model + .insuranceApproval[ + index] + .approvalDetails + .status, + style: TextStyle( + fontSize: 17.5, + fontWeight: + FontWeight + .w600), + ), ), - ), - ], + ], + ), ), - ), - Expanded( - flex: 1, - child: Column( - children: [ - Text('Usage Status '), - Padding( - padding: EdgeInsets.only( - top: SizeConfig - .heightMultiplier * - 3.0), - child: Text( - model - .insuranceApproval[ - index] - .approvalDetails == - null - ? '' - : model - .insuranceApproval[ - index] - .approvalDetails - .isInvoicedDesc, - style: TextStyle( - fontWeight: - FontWeight.w600, - fontSize: 17.5), + VerticalDivider( + width: 2.3, + thickness: 1.2, + color: Colors.black, + ), + Expanded( + flex: 1, + child: Column( + children: [ + Text(TranslationBase.of( + context) + .usageStatus), + Padding( + padding: EdgeInsets.only( + top: SizeConfig + .heightMultiplier * + 3.0), + child: Text( + model + .insuranceApproval[ + index] + .approvalDetails == + null + ? '' + : model + .insuranceApproval[ + index] + .approvalDetails + .isInvoicedDesc, + style: TextStyle( + fontWeight: + FontWeight.w600, + fontSize: 17.5), + ), ), - ), - ], + ], + ), ), - ), - ], + ], + ), ), Divider( color: Colors.black, diff --git a/lib/pages/insurance/insurance_card_screen.dart b/lib/pages/insurance/insurance_card_screen.dart index f1082ec6..282538c2 100644 --- a/lib/pages/insurance/insurance_card_screen.dart +++ b/lib/pages/insurance/insurance_card_screen.dart @@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/core/model/insurance/insurance_card.dart'; import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; class InsuranceCard extends StatefulWidget { @override @@ -24,7 +25,7 @@ class _InsuranceCardState extends State { AppScaffold( isShowAppBar: true, baseViewModel: model, - appBarTitle: 'Insurance Cards', + appBarTitle: TranslationBase.of(context).insuranceCards, body: Container( margin: EdgeInsets.only( left: SizeConfig.screenWidth * 0.004, @@ -60,7 +61,7 @@ class _InsuranceCardState extends State { thickness: 0.5, ), Texts( - 'Company Name: ' + + TranslationBase.of(context).companyName + model.insurance[index].companyName, fontSize: 20.0, ), @@ -73,23 +74,23 @@ class _InsuranceCardState extends State { crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Text( - 'Category: ' + + TranslationBase.of(context).category + model.insurance[index].subCategoryDesc, style: TextStyle(fontSize: 18.5), ), Text( - 'Expiration Date: ' + + TranslationBase.of(context).expirationDate + convertDateFormat( model.insurance[index].cardValidTo), style: TextStyle(fontSize: 18.5), ), Text( - 'Patient Card ID : ' + + TranslationBase.of(context).patientCard + model.insurance[index].patientCardID, style: TextStyle(fontSize: 18.5), ), Text( - 'Policy Number : ' + + TranslationBase.of(context).policyNumber + model .insurance[index].insurancePolicyNumber, style: TextStyle(fontSize: 18.5), @@ -114,12 +115,13 @@ class _InsuranceCardState extends State { SizedBox( height: 14.5, ), - Container( - child: Button( - label: 'SEE DETAILS', + if (model.insurance[index].isActive == true) + Container( + child: Button( + label: TranslationBase.of(context).seeDetails, + ), + width: 400.0, ), - width: 400.0, - ), ], ), ], diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 71d1699f..0e3c95b2 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -194,6 +194,28 @@ class TranslationBase { String get family => localizedValues['family'][locale.languageCode]; String get myFamilyFiles => localizedValues['family-title'][locale.languageCode]; + String get approvals => localizedValues['approvals'][locale.languageCode]; + String get approvalNo => localizedValues['approvalNo'][locale.languageCode]; + String get companyName => localizedValues['companyName'][locale.languageCode]; + String get receiptOn => localizedValues['receiptOn'][locale.languageCode]; + String get expiryDate => localizedValues['expiryDate'][locale.languageCode]; + String get procedureName => + localizedValues['procedureName'][locale.languageCode]; + String get procedureStatus => + localizedValues['procedureStatus'][locale.languageCode]; + String get usageStatus => localizedValues['usageStatus'][locale.languageCode]; + String get unusedCount => localizedValues['unusedCount'][locale.languageCode]; + String get totalApproval => + localizedValues['totalApproval'][locale.languageCode]; + String get category => localizedValues['category'][locale.languageCode]; + String get expirationDate => + localizedValues['expirationDate'][locale.languageCode]; + String get patientCard => localizedValues['patientCard'][locale.languageCode]; + String get policyNumber => + localizedValues['policyNumber'][locale.languageCode]; + String get seeDetails => localizedValues['seeDetails'][locale.languageCode]; + String get insuranceCards => + localizedValues['insuranceCards'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate {