@php $cover = $patient->insurances->sortByDesc('is_primary'); $canManage = auth()->user()->can('patient-insurances.manage'); $relationships = ['self' => 'Self', 'spouse' => 'Spouse', 'child' => 'Child', 'parent' => 'Parent', 'other' => 'Other']; @endphp
@if ($cover->isEmpty()) @if ($canManage) @endif @else

{{ $cover->count() }} cover {{ Str::plural('record', $cover->count()) }} on file.

@if ($canManage) @endif
@foreach ($cover as $insurance)

{{ $insurance->payer?->name }}

{{ $insurance->scheme?->name ?? 'No scheme specified' }}

@if ($insurance->is_primary) @endif
Member no.
{{ $insurance->member_number }}
Card no.
{{ $insurance->card_number ?: '—' }}
Relationship
{{ $relationships[$insurance->relationship] ?? $insurance->relationship }}
Principal
{{ $insurance->principal_name ?: '—' }} @if ($insurance->principal_member_number) {{ $insurance->principal_member_number }} @endif
Valid
{{ $insurance->valid_from?->toDateString() ?? '—' }} to {{ $insurance->valid_to?->toDateString() ?? 'open' }} @unless ($insurance->is_valid) not active @endunless
Coverage
@if ((float) $insurance->coverage_limit > 0) {{ number_format((float) $insurance->coverage_limit, 2) }} used {{ number_format((float) $insurance->amount_used, 2) }} · left {{ number_format($insurance->remaining_coverage, 2) }} @else No limit recorded @endif
@if ($insurance->notes)

{{ $insurance->notes }}

@endif @if ($insurance->verified_at)

Eligibility checked {{ $insurance->verified_at->format('d M Y H:i') }} @if ($insurance->verifiedBy) by {{ $insurance->verifiedBy->name }} @endif

@endif @if ($canManage)
@csrf @method('DELETE')
@endif
@endforeach
@endif {{-- ------------------------------------------------------------ add cover --}} @if ($canManage)
@csrf

Add insurance cover

@error('payer_id')

{{ $message }}

@enderror

This payer has no active schemes on file.

@error('scheme_id')

{{ $message }}

@enderror
@foreach ($cover as $insurance) {{-- -------------------------------------------------------- verify --}}
@csrf @method('PATCH')

Eligibility check — {{ $insurance->payer?->name }}

Record what the payer confirmed for member {{ $insurance->member_number }}. Only verified cover counts towards a claim.

{{-- ---------------------------------------------------------- edit --}}
@csrf @method('PUT')

Edit insurance cover

Changing the payer, scheme or member number resets this cover to pending and drops the previous eligibility outcome.

@error('payer_id')

{{ $message }}

@enderror
@endforeach @endif