<!-- BEGIN resources/new_diagnoses.tt -->
[% META title = 'Resources » New/Relapsed Diagnoses' -%]
[% # PROCESS dumper.tt dump = locations %]
<h2 align="center">New / relapsed diagnoses</h2>
<p class="indent bold">
Please select a location and duration [or leave blank for default 7 days]:
</p>
<form action="[% app_url %]/resources/new_diagnoses" method="get"
name="new_diagnoses" id="new_diagnoses">
<p class="indent">Location:
<select name="org_code">
<option value=""></option>
<option value="%" [% 'selected' IF c.query.param('org_code') == '%' %]>
All locations
</option>
[% FOREACH location IN locations %]
<option value="[% location.value %]" [% 'selected' IF location.value
== c.query.param('org_code') %]>[% location.key %]</option>
[% END %]
</select>
for previous <input type="text" name="duration" size="3"
value="[% c.query.param('duration') %]" /> days
[% site.html.submit %]
</p>
</form>
[% IF results.size %]
[% # site.html.back_button %]
<p class="red indent">
** Please note a full written report will be issued for all cases **
</p>
<table class="indent">
<tr>
<th scope="col">Lab No.</th>
<th scope="col">Name</th>
<th scope="col">DoB</th>
<th scope="col">Source</th>
<th scope="col">Date</th>
<th scope="col">Authorised</th>
<th scope="col">Diagnosis</th>
<th scope="col">Status</th>
</tr>
[% FOREACH data IN results;
patient = data.patient_case.patient;
report_status = data.request_report.status;
%]
<tr [% IF report_status == 'relapse' %] style="background: #fff8dc"[% END %]>
<td>[% INCLUDE site/lab_number.tt want_url = 1 %]</td>
<td>
[% patient.last_name | upper %],
[% patient.first_name | ucfirst %]
[% patient.middle_name | ucfirst %]
</td>
<td>[% patient.dob.strftime('%d.%b.%Y') %]</td>
<td>
[% INCLUDE site/display_name.tt
location = data.patient_case.referral_source.display_name %]
</td>
<td>[% data.created_at.strftime('%d.%b.%Y') %]</td>
<td>
[% data.request_history.defined(0) # it's an array (ie multiple auth's)
? data.request_history.0.time.strftime('%d.%b.%Y') # 1st one
: data.request_history.time.strftime('%d.%b.%Y')
%]
</td>
<td>
[% diagnosis = data.request_report.diagnosis.name %]
[% IF diagnosis.match('See comments') %]
<span class="acronym" title="[% data.request_report.comment %]">
[% diagnosis %]
</span>
[% ELSE %]
[% diagnosis %]
[% END %]
</td>
<td>[% report_status | upper %]</td>
</tr>
[% END %]
</table>
[% ELSIF c.query.param('org_code') # have done a search %]
<p class="info">No new / relapsed cases over selected duration</p>
[% END %]
<!-- END resources/new_diagnoses.tt -->