[% # PROCESS dumper.tt dump = resultable_tests %] [% # PROCESS dumper.tt dump = data_options_map %]

Test results: [% div_name = sectionName _ '_data'; INCLUDE site/snippets/toggleview.tt %]

[% IF c.query.param('results_only') %] [show all results] [% ELSE %] [show results only] [% END %]

[% UNLESS is_locked # can still view results section if locked %]
[% END %] [% sorted_tests = natural_sort(resultable_tests); # PROCESS dumper.tt dump = sorted_tests; %] [% count = 1 %] [% FOREACH test_name IN sorted_tests; # PROCESS dumper.tt dump = this_section.test.item(test_name); test_data = this_section.test.item(test_name); # PROCESS dumper.tt dump = test_data; NEXT UNLESS test_data.is_active.match('yes'); # skip inactive data_type = data_map.lab_test_data_type.item(test_data.id).data_type; # PROCESS dumper.tt dump = data_type; NEXT IF c.query.param('results_only') AND NOT test_data.result; IF test_data.result; class = 'title'; ELSIF test_data.status; class = 'red'; # awaiting result ELSE; class = 'normal'; END; %] [% # n_cols = data_type.type == 'text' ? 2 : 6 # text longer than others %] [% UNLESS loop.last OR # don't start new table unless multiple of $n_cols: count % 3 %]
[% test_name | html %] [% IF ! data_type.id # assume free text %] [% ELSE %] [% END %]
[% END %] [% count = count + 1 %] [% END %]

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

[% UNLESS is_locked %]
[% END %]