Prolab LIS Templates : Results
HBS Template Structure
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>Rapport de Résultats</title>
<style>
/* CSS styles */
</style>
</head>
<body>
<div class="report-container">
{{{reportHeader}}}
{{{patientInfo}}}
{{{barcode}}}
<table>
<thead>
<tr>
<th>Test</th>
<th>Résultat</th>
<th>Unités</th>
<th>Valeurs de Référence</th>
<th>Précédent</th>
</tr>
</thead>
<tbody>
{{{testResults}}}
</tbody>
</table>
{{{reportSummary}}}
{{{interpretation}}}
{{{notes}}}
{{{signature}}}
{{{footer}}}
</div>
</body>
</html>
JSON Structure
{
"template": "test_result_report",
"data": {
"sectionName": {
"type": "bloc|groupedCollection",
"template": "HTML with {{variables}}",
"content": {}
}
},
"outputFormat": "pdf",
"pageFormat": {
"format": "A4",
"margin": { "top": "2cm", "right": "2cm", "bottom": "2cm", "left": "2cm" }
},
"printOptions": {
"printBackground": true,
"displayHeaderFooter": true,
"margin": { "top": "2cm", "right": "2cm", "bottom": "2cm", "left": "2cm" }
},
"headerTemplate": "<div>Page header</div>",
"footerTemplate": "<div>Page <span class='pageNumber'></span> de <span class='totalPages'></span></div>",
"css": {
"additional": ["CSS rules"]
}
}
Section Types
Bloc: Static content block
{
"type": "bloc",
"template": "<div>{{variable}}</div>",
"content": {}
}
GroupedCollection: Dynamic list grouped by panels
{
"type": "groupedCollection",
"groupBy": [
{
"testPanelParentName": {
"template": "<tr><td colspan='5'>{{groupValue}}</td></tr>",
"order": 1,
"sortBy": "order",
"sortOrder": "asc"
}
}
],
"content": {
"default_template": "<tr><td>{{variable}}</td></tr>",
"items": []
}
}
Variables by Section
reportHeader
| Variable | Type | Required |
|---|---|---|
reportNumber | string | Yes |
reportDate | string | Yes |
status | string | Yes |
validationStatus | string | Yes |
barcode
| Variable | Type | Required |
|---|---|---|
barcodeImage | string | Yes |
patientInfo
| Variable | Type | Required |
|---|---|---|
patientName | string | Yes |
dateOfBirth | string | Yes |
gender | string | Yes |
age | number/string | Yes |
referenceNumber | string | Yes |
bloodType | string | No |
orderingPhysician | string | Yes |
testResults (groupedCollection)
Group Variables:
testPanelParentName.groupValue– Parent panel nametestPanelName.groupValue– Panel name
Item Variables:
| Variable | Type | Required |
|---|---|---|
testName | string | Yes |
result | string | Yes |
units | string | No |
referenceRange | string | No |
previous | string | No |
isAbnormal | boolean | No |
secondaryUnits | string | No |
convertedResult | string | No |
secondaryReferenceRange | string | No |
interpretation | string | No |
comments | string | No |
reportSummary
| Variable | Type | Required |
|---|---|---|
orderingPhysician | string | Yes |
specimenCollectedDate | string | Yes |
specimenReceivedDate | string | Yes |
reportDate | string | Yes |
resultBy | string | Yes |
verifiedBy | string | Yes |
interpretation
| Variable | Type | Required |
|---|---|---|
interpretationText | string | No |
notes
| Variable | Type | Required |
|---|---|---|
notesText | string | No |
signature
| Variable | Type | Required |
|---|---|---|
resultBy | string | Yes |
resultDate | string | Yes |
verifiedBy | string | Yes |
verifiedDate | string | Yes |
labDirector | string | Yes |
reportDate | string | Yes |
footer
| Variable | Type | Required |
|---|---|---|
footerText | string | No |
GroupedCollection Structure
The testResults section uses groupedCollection type to group tests by panels:
{
"testResults": {
"type": "groupedCollection",
"groupBy": [
{
"testPanelParentName": {
"template": "<tr class='panel-header parent-panel'><td colspan='5'><h3>{{groupValue}}</h3></td></tr>",
"order": 1,
"sortBy": "order",
"sortOrder": "asc"
}
},
{
"testPanelName": {
"template": "<tr class='panel-header'><td colspan='5'><h4>{{groupValue}}</h4></td></tr>",
"order": 2,
"sortBy": "order",
"sortOrder": "asc"
}
}
],
"content": {
"default_template": "<tr>...test row...</tr>",
"items": []
}
}
}
Groups are rendered in order before items. Each item can have optional converted values, interpretation, and comments rows.
Handlebars Syntax
{{variable}} // Variable output
{{{section}}} // Unescaped HTML injection
{{#if variable}}...{{/if}} // Conditional block
{{#if isAbnormal}}abnormal{{else}}normal{{/if}} // Conditional class
{{groupValue}} // Group value in groupedCollection







