<!-- BEGIN outreach/data_summary.tt -->
[% # manipulate some immunology params:
immunology = outreach.immunology;
IF immunology.electrophoresis.result.match('Isotype undetermined');
immunology.electrophoresis.result = '';
END;
FOREACH param IN ['IgG' 'IgA' 'IgM'];
IF immunology.item(param).result;
IF immunology.item(param).result * 100 == immunology.item(param).default * 100;
immunology.item(param).result = '';
END;
END;
END;
IF immunology.paraprotein.result;
IF immunology.paraprotein.result * 100 == immunology.paraprotein.default * 100;
IF immunology.electrophoresis.result.match('Ig');
immunology.paraprotein.result = 'Unquantifiable';
ELSIF immunology.electrophoresis.result.match('No paraprotein');
immunology.paraprotein.result = '';
ELSE;
immunology.paraprotein.result = 'N/K';
END;
END;
END;
IF outreach.flow_cytometry.cd19_neg_pc.result;
IF outreach.flow_cytometry.cd19_neg_pc.result < 0.001;
outreach.flow_cytometry.cd19_neg_pc.result = '< 0.001';
ELSE;
outreach.flow_cytometry.cd19_neg_pc.result =
sig_figs(outreach.flow_cytometry.cd19_neg_pc.result);
END;
END;
IF outreach.calculated.abnormal_b_cells.result;
IF outreach.calculated.abnormal_b_cells.result < 0.01;
outreach.calculated.abnormal_b_cells.result = '< 0.01';
ELSE;
outreach.calculated.abnormal_b_cells.result =
sig_figs(outreach.calculated.abnormal_b_cells.result);
END;
END;
# abnormal B cells calculated so doesn't get value from default_and_ranges table:
outreach.calculated.abnormal_b_cells.units = outreach.haematology.wbc.units;
%]
[% BLOCK rows;
DEFAULT class = 'normal';
IF is_numerical(value.result); # no maths funcs unless numerical:
IF value.lower_flag && value.result < value.lower_flag; class = 'highlight';
ELSIF value.upper_flag && value.result > value.upper_flag; class = 'highlight';
END;
END;
%]
<td class="[% class %]" align="center">[% value.result %]</td>
<td align="center">
[% IF value.lower_limit; 10 * value.lower_limit / 10; END %] -
[% IF value.upper_limit; 10 * value.upper_limit / 10; END %]
</td>
<td>[% value.units.replace('10/9', '10<sup>9</sup>') %]</td>
[% END %]
[% BLOCK popup;
patient_id = request_data.patient_case.patient_id %]
<a href="[% app_url %]/chart/outreach_param/[% param %]/[% patient_id %]"
onclick="return popup(this.href);">
<span class="acronym" title="chart">[% label %]</span>
</a>
[% END %]
[% PROCESS site/popup.tt height=280, width=300, top=250 %]
<h5>Data summary:</h5>
<table class="indent borderless">
<tr>
<td valign="top">
<table class="outreachResults">
<tr>
<th scope="col">Param</th>
<th scope="col">Result</th>
<th scope="col">Range</th>
<th scope="col">Units</th>
</tr>
<tr>
<td class="label">
[% PROCESS popup label = 'Hb' param = 'hb' %]:
</td>
[% INCLUDE rows value = outreach.haematology.hb %]
</tr>
<tr>
<td class="label">
[% PROCESS popup label = 'WBC' param = 'wbc' %]:
</td>
[% INCLUDE rows value = outreach.haematology.wbc %]
</tr>
<tr>
<td class="label">
[% PROCESS popup label = 'Plts' param = 'plts' %]:
</td>
[% INCLUDE rows value = outreach.haematology.plts %]
</tr>
<tr>
<td class="label">
[% PROCESS popup label = 'Lymphs' param = 'lymphs' %]:
</td>
[% INCLUDE rows value = outreach.haematology.lymphs %]
</tr>
<tr>
<td class="label">
[% PROCESS popup label = 'Total B' param = 'total_b_cells' %]:
</td>
[% INCLUDE rows value = outreach.flow_cytometry.total_b_cells %]
</tr>
<tr>
<td class="label">Abnormal B:</td>
[% INCLUDE rows value = outreach.calculated.abnormal_b_cells %]
</tr>
<tr>
<td class="label">
[% PROCESS popup label = 'CD19<sup>-</sup> PC' param = 'cd19_neg_pc' %]:
</td>
[% INCLUDE rows value = outreach.flow_cytometry.cd19_neg_pc %]
</tr>
</table>
</td>
<td width="10"></td>
<td valign="top">
<table class="outreachResults">
<tr>
<th scope="col">Param</th>
<th scope="col">Result</th>
<th scope="col">Range</th>
<th scope="col">Units</th>
</tr>
<tr>
<td class="label">
[% PROCESS popup label = 'Creatinine' param = 'creatinine' %]:
</td>
[% INCLUDE rows value = outreach.biochemistry.creatinine %]
</tr>
<tr>
<td class="label">
[% PROCESS popup label = 'Calcium' param = 'calcium' %]:
</td>
[% INCLUDE rows value = outreach.biochemistry.calcium %]
</tr>
<tr>
<td class="label">
[% PROCESS popup label = 'IgG' param = 'IgG' %]:
</td>
[% INCLUDE rows value = outreach.immunology.IgG %]
</tr>
<tr>
<td class="label">
[% PROCESS popup label = 'IgA' param = 'IgA' %]:
</td>
[% INCLUDE rows value = outreach.immunology.IgA %]
</tr>
<tr>
<td class="label">
[% PROCESS popup label = 'IgM' param = 'IgM' %]:
</td>
[% INCLUDE rows value = outreach.immunology.IgM %]
</tr>
<tr>
<td class="label">Electrophoresis:</td>
[% INCLUDE rows value = outreach.immunology.electrophoresis %]
</tr>
<tr>
<td class="label">
[% PROCESS popup label = 'Paraprotein' param = 'paraprotein' %]:
</td>
[% INCLUDE rows value = outreach.immunology.paraprotein %]
</tr>
</table>
</td>
</tr>
</table>
<h5>Report table:</h5>
<!-- END outreach/data_summary.tt -->