<!-- BEGIN [% component.name %] -->
[% # PROCESS dumper.tt dump = scan_type %]
[% # PROCESS dumper.tt dump = setnum %]
[% # PROCESS dumper.tt dump = dataset %]
<div class="indent imaging">
<form method="post" name="imaging-[% scan_type %][% setnum IF setnum %]"
id="imaging-[% scan_type %][% setnum IF setnum %]"
action="[% app_url %]/hmrn_data/new_imaging_data/[% data.id %]/[% patient.id %]">
[% IF data_entry; # is data entry %]
[% IF # provide a name="error" for internal anchor:
error_scan_stage OR error_scan_date
%]<a name="error"><span> </span></a>[% END %]
<p class="bold indent">
New scan:
<select name="scan_stage">
<option value="">-- select --</option>
<option value="initial">initial scan</option>
<option value="follow-up" [% 'selected=1' IF ndatasets # previous data %]>
follow-up</option>
</select>
[% error_scan_stage %]
date:
<input type="text" size="5" name="scan_date" />
[% error_scan_date %]
</p>
<input type="hidden" name="scan_type" value="[% scan_type %]" />
<input type="hidden" name="dataset" value="[% ndatasets + 1 %]" />
[% ELSE %]
<p class="indent">
<span class="bold">[% dataset.stage_date.stage | ucfirst %] scan</span>
on <span class="bold">[% dataset.stage_date.date.dmy('/') %]</span>
[ <a href="[% app_url %]/hmrn_data/edit_imaging/[% data.id %]/[% patient.id
%]?scan_type=[% scan_type %];dataset=[% setnum %]">edit</a> ]
</p>
[% # find nodal & extra-nodal entries for display:
nodal_sites = []; extranodal_sites = []; other_options = [];
FOREACH d IN dataset.site_opts; # PROCESS dumper.tt dump = d;
NEXT UNLESS d.key.match('\d'); # skip non-numeric
opt_location = imaging_opts.location.item(d.key); # PROCESS dumper.tt dump = opt_location;
nodal_sites.push(1) IF opt_location.match('_nodal'); # upper/lower
extranodal_sites.push(1) IF opt_location.match('extranodal');
other_options.push(1) IF NOT opt_location;
END;
have_other_opts = other_options.size; # PROCESS dumper.tt dump = have_other_opts;
have_nodal_sites = nodal_sites.size; # PROCESS dumper.tt dump = have_nodal_sites;
have_extranodal_sites = extranodal_sites.size; # PROCESS dumper.tt dump = have_extranodal_sites;
%]
[% END %]
<table class="indent">
<tr>
[% INCLUDE hmrn/data/nodal_sites.tt
IF data_entry OR have_nodal_sites OR have_other_opts %]
<td class="borderless"> </td>
[% INCLUDE hmrn/data/extranodal_sites.tt
IF data_entry OR have_extranodal_sites OR dataset.other %]
</tr>
[% IF user_can_enter_data AND data_entry # allow data entry %]
<tr class="borderless" align="center">
<td colspan="2">[% site.html.submit %] [% site.html.reset %]</td>
</tr>
[% END %]
</table>
</form>
</div>
<!-- END [% component.name %] -->