@extends('layouts.app') @section('title', 'Sick Leave | ' . ($sl->patient->full_name ?? '')) @section('styles') @endsection @section('content') @php $patient = $sl->patient; // Pronoun decisions based on patient gender. Defaults to neutral // forms if gender unrecorded so the cert still reads correctly. $pronouns = match (strtolower($patient->gender ?? '')) { 'male' => ['his_her' => 'his', 'he_she' => 'he', 'him_her' => 'him'], 'female' => ['his_her' => 'her', 'he_she' => 'she', 'him_her' => 'her'], default => ['his_her' => 'their','he_she' => 'they','him_her' => 'them'], }; $hisHer = $pronouns['his_her']; $heShe = ucfirst($pronouns['he_she']); $himHer = $pronouns['him_her']; $signOff = $sl->sign_off_name; $forGuardian = $sl->isForGuardian(); @endphp {{-- On-screen action bar; hidden in print view --}}
Back

Sick Leave Certificate | {{ $patient->full_name ?? '' }}

{{-- PRINTABLE CERTIFICATE --}}
{{-- LETTERHEAD (shared partial — same as receipts, invoices, discharge summaries) --}} @include('partials._document-header') {{-- PATIENT DEMOGRAPHICS — row 1 --}}
Name:{{ $patient->full_name ?? '' }} Patient ID:{{ $patient->mrn ?? '' }} Gender:{{ ucfirst($patient->gender ?? '') }} Age:{{ $patient->age ?? '' }} {{ $patient->age == 1 ? 'year' : 'years' }}
{{-- PATIENT DEMOGRAPHICS — row 2 (treatment + leave facts) --}}
Treatment Date:{{ $sl->treatment_date?->format('d M Y') }} Days Off:{{ $sl->days }} {{ $sl->days == 1 ? 'day' : 'days' }} Effective Through:{{ optional($sl->end_date)->format('d M Y') }}
{{-- GUARDIAN STRIP — only when issued to guardian. Patient demographics stay on top (per Clara's UX choice in Issue #4 round 2); this strip clarifies who the leave is FOR, which is the data the guardian's employer needs. --}} @if($forGuardian)
Leave Issued To: {{ $sl->guardian_name }} Relationship: {{ $sl->guardian_relationship ?: 'Guardian' }} Capacity: Caregiver of patient
@endif {{-- SEPARATOR --}}
{{-- TITLE --}}

Sick Leave Certificate

{{-- BODY: branches on patient vs guardian recipient. --}}
@if($forGuardian) {{-- Guardian-issuance phrasing. Subject of the leave is the guardian; the medical justification is the patient's care need. --}} @php $relText = $sl->guardian_relationship ? strtolower($sl->guardian_relationship) : 'guardian'; @endphp

The above named client (a minor under our care) was attended to at our facility on {{ $sl->treatment_date?->format('d M Y') }} and is being managed accordingly. To enable continued care and support, {{ $hisHer }} {{ $relText }}, {{ $sl->guardian_name }}, has been granted {{ $sl->days }} {{ $sl->days == 1 ? 'day' : 'days' }} off duty effective today.

Kindly accord {{ $sl->guardian_name }} the necessary support as may be appropriate.

@else {{-- Standard patient-issuance phrasing (unchanged from original). --}}

The above named client sought treatment at our facility on {{ $sl->treatment_date?->format('d M Y') }} and managed accordingly. As part of {{ $hisHer }} management, {{ $heShe }} has been granted {{ $sl->days }} {{ $sl->days == 1 ? 'day' : 'days' }} off duty effective today to enable quick recuperation.

Kindly accord {{ $himHer }} the necessary support as may be appropriate.

@endif
{{-- Flex spacer: absorbs all leftover vertical space so the sign-off block below lands at the bottom of the printable area. --}}
{{-- SIGN-OFF (pinned to bottom by the spacer above) --}}

Issued By:

{{ $signOff }}

Attending Clinician

Issued: {{ $sl->issued_at?->format('d M Y H:i') }}

Signature & Stamp:

@include('partials._document-footer')
@endsection