From dffed5df6bb436538010eef683b03fcf10c9380e Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 19 Feb 2026 14:06:27 +0300 Subject: [PATCH] Insurance approvals page fixes --- assets/langs/ar-SA.json | 17 ++-- assets/langs/en-US.json | 3 +- lib/core/api/api_client.dart | 4 +- ...ent_insurance_approval_response_model.dart | 12 ++- lib/features/lab/lab_repo.dart | 2 +- lib/generated/locale_keys.g.dart | 1 + .../hmg_services/services_page.dart | 2 + .../insurance_approval_details_page.dart | 93 +++++++++++++------ 8 files changed, 88 insertions(+), 46 deletions(-) diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 76e10ea..69a3357 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -488,7 +488,7 @@ "services2": "الخدمات", "cantSeeProfile": "لرؤية ملفك الطبي، يرجى تسجيل الدخول أو التسجيل الآن", "loginRegisterNow": "تسجيل الدخول أو التسجيل الآن", - "hmgPharmacy": "صيدلية HMG", + "hmgPharmacy": "صيدلية مجموعة الحبيب الطبية", "ecommerceSolution": "حلول التجارة الإلكترونية", "comprehensive": "شامل", "onlineConsulting": "استشارات عبر الإنترنت", @@ -666,7 +666,7 @@ "findUs": "اعثر علينا", "liveChat": "دردشة مباشرة", "service": "خدمة", - "hmgServiceLabel": "خدمة HMG", + "hmgServiceLabel": "خدمة مجموعة الحبيب الطبية", "healthWeatherIndicators": "مؤشرات الطقس الصحية", "healthTipsBasedOnCurrentWeather": "نصائح صحية بناءً على الطقس الحالي", "moreDetails": "المزيد من التفاصيل", @@ -717,10 +717,10 @@ "bloodDonationInfo": "من خلال هذه الخدمة، يمكنك تسجيل اسمك كمتبرع بالدم ��يث سيتواصل معك بنك الدم في مجموعة الحبيب الطبية في حالة الحاجة إلى فصيلة الدم.", "bloodInstruction": "أدخل المعلومات المطلوبة، من أجل التسجيل في خدمة التبرع بالدم", "viewTerms": "لعرض الشروط والأحكام", - "wantConnectHmgNetwork": "عزيزي العميل، لا يوجد وصول إلى الإنترنت، هل ترغب في الاتصال بشبكة HMG لاستخدام تطبيقنا، تأكد من أنك في نطاق شبكة HMG", - "failedToAccessHmgServices": "متصل بشبكة HMG،\n\nلكن فشل في الوصول إلى خدمات HMG", + "wantConnectHmgNetwork": "عزيزي العميل، لا يوجد وصول إلى الإنترنت، هل ترغب في الاتصال بشبكة مجموعة الحبيب الطبية لاستخدام تطبيقنا، تأكد من أنك في نطاق شبكة مجموعة الحبيب الطبية", + "failedToAccessHmgServices": "متصل بشبكة مجموعة الحبيب الطبية،\n\nلكن فشل في الوصول إلى خدمات مجموعة الحبيب الطبية", "offerAndPackages": "عروض وباقات", - "offerAndPackagesDetails": "تتيح لك هذه الخدمة عرض جميع عروض HMG:", + "offerAndPackagesDetails": "تتيح لك هذه الخدمة عرض جميع عروض مجموعة الحبيب الطبية:", "invoiceNo": "رقم الفاتورة", "invoiceDate": "تاريخ الفاتورة", "specialResult": "نتيجة خاصة", @@ -853,8 +853,8 @@ "onboardingBody1": "ببضع نقرات فقط يمكنك استشارة الطبيب الذي تختاره.", "onboardingHeading2": "الوصول إلى السجل الطبي بين يديك", "onboardingBody2": "تتبع تاريخك الطبي بما في ذلك الفحوصات المخبرية، الوصفات الطبية، التأمين، وغيرها.", - "hmgHospitals": "مستشفيات HMG", - "hmcMedicalClinic": "مراكز HMC الطبية", + "hmgHospitals": "مستشفيات مجموعة الحبيب الطبية", + "hmcMedicalClinic": "مراكز مجموعة الحبيب الطبية", "applyFilter": "تطبيق الفلتر", "facilityAndLocation": "المرفق والموقع", "regionAndLocation": "المنطقة والمواقع", @@ -1581,5 +1581,6 @@ "reschedulingAppo": "إعادة جدولة الموعد، يرجى الانتظار...", "invalidEligibility": "لا يمكنك إجراء الدفع عبر الإنترنت لأنك غير مؤهل لاستخدام الخدمة المقدمة.", "invalidInsurance": "لا يمكنك إجراء الدفع عبر الإنترنت لأنه ليس لديك تأمين صالح.", - "continueCash": "تواصل نقدا" + "continueCash": "تواصل نقدا", + "hmgPolicies": "سياسات مجموعة الحبيب الطبية" } diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index bf73d6d..8910883 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -1572,5 +1572,6 @@ "reschedulingAppo": "Rescheduling Appointment, Please wait...", "invalidEligibility": "You cannot make online payment because you are not eligible to use the provided service.", "invalidInsurance": "You cannot make online payment because you do not have a valid insurance.", - "continueCash": "Continue as cash" + "continueCash": "Continue as cash", + "hmgPolicies": "HMG Policies" } diff --git a/lib/core/api/api_client.dart b/lib/core/api/api_client.dart index 2c41b86..e706a9d 100644 --- a/lib/core/api/api_client.dart +++ b/lib/core/api/api_client.dart @@ -194,8 +194,8 @@ class ApiClientImp implements ApiClient { body['TokenID'] = "@dm!n"; } - // body['TokenID'] = "@dm!n"; - // body['PatientID'] = 4773989; + body['TokenID'] = "@dm!n"; + body['PatientID'] = 4773781; // body['PatientTypeID'] = 1; // body['PatientOutSA'] = 0; // body['SessionID'] = "45786230487560q"; diff --git a/lib/features/insurance/models/resp_models/patient_insurance_approval_response_model.dart b/lib/features/insurance/models/resp_models/patient_insurance_approval_response_model.dart index f272f2d..303b6ed 100644 --- a/lib/features/insurance/models/resp_models/patient_insurance_approval_response_model.dart +++ b/lib/features/insurance/models/resp_models/patient_insurance_approval_response_model.dart @@ -52,7 +52,7 @@ class InsuranceApprovalResponseModel { String? eApprovalRemarks; bool? isEmailSentOnDelayApproval; int? eAuthorizationID; - InsuranceApprovalDetails? apporvalDetails; + List? apporvalDetails = []; String? approvalStatusDescption; String? clinicName; String? clinicNameN; @@ -217,7 +217,9 @@ class InsuranceApprovalResponseModel { isEmailSentOnDelayApproval = json['IsEmailSentOnDelayApproval']; eAuthorizationID = json['EAuthorizationID']; if (json['ApporvalDetails'] != null && json['ApporvalDetails'].length != 0) { - apporvalDetails = InsuranceApprovalDetails.fromJson(json['ApporvalDetails'][0]); + json['ApporvalDetails'].forEach((v) { + apporvalDetails!.add(InsuranceApprovalDetails.fromJson(v)); + }); } approvalStatusDescption = json['ApprovalStatusDescption']; clinicName = json['ClinicName']; @@ -302,9 +304,9 @@ class InsuranceApprovalResponseModel { data['EApprovalRemarks'] = this.eApprovalRemarks; data['IsEmailSentOnDelayApproval'] = this.isEmailSentOnDelayApproval; data['EAuthorizationID'] = this.eAuthorizationID; - if (this.apporvalDetails != null) { - data['ApporvalDetails'] = this.apporvalDetails!.toJson; - } + // if (this.apporvalDetails != null) { + // data['ApporvalDetails'] = this.apporvalDetails!.toJson; + // } data['ApprovalStatusDescption'] = this.approvalStatusDescption; data['ClinicName'] = this.clinicName; data['ClinicNameN'] = this.clinicNameN; diff --git a/lib/features/lab/lab_repo.dart b/lib/features/lab/lab_repo.dart index a4cdcf1..285c732 100644 --- a/lib/features/lab/lab_repo.dart +++ b/lib/features/lab/lab_repo.dart @@ -232,7 +232,7 @@ class LabRepoImp implements LabRepo { "DoctorID": labOrder.doctorID!, "OrderNo": labOrder.orderNo!, "InvoiceType": labOrder.invoiceType!, - "SetupID": labOrder.setupID!, + "SetupID": labOrder.setupID ?? "", "IsDownload": true, 'ClinicName': labOrder.clinicDescription, 'DateofBirth': Utils.appState.getAuthenticatedUser()!.dateofBirth, diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 3940f9e..f546be4 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -1573,5 +1573,6 @@ abstract class LocaleKeys { static const invalidEligibility = 'invalidEligibility'; static const invalidInsurance = 'invalidInsurance'; static const continueCash = 'continueCash'; + static const hmgPolicies = 'hmgPolicies'; } diff --git a/lib/presentation/hmg_services/services_page.dart b/lib/presentation/hmg_services/services_page.dart index f0bf08f..4458b75 100644 --- a/lib/presentation/hmg_services/services_page.dart +++ b/lib/presentation/hmg_services/services_page.dart @@ -692,6 +692,8 @@ class ServicesPage extends StatelessWidget { ) ], ), + SizedBox(height: 24.h), + LocaleKeys.hmgPolicies.tr().toText18(weight: FontWeight.bold), SizedBox(height: 16.h), Row( children: [ diff --git a/lib/presentation/insurance/insurance_approval_details_page.dart b/lib/presentation/insurance/insurance_approval_details_page.dart index a6d8157..a074a8d 100644 --- a/lib/presentation/insurance/insurance_approval_details_page.dart +++ b/lib/presentation/insurance/insurance_approval_details_page.dart @@ -1,5 +1,6 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_staggered_animations/flutter_staggered_animations.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_export.dart'; import 'package:hmg_patient_app_new/core/app_state.dart'; @@ -122,35 +123,69 @@ class InsuranceApprovalDetailsPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ "Approval Details".toText16(isBold: true), - SizedBox(height: 16.h), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - LocaleKeys.procedureName.tr(context: context).toText14(isBold: true), - Expanded( - child: (insuranceApprovalResponseModel.apporvalDetails!.procedureName ?? "") - .toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor, textAlignment: TextAlign.end, maxLine: 2), - ), - ], - ), - SizedBox(height: 8.h), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - "${LocaleKeys.status.tr(context: context)}: ".toText14(isBold: true), - insuranceApprovalResponseModel.apporvalDetails!.status!.toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor), - ], - ), - SizedBox(height: 8.h), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - "${LocaleKeys.usageStatus.tr(context: context)}: ".toText14(isBold: true), - (insuranceApprovalResponseModel.apporvalDetails!.isInvoicedDesc ?? "").toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor), - ], - ), - ], - ) : SizedBox.shrink(), + ListView.separated( + padding: EdgeInsets.only(top: 16.h), + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + itemCount: insuranceApprovalResponseModel.apporvalDetails!.length, + itemBuilder: (context, index) { + return AnimationConfiguration.staggeredList( + position: index, + duration: const Duration(milliseconds: 500), + child: SlideAnimation( + verticalOffset: 100.0, + child: FadeInAnimation( + child: AnimatedContainer( + duration: Duration(milliseconds: 300), + curve: Curves.easeInOut, + decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + LocaleKeys.procedureName.tr(context: context).toText14(isBold: true), + Expanded( + child: (insuranceApprovalResponseModel.apporvalDetails![index]!.procedureName ?? "") + .toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor, textAlignment: TextAlign.end, maxLine: 2), + ), + ], + ), + SizedBox(height: 8.h), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + "${LocaleKeys.status.tr(context: context)}: ".toText14(isBold: true), + insuranceApprovalResponseModel.apporvalDetails![index]!.status!.toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor), + ], + ), + SizedBox(height: 8.h), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + "${LocaleKeys.usageStatus.tr(context: context)}: ".toText14(isBold: true), + (insuranceApprovalResponseModel.apporvalDetails![index]!.isInvoicedDesc ?? "").toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor), + ], + ), + ], + ), + ), + ), + ), + ); + }, + separatorBuilder: (BuildContext cxt, int index) => Column( + children: [ + SizedBox(height: 16.h), + Divider(height: 1, color: AppColors.greyColor), + SizedBox(height: 16.h), + ], + ), + ), + ], + ) + : SizedBox.shrink(), ), ) ],