Prolab LIS Cloud

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

VariableTypeRequired
reportNumberstringYes
reportDatestringYes
statusstringYes
validationStatusstringYes

barcode

VariableTypeRequired
barcodeImagestringYes

patientInfo

VariableTypeRequired
patientNamestringYes
dateOfBirthstringYes
genderstringYes
agenumber/stringYes
referenceNumberstringYes
bloodTypestringNo
orderingPhysicianstringYes

testResults (groupedCollection)

Group Variables:

  • testPanelParentName.groupValue – Parent panel name
  • testPanelName.groupValue – Panel name

Item Variables:

VariableTypeRequired
testNamestringYes
resultstringYes
unitsstringNo
referenceRangestringNo
previousstringNo
isAbnormalbooleanNo
secondaryUnitsstringNo
convertedResultstringNo
secondaryReferenceRangestringNo
interpretationstringNo
commentsstringNo

reportSummary

VariableTypeRequired
orderingPhysicianstringYes
specimenCollectedDatestringYes
specimenReceivedDatestringYes
reportDatestringYes
resultBystringYes
verifiedBystringYes

interpretation

VariableTypeRequired
interpretationTextstringNo

notes

VariableTypeRequired
notesTextstringNo

signature

VariableTypeRequired
resultBystringYes
resultDatestringYes
verifiedBystringYes
verifiedDatestringYes
labDirectorstringYes
reportDatestringYes
VariableTypeRequired
footerTextstringNo

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