@extends('layouts.app') @section('title', $incident->reference_number) @php $breadcrumbs = [ ['label' => 'Dashboard', 'url' => route('dashboard'), 'icon' => 'fa-home'], ['label' => 'Incidents', 'url' => route('incidents.index'), 'icon' => 'fa-exclamation-triangle'], ['label' => $incident->reference_number, 'url' => null, 'active' => true] ]; @endphp @section('content')
Back to Incidents

{{ $incident->title ?? $incident->reference_number }}

{{ $incident->reference_number }}

@can('incidents.print') Export PDF @endcan @can('incidents.create') Copy @endcan @can('incidents.edit') @if($incident->status !== 'closed' && $incident->status !== 'resolved') Edit @endif @endcan @can('incidents.create') @if(!$incident->investigation && $incident->status !== 'closed') Start Investigation @endif @endcan
@if($incident->status === 'open' || $incident->status === 'reported')

Open Incident

This incident requires attention and investigation.

{{ ucfirst($incident->status) }}
@elseif($incident->status === 'investigating')

Under Investigation

Investigation is in progress.

Investigating
@elseif($incident->status === 'closed' || $incident->status === 'resolved')

Incident Closed

This incident has been resolved and closed.

{{ ucfirst($incident->status) }}
@endif

Incident Details

Event Type

@if($incident->event_type) @php $eventTypeIcons = [ 'injury_illness' => ['icon' => 'fa-user-injured', 'color' => 'red', 'label' => 'Injury/Illness'], 'property_damage' => ['icon' => 'fa-tools', 'color' => 'orange', 'label' => 'Property Damage'], 'near_miss' => ['icon' => 'fa-exclamation-triangle', 'color' => 'yellow', 'label' => 'Near Miss'], 'environmental' => ['icon' => 'fa-leaf', 'color' => 'green', 'label' => 'Environmental'], ]; $eventType = $eventTypeIcons[$incident->event_type] ?? ['icon' => 'fa-circle', 'color' => 'gray', 'label' => 'Other']; @endphp
{{ $eventType['label'] }}
@else

N/A

@endif

Severity

{{ ucfirst($incident->severity) }}

Date & Time

{{ $incident->incident_date->format('F j, Y') }}
{{ $incident->incident_date->format('g:i A') }}

Location

{{ $incident->location }}

@if($incident->location_specific)

{{ $incident->location_specific }}

@endif

Department

{{ $incident->department->name ?? 'N/A' }}

Assigned To

{{ $incident->assignedTo->name ?? 'Unassigned' }}

Description

{{ $incident->description }}

@if($incident->isInjuryIllness())

Injury/Illness Details

@if($incident->injury_type)

Injury Type

{{ ucfirst(str_replace('_', ' ', $incident->injury_type)) }}

@endif @if($incident->body_part_affected)

Body Part Affected

{{ $incident->body_part_affected }}

@endif @if($incident->nature_of_injury)

Nature of Injury

{{ $incident->nature_of_injury }}

@endif @if($incident->lost_time_injury)

Lost Time Injury

Yes @if($incident->days_lost) ({{ $incident->days_lost }} days) @endif

@endif @if($incident->medical_treatment_details)

Medical Treatment

{{ $incident->medical_treatment_details }}

@endif
@elseif($incident->isPropertyDamage())

Property Damage Details

@if($incident->asset_damaged)

Asset Damaged

{{ $incident->asset_damaged }}

@endif @if($incident->estimated_cost)

Estimated Cost

${{ number_format($incident->estimated_cost, 2) }}

@endif @if($incident->insurance_claim_filed)

Insurance Claim

Filed

@endif @if($incident->damage_description)

Damage Description

{{ $incident->damage_description }}

@endif
@elseif($incident->isNearMiss())

Near Miss Details

@if($incident->potential_severity)

Potential Severity

{{ ucfirst($incident->potential_severity) }}

@endif @if($incident->potential_consequences)

Potential Consequences

{{ $incident->potential_consequences }}

@endif @if($incident->preventive_measures_taken)

Preventive Measures Taken

{{ $incident->preventive_measures_taken }}

@endif
@endif @if($incident->hasImages())

Images

@foreach($incident->images as $image) Incident image @endforeach
@endif

Quick Info

Reported By

{{ $incident->reporter->name ?? $incident->reporter_name ?? 'Anonymous' }}

@if($incident->reporter)

{{ $incident->reporter->email }}

@endif

Reported On

{{ $incident->created_at->format('M j, Y g:i A') }}

@if($incident->assignedTo)

Assigned To

{{ $incident->assignedTo->name }}

@endif

Quick Actions

Risk Assessment Integration

@if(!$incident->related_hazard_id) Create Hazard from Incident @else View Related Hazard @endif @if(!$incident->related_risk_assessment_id) Create Risk Assessment @else View Related Risk Assessment @endif @if($incident->rootCauseAnalysis) Trigger Risk Review @endif
@if(!$incident->investigation && $incident->status !== 'closed') Start Investigation @endif @if($incident->investigation && !$incident->rootCauseAnalysis) Perform RCA @endif @if($incident->rootCauseAnalysis && $incident->capas->count() == 0) Create CAPA @endif @if($incident->canBeClosed() && $incident->closure_status !== 'approved')
@csrf
@endif @if($incident->closure_status === 'pending_approval')

Pending Approval

@endif
@if($incident->related_hazard_id || $incident->related_risk_assessment_id || $incident->hazard_was_identified)

Risk Assessment Integration

@if($incident->hazard_was_identified)
Hazard was identified
@endif @if($incident->controls_were_in_place)
Controls were in place
@if($incident->controls_were_effective !== null) {{ $incident->controls_were_effective ? 'Effective' : 'Ineffective' }} @endif
@endif @if($incident->related_hazard_id) @endif @if($incident->related_risk_assessment_id) @endif @if($incident->risk_assessment_gap_analysis)

Gap Analysis

{{ $incident->risk_assessment_gap_analysis }}

@endif
@endif

Workflow Status

Investigation @if($incident->investigation) {{ ucfirst($incident->investigation->status) }} @else Not Started @endif
Root Cause Analysis @if($incident->rootCauseAnalysis) {{ ucfirst($incident->rootCauseAnalysis->status) }} @else Not Started @endif
CAPAs @php $totalCapas = $incident->capas->count(); $closedCapas = $incident->capas->where('status', 'closed')->count(); @endphp @if($totalCapas > 0) {{ $closedCapas }}/{{ $totalCapas }} Closed @else None @endif
@endsection