[% content_only = 1 %]
<html>
<head>
    <title>Sample Linkage Form</title>
</head>

<body>
	<div style="width: 100%">
		<div class="inline">
			<div class="header">100,000 Genomes Project</div>
			<div class="header">Sample Linkage Form</div>
		</div>
		<div class="inline logo">
			<img src="[% c.cfg('settings').base_href %]/images/YH-GMC.jpg" />
		</div>
	</div>

	<p class="spacer"></p>

	<div class="participant">
		<p class="spacer"></p>
		<table class="content">
			<tr>
				<th colspan="2">
                    [% data.first_name.ucfirst %] [% data.last_name.upper %]
					:: [% data.dob %] :: [% data.gender %]
                </th>
			</tr>
			<tr>
				<td>
					<span class="header">NHS number:</span>
					[% data.nhs_number %]
				</td>
				<td>
					[% render_barcode(data.nhs_number) %]
				</td>
			</tr>
			<tr>
				<td>
					<span class="header">Participant ID:</span>
					[% data.participant_id %]
				</td>
				<td>
					[% render_barcode(data.participant_id) %]
				</td>
			</tr>

			[% IF slf_type.match('rare_disease') %]
			<tr>
				<td>
					<span class="header">Family ID:</span>
					[% data.family_id %]
				</td>
				<td>
					[% render_barcode(data.family_id) %]
				</td>
			</tr>
			[% END %]
			<tr>
				<td colspan="2">
					<span class="header">Referrer:</span>
					[% data.referrer %], [% data.location %]
				</td>
			</tr>
			<tr>
				<td colspan="2">
					<span class="header">Disease type:</span>
					[% data.disease_type %]
				</td>
			</tr>
			<tr class="spacer"><td></td></tr>
		</table>
		<table class="content">
			<tr>
				<td>Date samples collected:</td>
				<td class="label">dd / mm / YYYY</td>
			</tr>
			<tr>
				<td>Time samples collected:</td>
				<td class="label">hh : mm</td>
			</tr>
			<tr class="spacer"><td></td></tr>
			[% IF slf_type.match('rare_disease') %]
			<tr>
				<td>Total samples in group:</td>
				<td>[% data.total_samples %]</td>
			</tr>
			[% END %]
		</table>
	</div>
	[% BLOCK mini_barcode; # replace hbc2d between word-boundaries ie table class only:
		render_barcode(text).replace('\bhbc2d\b', 'hbc2d_small');
	END %]
	<div class="sample">
		<table class="content">
			<tr>
				<td colspan="2" id="info">
                    Peel off the labels below and stick on relevant tubes
                </td>
			</tr>
			[%
				IF slf_type.match('rare_disease');
					INCLUDE 'worklist/local/genomics/rare_disease_barcode.tt';
				ELSIF slf_type.match('cancer_blood');
					INCLUDE 'worklist/local/genomics/cancer_blood_barcode.tt';
				ELSIF slf_type.match('cancer_tissue');
					INCLUDE 'worklist/local/genomics/cancer_tissue_barcode.tt';
				END;
			%]
		</table>
	</div>
</body>
</html>
