@extends('layouts.app') @section('title', 'Ticket de consultation #' . $ticket->id) @section('content')

Ticket de consultation #{{ $ticket->id }} {{ ucfirst(str_replace('_', ' ', $ticket->status)) }}

@if($ticket->status === 'en_attente')
@csrf @method('PUT')
@endif @if($ticket->status === 'en_cours')
@csrf @method('PUT')
@endif
Retour à la liste
Informations du patient
Nom complet :
{{ $ticket->patient->first_name }} {{ $ticket->patient->last_name }}

Date de naissance :
{{ \Carbon\Carbon::parse($ticket->patient->date_of_birth)->format('d/m/Y') }}

Âge :
{{ \Carbon\Carbon::parse($ticket->patient->date_of_birth)->age }} ans

Sexe :
{{ $ticket->patient->gender === 'M' ? 'Masculin' : 'Féminin' }}

Téléphone :
{{ $ticket->patient->phone ?? 'Non renseigné' }}

Adresse :
{{ $ticket->patient->address ?? 'Non renseignée' }}
Détails de la consultation
Médecin :
Dr. {{ $ticket->doctor->first_name }} {{ $ticket->doctor->last_name }}

Spécialité :
{{ $ticket->doctor->specialty }}

Centre de santé :
{{ $ticket->healthCenter->name }}

Date création :
{{ $ticket->created_at->format('d/m/Y à H:i') }}

Type consultation :
{{ ucfirst($ticket->consultation_type) }}
@if($ticket->priority !== 'normale')
Priorité :
{{ ucfirst($ticket->priority) }}
@endif @if($ticket->symptoms)
Symptômes rapportés :

{{ $ticket->symptoms }}

@endif
Suivi temporel
Ticket créé

{{ $ticket->created_at->format('d/m/Y') }}

{{ $ticket->created_at->format('H:i') }}
@if($ticket->status !== 'en_attente')
Consultation démarrée

{{ $ticket->updated_at->format('d/m/Y') }}

{{ $ticket->updated_at->format('H:i') }}
@endif
Temps d'attente
@php $waitTime = $ticket->status === 'en_attente' ? $ticket->created_at->diffInMinutes(now()) : $ticket->created_at->diffInMinutes($ticket->updated_at); @endphp

{{ $waitTime }} min

@if($waitTime > 60) ({{ floor($waitTime / 60) }}h {{ $waitTime % 60 }}min) @endif
Position dans la file
@php $position = \App\Models\ConsultationTicket::where('doctor_id', $ticket->doctor_id) ->where('status', 'en_attente') ->where('created_at', '<', $ticket->created_at) ->count() + 1; @endphp

@if($ticket->status === 'en_attente') {{ $position }}{{ $position === 1 ? 'er' : 'ème' }} @else Terminé @endif

en attente
@if($ticket->status !== 'termine')
Actions rapides
@if($ticket->status === 'en_attente')
@csrf @method('PUT')
@csrf @method('PUT')
@endif @if($ticket->status === 'en_cours')
@csrf @method('PUT')
@endif Aller à la pharmacie
@endif @endsection