<!-- BEGIN request/edit/edit_case_data.tt -->
	<p class="title">Patient case data:</p>

    [% IF patient_cases.size; # PROCESS dumper.tt dump = patient_cases %]
		<p class="indent">
			<span class="title">Select a previous record or edit current record:</span>
		</p>	
	
		<div style="margin-bottom: 10px">			
			<table class="indent">
				<tr>
					<th scope="col">Unit number</th>
					<th scope="col">Location</th>
					<td class="borderless"></td>
				</tr>
					
				[% FOREACH entry IN patient_cases %]
				<tr>
					<td class="content">
						<input type="text" [% site.html.disabled %]
							value="[% entry.unit_number %]" />
					</td>
					<td class="content">
						<input type="text" [% site.html.disabled %] size="40"
							value="[% entry.referral_source.display_name %]" />
					</td>
					<td class="borderless">
						<input type="radio" name="use_patient_case_id"
							value="[% entry.id %]" />
						<span class="maroon">&#171; select</span>
					</td>
				</tr>
				[% END %]
			</table>
		</div>
    [% END %]
	
    [% this_case = request_data.data.patient_case %]
	
	[% PROCESS request/edit/single_record_data.tt %]		
	
	[% IF record_count > 1 %]
		[% default_setting =  this_case.unit_number.match('UNKNOWN') ? 'all' : 'one' %]
	<p class="indent"><span class="title">Apply change to:</span><br />
		<span class="indent">
			<input type="radio" name="scope" value="one"
				[% 'checked' IF default_setting.match('one') %] />this record only
		</span><br />
		<span class="indent">
			<input type="radio" name="scope" value="all"
				[% 'checked' IF default_setting.match('all') %] />
            all <strong>[% record_count %]</strong> records					
		</span>
	</p>
	[% ELSE # flag to delete this patient_case after edit %]
		<input type="hidden" name="scope" value="all" />
	[% END %]
 
	<p class="indent">[% site.html.reset %]</p>
<!-- END request/edit/edit_case_data.tt -->
