{{-- Treatment sessions log: one row per session with pain before / after. Needs $sessions, $appointment, $access, $route. --}} @php $canEdit = auth()->user()->can($access . '-create'); $canDelete = auth()->user()->can($access . '-delete'); @endphp
@forelse ($sessions as $s) @php $better = $s->pain_before !== null && $s->pain_after !== null ? $s->pain_before - $s->pain_after : null; $sRow = ['id' => $s->id, 'date' => $s->date?->format('Y-m-d'), 'treatment' => $s->treatment, 'pain_before' => $s->pain_before, 'pain_after' => $s->pain_after, 'notes' => $s->notes]; @endphp @empty @endforelse @if ($canEdit) @endif
Date Treatment Pain before Pain after Notes By
{{ $s->date?->format('d M, Y') }} {{ $s->treatment }} {{ $s->pain_before ?? '-' }} {{ $s->pain_after ?? '-' }} @if ($better) {{ $better > 0 ? '↓' . $better : '↑' . abs($better) }} @endif {{ $s->notes }} {{ $s->user?->name }} @if ($canEdit) @endif @if ($canDelete) @endif
No sessions yet.
@foreach (array_merge(array_values(\App\Services\ClinicSafety::TREATMENTS), ['Full Body Massage', 'Half Body Massage', 'Normal Cupping', 'VIP Cupping']) as $t) @include('patient_mangement.appointment.clinic_assessment._pain', ['id' => 'ca_s_before']) @include('patient_mangement.appointment.clinic_assessment._pain', ['id' => 'ca_s_after'])