[% META title = 'Admin » Diagnosis New Lab Tests' -%] [% # PROCESS dumper.tt dump = lab_sections %] [% # PROCESS dumper.tt dump = section_tests %] [% # PROCESS dumper.tt dump = categories %] [% # PROCESS dumper.tt dump = diagnosis_lab_tests %]

Configure Diagnosis Request New Lab Tests

[% PROCESS admin/lab/test/diagnosistests/showhide.tt %] [% IF c.query.param('diagnosis_id') %]

[% diagnosis_name %]

[% END %]
Diagnosis category: [% PROCESS admin/lab/test/diagnosistests/category_select.tt %] [% site.html.submit %] [% site.html.reset %]
[% IF section_tests.size %] [% IF NOT diagnosis_lab_tests.size %]

No lab-tests configured

[% END %]
[% FOREACH section IN section_tests; # PROCESS dumper.tt dump = section; section_name = section.key; lab_tests = section.value; %]

[% section_name %] [% div_name = section_name; INCLUDE site/snippets/toggleview.tt %] [% configured = []; FOREACH test IN lab_tests; NEXT UNLESS diagnosis_lab_tests.item(test.id); label = test.test_type.match('panel') ? test.field_label _ ' panel' : test.field_label; configured.push(label); END; IF configured.size; '['; configured.join('; '); ']'; END; %]

[% count = 1 %] [% FOREACH test IN lab_tests; NEXT UNLESS # test.test_type == 'test'AND test.is_active == 'yes'; # NB query already excludes inactive selected = diagnosis_lab_tests.item(test.id); class = selected ? 'bold' : 'normal'; %] [% UNLESS loop.last OR # don't start new table unless multiple of 4: ( lab_tests.size > 4 AND count % 4 ) %]
[% test.field_label %] [% '[panel]' IF test.test_type.match('panel') %] :
[% END %] [% count = count + 1 %] [% END %] [% '' IF count == 1 # or get invalid html %]
[% END %]

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

[% END %]