<!-- BEGIN outreach/flow_cytometry.tt -->
  [%
    lab_data = outreach.flow_cytometry; # PROCESS dumper.tt dump = lab_data;
    fields = lab_data.keys; # PROCESS dumper.tt dump = fields;
    flow_results = []; # to test for data file import
  %]
  
  [% outreach_flow_cytometry_dfv_js %]
  
  <form method="post" action="[% app_url %]/outreach/lab_results/[% request_data.id %]"
      name="outreachFlow" id="outreachFlow" [% outreach_flow_cytometry_onsubmit %]>
    <input type="hidden" name="department" value="flow_cytometry" />
    <table class="indent">
      <tr>
        [% FOREACH param IN fields;
          flow_results.push(lab_data.item(param).result) IF lab_data.item(param).result;
          
          class = # highlight if param result below param lower_limit:
              lab_data.item(param).result AND # have data
              lab_data.item(param).lower_flag AND # and lower_limit
              lab_data.item(param).result < lab_data.item(param).lower_flag # data below lower_limit
            ? 'highlight' : 'normal'
          %]
          <th class="[% class %]">
            [% INCLUDE th_default_val lab_data_param = lab_data.item(param) %]
          </th>
        [% END %]
      </tr>  
			
			<tr>
			[% FOREACH param IN fields; # error = errs.item(param); %]
				<td>
					<input type="text" size="3" name="[% param %]" id="[% param %]"
            value="[% lab_data.item(param).result %]" />
          [% error %]
				</td>				
			[% END %]
      
      <td class="borderless">
        [% # load link to datafile if exists AND record is screened:
          IF has_optional.initial_screen
            AND have_data_file(data.id); # callback in C::Report::outreach() %]
            [% IF flow_results.size # already have results %]
              <span class="highlight">
                <a href="[% app_url %]/result/preview_datafile/[% data.id %]">
                  re-import results data</a>
              </span>
            [% ELSE %]
              [ <a href="[% app_url %]/result/preview_datafile/[% data.id %]">
                import results data</a> ]
            [% END %]
            [% INCLUDE outreach_submit %]
          [% END %]        
      </td>
      
			</tr>
		</table>

	</form>
<!-- BEGIN outreach/flow_cytometry.tt -->    
