[% META title = 'Admin » Linked Lab Tests' -%] [% # PROCESS dumper.tt dump = sections %] [% # PROCESS dumper.tt dump = linked_tests_map %] [% # PROCESS dumper.tt dump = t.as_tree FOREACH t IN all_linked_tests %] [% # PROCESS dumper.tt dump = vars %] [% IF all_linked_tests.size %]

Linked Lab Tests [% div_name = 'linked_tests'; INCLUDE site/snippets/toggleview.tt %]

[% class = c.query.param('lab_section_id') ? 'itemhidden' : 'normal' %]
[% FOREACH test IN all_linked_tests; # PROCESS dumper.tt dump = test.as_tree; %] [% END %]
Parent Test Linked Test
[% loop.count %] [% test.parent_lab_test.field_label %] [[% test.parent_lab_test.lab_section.section_name %]] [% test.linked_lab_test.field_label %] [[% test.linked_lab_test.lab_section.section_name %]] edit
[% ELSE %]

No linked lab tests configured

[% END %]

Configure Linked Lab Tests

Select lab section of parent lab test:

[% IF parent_tests.size; # PROCESS dumper.tt dump = parent_tests; %]

1) Select parent lab test [ pre-configured parent test(s) in red [% UNLESS c.query.param('parent_test_id') %]; warning: no parent lab test selected [% END %]]

[% count = 1 %] [% FOREACH test IN parent_tests; # test.is_active; NEXT UNLESS test.is_active.match('yes'); class = linked_tests_map.item(test.id) ? 'red' : 'normal' %] [% UNLESS loop.last OR ( count % 5 ) # don't start new table unless multiple of 6: %]
[% test.field_label | html %]
[% END %] [% count = count + 1 %] [% END %] [% '' IF count == 1 # or get invalid html %]
[% # UNLESS c.query.param('parent_test_id' ) # need this anyway %]
[% site.html.submit %]
[% # END %]
[% END %] [% IF lab_tests.size %]

2) Select lab test(s) for linking:

[% site.html.submit %] [% site.html.reset %]
[% END %]