
    <p class="warning">
        Potential duplicate record. Unit No. and/or NHS No. matches:
    </p>

    [% FOREACH entry IN maybe_duplicate %]
    <p class="indent">  [% # PROCESS dumper.tt dump = entry.patient %]
        [% FOREACH field IN [ 'last_name' 'first_name' ] %]
            [% IF entry.patient.$field != c.query.param($field) %]
                <span class="highlight">[% entry.patient.$field %]</span>
            [% ELSE %]
                [% entry.patient.$field %]
            [% END %]
            ::
        [% END %]

        [% entry.patient.dob.strftime('%d.%b.%Y') %] ::

        [% SET unit_number = entry.unit_number || site.html.grey_null %]
        [% IF unit_number == c.query.param('unit_number') %]
            <strong>[% unit_number %]</strong>
        [% ELSE %]
            [% unit_number %]
        [% END %]
        ::
        [% SET nhs_number = entry.patient.nhs_number || site.html.grey_null %]
        [% IF nhs_number == c.query.param('nhs_number') %]
            [% SET nhs_number_duplicate = 1 %]
            <strong>[% nhs_number %]</strong>
        [% ELSE %]
            [% nhs_number %]
        [% END %]
        ::
        [% entry.referral_source.display_name %]
    </p>
    [% END %]

    [% UNLESS nhs_number_duplicate # flag disables submit button instead %]
    <p class="bold">
        Either amend patient details above, or confirm details below are correct:
            <input type="checkbox" name="_local_confirmed" value="1" />
    </p>
    [% END %]

<hr />
