<!-- BEGIN [% template.name %] -->
[% META title = 'Chimerism data' %]
[% # PROCESS dumper.tt dump = data %]
<h2>
Chimerism data summary
</h2>
[% IF data.size;
USE math = format('%.0f');
i = 0;
%]
<form action="[% app_url %]/data-import/do_chimerism" method="post"
name="chimerism" id="chimerism">
<table class="indent">
<tr>
<td class="borderless"></td>
<th scope="col">LabNo</th>
<th scope="col">Name</th>
<th scope="col">Baseline</th>
<th scope="col">Marker</th>
<th scope="col">Donor</th>
<th scope="col">Patient</th>
<th scope="col">Result</th>
<th scope="col">Ref</th>
<th scope="col">Import</th>
<td class="borderless" colspan="2"></td>
</tr>
[% FOREACH request IN data; # INCLUDE dumper.tt dump = request;
FOREACH set IN request.value; # INCLUDE dumper.tt dump = set;
row = set.value; # INCLUDE dumper.tt dump = row;
baseline_data = row.${'baseline chimerism data'};
hmds_ref = row.${'hmds ref'};
result = [];
result.push(row.id);
result.push(hmds_ref);
result.push(row.test);
result.push(baseline_data);
%]
<tr>
<td>[% i = i + 1; i %]</td>
<td>[% hmds_ref %]</td>
<td>[% row.name %]</td>
<td>[% baseline_data %]</td>
<td>[% row.test %]</td>
<td>[% row.donor_result UNLESS row.donor_result == 1 # used for 100% %]</td>
<td>[% row.patient_result %]</td>
<td>[% # use 'size' here in case result is zero:
IF row.donor_result.size AND row.patient_result.size;
val = math( row.donor_result /
( row.donor_result + row.patient_result ) * 100 );
result.push(val); val; '%';
END %]
</td>
<td>[% row.marker_ref %]</td>
[% IF row.data_ok == 2 OR baseline_data %]
<td align="right">
[% hmds_ref %]
<input type="checkbox" name="result"
value="[% result.join('~') %]" />
</td>
[% ELSE %]
<td align="center">
<span class="red acronym" title="data error">X</span>
</td>
[% END %]
</tr>
[% END; END %]
<tr>
<td colspan="6" align="right" class="borderless">
<input type="button" name="CheckAll" value="Select all"
onClick="checkAll(document.chimerism.result)">
<input type="button" name="UnCheckAll" value="Clear all"
onClick="uncheckAll(document.chimerism.result)">
[% site.html.submit %]
</td>
</tr>
</table>
</form>
[% END %]
<!-- END [% template.name %] -->