@extends('layouts.app') @section('title', $test->name) @section('content')
{{-- This screen is reached from the catalogue listing, which is where its way back points. --}} {{ __('laboratory::messages.catalogue.title') }}

{{ $test->name }}

{{ $test->code }}

{{-- Availability sits with the Super Admin alone. Everyone else sees the state without a control, rather than a button that refuses them — a disabled button invites the question "why not me?", and the answer is a policy, not a bug. --}} @can('activate', $test)
@csrf @method('PATCH')
@endcan
{{-- What this test is, as a row of pills rather than a run-on sentence. Each fact is one chip, so an empty one simply is not drawn. --}}
{{ $test->is_active ? __('laboratory::messages.catalogue.available') : __('laboratory::messages.catalogue.not_available') }} {{ $test->kind->label() }} {{ $test->category->label() }} @if ($test->unit) {{ __('laboratory::messages.catalogue.unit') }}: {{ $test->unit }} @endif @if ($test->specimen_type) {{ $test->specimen_type }} @endif @if ($test->billing_code) {{ __('laboratory::messages.catalogue.billing_code') }}: {{ $test->billing_code }} @endif
{{-- Why a test cannot be offered, stated where it can be fixed. Finding this out only at activation means a round trip through a command. --}} @if ($blockers !== [])
{{ __('laboratory::messages.setup.not_ready') }}
@elseif ($warnings !== [])
@endif
@can('update', $test) @include('laboratory::catalogue.partials.setup') @endcan @if ($test->isPanel()) @php($canEditPanel = auth()->user()?->can('update', $test) ?? false) {{ trans_choice('laboratory::messages.catalogue.components_count', $test->components->count(), [ 'count' => $test->components->count(), ]) }} @error('component') @enderror @if ($canEditPanel) {{-- Above the list, not below it. A full blood count carries thirteen analytes, and with the box underneath them the one thing somebody came to do was a scroll away — while the list they were adding to had scrolled off the top. Searched for rather than picked from a dropdown: the catalogue holds over a thousand tests, and a picker script would not survive the content security policy. --}}

{{ __('laboratory::messages.catalogue.add_component') }}

@if ($adding !== '') {{ __('common.clear') }} @endif
@if ($adding !== '') @if ($candidates === [])

{{ __('laboratory::messages.catalogue.no_candidates') }}

@else
    @foreach ($candidates as $candidate)
  • {{ $candidate->name }} {{ $candidate->code }}{{ $candidate->unit ? ' · '.$candidate->unit : '' }}
    @csrf
  • @endforeach
@endif @endif
@endif {{-- A table rather than a list of links: the code is what a clinician orders by and what every result is stamped with, so it belongs beside the name rather than one click away. --}}
@if ($canEditPanel) @endif @forelse ($test->components as $component) @if ($canEditPanel) @endif @empty @endforelse
{{ __('laboratory::messages.catalogue.code') }} {{ __('laboratory::messages.catalogue.name') }} {{ __('laboratory::messages.catalogue.unit') }}{{ __('common.actions') }}
{{ $component->code }} {{ $component->name }} @if (! $component->is_active) {{ __('laboratory::messages.catalogue.inactive') }} @endif @if ($component->unit) {{ $component->unit }} @else {{-- Named, not left blank: a panel whose component has no unit cannot report a number against a range. --}} {{ __('laboratory::messages.catalogue.no_unit') }} @endif {{-- Asked where the button is, and only about the panel: orders already placed keep their own lines. --}}
@csrf @method('DELETE')

{{ __('laboratory::messages.catalogue.components_none') }}

@else
@forelse ($test->referenceRanges as $range) {{-- The critical columns are the two that get somebody telephoned, so they are the two that are coloured. --}} @empty @endforelse
{{ __('laboratory::messages.catalogue.sex') }} {{ __('laboratory::messages.catalogue.age_from') }} {{ __('laboratory::messages.catalogue.low') }} {{ __('laboratory::messages.catalogue.high') }} {{ __('laboratory::messages.catalogue.critical_low') }} {{ __('laboratory::messages.catalogue.critical_high') }}
{{ __('laboratory::messages.catalogue.sex_'.$range->sex) }} @if ($range->min_age_days === null && $range->max_age_days === null) — @else {{ $range->min_age_days === null ? '0' : round($range->min_age_days / 365.25, 1) }} – {{ $range->max_age_days === null ? '∞' : round($range->max_age_days / 365.25, 1) }} @endif {{ $range->low ?? '—' }} {{ $range->high ?? '—' }}{{ $range->critical_low ?? '—' }} {{ $range->critical_high ?? '—' }}

{{ __('laboratory::messages.catalogue.no_ranges') }}

{{ __('laboratory::messages.catalogue.no_ranges_text') }}

@endif
@can('update', $test) @if (! $test->isPanel())
@csrf

{{ __('laboratory::messages.catalogue.critical_hint') }}

@endif @endcan
@endsection