{{-- ── HEADER ── --}}

Pacientes

Registro clínico y gestión de historia médica

Nuevo paciente
{{-- ── STATS ── --}}

{{ $stats['total'] }}

Total pacientes

{{ $stats['active'] }}

Activos

{{ $stats['with_hc'] }}

Con historia clínica

{{-- ── SEARCH ── --}}
@if(request()->hasAny(['search','status'])) Limpiar @endif
{{-- ── LISTA ── --}}
@if($query->isEmpty())

@if(request()->hasAny(['search','status'])) No se encontraron resultados @else Sin pacientes registrados @endif

@if(request()->hasAny(['search','status'])) Intenta con otros términos. @else Registra tu primer paciente para comenzar. @endif

Nuevo paciente
@else {{-- Cabecera de tabla --}} {{-- Filas --}} @php $colors = ['#6366f1','#10b981','#f59e0b','#8b5cf6','#06b6d4','#ec4899','#14b8a6','#f97316']; @endphp
@foreach($query as $patient) @php $initials = collect(explode(' ', $patient->fullName()))->take(2)->map(fn($w)=>strtoupper(substr($w,0,1)))->implode(''); $color = $colors[abs(crc32($patient->fullName())) % count($colors)]; @endphp
{{-- Avatar --}}
{{ $initials }}
{{-- Nombre --}}
{{ $patient->fullName() }} @if($patient->blood_type) {{ $patient->blood_type }} @endif @if($patient->clinicalHistory) HC @endif

@if($patient->age()) {{ $patient->age() }} años @endif @if($patient->gender) · {{ ['male'=>'Masculino','female'=>'Femenino','other'=>'Otro'][$patient->gender] ?? '' }} @endif

{{-- Documento --}} {{-- Contacto --}} {{-- Citas --}} {{-- Evoluciones --}} {{-- Estado + acciones --}}
@if($patient->is_active) @else @endif {{-- Acciones en hover --}}
@endforeach
{{-- Footer paginación --}}

@if($query->hasPages()) Mostrando {{ $query->firstItem() }}–{{ $query->lastItem() }} de {{ $query->total() }} pacientes @else {{ $query->total() }} paciente{{ $query->total() !== 1 ? 's' : '' }} en total @endif

@if($query->hasPages())
{{ $query->links() }}
@endif
@endif