@php $departmentOptions = \App\Support\Lookup::options('lab_department'); $resultTypeOptions = \App\Support\Lookup::options('result_type'); $categoryOptions = $categories->mapWithKeys(fn ($c) => [$c->id => "{$c->name} — {$c->department_label}"]); $isEditingTest = (bool) $editing; $isEditingPanel = (bool) $editingPanel; $testFormSelected = collect(old('panel_tests', $editing?->panels?->pluck('id')->all() ?? []))->map(fn ($v) => (int) $v)->all(); $panelFormSelected = collect(old('tests', $editingPanel?->tests?->pluck('id')->all() ?? []))->map(fn ($v) => (int) $v)->all(); @endphp {{ $stats['tests'] }} line(s) · {{ $stats['active'] }} orderable · {{ $stats['panels'] }} panel(s) · {{ $stats['billable'] }} linked to billing

Catalogue lines

{{ number_format($stats['tests']) }}

Tests and panel lines across all departments.

Orderable now

{{ number_format($stats['active']) }}

Selectable on the CPOE order form.

Linked to billing

{{ number_format($stats['billable']) }}

A charge item attaches when a test is first billed.

Panels orderable

{{ number_format($stats['panels']) }}

Bundles that bill as one line.

{{-- Filters --}}
Reset
{{-- Tests table --}}
@forelse ($tests as $test) @empty @endforelse
Test Category Department Result Price State Actions
{{ $test->name }} {{ $test->code }} @if ($test->is_panel) panel @endif @if ($test->requires_fasting) fasting @endif {{ $test->specimen_type ? lookup_label('specimen_type', $test->specimen_type, $test->specimen_type) : 'No specimen' }} @if ($test->container) · {{ $test->container }} @endif @if ($test->tat_hours) · TAT {{ $test->tat_hours }} h @endif @if ($test->chargeItem) billable via {{ $test->chargeItem->code ?? $test->chargeItem->name }} @endif {{ $test->category?->name ?? '—' }} {{ $test->result_type_label }} {{ $test->price !== null ? money($test->price) : '—' }} @if ($test->is_active) Orderable @else Retired @endif
@csrf
No catalogue lines match. Widen the filters or add a test.
{{ $tests->links() }}
{{-- Panels table --}}
@forelse ($panels as $panel) @empty @endforelse
Panel Department Constituents Price State Actions
{{ $panel->name }} {{ $panel->code }} @if ($panel->description) {{ $panel->description }} @endif {{ $panel->tests->count() }} test(s) @if ($panel->tests->isNotEmpty()) {{ $panel->tests->pluck('name')->implode(', ') }} @endif {{ money($panel->price) }} @if ($panel->is_active) Orderable @else Withdrawn @endif
@csrf
No panels yet. A panel bundles priced tests into one orderable line.
{{-- Right column: forms --}}
{{-- Test form (create or edit) --}} @if ($isEditingTest)
Editing {{ $editing->code }} @if ($editing->panels->isNotEmpty()) · {{ $editing->panels->count() }} constituent(s) @endif Cancel edit
@endif
@csrf @if ($isEditingTest) @method('PUT') @endif

Hold Ctrl / Cmd to pick several. Only priced lines are listed — a panel of unpriced guide tests would bill nothing.

@error('panel_tests.*')

{{ $message }}

@enderror
@if ($isEditingTest) Discard @endif
{{-- Panel form (create or edit) --}}
@csrf @if ($isEditingPanel) @method('PUT') @endif

The tests that run when the panel is ordered.

@error('tests.*')

{{ $message }}

@enderror
@if ($isEditingPanel) Discard @endif

The order form reads orderable lines only — retiring a test removes it from new orders without touching work already in flight. A charge item attaches the first time a line is billed, so the price you set here is the price the invoice sees. Panels bill once; their constituents never bill separately.