@php $exam = $dentalPerioExam; $siteMap = []; foreach ($exam?->sites ?? [] as $site) { $siteMap[$site->tooth_code][$site->surface] = $site; } $teeth = array_merge($dentalRows['upper'] ?? [], $dentalRows['lower'] ?? []); $probeTeeth = array_slice($teeth, 0, 8); $canManage = $canConsult ?? false; @endphp

Periodontal exam

Record probing depths, bleeding, and plaque by tooth surface.

@if ($exam)

Latest exam {{ $exam->exam_date?->format('d M Y') }} · {{ $exam->sites->count() }} sites

@endif @if ($canManage)
@csrf
@foreach ($dentalPerioSurfaces ?? [] as $surface) @endforeach @foreach ($probeTeeth as $idx => $tooth) @foreach ($dentalPerioSurfaces ?? [] as $sIdx => $surface) @php $existing = $siteMap[$tooth][$surface] ?? null; @endphp @endforeach @endforeach
Tooth{{ $surface }} mm B P
{{ $tooth }} bleeding)> plaque)>
@else
@foreach ($dentalPerioSurfaces ?? [] as $surface) @endforeach @forelse ($probeTeeth as $tooth) @foreach ($dentalPerioSurfaces ?? [] as $surface) @php $existing = $siteMap[$tooth][$surface] ?? null; @endphp @endforeach @empty @endforelse
Tooth{{ $surface }} mm B P
{{ $tooth }}{{ $existing?->probing_mm ?? '—' }} {{ $existing?->bleeding ? '✓' : '—' }} {{ $existing?->plaque ? '✓' : '—' }}
No perio exam yet.
@if ($exam?->notes)

{{ $exam->notes }}

@endif @endif