{{-- Smart Report v2 - Food / Inhalant sensitivity (FS, IS). --}} {{-- Mirrors SmartReportService::GetFSISPDF (lines 3350-3443). Multi-page layout --}} {{-- with sensitivity rows + final reference page. --}} @php $service = $service ?? app(\App\Services\SmartReportV2Service::class); $Package = $group['package'] ?? ($group['firstPackage'] ?? null); $code = $Package->lABCATEGORYPACKAGE->CODE ?? 'FS'; $model = $Package ? $service->buildFoodSensModel($Package, $code) : ['code' => $code, 'pages' => [[]]]; @endphp @foreach ($model['pages'] as $pageIdx => $rows)
@include('pdf.smart_report.components.backgrounds.bg', ['template' => 'food-sens', 'page' => ($pageIdx === 0 ? 1 : 2)]) {{-- v1 (GetFSISPDF 3417-3427) draws the patient header ONLY on the first page — continuation pages import template page 2 bare and start the rows at y=60 with no header, title, or description. --}} @if ($pageIdx === 0) @include('pdf.smart_report.components.patient_header', [ 'Order' => $Order, 'Profile' => $Profile, 'firstPackage' => $Package, 'Category' => (($Package->lABCATEGORYPACKAGE->REPORT_DISPLAY_NAME_AR ?? null) ?: ($Package->lABCATEGORYPACKAGE->NAME_AR ?? '')), 'Description' => $Package->lABCATEGORYPACKAGE->SMART_DESC_AR ?? '', 'setAdvice' => false, ]) @endif @foreach ($rows as $row) {{-- Icon (right side) — centred vertically in the 10 mm row --}} @if (!empty($row['icon']) && is_file($row['icon'])) @endif {{-- Arabic name (bold, right-aligned) — flex so text centres in the 10 mm cell --}}
{{ $row['name_ar'] }}
{{-- Result value (colored by severity) --}}
{{ $row['result'] }}
{{-- Severity bar image --}} @if (!empty($row['bar']) && is_file($row['bar'])) @endif {{-- "درجة الحساسية" sub-label --}}
درجة الحساسية
@endforeach
@endforeach {{-- ═══════════════════════════ REFERENCE PAGE ══════════════════════ --}}
@include('pdf.smart_report.components.backgrounds.bg', ['template' => 'food-sens-reference', 'page' => 1]) @include('pdf.smart_report.components.patient_header', [ 'Order' => $Order, 'Profile' => $Profile, 'firstPackage' => $Package, 'Category' => (($Package->lABCATEGORYPACKAGE->REPORT_DISPLAY_NAME_AR ?? null) ?: ($Package->lABCATEGORYPACKAGE->NAME_AR ?? '')), 'Description' => $Package->lABCATEGORYPACKAGE->SMART_DESC_AR ?? '', 'setAdvice' => false, ])