[%- content_only = 1; # no html wrappers; called from record/default.tt -%] [%# INCLUDE site/lab_number.tt want_url = 0 %] [% settings = c.cfg('settings') %] [%# base href only needed so wkhtmltopdf can find static files as http addr: %] [% UNLESS is_print_request # wrecks span width formatting %] [% END %] [% # define static vars - don't change between requests if print-run request: text_str = { csf => 'absence of involvement of the cerebro-spinal fluid does not' _ ' exclude the possibility of intracerebral disease', tests_pending => 'there are further laboratory investigations pending', service_url => 'the definitive report is available online at ' _ settings.service_url, pb_sample => 'please send a peripheral blood sample with all bone marrow specimens', clinic_return => 'Currently unsuitable for community monitoring: an appointment' _ ' will be made at the haematology clinic.', # clinic_return => 'A haematology clinic appointment is required. If you do not' # _ ' receive confirmation of an appointment within two weeks, please contact us.', pack_dispatch => 'Suitable for community monitoring: a pack will be sent out', ukas_accredited_tests => 'all lab-tests accredited to ISO 15189:2012' _ ' except as listed <http://hmds.info/lab-tests>', }; acronym_class = is_print_request ? 'normal' : 'acronym'; # don't display if print req %] [% # PROCESS dumper.tt dump = data.as_tree %] [% IF reports.size; # HTML print-run request: offset = c.query.param('offset') || 0; # next offset value count = c.query.param('total') || 0; # total number of records in print run start = c.query.param('start') | uri; end = c.query.param('end') | uri; offset_next = offset + 50; offset_lower = offset_next + 1; # start of next offset offset_upper = offset_next + 50; # end of next offset url = []; url.push("total=$count"); url.push("offset=$offset_next"); url.push("start=$start"); url.push("end=$end"); # PROCESS dumper.tt dump = url; %]

[% site.html.back_button %] [% IF count >= offset_lower; # still more records to print: %] [% offset_lower %] to [% ( offset_upper > count ) ? count : offset_upper %] » [% ELSE %] [finished] [% END %]

[% FOREACH entry IN reports; import(entry); # clobbers all previous keys (history, has_optional, etc): # need to (re)define vars not set in caller record/default.tt: request_data = data.as_tree; # save multiple lookups if undefined report = data.request_report; # PROCESS dumper.tt dump = report.as_tree; patient = data.patient_case.patient; # PROCESS dumper.tt dump = patient.as_tree; %]
[% INCLUDE record/report/body.tt %]
[% END %] [% ELSE; INCLUDE record/report/body.tt; END %] [% UNLESS is_print_request # printed as wkhtmltopdf footer %] [% END %] [% UNLESS c.get_current_runmode.match('_do_print') # print run %]
THIS PAGE VIEW IS NOT FORMATTED FOR PRINTING. PLEASE USE THE "PRINT" ICON IN THE UPPER NAVIGATION SECTION.
[% END %]