    [% META title="Initial Screen" %]
<!-- BEGIN [% template.name %] -->

    [% # PROCESS dumper.tt dump = screen_categories %]
    [% # PROCESS dumper.tt dump = haem_data.as_tree %]

    [% IF dfv_errors %]
        <p class="error">[% c.config('msg').dfv_errors %]</p>
    [% END %]

    [% PROCESS screen/showhide.tt %]
    
    <h2>Screen record:</h2>
    
    [% IF haem_data %]
        <h4 class="indent">Haematology</h4>
        [% INCLUDE result/haem_data.tt function = 'screen' %]
    [% END %]
    
    <div class="indent">
    [% PROCESS request/summary_display.tt # expects 'data' object %]
    </div>
    
    [% initial_screen_dfv_js %]

    [% INCLUDE site/previous_cases.tt # 'PROCESS' clobbers 'data'  %]

    <span class="spacer">&nbsp;</span>

    <form method="post" action="[% app_url %]/screen/do_initial_screen/[% data.id %]"
            [% initial_screen_onsubmit %] name="initialScreen" id="initialScreen">

        <table class="indent">
            <tr>
                <td class="label">Screen category:</td>
                <td class="content">
                    [% PROCESS screen/screen_category_select.tt %]
                </td>
                <td rowspan="2" class="borderless">
                    [% site.html.submit %] [% site.html.reset %]
                </td>
            </tr>
            [% IF audit_categories.size # only if settings.have_request_audit %]
            <tr>
                <td class="label">Reason for request:</td>
                <td class="content">
                    <select name="option_id">
                        <option value="">&nbsp;</option>
                        [% FOREACH group IN audit_categories %]
                        <optgroup label="[% group.description | upper %]">
                            [% FOREACH item IN request_audit %]
                            [% NEXT UNLESS
                                item.category.description.match(group.description) %]
                            <option value="[% item.id %]">
                                [% item.description %]
                            </option>
                            [% END %]
                        </optgroup>
                        [% END %]
                    </select>
                    [% error_option_id %]
                </td>
            </tr>
            [% END %]
        </table>
    </form>
<!-- END [% template.name %] -->
