<!-- BEGIN request/edit/edit_request_data.tt -->
	<table class="indent">
        <tr>
            <td class="label">Referrer:</td>
			<td class="search_bar">
				<input style="width: 150px" type="text" name="_referrer"
					id="referrer_name" value="[% data.referrer_department.referrer.name %]" />
				<input type="hidden" name="referrer_code" id="referrer_id" />
                [% IF error_referrer_code %]
                    [% error_referrer_code %]
                [% ELSE %]
                    [ <a href="[% app_url %]/config/clinicians">new</a> ]
                [% END %]
            </td>
        </tr>
        <tr>
            <td class="label">Specimen:</td>
            <td class="content">
                <input class="field" type="text" name="specimen_code" id="is_valid_specimen" 
					value="[% request_data.specimen_map.item(data.id).sample_code.join(', ') %]"
                [% IF c.cfg('use_cgi_ajax') %]
                    onChange="do_ajax(['is_valid_specimen'], ['bad_specimen']); return true;"
                [% END %] [% site.html.on_focus %] />[% error_specimen_code %]
                <span class="ajax_error"><em id="bad_specimen"></em></span>
			</td>
        </tr>
		
		[%
			IF request_data.has_optional.clinical_trial;
				trial_id = data.request_trial.trial_id;
				trial_number = get_trial_number(patient.id, data.request_trial.trial_id);
			END;
		%]
        <tr>
            <td class="label">Trial/study:</td>
            <td class="content">
				<select name="trial_id" id="trial_id" [% site.html.on_focus %]>
					<option value="">&nbsp;</option>
					[% FOREACH trial IN trials %]
					<option value="[% trial.id %]"
							[% 'selected' IF trial.id == trial_id %]>
						[% trial.trial_name %]
					</option>
					[% END %]
				</select>
				[% error_trial_id %]
			</td>
        </tr>
        <tr>
            <td class="label">Trial no:</td>
            <td class="content">
				<input class="field" type="text" name="trial_number"
					value="[% trial_number %]" />
				[% error_trial_number %]
			</td>
		</tr>
		
		[%
			IF request_data.has_optional.external_ref;
				external_ref = data.request_external_ref.external_reference;
			END;
		%]
        <tr>
            <td class="label">External ref:</td>
            <td class="content">
				<input class="field" type="text" name="external_reference"
					value="[% external_ref %]" />
                [% error_external_reference %]
			</td>
        </tr>
	</table>
<!-- END request/edit/edit_request_data.tt -->
