RSS Git Download  Clone
Raw Blame History
	[%
      IF is_results_entry;
        # META title = 'Worklist';
		my.meta_title = "Worklist » Data Entry » ${lab_section.section_name}";
      ELSE; # format for printing:
        skip_wrappers = 1;
      END;
    %]
    
<!-- BEGIN [% template.name %] -->	
    [% # PROCESS dumper.tt dump = user_list %]
    [% # PROCESS dumper.tt dump = request_options_map %]
    [% # PROCESS dumper.tt dump = status_options_map %]
    [% # PROCESS dumper.tt dump = outstanding_investigations %]
    [% # PROCESS dumper.tt dump = lab_section.as_tree %]
    [% # PROCESS dumper.tt dump = c.query.param('lab_test_id') %]

  <p class="classname">[% site.html.back_button %]</p>
  
  [% title = is_results_entry ? 'data entry' : 'worksheet' %]
  <h3>[% lab_section.section_name _ ' ' _ title %]</h3>  

  [% IF dfv_errors %]
        <p class="error">[% c.config('msg').dfv_errors %]</p>
    [% END %]

  [% worklist_update_status_dfv_js %]

  [% IF is_results_entry %]
  <form action="[% app_url %]/worklist/update_results/[% lab_section.id %]"
      [% worklist_update_status_onsubmit %] method="post" name="update_results"
        id="update_results">
    <input type="hidden" name="results_entry" value="1" />
	<input type="hidden" name="query_params"
            value="[% c.query.self_url # preserve for possible redirect %]" />
    [% INCLUDE worklist/snippets/data_entry.tt %]
  [% END %]
  
  <p class="spacer"></p>
  
  <div class="indent">
	[% # build args for url_links:
        args = [];
        args.push( 'status_option_id=' _ c.query.param('status_option_id') );
        args.push( 'results_entry='	   _ c.query.param('results_entry') );
        FOREACH test_id IN c.query.param('lab_test_id'); # can be multiple
            args.push( 'lab_test_id=' _ test_id );
        END;
	%]
    <table>
      <tr>
        <td class="borderless"></td>		
        <th>
		  <a href="[% app_url %]/worklist/display/[% lab_section.id %]?[%
            args.join(';') %];sort_by=lab_number">Lab No</a>		  
		</th>
        <th>Name</th>
        <th>Date</th>
        <th>Sample</th>
        <th>Source</th>
        
        [% IF worklist_cols.item(lab_section.section_name).headers; # override default
            FOREACH h IN worklist_cols.item(lab_section.section_name).headers %]
            <th>[% h %]</th>
            [% END %]
        [% ELSE %]
            <th>Presentation</th>
            <th>
                <a href="[% app_url %]/worklist/display/[% lab_section.id %]?[%
                    args.join(';') %];sort_by=lab_tests">Investigation</a>
            </th>
        [% END %]
        
        <th>Status</th>
		[% IF is_results_entry %]
		  <th>Done</th>
		[% ELSIF section_has_test_details %]
		  <th>Notes</th>
		[% END %]
      </tr>
      
      [% FOREACH entry IN outstanding_investigations; # PROCESS dumper.tt dump = entry %]
        [% PROCESS worklist/snippets/row.tt type = 'investigation' %]  
      [% END %]
    </table>
  </div>
  
  <p>
	[% site.html.back_button %]
	[% IF is_results_entry; site.html.submit; ' '; site.html.reset; END %]
  </p>
  
  [% IF is_results_entry %]
  </form>
  [% END %]
<!-- END [% template.name %] -->