@extends('layouts.app') @section('content')

Triage Queue

Patients awaiting vitals and triage assessment
Waiting: {{ $encounters->count() }}
@if($encounters->isEmpty())
No patients waiting for triage
Newly registered visits will appear here automatically
@else
@foreach($encounters as $index => $encounter) @php /* |-------------------------------------------------------------------------- | AGE |-------------------------------------------------------------------------- */ $age = null; if (!empty($encounter->date_of_birth)) { $age = \Carbon\Carbon::parse( $encounter->date_of_birth )->age; } /* |-------------------------------------------------------------------------- | SERVICE COLORS |-------------------------------------------------------------------------- */ $serviceType = strtolower( $encounter->visit_type ?? '' ); $serviceBg = '#f3f4f6'; $serviceColor = '#374151'; if ($serviceType === 'immunization') { $serviceBg = '#dcfce7'; $serviceColor = '#166534'; } elseif ($serviceType === 'anc') { $serviceBg = '#fef3c7'; $serviceColor = '#92400e'; } elseif ($serviceType === 'emergency') { $serviceBg = '#fee2e2'; $serviceColor = '#991b1b'; } /* |-------------------------------------------------------------------------- | PRIORITY |-------------------------------------------------------------------------- */ $priority = 'Routine'; $priorityBg = '#dbeafe'; $priorityColor = '#1d4ed8'; if ( ($encounter->spo2 ?? 100) < 90 ) { $priority = 'Critical'; $priorityBg = '#fee2e2'; $priorityColor = '#991b1b'; } elseif ( ($encounter->temperature ?? 0) >= 39 ) { $priority = 'High Risk'; $priorityBg = '#fef3c7'; $priorityColor = '#92400e'; } @endphp @endforeach
Queue No Encounter Patient Age / Sex Patient No Visit No Service Priority Arrival Action
{{ $index + 1 }}
{{ $encounter->encounter_no }}
{{ ucfirst( $encounter->status ?? 'waiting' ) }}
{{ $encounter->first_name }} {{ $encounter->last_name }}
{{ $age ?? '—' }} yrs / {{ strtoupper($encounter->gender ?? '—') }}
{{ $encounter->patient_no }} {{ $encounter->visit_no }} {{ ucfirst( $encounter->visit_type ?? 'Medical' ) }} {{ $priority }}
{{ \Carbon\Carbon::parse( $encounter->created_at )->format('H:i') }}
{{ \Carbon\Carbon::parse( $encounter->created_at )->diffForHumans() }}
Start Triage
Patients are listed in FIFO order based on encounter creation time.

• Medical patients proceed to Clinical Assessment
• Immunization visits bypass clinician consultation and proceed directly to vaccination workflow
• Critical patients may require emergency escalation
@endif
@endsection