{{-- One printed prescription, shared by - pharmacy/prescription/print.blade.php ($showQty = true) - patient_mangement/appointment/prescription/print ($showQty = false) Opened on its own in the print popup, so it carries its own styles. --}} @php $showQty = $showQty ?? false; $patient = $prescription?->Appointment?->Patient ?? $prescription?->Admission?->Patient ?? $prescription?->Emergency?->Patient; $age = $patient?->dob ? \Carbon\Carbon::parse($patient->dob)->diff(now()) : null; $doctor = $prescription->createdBy?->Employee; $details = $prescription->PrescriptionDetails; // older rows may hold the text "null" from the form $txt = fn ($v) => in_array(strtolower(trim((string) $v)), ['', 'null', 'undefined'], true) ? null : trim((string) $v); $cell = fn ($v) => $txt($v) !== null ? e($txt($v)) : '—'; @endphp
| # | Medicine | @if ($showQty)Qty | @endifDose | Frequency | Route | Duration | Instruction |
|---|---|---|---|---|---|---|---|
| {{ $loop->iteration }} | {{ $d?->Product?->name }} | @if ($showQty){{ $d?->quantity + 0 }} | @endif{!! $cell($d?->dose) !!} | {!! $cell($d?->frq?->name) !!} | {!! $cell($d?->dsgform?->name) !!} | {!! $cell($d?->duration) !!} | {!! $cell($d?->instruction) !!} |