[% META title = 'Resources &raquo; Incomplete Tests '%]
<!-- BEGIN [% template.name %] -->
    [% # INCLUDE dumper.tt dump = dataset %]


    <h3 class="header">Incomplete [% c.query.param('section') %] section
        [% c.query.param('investigation') %] tests:</h3>

    [% USE date = DateTime(today = 1) %]

    <p class="indent">[% site.html.back_button %]</p>

    <table class="indent">
        <tr>
            <th>Lab No</th>
            <th>Name</th>
            <th>DoB</th></th>
            <th>NHS number</th>
            <th>Location</th></th>
            <th>Lab-test Status</th>
        </tr>
        [% FOREACH data IN dataset;
            last_update = data.request_lab_tests_status.time;
            patient = data.patient_case.patient;
        %]
            <tr>
                <td>[% INCLUDE site/snippets/lab_number.tt want_url = 1 %]</td>
                <td>
                    [% patient.last_name | upper %],
                    [% patient.first_name | ucfirst %]
                </td>
                <td>
                    [% patient.dob.dmy('.') %]
                </td>
                <td>
                    [% INCLUDE site/nhs_number.tt nhs_number = patient.nhs_number %]
                </td>
                <td>[% data.patient_case.referral_source.display_name %]</td>
                <td>
                    [% data.request_lab_tests_status.status.description %]
                    <span class="acronym" title="[% last_update.dmy('.') %]">
                        [[% last_update.delta_days(date).delta_days %] days ago]
                    </span>
                </td>
            </tr>
        [% END %]
    </table>

    <p class="indent">[% site.html.back_button %]</p>
<!-- END [% template.name %] -->
