[% META title="Sample storage" %]
<!-- BEGIN [% template.name %] -->
[% # PROCESS dumper.tt dump = specimen_map %]
[% # define some data structures:
# c.debug('##############'); # to reveal any db calls from templates
data = request_data;
patient = request_data.patient_case.patient; # not as_tree - preserve datetime objects %]
<h2>
Sample storage on [% patient.last_name | upper %],
[% format_firstname(patient) || patient.first_name | ucfirst %]
[ [% PROCESS site/lab_number.tt %] ]
</h2>
<p class="info indent">Number of vials in store: [% storage.size || 0 %]</p>
<h3 class="header">Input new vials</h3>
<form action="[% app_url %]/storage/input/[% data.id %]" method="post">
<table class="indent">
<tr>
<td>
[% FOREACH item IN specimen_map.item(data.id).sample_code %]
<div>
<label><input type="radio" name="specimen" value="[% item %]" />
[% item %]</label>
</div>
[% END %]
</td>
<td><input type="text" name="location" /></td>
<td class="borderless">
<span class="error">« place cursor here</span>
[% site.html.submit %]
[% site.html.reset %]
</td>
</tr>
[% FOREACH item IN storage %]
<tr>
<td>[% item.specimen_code %]</td>
<td>[% item.location %]</td>
<td><a href="">[edit]</a></td>
</tr>
[% END %]
</table>
</form>
[% IF storage.size %]
<h3 class="header">Output vials</h3>
<form action="[% app_url %]/storage/output/[% data.id %]" method="post">
</form>
[% END %]
<!-- END [% template.name %] -->