@php $hasStructures = false; $structures = [ 'Lids' => 'lids', 'Conjunctiva' => 'conjunctiva', 'Cornea' => 'cornea', 'Anterior Chamber (AC)' => 'ac', 'Iris' => 'iris', 'Pupil' => 'pupil', 'Lens' => 'lens', 'Vitreous' => 'vitreous', 'Retina' => 'retina', 'Macula' => 'macula', ]; if (isset($examination->eye_structures) && is_array($examination->eye_structures)) { foreach ($structures as $key) { $od = $examination->eye_structures[$key]['od'] ?? $examination->eye_structures[$key]['right'] ?? null; $os = $examination->eye_structures[$key]['os'] ?? $examination->eye_structures[$key]['left'] ?? null; if (!empty($od) || !empty($os)) { $hasStructures = true; break; } } } $hasTests = !empty($examination->clinical_tests) && is_array($examination->clinical_tests); $hasProcedure = !empty($examination->foreign_body_removal['notes']) || !empty($examination->foreign_body_removal['removal']); @endphp @if($hasStructures || $hasTests || $hasProcedure)
Ocular Status & Findings
@if($hasStructures)
OCULAR EXAMINATION
@foreach($structures as $label => $key) @php $od = $examination->eye_structures[$key]['od'] ?? $examination->eye_structures[$key]['right'] ?? null; $os = $examination->eye_structures[$key]['os'] ?? $examination->eye_structures[$key]['left'] ?? null; @endphp @if(!empty($od) || !empty($os)) @endif @endforeach
OCULAR STRUCTURE RIGHT EYE (OD) LEFT EYE (OS)
{{ $label }} {{ $od ?: 'Normal' }} {{ $os ?: 'Normal' }}
@endif @if($hasTests)
Other Clinical Observations
@foreach($examination->clinical_tests as $test) @if(!empty($test['name']) && (!empty($test['od']) || !empty($test['os']))) @endif @endforeach
DIAGNOSTIC TEST RIGHT EYE (OD) LEFT EYE (OS)
{{ strtoupper($test['name']) }} {{ $test['od'] ?: '—' }} {{ $test['os'] ?: '—' }}
@endif @if($hasProcedure)
Foreign Body Removal Procedure

{{ !empty($examination->foreign_body_removal['removal']) ? 'REMOVAL PERFORMED' : 'NO REMOVAL' }}
PROCEDURE NOTES & OBSERVATIONS:
{{ $examination->foreign_body_removal['notes'] ?? 'No specific removal notes recorded.' }}
@endif @endif