RSS Git Download  Clone
Raw Blame History
  [% META title = 'Admin » Active Lab Tests' -%]
<!-- BEGIN [% template.name %] -->
    [% # INCLUDE dumper.tt dump = lab_sections %]
    
    [%
        url = app_url _ '/resources/list_all_lab_tests';
        lab_section_id = c.query.param('lab_section_id');    
    %]
    
    [% IF lab_tests.size %]
        <p class="header">Active Lab Tests</p>
        
        [% IF lab_sections.size %]
          <form action="[% url %]" method="post" name="form">
            <p><span class="bold">Show only</span>:
                <select name="lab_section_id" id="lab_section_id" onchange="submit()">
                    <option value="">----</option>
                    [% FOREACH s IN lab_sections %]
                        <option value="[% s.id %]"
                            [% 'selected' IF s.id == lab_section_id %]>[% s.section_name %]
                        </option>
                    [% END %]
                </select>
            </p>
          </form>
        [% END %]

        <table class="indent">
            <tr>
                <td class="borderless"></td>
                <th><a href="[% url %]?sort_by=field_label">Test Label</a></th>
                <th><a href="[% url %]?sort_by=test_name">Test Name</a></th>
                <th><a href="[% url %]?sort_by=test_type">Test Type</a></th>
                <th>Active</th>
                <th>
                [% UNLESS lab_section_id %]
                    <a href="[% url %]?sort_by=lab_section.section_name">Lab Section</a>
                [% ELSE %]Lab Section[% END %]
                </th>
            </tr>
            [% i = 0; WHILE ( test = lab_tests.next );
                IF lab_section_id;
                    NEXT UNLESS test.lab_section_id == lab_section_id;
                END;
            %]
                <tr>
                    <td align="right">[% i = i + 1; i %]</td>
                    <td>[% test.field_label %]</td>
                    <td>[% test.test_name %]</td>
                    <td>[% test.test_type %]</td>
                    <td>[% test.is_active %]</td>
                    <td>[% test.lab_section.section_name %]</td>
                </tr>
            [% END %]
        </table>
    [% ELSE %]
        <p class="warning">No lab tests configured</p>
    [% END %]
<!-- END [% template.name %] -->