{{-- Smart Report v2 - HE / PT-INR analysis card grid. --}} {{-- Mirrors SmartReportService::GetHEPDF (lines 2752-3063). 4 cells per page, --}} {{-- branched by Result CODE: HBA/PRT -> LNH; HBA2/HBF/INR -> NH; --}} {{-- HBD/HBS/HBC/Sickle -> BP. Profile->ID 18/34 force HBA2 -> LNH. --}} @php /** @var array $group Group view-model from WebController v2 dispatch */ /** @var \App\Services\SmartReportV2Service $service */ $service = $service ?? app(\App\Services\SmartReportV2Service::class); $Package = $group['package'] ?? ($group['firstPackage'] ?? null); $rows = $Package ? $service->buildHeRows($Package, $Profile) : []; // Group by the v1 raw-key page number (skipped rows keep their grid // slots, so a page can hold fewer than 4 cards — mirrors GetHEPDF). $pages = []; foreach ($rows as $heRow) { $pages[$heRow['page']][] = $heRow; } $pages = array_values($pages); if (empty($pages)) $pages = [[]]; $TestName = $Package->lABCATEGORYPACKAGE->REPORT_DISPLAY_NAME_AR ?? ($Package->lABCATEGORYPACKAGE->NAME_AR ?? ''); @endphp @foreach ($pages as $pageIdx => $pageRows)
{{-- Title bar --}}