<!-- BEGIN [% template.name %] -->
  [% # PROCESS dumper.tt dump = data;
	patient = data.patient_case.patient;
  %]

	<h2 class="header">DRAFT REPORT: [% PROCESS site/lab_number.tt %]</h2>

	<h3 class="indent">
		[% patient.last_name   | upper %],
		[% patient.first_name  | ucfirst %]
		[% patient.middle_name | ucfirst %] ::
		[% patient.dob.strftime('%d.%b.%Y') %] ::
        [% IF patient.nhs_number;
			PROCESS site/nhs_number.tt nhs_number = patient.nhs_number;
          ELSE; data.patient_case.unit_number || 'unknown'; END
		%]
	</h3>
	<table class="indent">
        <tr>
            <td class="label">Specimen:</td>
            <td>[% data.specimen.description.join('; ') %]</td>
        </tr>
        <tr>
            <td class="label">Quality:</td>
            <td>[% data.report.specimen_quality %]</td>
        </tr>
		[% IF data.report.gross_description %]
        <tr>
            <td class="label">Description:</td>
            <td>[% data.report.gross_description %]</td>
        </tr>
		[% END %]
        <tr>
            <td class="label">Biopsy site:</td>
            <td>[% symbolise(data.report.biopsy_site) %]</td>
        </tr>
		
		<tr class="borderless">
			<td colspan="2"></td>
		</tr>
		
		[% IF data.report.clinical_details %]
		<tr>
		  <td class="label">Request Details:</td>
		  <td>[% symbolise(data.report.clinical_details) %]</td>
		</tr>
		[% END %]

		[% IF data.report.morphology %]
		<tr>
		  <td class="label">Morphology:</td>
		  <td>
			[%
			  morphology = line_break(data.report.morphology);
			  symbolise(morphology) | html_line_break;
			%]
		  </td>
		</tr>
		[% END %]

		<tr>
		  <td class="label">Comment:</td>
		  <td>
			[%
			  raw_comment = line_break(data.report.comment);
			  symbolise(raw_comment) | html_line_break;
			%]
		  </td>
		</tr>
		<tr>
		  <td class="label top-align">Diagnosis:</td>
		  <td>
			[% IF data.report.secondary_diagnosis %]
				<div><b>Primary</b>: [% data.report.diagnosis.name | html %]</div>
				<div><b>Secondary</b>: [% data.report.secondary_diagnosis.name | html %]</div>
			[% ELSE; data.report.diagnosis.name | html; END %]
		  </td>
		</tr>
		<tr>
		  <td class="label">Reporter:</td>
		  <td>
			[% data.report.user.first_name | ucfirst %]
			[% data.report.user.last_name  | ucfirst %]
			on [% data.report.updated_at.strftime('%d.%b.%Y') %]
		  </td>
		</tr>
	</table>

	<form action="[% app_url %]/report/=/[% c.param('id') %]" method="post">
		<p class="indent">
		  [% site.html.back_button %]
		  <input class="red button" type="submit" value="Import" />
		  <input type="hidden" name="import_user_id" value="[% c.param('Id') %]" />
		</p>
	</form>
<!-- END [% template.name %] -->
