@extends('layouts.app') @section('title', 'Prescriptions') @section('styles') @endsection @section('content')

Prescriptions

All prescriptions issued to clients · in-house and external

Add New Prescription
@if(session('success'))

{{ session('success') }}

@endif {{-- Filters --}}
@if($search || ($status && $status !== 'all') || request('from') || request('to') || ($source !== 'all')) Clear @endif
{{-- Table — one row per prescription pad --}}
@forelse($rows as $row) @php $patient = $patients[$row->patient_id] ?? null; $user = $users[$row->prescribed_by] ?? null; $created = \Carbon\Carbon::parse($row->created_at); $isLegacy = empty($row->prescription_group_id); @endphp @empty @endforelse
Date Rx # Patient MRN Drugs Source Prescriber Action
{{ $created->format('d M Y') }}
{{ $created->format('H:i') }}
@if($isLegacy) @else {{ $row->prescription_group_id }} @endif {{ $patient->full_name ?? '—' }} {{ $patient->mrn ?? '' }}

{{ $row->drug_count }} drug{{ $row->drug_count == 1 ? '' : 's' }}

{{ \Illuminate\Support\Str::limit($row->drug_names, 80) }}

@if($row->source === 'external') External @else In-house @endif {{ $user->name ?? '—' }} @if($isLegacy) Legacy @else View / Print @endif

No prescriptions found

Try clearing filters or add a new prescription.

@if($rows->hasPages())
{{ $rows->links() }}
@endif
@endsection