Add header and footer templates for report generation

- Created a footer template with contact information and page number.
- Created a header template displaying patient details including name, age, height, weight, and focus.
This commit is contained in:
bolade
2025-09-26 21:42:02 +01:00
parent 1ae1ec2369
commit 894fbbcee3
40 changed files with 805 additions and 1838 deletions
+33 -97
View File
@@ -23,21 +23,9 @@ page_2_context = {
page_3_context = {
"patient_name": "Keirstyn Moran",
"age": "34",
"height": "5'4\"",
"weight": "123lbs",
"focus": "Endurance",
"fat_mass": "27.6lbs",
"fat_percentage": "22.4%",
"lean_mass": "95.4lbs",
"lean_percentage": "77.6%",
"body_fat_percent": "22.4%",
"age_range": "20-39",
"gender": "F",
"contact_email": "info@ishplabs.com",
"website": "www.ishplabs.com",
"social": "@ishplabs",
"page_number": "4",
}
page_4_context = {
"body_composition_chart": image_to_base64(
"/home/oluwasanmi/Documents/Work/MKD/report_generation/graphs/page_1_body_composition.png"
),
@@ -46,13 +34,17 @@ page_3_context = {
),
}
page_4_context = {
"patient_name": "Keirstyn Moran",
}
page_5_context = {
"patient_name": "Keirstyn Moran",
"metabolism_chart": "",
"fuel_source_chart": "",
"resting_calories": 1540,
"neat_calories": 310,
"weight_loss_calories": 1725,
"weight_loss_rate": "1lb/week",
"total_calories": 3575,
}
page_6_context = {
"patient_name": "Keirstyn Moran",
"age": "34",
@@ -77,39 +69,22 @@ page_6_context = {
"protein_percentage": "28%",
"carbs_percentage": "36%",
"fats_percentage": "36%",
"contact_email": "info@ishplabs.com",
"website": "www.ishplabs.com",
"social": "@ishplabs",
"page_number": "6",
}
page_7_context = {
"patient_name": "Keirstyn Moran",
"age": "34",
"height": "5'4\"",
"weight": "123lbs",
"focus": "Endurance",
"fvc_value": "4.24L → 112.0%",
"fev1_value": "3.26L → 103.3%",
"fev1_fvc_ratio": "76.89% → 91.8%",
"indication": "No Respiratory Capacity Limitation",
"peak_vt_value": "2.38L/Breath which occurs at 172bpm (Zone 3)",
"peak_vt_percentage": "73% of FEV1",
"contact_email": "info@ishplabs.com",
"website": "www.ishplabs.com",
"social": "@ishplabs",
"page_number": "7",
"respiratory_graph": image_to_base64(
"peak_vt": 3.2,
"peak_vt_bpm": 198,
"peak_vt_zone": 3,
"fev1_percentage": 85,
"lung_analysis_chart": "",
"respiratory_analysis_chart": image_to_base64(
"/home/oluwasanmi/Documents/Work/MKD/report_generation/graphs/respiratory.png"
),
}
page_8_context = {
"patient_name": "Keirstyn Moran",
"age": "34",
"height": "5'4\"",
"weight": "123lbs",
"focus": "Endurance",
"vo2_max_value": "49.5",
"vo2_max_percentile": "100th percentile",
"age_range": "30-39",
@@ -164,35 +139,15 @@ page_8_context = {
"zone3_breath_range": "Ideal Range: 25-30 breaths",
"zone4_breath_range": "Ideal Range: 30-35 breaths",
"zone5_breath_range": "Ideal Range: 40+ breaths",
"contact_email": "info@ishplabs.com",
"website": "www.ishplabs.com",
"social": "@ishplabs",
"page_number": "8",
}
page_9_context = {
"patient_name": "Keirstyn Moran",
"age": "34",
"height": "5'4\"",
"weight": "123lbs",
"focus": "Endurance",
"fuel_utilization_chart": image_to_base64(
"/home/oluwasanmi/Documents/Work/MKD/report_generation/graphs/fuel_utilization_chart.png"
),
"client_name": "Keirstyn Moran",
"assessment_date": "July 29 2025",
"contact_email": "info@ishplabs.com",
"website": "www.ishplabs.com",
"social": "@ishplabs",
"page_number": "9",
}
page_10_context = {
"patient_name": "Keirstyn Moran",
"age": "34",
"height": "5'4\"",
"weight": "123lbs",
"focus": "Endurance",
"vo2_pulse_drop_bpm": "180 bpm",
"vo2_pulse_drop_zone": "Zone 4",
"vo2_pulse_chart": image_to_base64(
@@ -203,18 +158,9 @@ page_10_context = {
"vo2_breath_chart": image_to_base64(
"/home/oluwasanmi/Documents/Work/MKD/report_generation/graphs/vo2_breath_chart.png"
),
"contact_email": "info@ishplabs.com",
"website": "www.ishplabs.com",
"social": "@ishplabs",
"page_number": "10",
}
page_11_context = {
"patient_name": "Keirstyn Moran",
"age": "34",
"height": "5'4\"",
"weight": "123lbs",
"focus": "Endurance",
"fat_max_optimal": "*Optimal 10-12Kcals/minute",
"fat_max_value": "3.8Kcals/min",
"fat_max_heart_rate": "49% of Max Heart Rate",
@@ -243,18 +189,10 @@ page_11_context = {
"hr_good": "62-65bpm",
"hr_excellent": "55-61bpm",
"hr_athlete": "44-54bpm",
"contact_email": "info@ishplabs.com",
"website": "www.ishplabs.com",
"social": "@ishplabs",
"page_number": "11",
}
page_12_context = {
"patient_name": "Keirstyn Moran",
"contact_email": "info@ishplabs.com",
"website": "www.ishplabs.com",
"social": "@ishplabs",
"page_number": "12",
}
page_13_context = {
@@ -369,11 +307,9 @@ page_17_context = {
}
page_18_context = {
"patient_name": "Keirstyn Moran",
"contact_email": "info@ishplabs.com",
"website": "www.ishplabs.com",
"social": "@ishplabs",
"page_number": "18",
"body_fat_percentage_chart": image_to_base64(
"/home/oluwasanmi/Documents/Work/MKD/report_generation/graphs/body_fat_percentage_chart.png"
),
}
page_19_context = {
@@ -388,18 +324,18 @@ context_list = [
page_1_context,
page_2_context,
page_3_context,
# page_4_context,
# page_5_context,
# page_6_context,
# page_7_context,
# page_8_context,
# page_9_context,
# page_10_context,
# page_11_context,
# page_12_context,
# page_13_context,
# page_14_context,
# page_15_context,
page_4_context,
page_5_context,
page_6_context,
page_7_context,
page_8_context,
page_9_context,
page_10_context,
page_11_context,
page_12_context,
page_13_context,
page_14_context,
page_15_context,
page_16_context,
page_17_context,
page_18_context,