HeartLab
Connectivity

HL7 Templates

Create and customize HL7 message templates generated by HeartLab for downstream systems.

HL7 Templates

HeartLab HL7 Templates allow administrators to customize the HL7 message structure generated by HeartLab for downstream systems such as:

  • Electronic Medical Records (EMR)
  • Practice Management Systems (PMS)
  • Integration engines
  • External clinical systems

Templates use dynamic variables to automatically insert:

  • Patient information
  • Study details
  • Report content
  • PDF report data

into HL7 messages generated by HeartLab.

Applies to

  • Users with Integrations: HL7 permissions (typically Administrators)

Before You Begin

HL7 templates are typically configured with assistance from:

  • Your IT team
  • EMR vendor
  • Integration provider
  • HeartLab representative

You may require:

  • HL7 message specifications
  • Receiving application requirements
  • Facility identifiers
  • Custom segment formatting rules
If you are unsure how your HL7 message should be structured, please contact your integration provider or HeartLab representative before modifying templates.

Create an HL7 Template

If you do not see these settings, your role may not include Integrations: HL7 permissions. Contact your HeartLab administrator if required.
  1. Navigate to Settings > Integrations > HL7 Templates
  2. Select Create HL7 Template
  3. Enter a template name.
  4. Select Create Template

HL7 Template Content

The Content editor contains the HL7 message structure generated by HeartLab.

Default example:

MSH|^~\&|HeartLab|HeartLab|RECEIVING_APP|RECEIVING_FACILITY|{{ message.timestamp | date }}||ORU^R01|{{ message.id }}|P|2.5|||||UNICODE UTF-8
PID|1||{{ patient.id }}||{{ patient.name | person_name }}||{{ patient.birthdate | date }}|{{ patient.sex }}
OBR|1|||{{ study.accessionNumber }}^{{ study.type }}^L|||{{ study.date | date }}
OBX|1|ED|REPORT^Diagnostic Report^L||{{ report.pdf }}||||||F

Dynamic Variables

Templates use dynamic variables wrapped in:

{{ variable }}

These variables are automatically replaced with study data when the HL7 message is generated.

Examples include:

VariableDescription
{{ patient.id }}Patient identifier
{{ patient.name }}Patient name
{{ patient.birthdate }}Patient date of birth
{{ patient.sex }}Patient sex
{{ study.accessionNumber }}Study accession number
{{ study.type }}Study type
{{ study.date }}Study date
{{ report.pdf }}Encoded report PDF
{{ message.timestamp }}Message timestamp
{{ message.id }}Unique message ID

Example Output

The Example Output section displays a rendered preview of the generated HL7 message using example data.

This can be used to:

  • Validate HL7 formatting
  • Verify variable replacement
  • Confirm segment structure
  • Review message output before deployment

Downloading HL7 Output

Select HL7 Download to export the generated HL7 example output for:

  • Testing
  • Validation
  • EMR onboarding
  • Integration troubleshooting

Best Practices

  • Keep a backup of working templates before making changes
  • Validate template changes with your receiving system
  • Test changes in a non-production environment where possible
  • Confirm receiving systems support the configured HL7 version and message structure

Troubleshooting

Common causes of HL7 formatting issues include:

  • Invalid HL7 segment structure
  • Incorrect separator characters
  • Unsupported receiving system requirements
  • Invalid or incomplete template variables
  • Incorrect encoding expectations

If generated HL7 output is rejected:

  • Review the Example Output section
  • Verify all required segments exist
  • Confirm formatting requirements with the receiving system
  • Compare output against vendor-provided HL7 specifications
  • Contact your HeartLab representative for assistance if required
MFR
Manufacturer
HeartLab Limited 305 / 150 Karangahape Road Auckland 1010 New Zealand
UK REP
UK Responsible Person
Casus UKRP Ltd 107-111 Fleet Street London EC4A 2AB United Kingdom
AUS
Australian Sponsor
Emergo Australia Level 20 Tower II Darling Park 201 Sussex Street Sydney NSW 2000 Australia
MD Applies to HeartLab v7.2 and above Effective 0000-00-00 eIFU version 0.0.0 UDI-DI 09421907090023