{{-- ICTHospital - OPD token queue for a day: check in, call in, done, bill the visit. Copyright (c) DEVtrust Part of ICTHospital Licensed under the GNU General Public License v3.0. --}} @extends('layouts.master') @section('content') @include('app.partials._alerts') @php($mins = fn ($a, $b) => ($a && $b) ? max(0, (int) floor(\Carbon\Carbon::parse($a)->diffInMinutes(\Carbon\Carbon::parse($b)))) : null) @php($canUpdate = \App\Support\Permissions::allows('appointment_update')) @php($canBill = \App\Support\Permissions::allows('payment_add'))

OPD token queue

@foreach (['Total patients' => $counts['total'], 'Waiting' => $counts['waiting'], 'With doctor' => $counts['in'], 'Checked out' => $counts['done']] as $label => $n)
{{ $label }}
{{ $n }}
@endforeach
@if (\App\Support\Permissions::allows('appointment_add') && $date === now()->toDateString())
{{ csrf_field() }}

@endif
@forelse ($visits as $v) @php($p = $patients[$v->patient] ?? null) @empty @endforelse
TokenPatientDoctorBookedChecked inWaitingWith doctorStatusFee
{{ $v->token_no ?: '-' }} @if ($p){{ $p->name }}
{{ $p->patient_id }}@endif
{{ $doctorNames[$v->doctor] ?? '' }} {{ $v->s_time ? \Carbon\Carbon::parse($v->s_time)->format('H:i') : '' }}{{ $v->remarks === 'Walk-in' ? ' (walk-in)' : '' }} {{ $v->checked_in_at ? \Carbon\Carbon::parse($v->checked_in_at)->format('H:i') : '' }} {{ ($w = $mins($v->checked_in_at, $v->consult_started_at ?: ($v->status === 'arrived' ? now() : null))) !== null ? $w . ' min' : '' }} {{ ($t = $mins($v->consult_started_at, $v->checked_out_at ?: ($v->status === 'in consultation' ? now() : null))) !== null ? $t . ' min' : '' }} {{ ucfirst($v->status) }} @if ($v->payment_id)#{{ $v->payment_id }}@endif @if ($canUpdate) @if (in_array($v->status, ['scheduled', 'no show'], true) || ($v->status === 'arrived' && $v->token_no === null))
{{ csrf_field() }}
@elseif ($v->status === 'arrived')
{{ csrf_field() }}
@elseif ($v->status === 'in consultation')
{{ csrf_field() }}
@endif @endif @if (\App\Support\Permissions::allows('consultation_add') && in_array($v->status, ['arrived', 'in consultation', 'completed'], true)) Consult @endif @if ($canBill && ! $v->payment_id && $v->status !== 'cancelled')
{{ csrf_field() }}
@endif @if ($v->token_no)Token slip@endif @if ($v->mode === 'video' && $v->video_room) Video@endif
No visits for this day yet. Book appointments, or issue a walk-in token above.

Check in gives the next token for that doctor. Waiting time runs from check in to call in; time with the doctor runs from call in to done.

@stop