Vital sign updates

pull/204/head
haroon amjad 21 hours ago
parent db89408185
commit fbb2570d8e

@ -233,7 +233,7 @@ class ApiConsts {
static String getAiOverViewLabOrder = "Services/Patients.svc/REST/HMGAI_Lab_Analyzer_API"; static String getAiOverViewLabOrder = "Services/Patients.svc/REST/HMGAI_Lab_Analyzer_API";
// ************ static values for Api **************** // ************ static values for Api ****************
static final double appVersionID = 20.5; static final double appVersionID = 20.9;
// static final double appVersionID = 50.7; // static final double appVersionID = 50.7;
static final int appChannelId = 3; static final int appChannelId = 3;

@ -48,13 +48,14 @@ class VitalSignUiModel {
); );
} }
if (s.contains('low')) { // Warning for both low and overweight/underweight BMI, since they can indicate potential health issues.
final Color yellowBg = AppColors.warningColor.withValues(alpha: 0.12); if (s.contains('low') || s.contains('underweight') || s.contains('overweight')) {
final Color yellowBg = AppColors.highAndLow.withValues(alpha: 0.12);
return VitalSignUiModel( return VitalSignUiModel(
iconBg: yellowBg, iconBg: yellowBg,
iconFg: AppColors.warningColor, iconFg: AppColors.highAndLow,
chipBg: yellowBg, chipBg: yellowBg,
chipFg: AppColors.warningColor, chipFg: AppColors.highAndLow,
); );
} }
@ -91,12 +92,27 @@ class VitalSignUiModel {
} }
static String bmiStatus(dynamic bmi) { static String bmiStatus(dynamic bmi) {
if (bmi == null) return 'N/A'; String bmiStatus = 'Normal';
final double bmiValue = double.tryParse(bmi.toString()) ?? 0; final double bmiResult = double.tryParse(bmi.toString()) ?? 0;
if (bmiValue < 18.5) return 'Underweight';
if (bmiValue < 25) return 'Normal'; if (bmiResult >= 30) {
if (bmiValue < 30) return 'Overweight'; bmiStatus = "High";
return 'High'; } else if (bmiResult < 30 && bmiResult >= 25) {
bmiStatus = "Overweight";
} else if (bmiResult < 25 && bmiResult >= 18.5) {
bmiStatus = "Normal";
} else if (bmiResult < 18.5) {
bmiStatus = "Underweight";
}
// if (bmi == null) return 'N/A';
// final double bmiValue = double.tryParse(bmi.toString()) ?? 0;
// if (bmiValue < 18.5) return 'Underweight';
// if (bmiValue < 25) return 'Normal';
// if (bmiValue < 30) return 'Overweight';
// return 'High';
return bmiStatus;
} }
} }

@ -1538,6 +1538,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
value: vitalSign.bodyMassIndex?.toString() ?? '--', value: vitalSign.bodyMassIndex?.toString() ?? '--',
unit: '', unit: '',
status: vitalSign.bodyMassIndex != null ? _getBMIStatus(vitalSign.bodyMassIndex) : null, status: vitalSign.bodyMassIndex != null ? _getBMIStatus(vitalSign.bodyMassIndex) : null,
// status: "Overweight",
onTap: onTap, onTap: onTap,
), ),
), ),

@ -69,16 +69,16 @@ class _VitalSignPageState extends State<VitalSignPage> {
: null; : null;
// Debug logging for blood pressure // Debug logging for blood pressure
if (latestVitalSign != null) { // if (latestVitalSign != null) {
print('=== Blood Pressure Debug ==='); // print('=== Blood Pressure Debug ===');
print('bloodPressureHigher: ${latestVitalSign.bloodPressureHigher}'); // print('bloodPressureHigher: ${latestVitalSign.bloodPressureHigher}');
print('bloodPressureLower: ${latestVitalSign.bloodPressureLower}'); // print('bloodPressureLower: ${latestVitalSign.bloodPressureLower}');
print('bloodPressureHigher type: ${latestVitalSign.bloodPressureHigher.runtimeType}'); // print('bloodPressureHigher type: ${latestVitalSign.bloodPressureHigher.runtimeType}');
print('bloodPressureLower type: ${latestVitalSign.bloodPressureLower.runtimeType}'); // print('bloodPressureLower type: ${latestVitalSign.bloodPressureLower.runtimeType}');
print('bloodPressureHigher == 0: ${latestVitalSign.bloodPressureHigher == 0}'); // print('bloodPressureHigher == 0: ${latestVitalSign.bloodPressureHigher == 0}');
print('bloodPressureLower == 0: ${latestVitalSign.bloodPressureLower == 0}'); // print('bloodPressureLower == 0: ${latestVitalSign.bloodPressureLower == 0}');
print('========================'); // print('========================');
} // }
return SingleChildScrollView( return SingleChildScrollView(
child: Column( child: Column(

@ -2,8 +2,8 @@ name: hmg_patient_app_new
description: "New HMG Patient App" description: "New HMG Patient App"
publish_to: 'none' # Remove this line if you wish to publish to pub.dev publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 0.0.15+12 #version: 0.0.15+12
#version: 0.0.1+14 version: 0.0.1+16
environment: environment:
sdk: ">=3.6.0 <4.0.0" sdk: ">=3.6.0 <4.0.0"

Loading…
Cancel
Save