[% META title = 'Request &raquo; Barcodes' %]
[%# content_only = 1 %]
<!-- BEGIN [% template.name %] -->
    [% # INCLUDE dumper.tt dump = data.as_tree %]
    [% # INCLUDE dumper.tt dump = c.cfg('settings') %]

    [% INCLUDE record/patient_summary.tt request = data %]

    <h3 class="header">Request barcodes</h3>

    <table class="outer">
        <tr>
            <th>Field</th>
            <!--<th>Value</th>-->
            <th>DataMatrix</th>
            <!--<th>QR Code</th>-->
            <th>Code-128</th>
            <!--<th>Code-93</th>-->
        </tr>
        <tr>
            [% lab_number = c.cfg('settings').lab_number_prefix
                _ data.request_number _ '/' _ ( data.year - 2000 ) %]
            <td class="bold">Lab number</td>
            <td>[% render_barcode(lab_number, 'data_matrix') %]</td>
            <td>[% render_barcode(lab_number, 'code128') %]</td>
        </tr>
        <tr>
            [% nhs_number = data.patient_case.patient.nhs_number %]
            <td class="bold">NHS number</td>
            <td>[% render_barcode(nhs_number, 'data_matrix') %]</td>
            <td>[% render_barcode(nhs_number, 'code128') %]</td>
        </tr>
        <tr>
            [% unit_number = data.patient_case.unit_number %]
            <td class="bold">Unit number</td>
            <td>[% render_barcode(unit_number, 'data_matrix') %]</td>
            <td>[% render_barcode(unit_number, 'code128') %]</td>
        </tr>
        [% IF data.request_external_ref;
            external_ref = data.request_external_ref.external_reference %]
            <tr>
                <td class="bold">External ref</td>
                <td>[% render_barcode(external_ref, 'data_matrix') %]</td>
                <td>[% render_barcode(external_ref, 'code128') %]</td>
            </tr>
        [% END %]
        [% IF c.cfg('settings').composite_barcode; # empty vars OK:
            composite =
                lab_number  _ ',' _
                nhs_number  _ ',' _
                unit_number _ ',' _
                external_ref;
        %]
            <tr>
                <td class="bold">Composite</td>
                <td>[% render_barcode(composite, 'data_matrix') %]</td>
                <td>[% render_barcode(composite, 'code128') %]</td>
            </tr>
        [% END %]
    </table>
    <p>Test input: <input type="text" size="50" /></p>
<!-- END [% template.name %] -->
