RSS Git Download  Clone
Raw Blame History
[% skip_wrappers = 1 %]
<!-- BEGIN worklist/local/fish/worksheet.tt -->

    [%
        patient = data.patient_case.patient;
        report  = data.as_tree.request_report; # as_tree to prevent tt lookup if empty
    %]
    
    <h2 align="center">
        FISH worksheet [% PROCESS site/lab_number.tt want_url = 0 %]
    </h2>
    
    <table id="pid">
      <tr>
        <th>Name</th>
        <th>DoB</th>
        <th>ID No.</th>
        <th>Date</th>
        <th>Source</th>
        <th>Clinician</th>
        <th>Specimen</th>
      </tr>

      <tr>
        <td>
            [% patient.last_name | upper %],
            [% format_firstname(patient) || patient.first_name | ucfirst %]
        </td>
        <td>[% patient.dob.strftime('%d.%b.%Y') %]</td>
        <td>[% patient.nhs_number || data.patient_case.unit_number %]</td>
        <td>[% data.created_at.strftime('%d.%b.%Y') %]</td>
        <td>
            [% location = data.patient_case.referral_source.display_name;
                PROCESS site/display_name.tt %]
        </td>
        <td>[% data.referrer_department.referrer.name %]</td>
        <td>[% specimen_map.item(data.id).sample_code.join(', ') %]</td>
      </tr>
    </table>
		
	<div id='report'>
		<p><u>Flow results</u>: [% result_summaries.item(data.id) %]</p>
		<p><u>Clinical details</u>: [% report.clinical_details %]</p>
		<p><u>Gross description</u>: [% gross_description.item(data.id) %]</p>
		<p><u>Specimen quality</u>: [% report.specimen_quality %]</p>
		<p>
            <u>Reported as</u>: <strong>[% report.diagnosis.name %]</strong>
            <!-- on <strong>{{ReportDate}}</strong> -->
        </p>
	</div>
    
    [% BLOCK row %]
        <tr>
            <td class="probe">[% probe %]</td>
            <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>
        </tr>    
    [% END %]
    
    <table id="probes">
        <tr>
            <th id="col-one">Probe</th>
            <th id="col-two">Slide quality</th>
            <th id="col-three">FISH result</th>
            <th id="col-four">Interpretation</th>
            <th id="col-five">FISH quality</th>
        </tr>
        
        [%
            all_probes = []; # initialise array for probes:
            
            FOREACH probe IN fish_data.item(data.id);
                IF probe.test_type.match('test'); # just add test name
                    all_probes.push(probe.field_label);
                ELSIF probe.test_name.match('fish');
                    all_probes.push('FISH'); # HILIS3 legacy
                ELSIF probe.test_type.match('panel'); # add panel probe-set:
                    FOREACH pp IN panel_probes.item(probe.field_label);                    
                        all_probes.push(pp);
                    END;
                END;
            END;
            FOREACH probe IN all_probes; PROCESS row; END; # DON'T SORT
            
            FILTER repeat(3); PROCESS row probe = ''; END; # 3 empty rows
        %]
    </table>
    
    <div class="emptyBox">
        
    </div>
    
    <table class="footer">
        <tr>
            <td>Reported by:</td>
            <td class="empty"></td>
            <td>FISH Batch no:</td>
            <td class="empty"></td>
        </tr>
        <tr>
            <td>Checked by:</td>
            <td class="empty"></td>
            <td>Enzyme/PreDenaturation:</td>
            <td class="empty"></td>
        </tr>
    </table>    
<!-- END worklist/local/fish/worksheet.tt -->