<!-- BEGIN [% template.name %] -->
  [% META title = 'Worklist &raquo; Unverified Haematology Data' -%]

    [% # PROCESS dumper.tt dump = param_flags %]
    [% # PROCESS dumper.tt dump = haem_data %]
    [% # PROCESS dumper.tt dump = requestId_map %]
    
  [% IF haem_data.size %]
  <h3 class="header">Unverified haematology data [[% haem_data.size %]]</h3>

  <table class="indent">
    <tr>
        <td class="borderless"></td>
        <th>LabNo</th>
        <th>Date</th>
        <th>WBC</th>
        <th>RBC</th>
        <th>Hb</th>
        <th>Plt</th>
        <th>HCT</th>
        <th>MCV</th>
        <th>MCH</th>
        <th>MCHC</th>
        <th>Lym %</th>
        <th>Lym #</th>
        <th>Mix %</th>
        <th>Mix #</th>
        <th>Neu %</th>
        <th>Neu #</th>
        <td class="borderless" colspan="2">
    </tr>
    [% FOREACH entry IN haem_data;
        flags = param_flags.${entry.lab_number};
    %]
    <tr>
        <td>[% loop.count %]</td>
        <td>
          [% IF requestId_map.${entry.lab_number} %]
            <a href="[% app_url %]/search/=/[% requestId_map.${entry.lab_number}
                %]?_return=1">[% entry.lab_number %]</a>
          [% ELSE; entry.lab_number; END %]
        </td>
        <td>[% entry.created_at.dmy %]</td>
        
        [% FOREACH param IN param_fields %]
            <td class="[% flags.${param} ? 'red' : 'normal' %]">[% entry.${param} %]</td>           
        [% END %]

        <td>
            <a href="[% app_url %]/result/accept_haem_data/[%
                entry.lab_number %]">ACCEPT</a>
        </td>
        <td>
            <a href="[% app_url %]/result/delete_haem_data/[%
                entry.lab_number %]">DELETE</a>
        </td>
    </tr>
    [% END %]
  </table>
  [% END %]
<!-- END [% template.title %] -->
