[% # META title = '' # using my.meta_title to allow processing dynamic vars: status_query = c.query.param('status_query').replace('_', ' ') | ucfirst; my.meta_title = "Worklist » Request Status » ${status_query}" -%] [% # PROCESS dumper.tt dump = request_options_map %] [% # PROCESS dumper.tt dump = incomplete_lab_tests %] [% status_query = c.query.param('status_query'); duration = c.query.param('duration') || c.cfg('settings').unreported_duration; filter = c.query.param('filter'); # INCLUDE dumper.tt dump = filter; %] [% class = ( ! filter OR filter.match('all') ) ? 'normal' : 'grey' %]
| Lab No | Name | Sample | Source | [% UNLESS status_query == 'unscreened' %]Presentation | [% IF incomplete_lab_tests %]Incomplete tests | [% END %] [% END %]Registered | [% IF c.query.param('status_query').match('unauthorised') %]Reported | Reporter | [% END %]|
|---|---|---|---|---|---|---|---|---|---|
| [% i = ( i || 0 ) + 1; i %] | [% PROCESS site/lab_number.tt want_url = 1; # expects request object 'data' %] | [% class = request_options_map.item(data.id).urgent ? 'red' : 'normal' %][% patient.last_name | upper %], [% format_firstname(patient) || patient.first_name | ucfirst %] [% patient.middle_name | ucfirst %] | [% specimen_map.item(data.id).sample_code.join(', ') %] [% INCLUDE site/snippets/doi.tt IF request_options_map.item(data.id).doi %] | [% SET location = data.patient_case.referral_source.display_name %] [% PROCESS site/display_name.tt %] | [% UNLESS status_query == 'unscreened' %][% IF data.request_initial_screen; data.request_initial_screen.screen.description; ELSE; site.html.grey_null; END; %] | [% IF incomplete_lab_tests; tests = incomplete_lab_tests.${data.id} %]
[% IF tests; FOREACH t IN tests %]
[% t.test %]
[% END %]
[% ELSE %]
[none]
[% END %]
|
[% END %]
[% END %]
[%
delta = duration_map.${data.id};
class =
delta > 5 ? 'add' : # .red without bold text
delta > 2 ? 'orange' : 'green';
%]
[% data.created_at.strftime('%d.%b.%Y') %]
[[% delta %]]
|
[% IF c.query.param('status_query').match('unauthorised');
FOREACH r IN data.request_status;
NEXT UNLESS r.action.match('reported');
reporter = r.username.upper;
reported = r.time.strftime('%d.%b.%Y');
END;
%]
[% reported %] | [% reporter %] | [% END %]
[% site.html.back_button %]