Refactor code structure for improved readability and maintainability

This commit is contained in:
bolade
2025-11-26 11:23:04 +01:00
parent 47e6e69eb7
commit 100b47e947
12 changed files with 1335 additions and 641 deletions
+10 -2
View File
@@ -1297,6 +1297,8 @@ class ContextGenerator:
# Page 9
contexts["page_9"] = {
"client_name": self.patient_info["name"],
"assessment_date": datetime.now().strftime("%B %d %Y"),
"fat_max_value": f"{pnoe_metrics['fat_max_value']:.2f}",
"fat_max_hr": f"{int(pnoe_metrics['fat_max_hr'])}",
"fuel_utilization_chart": graphs.get("fuel_utilization", ""),
@@ -1410,10 +1412,16 @@ class ContextGenerator:
# Pages 14-18 (previously 13-17)
for i in range(1, 6):
contexts[f"page_{i + 13}"] = {
page_num = i + 13
contexts[f"page_{page_num}"] = {
"patient_name": self.patient_info["name"],
"page_number": i + 13,
"page_number": page_num,
}
# Add next_testing_date to page 16
if page_num == 16:
contexts["page_16"]["next_testing_date"] = self.patient_info.get(
"next_testing_date", "Contact us for scheduling"
)
# Page 19 - Glossary with Body Fat Percentage Master Chart (previously page 18)
contexts["page_19"] = {