made ui chnages
This commit is contained in:
@@ -177,6 +177,7 @@ async def upload_files(
|
||||
|
||||
# Prepare patient information
|
||||
patient_name = f"{first_name} {last_name}"
|
||||
print(f"DEBUG: Received next_testing_date: '{next_testing_date}'")
|
||||
patient_info = {
|
||||
"patient_name": patient_name,
|
||||
"first_name": first_name,
|
||||
|
||||
+27
-28
@@ -26,16 +26,16 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Metrics Summary Grid -->
|
||||
<div class="grid grid-cols-2 gap-4 mb-4">
|
||||
<!-- Metrics Summary Grid: Left and Right as two side-by-side panels, fields as two columns inside each -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4">
|
||||
<!-- Left Leg Metrics -->
|
||||
<div class="bg-blue-50 p-3 rounded-lg border-l-4 border-blue-300">
|
||||
<div class="bg-blue-50 p-3 rounded-lg border-l-4 border-blue-300 h-full flex flex-col">
|
||||
<h3 class="text-base font-bold text-gray-900 mb-3 text-center">
|
||||
Left Leg Analysis
|
||||
</h3>
|
||||
|
||||
<div class="space-y-2">
|
||||
<div class="bg-white p-2 rounded shadow-sm">
|
||||
<div class="grid grid-cols-2 gap-3">
|
||||
<!-- Baseline SmO2 -->
|
||||
<div class="bg-white p-2 rounded shadow-sm col-span-2 md:col-span-1">
|
||||
<div class="text-xs font-semibold text-gray-700">
|
||||
Baseline SmO₂
|
||||
</div>
|
||||
@@ -43,8 +43,8 @@
|
||||
{{ left_baseline_smo2 | default('75.4%') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-white p-2 rounded shadow-sm">
|
||||
<!-- Minimum SmO2 -->
|
||||
<div class="bg-white p-2 rounded shadow-sm col-span-2 md:col-span-1">
|
||||
<div class="text-xs font-semibold text-gray-700">
|
||||
Minimum SmO₂
|
||||
</div>
|
||||
@@ -55,8 +55,8 @@
|
||||
{{ left_minimum_lap | default('Lap 6') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-white p-2 rounded shadow-sm">
|
||||
<!-- Oxygen Drop -->
|
||||
<div class="bg-white p-2 rounded shadow-sm col-span-2 md:col-span-1">
|
||||
<div class="text-xs font-semibold text-gray-700">
|
||||
Oxygen Drop
|
||||
</div>
|
||||
@@ -67,12 +67,12 @@
|
||||
{{ left_drop_percentage | default('8% decrease') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-white p-2 rounded shadow-sm">
|
||||
<!-- Recovery -->
|
||||
<div class="bg-white p-2 rounded shadow-sm col-span-2 md:col-span-1">
|
||||
<div class="text-xs font-semibold text-gray-700">
|
||||
Recovery
|
||||
</div>
|
||||
<div class="text-xs text-gray-500">"Optimal >100%"</div>
|
||||
<div class="text-xs text-gray-500">Optimal >100%</div>
|
||||
<div class="text-base font-bold text-green-600">
|
||||
{{ left_recovery_percentage | default('109%') }}
|
||||
</div>
|
||||
@@ -81,13 +81,13 @@
|
||||
</div>
|
||||
|
||||
<!-- Right Leg Metrics -->
|
||||
<div class="bg-purple-50 p-3 rounded-lg border-l-4 border-purple-300">
|
||||
<div class="bg-purple-50 p-3 rounded-lg border-l-4 border-purple-300 h-full flex flex-col">
|
||||
<h3 class="text-base font-bold text-gray-900 mb-3 text-center">
|
||||
Right Leg Analysis
|
||||
</h3>
|
||||
|
||||
<div class="space-y-2">
|
||||
<div class="bg-white p-2 rounded shadow-sm">
|
||||
<div class="grid grid-cols-2 gap-3">
|
||||
<!-- Baseline SmO2 -->
|
||||
<div class="bg-white p-2 rounded shadow-sm col-span-2 md:col-span-1">
|
||||
<div class="text-xs font-semibold text-gray-700">
|
||||
Baseline SmO₂
|
||||
</div>
|
||||
@@ -95,8 +95,8 @@
|
||||
{{ right_baseline_smo2 | default('82.9%') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-white p-2 rounded shadow-sm">
|
||||
<!-- Minimum SmO2 -->
|
||||
<div class="bg-white p-2 rounded shadow-sm col-span-2 md:col-span-1">
|
||||
<div class="text-xs font-semibold text-gray-700">
|
||||
Minimum SmO₂
|
||||
</div>
|
||||
@@ -107,8 +107,8 @@
|
||||
{{ right_minimum_lap | default('Lap 6') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-white p-2 rounded shadow-sm">
|
||||
<!-- Oxygen Drop -->
|
||||
<div class="bg-white p-2 rounded shadow-sm col-span-2 md:col-span-1">
|
||||
<div class="text-xs font-semibold text-gray-700">
|
||||
Oxygen Drop
|
||||
</div>
|
||||
@@ -119,12 +119,12 @@
|
||||
{{ right_drop_percentage | default('11% decrease') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-white p-2 rounded shadow-sm">
|
||||
<!-- Recovery -->
|
||||
<div class="bg-white p-2 rounded shadow-sm col-span-2 md:col-span-1">
|
||||
<div class="text-xs font-semibold text-gray-700">
|
||||
Recovery
|
||||
</div>
|
||||
<div class="text-xs text-gray-500">"Optimal >100%"</div>
|
||||
<div class="text-xs text-gray-500">Optimal >100%</div>
|
||||
<div class="text-base font-bold text-blue-600">
|
||||
{{ right_recovery_percentage | default('97%') }}
|
||||
</div>
|
||||
@@ -143,10 +143,9 @@
|
||||
</p>
|
||||
<p>
|
||||
•
|
||||
<strong
|
||||
>{{ recovery_assessment | default('Excellent recovery
|
||||
capacity') }}</strong
|
||||
>
|
||||
<strong>
|
||||
{{ recovery_assessment | default('Excellent recovery capacity') }}
|
||||
</strong>
|
||||
- both legs recovered well
|
||||
</p>
|
||||
<p>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<span class="border-b border-black"
|
||||
>{{ zone2_speed | default('___') }}</span
|
||||
>{{ zone2_speed | default('___') }}</span
|
||||
>
|
||||
mph at {{ zone2_incline | default('2% Incline') }}
|
||||
</li>
|
||||
@@ -54,7 +54,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<span class="border-b border-black"
|
||||
>{{ zone3_speed | default('____') }}</span
|
||||
>{{ zone3_speed | default('___') }}</span
|
||||
>mph + at {{ zone3_incline | default('2% Incline')
|
||||
}}
|
||||
</li>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
class="w-full border-collapse border border-gray-300 text-xs"
|
||||
>
|
||||
<thead>
|
||||
<tr class="bg-cyan-200">
|
||||
<tr class="bg-blue-300">
|
||||
<th
|
||||
class="border border-gray-300 p-1 font-bold text-center"
|
||||
>
|
||||
@@ -238,7 +238,7 @@
|
||||
class="w-full border-collapse border border-gray-300 text-xs"
|
||||
>
|
||||
<thead>
|
||||
<tr class="bg-cyan-200">
|
||||
<tr class="bg-blue-300">
|
||||
<th
|
||||
class="border border-gray-300 p-1 font-bold text-center"
|
||||
>
|
||||
@@ -467,7 +467,7 @@
|
||||
class="w-full border-collapse border border-gray-300 text-xs"
|
||||
>
|
||||
<thead>
|
||||
<tr class="bg-cyan-200">
|
||||
<tr class="bg-blue-300">
|
||||
<th
|
||||
class="border border-gray-300 p-1 font-bold text-center"
|
||||
>
|
||||
@@ -641,7 +641,7 @@
|
||||
class="w-full border-collapse border border-gray-300 text-xs"
|
||||
>
|
||||
<thead>
|
||||
<tr class="bg-cyan-200">
|
||||
<tr class="bg-blue-300">
|
||||
<th
|
||||
class="border border-gray-300 p-1 font-bold text-center"
|
||||
>
|
||||
|
||||
+69
-280
@@ -1,7 +1,5 @@
|
||||
<div class="w-full page bg-white">
|
||||
<!-- Header Section -->
|
||||
<!-- main content -->
|
||||
<div class="px-2 py-6">
|
||||
<div class="px-1 py-6">
|
||||
<!-- Page Title -->
|
||||
<h1 class="text-2xl font-bold text-black mb-6 text-center">
|
||||
Weekly Meal Plan Breakdown
|
||||
@@ -15,131 +13,38 @@
|
||||
|
||||
<!-- Weekly Grid -->
|
||||
<div class="grid grid-cols-7 gap-0 mb-6">
|
||||
<!-- Monday -->
|
||||
<div class="bg-cyan-300 p-2 text-center border border-gray-300">
|
||||
<div class="text-[10px] font-bold text-black mb-1 bg-blue-300">
|
||||
Monday
|
||||
{% set days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] %}
|
||||
{% for i in range(7) %}
|
||||
<div
|
||||
class="border border-gray-300 text-center
|
||||
{% if i == 0 %} rounded-tl-lg rounded-bl-lg {% endif %}
|
||||
{% if i == 6 %} rounded-tr-lg rounded-br-lg {% endif %}
|
||||
{% if i < 5 %} bg-cyan-300 {% else %} bg-white {% endif %}"
|
||||
style="padding: 0"
|
||||
>
|
||||
<!-- Day Row (Always blue) -->
|
||||
<div class="bg-blue-300
|
||||
{% if i == 0 %} rounded-tl-lg {% endif %}
|
||||
{% if i == 6 %} rounded-tr-lg {% endif %}
|
||||
text-black text-sm font-bold px-2 py-1"
|
||||
style="border-top-left-radius: {% if i == 0 %}0.5rem{% else %}0{% endif %}; border-top-right-radius: {% if i == 6 %}0.5rem{% else %}0{% endif %};"
|
||||
>
|
||||
{{ days[i] }}
|
||||
</div>
|
||||
<div class="font-bold text-black mb-1">
|
||||
{{ deficit_calories | default('1725KCals') }}
|
||||
</div>
|
||||
<div class="text-xs text-black leading-tight text-left">
|
||||
<div>
|
||||
{{ deficit_protein | default('120g Protein') }}
|
||||
<!-- Macro Body (fills to the bottom, cyan or white) -->
|
||||
<div class="flex flex-col items-center py-1 px-2">
|
||||
<div class="font-bold text-sm text-black mb-1">
|
||||
{{ deficit_calories | default('1725KCals') }}
|
||||
</div>
|
||||
<div class="text-xs text-black leading-tight text-left">
|
||||
<div>{{ deficit_protein | default('120g Protein') }}</div>
|
||||
<div>{{ deficit_carbs | default('155g Carbs') }}</div>
|
||||
<div>{{ deficit_fat | default('69g Fat') }}</div>
|
||||
<div>{{ deficit_fiber | default('25g Fibre') }}</div>
|
||||
</div>
|
||||
<div>{{ deficit_carbs | default('155g Carbs') }}</div>
|
||||
<div>{{ deficit_fat | default('69g Fat') }}</div>
|
||||
<div>{{ deficit_fiber | default('25g Fibre') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tuesday -->
|
||||
<div class="bg-cyan-300 p-2 text-center border border-gray-300">
|
||||
<div class="text-[10px] font-bold text-black mb-1 bg-blue-300">
|
||||
Tuesday
|
||||
</div>
|
||||
<div class="font-bold text-black mb-1">
|
||||
{{ deficit_calories | default('1725KCals') }}
|
||||
</div>
|
||||
<div class="text-xs text-black leading-tight text-left">
|
||||
<div>
|
||||
{{ deficit_protein | default('120g Protein') }}
|
||||
</div>
|
||||
<div>{{ deficit_carbs | default('155g Carbs') }}</div>
|
||||
<div>{{ deficit_fat | default('69g Fat') }}</div>
|
||||
<div>{{ deficit_fiber | default('25g Fibre') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Wednesday -->
|
||||
<div class="bg-cyan-300 p-2 text-center border border-gray-300">
|
||||
<div class="text-[10px] font-bold text-black mb-1 bg-blue-300">
|
||||
Wednesday
|
||||
</div>
|
||||
<div class="font-bold text-black mb-1">
|
||||
{{ deficit_calories | default('1725KCals') }}
|
||||
</div>
|
||||
<div class="text-xs text-black leading-tight text-left">
|
||||
<div>
|
||||
{{ deficit_protein | default('120g Protein') }}
|
||||
</div>
|
||||
<div>{{ deficit_carbs | default('155g Carbs') }}</div>
|
||||
<div>{{ deficit_fat | default('69g Fat') }}</div>
|
||||
<div>{{ deficit_fiber | default('25g Fibre') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Thursday -->
|
||||
<div class="bg-cyan-300 p-2 text-center border border-gray-300">
|
||||
<div class="text-[10px] font-bold text-black mb-1 bg-blue-300">
|
||||
Thursday
|
||||
</div>
|
||||
<div class="font-bold text-black mb-1">
|
||||
{{ deficit_calories | default('1725KCals') }}
|
||||
</div>
|
||||
<div class="text-xs text-black leading-tight text-left">
|
||||
<div>
|
||||
{{ deficit_protein | default('120g Protein') }}
|
||||
</div>
|
||||
<div>{{ deficit_carbs | default('155g Carbs') }}</div>
|
||||
<div>{{ deficit_fat | default('69g Fat') }}</div>
|
||||
<div>{{ deficit_fiber | default('25g Fibre') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Friday -->
|
||||
<div class="bg-cyan-300 p-2 text-center border border-gray-300">
|
||||
<div class="text-[10px] font-bold text-black mb-1 bg-blue-300">
|
||||
Friday
|
||||
</div>
|
||||
<div class="font-bold text-black mb-1">
|
||||
{{ deficit_calories | default('1725KCals') }}
|
||||
</div>
|
||||
<div class="text-xs text-black leading-tight text-left">
|
||||
<div>
|
||||
{{ deficit_protein | default('120g Protein') }}
|
||||
</div>
|
||||
<div>{{ deficit_carbs | default('155g Carbs') }}</div>
|
||||
<div>{{ deficit_fat | default('69g Fat') }}</div>
|
||||
<div>{{ deficit_fiber | default('25g Fibre') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Saturday -->
|
||||
<div class="bg-white p-2 text-center border border-gray-300">
|
||||
<div class="text-[10px] font-bold text-black mb-1 bg-blue-300">
|
||||
Saturday
|
||||
</div>
|
||||
<div class="font-bold text-black mb-1">
|
||||
{{ deficit_calories | default('1725KCals') }}
|
||||
</div>
|
||||
<div class="text-xs text-black leading-tight text-left">
|
||||
<div>
|
||||
{{ deficit_protein | default('120g Protein') }}
|
||||
</div>
|
||||
<div>{{ deficit_carbs | default('155g Carbs') }}</div>
|
||||
<div>{{ deficit_fat | default('69g Fat') }}</div>
|
||||
<div>{{ deficit_fiber | default('25g Fibre') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Sunday -->
|
||||
<div class="bg-white p-2 text-center border border-gray-300">
|
||||
<div class="text-[10px] font-bold text-black mb-1 bg-blue-300">
|
||||
Sunday
|
||||
</div>
|
||||
<div class="font-bold text-black mb-1">
|
||||
{{ deficit_calories | default('1725KCals') }}
|
||||
</div>
|
||||
<div class="text-xs text-black leading-tight text-left">
|
||||
<div>
|
||||
{{ deficit_protein | default('120g Protein') }}
|
||||
</div>
|
||||
<div>{{ deficit_carbs | default('155g Carbs') }}</div>
|
||||
<div>{{ deficit_fat | default('69g Fat') }}</div>
|
||||
<div>{{ deficit_fiber | default('25g Fibre') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -151,166 +56,50 @@
|
||||
|
||||
<!-- Weekly Grid -->
|
||||
<div class="grid grid-cols-7 gap-0 mb-6">
|
||||
<!-- Monday -->
|
||||
<div class="bg-cyan-300 p-2 text-center border border-gray-300">
|
||||
<div class="text-[10px] font-bold text-black mb-1 bg-blue-300">
|
||||
Monday
|
||||
{% for i in range(7) %}
|
||||
<div class="border border-gray-300 text-center
|
||||
{% if i == 0 %} rounded-tl-lg rounded-bl-lg {% endif %}
|
||||
{% if i == 6 %} rounded-tr-lg rounded-br-lg {% endif %}
|
||||
{% if i < 5 %} bg-cyan-300 {% else %} bg-white {% endif %}"
|
||||
style="padding: 0"
|
||||
>
|
||||
<!-- Day Row (Always blue) -->
|
||||
<div class="bg-blue-300
|
||||
{% if i == 0 %} rounded-tl-lg {% endif %}
|
||||
{% if i == 6 %} rounded-tr-lg {% endif %}
|
||||
text-black text-sm font-bold px-2 py-1"
|
||||
style="border-top-left-radius: {% if i == 0 %}0.5rem{% else %}0{% endif %}; border-top-right-radius: {% if i == 6 %}0.5rem{% else %}0{% endif %};"
|
||||
>
|
||||
{{ days[i] }}
|
||||
</div>
|
||||
<div class="font-bold text-black mb-1">
|
||||
{{ refeed_weekday_calories | default('1615KCals') }}
|
||||
</div>
|
||||
<div class="text-xs text-black leading-tight text-left">
|
||||
<div>
|
||||
{{ refeed_weekday_protein | default('120g Protein')
|
||||
}}
|
||||
<!-- Macro Body (fills to the bottom, cyan or white) -->
|
||||
{% if i < 5 %}
|
||||
<div class="flex flex-col items-center py-1 px-2">
|
||||
<div class="font-bold text-sm text-black mb-1">
|
||||
{{ refeed_weekday_calories | default('1615KCals') }}
|
||||
</div>
|
||||
<div class="text-xs text-black leading-tight text-left">
|
||||
<div>{{ refeed_weekday_protein | default('120g Protein') }}</div>
|
||||
<div>{{ refeed_weekday_carbs | default('142g Carbs') }}</div>
|
||||
<div>{{ refeed_weekday_fat | default('63g Fat') }}</div>
|
||||
<div>{{ refeed_weekday_fiber | default('24g Fibre') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
{{ refeed_weekday_carbs | default('142g Carbs') }}
|
||||
{% else %}
|
||||
<div class="flex flex-col items-center py-1 px-2">
|
||||
<div class="font-bold text-black mb-1">
|
||||
{{ refeed_weekend_calories | default('2000KCals') }}
|
||||
</div>
|
||||
<div class="text-xs text-black leading-tight text-left">
|
||||
<div>{{ refeed_weekend_protein | default('120g Protein') }}</div>
|
||||
<div>{{ refeed_weekend_carbs | default('190g Carbs') }}</div>
|
||||
<div>{{ refeed_weekend_fat | default('84g Fat') }}</div>
|
||||
<div>{{ refeed_weekend_fiber | default('30g Fibre') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>{{ refeed_weekday_fat | default('63g Fat') }}</div>
|
||||
<div>
|
||||
{{ refeed_weekday_fiber | default('24g Fibre') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tuesday -->
|
||||
<div class="bg-cyan-300 p-2 text-center border border-gray-300">
|
||||
<div class="text-[10px] font-bold text-black mb-1 bg-blue-300">
|
||||
Tuesday
|
||||
</div>
|
||||
<div class="font-bold text-black mb-1">
|
||||
{{ refeed_weekday_calories | default('1615KCals') }}
|
||||
</div>
|
||||
<div class="text-xs text-black leading-tight text-left">
|
||||
<div>
|
||||
{{ refeed_weekday_protein | default('120g Protein')
|
||||
}}
|
||||
</div>
|
||||
<div>
|
||||
{{ refeed_weekday_carbs | default('142g Carbs') }}
|
||||
</div>
|
||||
<div>{{ refeed_weekday_fat | default('63g Fat') }}</div>
|
||||
<div>
|
||||
{{ refeed_weekday_fiber | default('24g Fibre') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Wednesday -->
|
||||
<div class="bg-cyan-300 p-2 text-center border border-gray-300">
|
||||
<div class="text-[10px] font-bold text-black mb-1 bg-blue-300">
|
||||
Wednesday
|
||||
</div>
|
||||
<div class="font-bold text-black mb-1">
|
||||
{{ refeed_weekday_calories | default('1615KCals') }}
|
||||
</div>
|
||||
<div class="text-xs text-black leading-tight">
|
||||
<div>
|
||||
{{ refeed_weekday_protein | default('120g Protein')
|
||||
}}
|
||||
</div>
|
||||
<div>
|
||||
{{ refeed_weekday_carbs | default('142g Carbs') }}
|
||||
</div>
|
||||
<div>{{ refeed_weekday_fat | default('63g Fat') }}</div>
|
||||
<div>
|
||||
{{ refeed_weekday_fiber | default('24g Fibre') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Thursday -->
|
||||
<div class="bg-cyan-300 p-2 text-center border border-gray-300">
|
||||
<div class="text-[10px] font-bold text-black mb-1 bg-blue-300">
|
||||
Thursday
|
||||
</div>
|
||||
<div class="font-bold text-black mb-1">
|
||||
{{ refeed_weekday_calories | default('1615KCals') }}
|
||||
</div>
|
||||
<div class="text-xs text-black leading-tight">
|
||||
<div>
|
||||
{{ refeed_weekday_protein | default('120g Protein')
|
||||
}}
|
||||
</div>
|
||||
<div>
|
||||
{{ refeed_weekday_carbs | default('142g Carbs') }}
|
||||
</div>
|
||||
<div>{{ refeed_weekday_fat | default('63g Fat') }}</div>
|
||||
<div>
|
||||
{{ refeed_weekday_fiber | default('24g Fibre') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Friday -->
|
||||
<div class="bg-cyan-300 p-2 text-center border border-gray-300">
|
||||
<div class="text-[10px] font-bold text-black mb-1 bg-blue-300">
|
||||
Friday
|
||||
</div>
|
||||
<div class="font-bold text-black mb-1">
|
||||
{{ refeed_weekday_calories | default('1615KCals') }}
|
||||
</div>
|
||||
<div class="text-xs text-black leading-tight">
|
||||
<div>
|
||||
{{ refeed_weekday_protein | default('120g Protein')
|
||||
}}
|
||||
</div>
|
||||
<div>
|
||||
{{ refeed_weekday_carbs | default('142g Carbs') }}
|
||||
</div>
|
||||
<div>{{ refeed_weekday_fat | default('63g Fat') }}</div>
|
||||
<div>
|
||||
{{ refeed_weekday_fiber | default('24g Fibre') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Saturday -->
|
||||
<div class="bg-cyan-300 p-2 text-center border border-gray-300">
|
||||
<div class="text-[10px] font-bold text-black mb-1 bg-blue-300">
|
||||
Saturday
|
||||
</div>
|
||||
<div class="font-bold text-black mb-1">
|
||||
{{ refeed_weekend_calories | default('2000KCals') }}
|
||||
</div>
|
||||
<div class="text-xs text-black leading-tight">
|
||||
<div>
|
||||
{{ refeed_weekend_protein | default('120g Protein')
|
||||
}}
|
||||
</div>
|
||||
<div>
|
||||
{{ refeed_weekend_carbs | default('190g Carbs') }}
|
||||
</div>
|
||||
<div>{{ refeed_weekend_fat | default('84g Fat') }}</div>
|
||||
<div>
|
||||
{{ refeed_weekend_fiber | default('30g Fibre') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Sunday -->
|
||||
<div class="bg-cyan-300 p-2 text-center border border-gray-300">
|
||||
<div class="text-[10px] font-bold text-black mb-1 bg-blue-300">
|
||||
Sunday
|
||||
</div>
|
||||
<div class="font-bold text-black mb-1">
|
||||
{{ refeed_weekend_calories | default('2000KCals') }}
|
||||
</div>
|
||||
<div class="text-xs text-black leading-tight">
|
||||
<div>
|
||||
{{ refeed_weekend_protein | default('120g Protein')
|
||||
}}
|
||||
</div>
|
||||
<div>
|
||||
{{ refeed_weekend_carbs | default('190g Carbs') }}
|
||||
</div>
|
||||
<div>{{ refeed_weekend_fat | default('84g Fat') }}</div>
|
||||
<div>
|
||||
{{ refeed_weekend_fiber | default('30g Fibre') }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -528,6 +528,7 @@ class ReportGeneratorService:
|
||||
"weight": weight_kg,
|
||||
"fat_percentage": fat_pct,
|
||||
"gender": gender,
|
||||
"next_testing_date": patient_info.get("next_testing_date", "Contact us for scheduling"),
|
||||
}
|
||||
contexts = self.context_generator.generate_all_contexts(
|
||||
patient_name,
|
||||
|
||||
@@ -14,6 +14,7 @@ Generator{% endblock %} {% block content %}
|
||||
{% endif %}
|
||||
|
||||
<form
|
||||
id="upload-form"
|
||||
action="/upload"
|
||||
method="post"
|
||||
enctype="multipart/form-data"
|
||||
@@ -147,19 +148,111 @@ Generator{% endblock %} {% block content %}
|
||||
</div>
|
||||
<div>
|
||||
<label
|
||||
for="next_testing_date"
|
||||
class="block text-sm font-medium text-gray-700"
|
||||
>Recommended Next Testing Date</label
|
||||
>
|
||||
<div class="mt-1 grid grid-cols-2 gap-3">
|
||||
<select
|
||||
id="next_testing_month"
|
||||
required
|
||||
class="block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm px-3 py-2 border"
|
||||
>
|
||||
<option value="">Month</option>
|
||||
<option value="January">January</option>
|
||||
<option value="February">February</option>
|
||||
<option value="March">March</option>
|
||||
<option value="April">April</option>
|
||||
<option value="May">May</option>
|
||||
<option value="June">June</option>
|
||||
<option value="July">July</option>
|
||||
<option value="August">August</option>
|
||||
<option value="September">September</option>
|
||||
<option value="October">October</option>
|
||||
<option value="November">November</option>
|
||||
<option value="December">December</option>
|
||||
</select>
|
||||
<select
|
||||
id="next_testing_year"
|
||||
required
|
||||
class="block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm px-3 py-2 border"
|
||||
>
|
||||
<option value="">Year</option>
|
||||
</select>
|
||||
</div>
|
||||
<input
|
||||
type="text"
|
||||
type="hidden"
|
||||
name="next_testing_date"
|
||||
id="next_testing_date"
|
||||
required
|
||||
class="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm px-3 py-2 border"
|
||||
placeholder="e.g., October 2025"
|
||||
/>
|
||||
</div>
|
||||
<script>
|
||||
// Populate year dropdown
|
||||
(function () {
|
||||
const yearSelect =
|
||||
document.getElementById(
|
||||
"next_testing_year"
|
||||
);
|
||||
const currentYear = new Date().getFullYear();
|
||||
for (
|
||||
let i = currentYear;
|
||||
i <= currentYear + 10;
|
||||
i++
|
||||
) {
|
||||
const option =
|
||||
document.createElement("option");
|
||||
option.value = i;
|
||||
option.textContent = i;
|
||||
yearSelect.appendChild(option);
|
||||
}
|
||||
|
||||
// Combine month and year into hidden input
|
||||
const monthSelect =
|
||||
document.getElementById(
|
||||
"next_testing_month"
|
||||
);
|
||||
const dateInput =
|
||||
document.getElementById(
|
||||
"next_testing_date"
|
||||
);
|
||||
|
||||
function updateDateInput() {
|
||||
const month = monthSelect.value;
|
||||
const year = yearSelect.value;
|
||||
if (month && year) {
|
||||
dateInput.value = month + " " + year;
|
||||
} else {
|
||||
dateInput.value = "";
|
||||
}
|
||||
}
|
||||
|
||||
monthSelect.addEventListener(
|
||||
"change",
|
||||
updateDateInput
|
||||
);
|
||||
yearSelect.addEventListener(
|
||||
"change",
|
||||
updateDateInput
|
||||
);
|
||||
|
||||
// Validate form submission
|
||||
const form =
|
||||
document.getElementById("upload-form");
|
||||
form.addEventListener("submit", function (e) {
|
||||
const month = monthSelect.value;
|
||||
const year = yearSelect.value;
|
||||
if (!month || !year) {
|
||||
e.preventDefault();
|
||||
alert(
|
||||
"Please select both month and year for the recommended next testing date."
|
||||
);
|
||||
return false;
|
||||
}
|
||||
// Ensure hidden input is set before submission
|
||||
updateDateInput();
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -3441,7 +3441,7 @@
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "report-generation",
|
||||
"display_name": ".venv",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user