@extends('layouts.app') @section('title', 'Prescription ' . $group . ' | ' . ($patient->full_name ?? '')) @section('styles') @endsection @section('content') @if(session('success'))

{{ session('success') }}

@endif {{-- Toolbar (hidden on print) --}}
Back to Prescriptions

Prescription {{ $group }}

Add New Prescription
{{-- PRINTABLE PRESCRIPTION --}}
{{-- LETTERHEAD --}} @include('partials._document-header') {{-- TITLE BAR --}}

PRESCRIPTION

Prescription No.

{{ $group }}

{{-- PATIENT DEMOGRAPHICS STRIP --}} {{-- Patient phone number and internal MRN deliberately omitted from the printed slip — receiving pharmacies don't need them, and leaking them risks downstream marketing/harassment + social engineering against the hospital. Name + age + gender + the Rx number are sufficient for safe dispensing. --}}
Name:{{ $patient->full_name ?? '—' }} Age:{{ $patient->age ?? '—' }} Gender:{{ ucfirst($patient->gender ?? '—') }} Date:{{ $createdAt->format('d M Y · H:i') }}
{{-- Allergies banner (if any) — printed prominently --}} @php // Patient::allergies is cast to array. Guard against null or // legacy non-array values (e.g. comma-separated strings from old data). $allergyList = []; if ($patient && !empty($patient->allergies)) { $allergyList = is_array($patient->allergies) ? $patient->allergies : array_filter(array_map('trim', explode(',', (string) $patient->allergies))); } @endphp @if(count($allergyList))
⚠ KNOWN ALLERGIES: {{ implode(', ', $allergyList) }}
@endif {{-- MEDICATIONS --}}
@foreach($prescriptions as $i => $rx) @endforeach
# Drug Name Dose Frequency Duration Route Qty
{{ $i + 1 }}

{{ $rx->drug_name }}

@if($rx->drugItem && $rx->drugItem->generic_name && strtolower($rx->drugItem->generic_name) !== strtolower($rx->drug_name))

Generic: {{ $rx->drugItem->generic_name }}

@endif
{{ $rx->dosage ?: '—' }} {{ $rx->frequency ?: '—' }} {{ $rx->duration ?: '—' }} {{ $rx->route ?: '—' }} {{ $rx->quantity }}
{{-- Instructions --}} @if($instructions)
{{ $instructions }}
@endif
{{-- /.rx-content-body --}} {{-- Signature block — pinned to bottom of A4 page via margin-top:auto --}}

Prescriber's Signature

{{ $prescriber->name ?? '—' }}

Official Stamp

{{-- Footer --}}

CONFIDENTIAL MEDICAL DOCUMENT : This prescription is intended solely for the named patient and valid only with the prescriber's signature and official stamp.

Generated by Clara Rosa Hospital HMIS · {{ now()->format('d M Y H:i') }} {{ $group }}
@endsection @section('scripts') @endsection