Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -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"] = {
|
||||
|
||||
Reference in New Issue
Block a user