{{-- Always opened inside the "Lab result" modal iframe (see viewLabResult() in appointment/laboratory/index.blade.php) — never as its own page, so it shouldn't carry the app's navbar/sidebar/footer at all. --}} @extends('layouts.embed_full') @section('title', $title) @section('page_css') @endsection @section('content') @php $db_settings = \App\Models\Setting::get(); $settings = []; foreach ($db_settings as $row) { $settings[$row->name] = $row->value; } @endphp {{-- Choose which tests to print (some clients want only some results). Screen only: it sits outside #print-content, which is all the Print button copies. --}} @php $only = $only ?? []; $pickGroups = collect($printable ?? [])->groupBy(function ($r) { if ($r->resultcomponent && count($r->resultcomponent->routine ?? []) > 0) { return $r->resultcomponent->name ?? 'Tests'; } return $r->labType?->name ?? 'Tests'; }); $pickTotal = collect($printable ?? [])->count(); $pickShown = $only ? collect($printable ?? [])->whereIn('id', $only)->count() : $pickTotal; @endphp
@if ($pickTotal > 1)
Print only these tests All · None
@foreach ($pickGroups as $heading => $rows)
@if ($rows->count() > 1) @endif @foreach ($rows as $r) @php $label = $r->resultcomponent && count($r->resultcomponent->routine ?? []) > 0 ? $r->resultcomponent->name : ($r->routine_name ?: $r->labType?->name); @endphp @endforeach
@endforeach
Tick at least one test.
@if ($only) Show all @endif
@endif
@if ($only)
Showing {{ $pickShown }} of {{ $pickTotal }} tests — only these will print.
@endif