diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 08adc616..5304cc8f 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -307,6 +307,7 @@ "vitalSignObese": "بدين", "vitalSignOverweight": "زيادة الوزن", "vitalSignUnderweight": "نقص الوزن", + "vitalSignSkinny": "نحيف جداً", "myMedical": "نشط", "myMedicalSubtitle": "الأدوية", "myDoctor": "أطبائي", diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 18484fc1..febd8632 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -306,6 +306,7 @@ "vitalSignObese": "Obese", "vitalSignOverweight": "Overweight", "vitalSignUnderweight": "Underweight", + "vitalSignSkinny": "Underweight", "myMedical": "Active", "myMedicalSubtitle": "Medications", "myDoctor": "My Doctors", diff --git a/lib/core/api/api_client.dart b/lib/core/api/api_client.dart index 374ac9d1..30ea3eba 100644 --- a/lib/core/api/api_client.dart +++ b/lib/core/api/api_client.dart @@ -198,9 +198,9 @@ class ApiClientImp implements ApiClient { url = "https://hmgwebservices.com/Services/NHIC.svc/REST/GetPatientInfo"; body['TokenID'] = "@dm!n"; } - - // body['TokenID'] = "@dm!n"; - // body['PatientID'] = 1018977; + // + body['TokenID'] = "@dm!n"; + body['PatientID'] = 1018977; // body['PatientTypeID'] = 1; // body['PatientOutSA'] = 0; // body['SessionID'] = "45786230487560q"; diff --git a/lib/features/hmg_services/models/ui_models/vital_sign_ui_model.dart b/lib/features/hmg_services/models/ui_models/vital_sign_ui_model.dart index ea0782bd..6fb24066 100644 --- a/lib/features/hmg_services/models/ui_models/vital_sign_ui_model.dart +++ b/lib/features/hmg_services/models/ui_models/vital_sign_ui_model.dart @@ -11,6 +11,7 @@ enum VitalSignStatus { obese, overweight, underweight, + skinny, } /// UI-only helper model for Vital Sign cards. @@ -34,8 +35,9 @@ class VitalSignUiModel { /// /// Rules: /// - Height is always blue. - /// - High, Obese, Overweight => red scheme. - /// - Low, Underweight => yellow scheme. + /// - High, Obese => red scheme. + /// - Overweight => orange scheme. + /// - Low, Underweight, Skinny => yellow scheme. /// - Otherwise => green scheme (Normal). static VitalSignUiModel scheme({required VitalSignStatus? status, required String label}) { final l = label.toLowerCase(); @@ -50,10 +52,8 @@ class VitalSignUiModel { ); } - // High, Obese, Overweight => red scheme (health concerns) - if (status == VitalSignStatus.high || - status == VitalSignStatus.obese || - status == VitalSignStatus.overweight) { + // High, Obese => red scheme (health concerns) + if (status == VitalSignStatus.high || status == VitalSignStatus.obese) { return VitalSignUiModel( iconBg: AppColors.chipSecondaryLightRedColor, iconFg: AppColors.primaryRedColor, @@ -62,8 +62,20 @@ class VitalSignUiModel { ); } - // Low, Underweight => yellow scheme (warning) - if (status == VitalSignStatus.low || status == VitalSignStatus.underweight) { + // Overweight => orange scheme (warning) + if (status == VitalSignStatus.overweight) { + return VitalSignUiModel( + iconBg: AppColors.warningColorYellow.withValues(alpha: 0.12), + iconFg: AppColors.warningColorYellow, + chipBg: AppColors.warningColorYellow.withValues(alpha: 0.12), + chipFg: AppColors.warningColorYellow, + ); + } + + // Low, Underweight, Skinny => yellow scheme (warning) + if (status == VitalSignStatus.low || + status == VitalSignStatus.underweight || + status == VitalSignStatus.skinny) { final Color yellowBg = AppColors.highAndLow.withValues(alpha: 0.12); return VitalSignUiModel( iconBg: yellowBg, @@ -98,6 +110,8 @@ class VitalSignUiModel { return LocaleKeys.vitalSignOverweight.tr(); case VitalSignStatus.underweight: return LocaleKeys.vitalSignUnderweight.tr(); + case VitalSignStatus.skinny: + return LocaleKeys.vitalSignSkinny.tr(); } } @@ -131,22 +145,30 @@ class VitalSignUiModel { return null; } - // BMI >= 25 (Overweight or Obese) => High - if (bmiResult >= 25) { - return VitalSignStatus.high; + // BMI >= 30 (Obese) => Red + if (bmiResult >= 30) { + return VitalSignStatus.obese; + } + // BMI >= 25 (Overweight) => Orange + else if (bmiResult >= 25) { + return VitalSignStatus.overweight; } - // BMI >= 18.5 and < 25 => Normal + // BMI >= 18.5 (Normal) => Green else if (bmiResult >= 18.5) { return VitalSignStatus.normal; } - // BMI < 18.5 (Underweight) => Low + // BMI >= 16 (Underweight) => Yellow + else if (bmiResult >= 16) { + return VitalSignStatus.underweight; + } + // BMI < 16 (Skinny/Severely underweight) => Yellow else { - return VitalSignStatus.low; + return VitalSignStatus.skinny; } } /// Weight status based on BMI with detailed classification - /// Returns: Obese, Overweight, Normal, Underweight + /// Returns: Obese, Overweight, Normal, Underweight, Skinny static VitalSignStatus? weightStatus(dynamic bmi) { // Return null if BMI is not available or is 0 final double bmiResult = double.tryParse(bmi.toString()) ?? 0; @@ -155,15 +177,26 @@ class VitalSignUiModel { return null; } + // BMI >= 30 (Obese) => Red if (bmiResult >= 30) { return VitalSignStatus.obese; - } else if (bmiResult >= 25) { + } + // BMI >= 25 (Overweight) => Orange + else if (bmiResult >= 25) { return VitalSignStatus.overweight; - } else if (bmiResult >= 18.5) { + } + // BMI >= 18.5 (Normal) => Green + else if (bmiResult >= 18.5) { return VitalSignStatus.normal; - } else { + } + // BMI >= 16 (Underweight) => Yellow + else if (bmiResult >= 16) { return VitalSignStatus.underweight; } + // BMI < 16 (Skinny/Severely underweight) => Yellow + else { + return VitalSignStatus.skinny; + } } } diff --git a/lib/features/insurance/insurance_view_model.dart b/lib/features/insurance/insurance_view_model.dart index 28210d39..621ebe4c 100644 --- a/lib/features/insurance/insurance_view_model.dart +++ b/lib/features/insurance/insurance_view_model.dart @@ -191,6 +191,7 @@ class InsuranceViewModel extends ChangeNotifier { notifyListeners(); }, (apiResponse) { + patientInsuranceApprovalsList =[]; if (apiResponse.messageStatus == 2) { // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); } else if (apiResponse.messageStatus == 1) { diff --git a/lib/features/my_invoices/my_invoices_view_model.dart b/lib/features/my_invoices/my_invoices_view_model.dart index cd18026c..631efd5b 100644 --- a/lib/features/my_invoices/my_invoices_view_model.dart +++ b/lib/features/my_invoices/my_invoices_view_model.dart @@ -52,6 +52,8 @@ class MyInvoicesViewModel extends ChangeNotifier { notifyListeners(); }, (apiResponse) { + _originalInvoicesList =[]; + allInvoicesList =[]; if (apiResponse.messageStatus == 2) { // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); } else if (apiResponse.messageStatus == 1) { diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index 17950a46..7287071a 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -322,6 +322,7 @@ class CodegenLoader extends AssetLoader{ "vitalSignObese": "بدين", "vitalSignOverweight": "زيادة الوزن", "vitalSignUnderweight": "نقص الوزن", + "vitalSignSkinny": "نحيف جداً", "myMedical": "نشط", "myMedicalSubtitle": "الأدوية", "myDoctor": "أطبائي", @@ -2034,6 +2035,7 @@ static const Map _en_US = { "vitalSignObese": "Obese", "vitalSignOverweight": "Overweight", "vitalSignUnderweight": "Underweight", + "vitalSignSkinny": "Underweight", "myMedical": "Active", "myMedicalSubtitle": "Medications", "myDoctor": "My Doctors", diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 1bd8019d..c2cac71e 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -308,6 +308,7 @@ abstract class LocaleKeys { static const vitalSignObese = 'vitalSignObese'; static const vitalSignOverweight = 'vitalSignOverweight'; static const vitalSignUnderweight = 'vitalSignUnderweight'; + static const vitalSignSkinny = 'vitalSignSkinny'; static const myMedical = 'myMedical'; static const myMedicalSubtitle = 'myMedicalSubtitle'; static const myDoctor = 'myDoctor'; diff --git a/lib/presentation/vital_sign/vital_sign_page.dart b/lib/presentation/vital_sign/vital_sign_page.dart index f712aa77..255ba606 100644 --- a/lib/presentation/vital_sign/vital_sign_page.dart +++ b/lib/presentation/vital_sign/vital_sign_page.dart @@ -236,7 +236,9 @@ class _VitalSignPageState extends State { fit: StackFit.expand, children: [ Image.asset( - AppAssets.bmiFullBody, + getIt.get().getAuthenticatedUser()?.gender == 1 + ? AppAssets.fullBodyFrontMale + : AppAssets.fullBodyFrontFemale, fit: BoxFit.cover, alignment: Alignment.topCenter, ),