@extends('layouts.app') @section('title', __('appointments::messages.appointments.book')) @section('content')

{{ __('appointments::messages.appointments.book') }}

{{ __('appointments::messages.appointments.book_subtitle') }}

@csrf
{{-- The patient is chosen by ULID through a type-ahead against the Patients module's published directory. No internal id ever reaches the form, and Appointments never touches a Patient model to render this. --}} @if ($patient !== null)
{{ $patient->name }} {{ $patient->mrn }} {{ __('common.reset') }}
@else
    {{-- Nobody by that name. A receptionist with a new patient at the desk used to get an empty box and no way forward from it. The search term travels to the register form, so the name just typed is not typed again. --}}
    {{ __('appointments::messages.appointments.no_patient_match') }} {{ __('appointments::messages.appointments.register_patient') }}
    @error('patient')
    {{ $message }}
    @enderror @endif
    {{-- The date comes before the clinician on purpose: which day decides who is in, not the other way round. --}}
    {{-- Filled from the date by Clinic.booking. Only clinicians with a free slot that day are offered, so choosing one can never lead to an empty list of times. --}} @error('doctor')
    {{ $message }}
    @enderror
    {{-- Slots come from the availability endpoint as ISO-8601 instants, so the browser never reasons about the clinic's timezone and cannot get it wrong. --}}
    {{ __('appointments::messages.appointments.pick_doctor') }}
    @error('starts_at')
    {{ $message }}
    @enderror
    {{ __('common.cancel') }}
    @endsection