{{-- Single row in the patient history timeline. Variables: $entry - array shape from PatientHistoryService::timeline() $patient - Patient model --}} @php $typeColors = [ 'opd' => 'bg-blue-50 text-blue-800 border-blue-200', 'dental' => 'bg-purple-50 text-purple-800 border-purple-200', 'ipd' => 'bg-indigo-50 text-indigo-800 border-indigo-200', 'admission' => 'bg-indigo-50 text-indigo-800 border-indigo-200', 'anc' => 'bg-pink-50 text-pink-800 border-pink-200', 'maternity' => 'bg-rose-50 text-rose-800 border-rose-200', 'visit' => 'bg-blue-50 text-blue-800 border-blue-200', ]; $statusColors = [ 'completed' => 'text-emerald-700', 'discharged' => 'text-emerald-700', 'delivered' => 'text-emerald-700', 'cancelled' => 'text-gray-500 line-through', 'in_consultation' => 'text-amber-700', 'admitted' => 'text-blue-700', 'active' => 'text-blue-700', ]; $color = $typeColors[$entry['subtype']] ?? $typeColors[$entry['type']] ?? 'bg-gray-50 text-gray-800 border-gray-200'; $stColor = $statusColors[$entry['status']] ?? 'text-gray-700'; $detailsUrl = route('patients.history.details', [ 'patient' => $patient->id, 'type' => $entry['type'], 'id' => $entry['id'], ]); @endphp
{{-- Date column --}}
{{ $entry['date']?->format('d M Y') ?? '—' }}
{{ $entry['date']?->format('H:i') ?? '' }}
{{-- Type badge --}} {{ $entry['subtype'] }} {{-- Reference + summary --}}
{{ $entry['reference'] }} @if($entry['clinician']) · {{ $entry['clinician'] }} @endif
{{ $entry['summary'] ?: '—' }}
{{-- Status --}} {{ str_replace('_', ' ', $entry['status']) }} {{-- Toggle button --}}
{{-- Lazy-loaded details container --}}