@extends('admin.layouts.app') @section('title', __('patients.title')) @section('content')

{{ __('patients.index.heading') }}

{{ __('patients.index.subtitle') }}

@can('patients.create') {{ __('patients.index.new_record') }} @endcan
@if (session('success'))
{{ session('success') }}
@endif @if (session('error'))
{{ session('error') }}
@endif
{{ __('patients.index.stats.total') }}
{{ $summary['total'] }}
{{ __('patients.index.stats.active') }}
{{ $summary['active'] }}
{{ __('patients.index.stats.inactive') }}
{{ $summary['inactive'] }}
{{ __('patients.index.stats.important_alerts') }}
{{ $summary['withAlerts'] }}
{{ __('common.reset') }}
@forelse ($patients as $patient) @empty @endforelse
{{ __('patients.index.table.patient') }} {{ __('patients.index.table.contact') }} {{ __('patients.index.table.medical_record') }} {{ __('patients.index.table.activity') }} {{ __('common.status') }} {{ __('common.actions') }}
{{ $patient->display_name }}
{{ $patient->patient_code }}
{{ $patient->phone }}
{{ $patient->email ?: __('patients.index.no_email') }}
{{ __('patients.index.record.contacts', ['count' => $patient->emergencyContacts->count()]) }}
{{ __('patients.index.record.files', ['count' => $patient->medicalFiles->count()]) }}
{{ __('patients.index.record.allergies', ['status' => filled($patient->medicalHistory?->allergies) ? __('patients.index.record.recorded') : __('patients.index.record.not_recorded')]) }}
{{ __('patients.index.activity.appointments', ['count' => $patient->appointments->count()]) }}
{{ __('patients.index.activity.invoices', ['count' => $patient->invoices->count()]) }}
{{ $patient->status?->label() ?? ucfirst($patient->status?->value ?? 'unknown') }}
{{ __('common.view') }} @can('patients.edit') {{ __('common.edit') }} @endcan
{{ __('patients.index.empty_filtered') }}
{{ $patients->links() }}
@endsection