<!-- BEGIN [% component.name %] -->
    [% # PROCESS dumper.tt dump = request.as_tree %]
    
    [% patient = request.patient_case.patient %]

    <div style="margin-bottom: 15px">[% site.html.back_button %]</div>

    [% IF specimen_map.item(request.id);
        specimen = specimen_map.item(request.id).sample_code.join(', '); END;
    %]
    
    <table>
      <thead>
        <tr class="tbl_header_darken">
          <th>Name</th>
          <th>DoB</th>
          <th>Unit Number</th>
          <th>NHS Number</th>
          <th>Lab No.</th>
          <th>Date</th>
          <th>Source</th>
          <th>Referrer</th>
          [% IF specimen %]<th>Sample</th>[% END %]
        </tr>
      </thead>
      
      <tbody>
      <tr>
        <td>
          [% patient.last_name   | upper %],
          [% format_firstname(patient) || patient.first_name | ucfirst %]
          [% patient.middle_name | ucfirst %]
        </td>
        <td>
          [% IF patient.dob; patient.dob.strftime('%d.%b.%Y');
            ELSE; site.html.grey_null; END %]
        </td>
        <td>
          [% request.patient_case.unit_number %]
        </td>
        <td>
          [% INCLUDE site/nhs_number.tt nhs_number = patient.nhs_number %]
        </td>
        <td>
          [% INCLUDE site/lab_number.tt data = request want_url = 1 %]
        </td>
        <td>[% request.created_at.strftime('%d.%b.%Y') %]</td>

        <td>
          [% SET location = request.patient_case.referral_source.display_name %]
          [% INCLUDE site/display_name.tt %]
        </td>
        <td>[% request.referrer_department.referrer.name %]</td>
        [% IF specimen %]<td>[% specimen %]</td>[% END %]
      </tr>
      </tbody>
    </table>

<!-- END [% component.name %] -->
