@extends('layouts.app') @section('title', __('patients::messages.patients.register')) @section('content') @php($duplicates = session('error_code') === 'patient_possible_duplicate' ? (session('error_details.matches') ?? []) : [])

{{ __('patients::messages.patients.register') }}

{{ __('patients::messages.register.subtitle') }}

{{-- The draft indicator lives in the header rather than the action bar so it is visible while the bar is scrolled past its own buttons, and so there is exactly one "Save draft" control on the page. --}} {{ __('patients::messages.register.draft_none') }}
@if ($duplicates !== []) {{-- The service found records that resemble these details and stopped. Showing the candidates is the whole point: an error that says "possible duplicate" without saying which one leaves the receptionist to search by hand, which is how the second record gets created anyway. --}}
{{ __('patients::messages.duplicate.explain') }}
@endif
@csrf {{-- An interrupted registration is the normal case at a reception desk, so the draft is offered back rather than restored silently — the person at the keyboard may not be the person who started it, and finding someone else's half-typed patient already in your form is how the wrong details get saved under the right name. --}}
{{-- --------------------------------------------------------- Demographics --------------------------------------------------------- --}}
{{-- One box, as the name is said and as it is read off a card. The record still keeps first, middle and last — search, sorting and every report read them — and the request splits on the way in. Seeded when the booking screen sent somebody here after a search that found nobody, so the name just typed is not typed a second time. --}}
{{-- Age or date of birth, whichever the patient actually knows. Most people arriving at the desk cannot give a date, so age is the default. What gets stored either way is `date_of_birth` — an age of 34 is written as today minus 34 years and flagged estimated, because that is exactly what it is. Storing it any other way would let an age-based dose read as if someone had produced a birth certificate. The switch and the age box are rendered hidden and revealed by resources/js. With no script the screen is the plain date field it has always been, rather than a control that silently collects nothing. --}} {{-- Beside the name, not under it: which of age and date of birth is being given, and the value itself, read as one question and now sit on one line. --}}
{{-- An estimated date of birth is flagged rather than hidden. Plenty of patients genuinely do not know theirs, and recording a guess as fact makes an age-based dose look more certain than it is. --}}
{{-- A list, not a
@endif
{{-- --------------------------------------------------------- Completion rail --------------------------------------------------------- --}}
{{-- --------------------------------------------------------- Sticky action bar --------------------------------------------------------- --}} {{ __('common.cancel') }} @endsection