{{-- 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 Prescription {{ $prescription?->name }}