RSS Git Download  Clone
Raw Blame History
  [% META title = 'Admin » Edit Lab Test' -%]
<!-- BEGIN [% template.name %] -->
  [% # PROCESS dumper.tt dump = c.stash.errs %]
  [% # PROCESS dumper.tt dump = section_specimen_types %]
  [% # PROCESS dumper.tt dump = specimen_types %]

  [% PROCESS admin/lab_test_nav.tt page = 'lab_test' %]

  [% lab_tests_dfv_js %]

  <h2 align="center">Edit Lab Test Details</h2>

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

    <p>[% site.html.back_button %]</p>

    <p class="bold indent"><span class="red">*</span>
        = default sample type for lab section</p>

    [% max_length = c.get_meta_data('LabTest').column('field_label').length %]

    <form method="post" action="[% app_url %]/admin/lab_test/update/[% data.id %]"
        [% lab_tests_onsubmit %] name="lab_test" id="lab_test">

    <table class="indent">
        <tr>
            <td class="label">Field Label</td>
            <td>
                <input type="text" name="field_label" value="[% data.field_label | html %]"
					[% PROCESS site/limit_text.tt input_name = 'field_label' %]
					maxlength="[% max_length %]" />
                [% error_field_label %]
                <div>[% PROCESS site/countdown.tt %]</div>
             </td>
        </tr>
        <tr>
            <td class="label">Test Name</td>
            <td>
                <input type="text" name="test_name" value="[% data.test_name | html %]"
					[% site.html.readonly %] />
                [% error_test_name %]
            </td>
        </tr>
        <tr>
            <td class="label">Lab Section</td>
            <td class="type">
                <select name="lab_section_id">
                    [% FOREACH s IN sections %]
                    <option value="[% s.id %]" [% 'selected' IF s.id == data.lab_section_id %]>
                        [% s.section_name %]
                    </option>
                    [% END %]
                </select>
                [% error_lab_section_id %]
            </td>
        </tr>
        <tr>
            <td class="label">Test Type</td>
            <td>
				<select name="test_type">
				[% FOREACH option IN ['test','panel'] %]
                     <option value="[% option %]" [% 'selected' IF option == data.test_type %]>
                        [% option %]
                    </option>
			    [% END %]
				</select>
                [% error_test_type %]
            </td>
        </tr>
        <tr>
            <td class="label">Results</td>
            <td>
				<select name="has_results">
				[% FOREACH option IN ['yes','no'] %]
                     <option value="[% option %]" [% 'selected' IF option == data.has_results %]>
                        [% option %]
                    </option>
			    [% END %]
				</select>
                [% error_has_results %]
            </td>
        </tr>
		<tr>
			<td class="label" style="vertical-align: top">
                Permitted<br />sample types:
            </td>
    		<td class="content">
                [% section_id = data.lab_section_id;
                    FOREACH type IN specimen_types; # PROCESS dumper.tt dump = type
                        is_default
                            = section_specimen_types.item(section_id).item(type.id)
                            ? 1 : 0 %]
                <div id="id">
                    <input type="checkbox" name="sample_type_id" value="[% type.id %]"
                        [% 'checked' IF section_specimen_types.item(section_id).item(type.id) %] />
                  [% type.specimen_type; IF is_default %]
                    <sup>[<span class="red">*</span>]</sup>[% END %]
                </div>                    
                [% END %]
                [% error_sample_type_id %]
	    	</td>
		</tr>
        <tr>
            <td class="label">Active</td>
            <td>
				<select name="is_active">
				[% FOREACH option IN ['yes', 'no'] %]
                     <option value="[% option %]" [% 'selected' IF option == data.is_active %]>
                        [% option %]
                    </option>
			    [% END %]
				</select>
                [% error_is_active %]
            </td>
        </tr>
		<tr>
            <td colspan="2" align="center">
                [% site.html.submit %]
            </td>
        </tr>
    </table>

	
    </form>
<!-- END [% template.name %] -->