@php $user = auth()->user(); $filtered = request()->hasAny(['q', 'status', 'type', 'prescriber', 'scope', 'from', 'to']); @endphp @can('drugs.view') Formulary @endcan @can('prescriptions.create') Write prescription @endcan
@if ($filtered) Clear @endif
@if ($prescriptions->isEmpty()) @if (request('q')) Nothing in the prescription register matches “{{ request('q') }}”. @else No scripts on file for this filter. They are written from an encounter, or from the patient's clinical record. @endif @can('prescriptions.create') Write prescription @endcan @can('encounters.view') Encounters @endcan @else
@foreach ($prescriptions as $prescription) @endforeach
Prescription Patient Prescriber Drugs Dispensed Status Written
{{ $prescription->prescription_no }}
@if ($prescription->is_controlled) Controlled @endif
{{ $prescription->patient?->full_name ?? 'Unknown patient' }}
{{ $prescription->patient?->medical_record_number }} @if ($prescription->encounter) · {{ $prescription->encounter->encounter_no }} @endif
@if ($prescription->patient?->isRestricted()) @endif
{{ $prescription->prescribedBy?->name ?? 'Unattributed' }}
{{ $prescription->prescribed_at?->format('d M Y H:i') }}
{{ $prescription->items_count }} {{ Str::plural('item', $prescription->items_count) }} {{ $prescription->dispensed_items_count }} / {{ $prescription->items_count }}
{{ $prescription->prescribed_at?->format('d M Y') }}
@if ($prescription->dispensed_at)
dispensed {{ $prescription->dispensed_at->format('d M Y') }}
@endif
Open @if ($prescription->status === 'pending' || $prescription->status === 'on_hold' || $prescription->status === 'partially_dispensed') @endif

Showing {{ $prescriptions->firstItem() }}–{{ $prescriptions->lastItem() }} of {{ number_format($prescriptions->total()) }}

{{ $prescriptions->links() }}
@endif