@extends('layouts.app') @section('title', 'New Visits') @section('content') @include('partials._queue-routing-helper') {{-- Stats Bar --}}

Today

{{ $stats['total'] }}

Waiting Triage

{{ $stats['waiting_triage'] }}

In Triage

{{ $stats['in_triage'] }}

Waiting Consult

{{ $stats['waiting_consult'] }}

In Consultation

{{ $stats['in_consultation'] }}

Completed

{{ $stats['completed'] }}

{{-- ═══ Create New Visit Form ═══ --}}

Create New Visit

@php $preselect = request('visit_type') ?? request('pathway') ?? 'outpatient'; @endphp
@csrf
{{-- Patient Search --}}
{{-- Department --}}
{{-- Payer --}}
{{-- Visit Type --}}
{{-- Submit --}}
{{-- Insurance fields (hidden) --}}
{{-- ═══ Filter Bar ═══ --}}
@if(request()->hasAny(['search','status','department']))Clear@endif
{{ $visits->total() }} visits
{{-- ═══ Visit List Table ═══ --}}
@forelse($visits as $v) @php $isUrgent = $v->status === 'urgent'; $statusMap = [ 'waiting' => ['Waiting Triage', 'badge-warning'], 'urgent' => ['URGENT', 'badge-danger'], 'in_triage' => ['In Triage', 'badge-info'], 'triaged' => ['Waiting Consult', 'badge-info'], 'in_consultation' => ['In Consultation', 'badge-info'], 'at_pharmacy' => ['At Pharmacy', 'badge-gray'], 'at_lab' => ['At Lab', 'badge-info'], 'at_radiology' => ['At Radiology', 'badge-info'], 'at_dentist' => ['At Dentist', 'badge-info'], ]; $st = $statusMap[$v->status] ?? [ucfirst(str_replace('_',' ',$v->status)), 'badge-gray']; @endphp @empty @endforelse
Visit # Patient Name MRN Age/Sex Visit Time Payer Department Status Triage Clinician Actions
{{ $v->visit_number }} {{ $v->patient->full_name ?? '' }} {{ $v->patient->mrn ?? '' }} {{ $v->patient->age ? $v->patient->age : '-' }}/{{ strtoupper(substr($v->patient->gender ?? '', 0, 1)) }} {{ $v->check_in_at ? $v->check_in_at->format('H:i') : '-' }} {{ $v->check_in_at ? $v->check_in_at->diffForHumans(null, true) . ' ago' : '' }} {{ $v->payer_label }} {{ $v->department->name ?? '-' }} {{ $st[0] }} @if($v->triage) {{ ucfirst($v->triage->priority) }} @else Pending @endif {{ $v->clinician->name ?? '–' }}
{{-- Send to Triage --}} @if(in_array($v->status, ['waiting', 'urgent'])) Triage @endif {{-- Send to Consultation (skip triage) --}} @if(in_array($v->status, ['waiting', 'urgent', 'in_triage', 'triaged']))
@csrf
@endif {{-- Send to Lab (direct lab pathway) --}} @if(in_array($v->status, ['waiting', 'urgent']) && in_array($v->visit_type, ['direct_lab']))
@csrf
@endif {{-- Send to Radiology (direct radiology pathway) --}} @if(in_array($v->status, ['waiting', 'urgent']) && in_array($v->visit_type, ['direct_radiology']))
@csrf
@endif {{-- Mark Urgent --}} @if($v->status !== 'urgent' && !in_array($v->status, ['in_consultation','completed']))
@csrf
@endif {{-- Open Visit --}} Open {{-- Patient Profile --}} Profile {{-- History --}} History {{-- Cancel --}} @if(in_array($v->status, ['waiting', 'urgent']))
@csrf
@endif
No active visits. Create a new visit above.
@if($visits->hasPages())
{{ $visits->links() }}
@endif
@endsection @push('scripts') @endpush