Refactor code structure for improved readability and maintainability
@@ -779,7 +779,18 @@
|
|||||||
"execution_count": null,
|
"execution_count": null,
|
||||||
"id": "fe3b7605",
|
"id": "fe3b7605",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"text/plain": [
|
||||||
|
"4"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"execution_count": 2,
|
||||||
|
"metadata": {},
|
||||||
|
"output_type": "execute_result"
|
||||||
|
}
|
||||||
|
],
|
||||||
"source": []
|
"source": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -38,8 +38,12 @@ page_4_context = {
|
|||||||
|
|
||||||
|
|
||||||
page_5_context = {
|
page_5_context = {
|
||||||
"metabolism_chart": "",
|
"metabolism_chart": image_to_base64(
|
||||||
"fuel_source_chart": "",
|
"/home/oluwasanmi/Documents/Work/MKD/report_generation/graphs/metabolism_chart.png"
|
||||||
|
),
|
||||||
|
"fuel_source_chart": image_to_base64(
|
||||||
|
"/home/oluwasanmi/Documents/Work/MKD/report_generation/graphs/fuel_source_chart.png"
|
||||||
|
),
|
||||||
"resting_calories": 1540,
|
"resting_calories": 1540,
|
||||||
"neat_calories": 310,
|
"neat_calories": 310,
|
||||||
"weight_loss_calories": 1725,
|
"weight_loss_calories": 1725,
|
||||||
@@ -194,7 +198,12 @@ page_11_context = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
page_12_context = {
|
page_12_context = {
|
||||||
|
"right_leg": image_to_base64(
|
||||||
|
"/home/oluwasanmi/Documents/Work/MKD/report_generation/graphs/right_leg.png"
|
||||||
|
),
|
||||||
|
"left_leg": image_to_base64(
|
||||||
|
"/home/oluwasanmi/Documents/Work/MKD/report_generation/graphs/left_leg.png"
|
||||||
|
),
|
||||||
}
|
}
|
||||||
|
|
||||||
page_13_context = {
|
page_13_context = {
|
||||||
|
|||||||
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 175 KiB |
|
After Width: | Height: | Size: 59 KiB |
|
After Width: | Height: | Size: 183 KiB |
|
Before Width: | Height: | Size: 138 KiB After Width: | Height: | Size: 110 KiB |
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 103 KiB |
@@ -6,7 +6,12 @@ from context import context_list
|
|||||||
env = Environment(loader=FileSystemLoader("report_gen"))
|
env = Environment(loader=FileSystemLoader("report_gen"))
|
||||||
|
|
||||||
html_pages = []
|
html_pages = []
|
||||||
|
a = 1
|
||||||
|
b = "string"
|
||||||
|
c = [1,2,3,5]
|
||||||
|
d = {
|
||||||
|
"key": "value"
|
||||||
|
}
|
||||||
header_context = {
|
header_context = {
|
||||||
"patient_name": "Keirstyn Moran",
|
"patient_name": "Keirstyn Moran",
|
||||||
"age": 34,
|
"age": 34,
|
||||||
@@ -122,3 +127,4 @@ html_string_to_pdf(html_doc, "multi_page_report.pdf")
|
|||||||
# pdfkit.from_string(html_doc, "truth_report.pdf", options=options)
|
# pdfkit.from_string(html_doc, "truth_report.pdf", options=options)
|
||||||
|
|
||||||
print("✅ PDF generated: multi_page_report.pdf")
|
print("✅ PDF generated: multi_page_report.pdf")
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<div class="flex gap-8">
|
<div class="flex gap-8">
|
||||||
<!-- Chart Image -->
|
<!-- Chart Image -->
|
||||||
<div class="flex-1">
|
<div class="flex-1">
|
||||||
<img src="right-leg-chart.png" alt="Right Leg SMO2 Chart" class="w-full h-auto">
|
<img src= "data:image/png;base64,{{ right_leg }}" alt="Right Leg SMO2 Chart" class="w-full h-auto">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Right Side Info -->
|
<!-- Right Side Info -->
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
<div class="flex gap-8">
|
<div class="flex gap-8">
|
||||||
<!-- Chart Image -->
|
<!-- Chart Image -->
|
||||||
<div class="flex-1">
|
<div class="flex-1">
|
||||||
<img src="left-leg-chart.png" alt="Left Leg SMO2 Chart" class="w-full h-auto">
|
<img src= "data:image/png;base64,{{ left_leg }}" alt="Left Leg SMO2 Chart" class="w-full h-auto">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Right Side Info -->
|
<!-- Right Side Info -->
|
||||||
|
|||||||