@extends('layouts.portal') @section('title', $patient->full_name . ' — ' . config('app.name')) @section('page_title', $patient->full_name) @section('page_subtitle', ($patient->file_number ? $patient->file_number . ' · ' : '') . __('patients.age') . ': ' . $summary['age'] . ' · ' . __('common.' . $patient->gender)) @section('page_actions') {{ __('common.edit') }} {{ __('menus.generate') }} @endsection @section('content') @if ($patient->dietType?->requires_medical_clearance)

{{ __('patients.clearance_warning') }}

@if ($patient->dietType->contraindications()) @endif
@endif {{-- Nutrition snapshot --}}

{{ __('patients.bmr') }}

{{ number_format($summary['bmr']) }}

{{ __('common.kcal') }}

{{ __('patients.tdee') }}

{{ number_format($summary['tdee']) }}

{{ __('common.kcal') }}

{{ __('patients.target_calories') }}

{{ number_format($summary['target_calories']) }}

{{ $patient->dietType?->name }}

{{ __('patients.bmi') }}

{{ $summary['bmi'] }}

{{ __('patients.bmi_category.' . $summary['bmi_category']) }}

{{-- Macros --}}

{{ __('patients.macros') }}

@foreach ([['protein', 'protein_g', 'bg-brand-50 text-brand-700'], ['carbs', 'carbs_g', 'bg-amber-50 text-amber-700'], ['fat', 'fat_g', 'bg-sky-50 text-sky-700']] as [$label, $key, $tone])

{{ $summary['macros'][$key] }}{{ __('common.grams') }}

{{ __('patients.' . $label) }}

@endforeach

{{ __('patients.water') }}: {{ $summary['water_litres'] }} L

{{-- Generate menu --}}

{{ __('menus.generate') }}

@csrf
@forelse ($patient->menuPlans as $menu)
{{ $menu->title ?? $menu->dietType?->name }}

{{ $menu->starts_on?->format('Y-m-d') }} · {{ $menu->duration_days }} {{ __('common.days') }} · {{ number_format($menu->target_calories) }} {{ __('common.kcal') }}

{{ __('menus.statuses.' . $menu->status) }}
@empty

{{ __('menus.empty') }}

@endforelse
{{-- Measurements --}}

{{ __('patients.measurements') }}

@csrf
@forelse ($patient->measurements as $m) @empty @endforelse
{{ __('patients.measured_on') }} {{ __('patients.weight_kg') }} {{ __('patients.body_fat_percent') }} {{ __('patients.waist_cm') }} {{ __('patients.consultant') }}
{{ $m->measured_on->format('Y-m-d') }} {{ $m->weight_kg }} {{ $m->body_fat_percent ?? '—' }} {{ $m->waist_cm ?? '—' }} {{ $m->recorder?->name ?? '—' }}
{{ __('patients.no_measurements') }}
{{-- Side column --}}

{{ __('patients.section_body') }}

@foreach ([ ['patients.height_cm', $patient->height_cm], ['patients.weight_kg', $patient->weight_kg], ['patients.target_weight_kg', $patient->target_weight_kg ?? '—'], ['patients.body_fat_percent', $patient->body_fat_percent ?? '—'], ['patients.waist_cm', $patient->waist_cm ?? '—'], ['patients.hip_cm', $patient->hip_cm ?? '—'], ] as [$label, $value])
{{ __($label) }}
{{ $value }}
@endforeach

{{ __('patients.section_lifestyle') }}

{{ __('patients.activity_level') }}
{{ __('patients.activity.' . $patient->activity_level) }}
{{ __('patients.goal') }}
{{ __('patients.goals.' . $patient->goal) }}
{{ __('patients.consultant') }}
{{ $patient->consultant?->name }}

{{ __('patients.section_clinical') }}

@foreach ([ ['patients.medical_conditions', $patient->medical_conditions], ['patients.medications', $patient->medications], ['patients.allergies', $patient->allergies], ['patients.disliked_foods', $patient->disliked_foods], ] as [$label, $items])

{{ __($label) }}

@if (filled($items))
@foreach ($items as $item) {{ $item }} @endforeach
@else {{ __('common.none') }} @endif
@endforeach @if ($patient->notes)
{{ $patient->notes }}
@endif
@endsection