{{-- ============================================================
PHASE 4 — IMPACT ASSESSMENT + CAPA + ACTIONS
============================================================ --}}
@php
$impact = $deviation->impact;
$activeLinks = $deviation->capaLinkages->where('is_active', true);
@endphp
The linkage becomes active automatically once approved.
Impact Assessment
Detailed Impact Items
@if($impact->items->isEmpty())
@foreach($impact->items as $item)
Type
Description
Severity
Mitigation
Proposed
Target
Status
@endforeach
{{ $item->impact_type ?? '—' }}
{{ Str::limit($item->impact_description, 60) }}
{{ $item->severity }}
{!! $item->requires_mitigation
? 'YES'
: 'NO' !!}
{{ Str::limit($item->proposed_mitigation, 40) ?? '—' }}
{{ $item->target_date?->format('M j, Y') ?? '—' }}
{{ $item->mitigation_status }}
Corrective & Preventive Actions (CAPA)
@foreach($pendingLinks as $pending)
@foreach($activeLinks as $link)
CAPA Number
Title
Type
Priority
Status
Linkage
Linked
Actions
@endforeach
{{-- Pending linkages shown in the same table with a "Pending" badge --}}
@foreach($pendingLinks as $pending)
{{ $link->capa?->capa_number ?? 'CAPA #' . $link->capa_id }}
{{ Str::limit($link->capa?->title ?? '—', 60) }}
{{ $link->capa?->capa_type ?? '—' }}
{{ $link->capa?->priority ?? '—' }}
{{ $link->capa?->status ?? '—' }}
{{ $link->linkage_type }}
@if($link->approval_instance_id)
WF #{{ $link->approval_instance_id }}
@endif
{{ $link->linked_date?->format('M j, Y') ?? '—' }}
@endforeach
{{ $pending->capa?->capa_number ?? 'CAPA #' . $pending->capa_id }}
{{ Str::limit($pending->capa?->title ?? '—', 60) }}
{{ $pending->capa?->capa_type ?? '—' }}
{{ $pending->capa?->priority ?? '—' }}
Awaiting approval
Pending
@if($pending->approval_instance_id)
WF #{{ $pending->approval_instance_id }}
@endif
{{ $pending->linked_date?->format('M j, Y') ?? '—' }}
Action Plan
@foreach($deviation->actions as $action)
Type
Description
Assigned
Due
Status
Actions
@endforeach
{{ str_replace('_', ' ', $action->action_type) }}
{{ Str::limit($action->action_description, 60) }}
{{ $action->assignee?->name ?? '—' }}
{{ $action->due_date?->format('M j, Y') }}
@if($action->isOverdue())
Overdue
@endif
{{ $action->status }}
@if($action->status === 'COMPLETED')
@endif