@php $filtered = ($patientQuery ?? '') !== ''; @endphp @if ($patient)
@csrf @php $pickerTests = $testsByLetter ->flatMap(fn ($group) => $group) ->map(fn ($t) => [ 'id' => $t->id, 'name' => $t->name, 'code' => $t->code, 'department' => $t->department_label, 'specimen' => $t->specimen_type, 'tat' => $t->tat_hours, 'price' => (float) $t->price, ]) ->values(); @endphp
{{-- The dropdown: search the whole book, group by letter --}} From the laboratory test guide — {{ $pickerTests->count() }} tests and {{ $panels->count() }} panels.
{{-- Picked tests as chips; each carries a hidden tests[] input --}}

Nothing picked yet. Search above, or add a priced panel below — a panel expands into its bench worklist but bills as one line at the panel price.

@error('tests.*') @enderror @if ($panels->isNotEmpty())
@foreach ($panels as $panel) @endforeach
@endif
Start over
{{-- Patient and encounter context --}}

{{ $patient->full_name }}

{{ $patient->medical_record_number }}

{{ $patient->age_display }} · {{ $patient->gender_label }} @if ($patient->phone) · {{ $patient->phone }} @endif

@if ($patient->allergies_summary)

{{ $patient->allergies_summary }}

@endif @if ($match = $patient->isRestricted())

Restricted record — access is logged.

@endif
@if ($openEncounters->isNotEmpty())

This order attaches to the encounter that opened the form:

{{ $encounter->encounter_no }} {{ $encounter->encounter_type_label ?? ucfirst($encounter->encounter_type) }} · {{ $encounter->status }}

To order against a different visit, open it from the patient's chart.

@endif
  • Curated catalogue tests carry their standard charge.
  • Guide-imported tests show the exact specimen the book requires; if the billing office has not priced one yet, it is listed on the charge sheet for pricing — never invented onto the bill.
  • A panel bills as one line at the panel price, however many bench tests it expands to.
@push('scripts') @endpush @else Search by MRN, name, phone or national ID.
@if ($filtered) Clear @endif
@if ($patientQuery === '')

Start typing a name or MRN above. The test guide's dropdown comes next.

@elseif (! auth()->user()->can('patients.view')) Your account cannot search the patient register. Open the patient's clinical record and place the order from there. @elseif ($matches->isEmpty()) Nothing in the register matches. Check the spelling, or register the patient first. @can('patients.create') Register a new patient @endcan @else
    @foreach ($matches as $match)
  • {{ Str::of($match->first_name)->substr(0, 1)->upper() }}{{ Str::of($match->last_name)->substr(0, 1)->upper() }}

    {{ $match->full_name }}

    {{ $match->medical_record_number }} · {{ $match->age_display }} · {{ $match->gender_label }} @if ($match->phone) · {{ $match->phone }} @endif

    @if ($match->isRestricted()) @endif Order tests
  • @endforeach
@endif
@endif