RSS Git Download  Clone
Raw Blame History
<!-- BEGIN [% template.name %] -->
    [% META title = 'BCR ABL data' %]

    [% # PROCESS dumper.tt dump = data %]
    
    <h2>
        BCR ABL ratio data summary
        [% IF data.size; '[' _ data.size _ ']'; END %]
    </h2>
    
    [% IF data.size %]
    <form action="[% app_url %]/data-import/do_bcr_abl" method="post" name="bcr_abl"
        id="bcr_abl">
    <table class="indent">
        <tr>
            <td class="borderless"></td>
            <th scope="col">LabNo</th>
            <th scope="col">Name</th>
            <th scope="col">BCR ABL</th>
            <th scope="col">ABL</th>
            <th scope="col">Result</th>
            <td class="borderless" colspan="2"></td>
        </tr>
        [% FOREACH entry IN data.keys.sort;
            # PROCESS dumper.tt dump = data.item(entry).copy_number;
            patient = data.item(entry).request_data.patient_case.patient;
            ABL = data.item(entry).copy_number.ABL;
            BCR_ABL = data.item(entry).copy_number.${'BCR ABL'};
            
            # reset defaults for loop:
            class  = 'normal';
            status = 'normal';
            ratio  = 0;
        %]
        <tr>
            <td>[% loop.count %]</td>
            <td>[% entry %]</td>
            [% IF
                patient.last_name != data.item(entry).sample_name;
                    status = 'error';
                ELSIF data.item(entry).error;
                    status = 'warning';
                END;
            %]                
            <td class="[% status %]">
                [% data.item(entry).sample_name | upper %]
                [% IF status == 'error' %]
                    [[% patient.last_name | upper %]]
                [% END %]
            </td>
            
            [% class = BCR_ABL AND BCR_ABL <= 10 ? 'red' : 'normal' %]
            <td class="[% class %]">
                [% BCR_ABL %]
            </td>

            [% class = ABL < 10000 ? 'blue' :
                ABL >= 10000 AND ABL < 20000 ? 'warning' : 'normal' %]
            <td class="[% class %]">
                [% ABL %]
            </td>

            <td>
                [%
                    messages = c.messages('file_upload').bcr_abl;
                    
                    IF ABL < 10000;
                        messages.poor_quality.summary;
                    ELSIF BCR_ABL; # ie not zero
                        ratio = ( BCR_ABL / ABL ) * 100 | format('%.3f');
                        ratio _ '%';
                    ELSE; # no bcr abl
                        expression = 1 / ABL | format('%.6f');
                        '<' _ expression | html; 
                    END;
                %]
            </td>
            <td>
                [% result = [];
                    result.push(entry); # labno for template summary
                    result.push(data.item(entry).request_data.id);
                    result.push(ABL);
                    result.push(BCR_ABL);
                    result.push(ratio);
                %]
                <input type="checkbox" name="result" value="[% result.join('::') %]"
                    [% UNLESS status== "normal"; 'disabled'; END %] />
            </td>
            <td class="borderless">
                [% previous_result = data.item(entry).existing_result.results_summary;
                    IF previous_result;
                %]
                    <span class="warning">WARNING:</span>
                    <span class="acronym" title="[% previous_result %]">
                        has previous result
                    </span>
                [% END %]
            </td>
        </tr>
        [% END %]
        <tr>
            <td colspan="6" align="right" class="borderless">
                <input type="button" name="CheckAll" value="Select all"
                  onClick="checkAll(document.bcr_abl.result)">
                <input type="button" name="UnCheckAll" value="Clear all"
                  onClick="uncheckAll(document.bcr_abl.result)">
                [% site.html.submit %]
            </td>
        </tr>
    </table>
    </form>
    [% ELSE %]
        <p class="error">Error: unable to extract any data from data file(s). Check:
            <ol id="id">
                <li>data file is an xls file, or a zip file containing at least 1 xls file</li>
                <li>data file contains ABL & BCR ABL data</li>
                <li>the 'Experiment File Name' field contains the string 'Q922'</li>
                <li>the 'Sample Name' field contains the LabNo & Name data</li>
            </ol>
        </p>
        <p class="indent">[% site.html.back_button %]</p>
    [% END %]
<!-- END [% template.name %] -->