<!-- BEGIN worklist/local/preregistration/edit.tt -->
  [% META title = 'Pre-screen &raquo; New Data' -%]

  [% # PROCESS dumper.tt dump = lab_tests %]
  
  [% # define some data structures:
    col_names = [ 'PCS','BLS','SCS','TLS','RIT','OUT' ];
    lab_tests_map = {
      PCS => 'plasma_cell',
      BLS => 'b_lymphoid',
      SCS => 'stem_cell',
      TLS => 't_lymphoid',
      RIT => 'rituximab',
      OUT => 'outreach',
    };
  %]

  [% pre_screen_data_dfv_js %]
  
  <h3 class="header">Submit new pre-screen data</h3>

  [% IF dfv_errors %]
    <dl>
        <dt class="error">[% c.cfg('msg').dfv_errors %]</dt>
        [% IF error_surname %]
            <dd>surname [% error_surname %]</dd>[% END %]
        [% IF error_specimen %]
            <dd>specimen [% error_specimen %]</dd>[% END %]
    </dl>
  [% END %]

  [% labno = c.param('id') %]
  <form action="[% app_url %]/local_worklist_preregistration/update/[% labno %]"
    method="post" name="pre-screen" id="pre-screen" [% pre_screen_data_onsubmit %]>

    <table class="indent">
      <tr>
        <th>LabNo</th>
        <th>Surname</th>
        <th [% IF error_specimen %]class="error"[% END %]>Specimen</th>
        [% FOREACH col IN col_names %]
          <th [% IF error_lab_tests %]class="error"[% END %]>[% col %]</th>
        [% END %]
        <td class="borderless"></td>
      </tr>

      <tr>
        <td>
          <a href="[% app_url %]/image/=/[% labno %]">[% labno %]</a>
        </td>
        <td>
          <input type="text" name="surname" size="15" [% site.html.onfocus %] />
        </td>
        <td>
          <select name="specimen">
            <option value=""></option>
            [% FOREACH type IN ['BM' 'CF' 'EF' 'GU' 'LA' 'LU' 'PB' 'RU' 'XA' 'XU'] %]
            <option value="[% type %]">[% type %]</option>
            [% END %]
          </select>
        </td>
        
        [% FOREACH col IN col_names;
            test_name = lab_tests_map.item(col); # test_name; %]
        <td width="35" align="center">
          <input type="checkbox" name="[% test_name %]" value="x" />
        </td>          
        [% END %]
        
        <td>[% site.html.submit %]</td>
		<td>
			<a href="[% app_url %]/local_worklist_preregistration/delete/[% labno %]">
				<span class="red">DELETE</span>
			</a>
		</td>
      </tr>
    </table>
  </form>
<!-- END worklist/local/preregistration/edit.tt -->
