Article

HL7 v2 and FHIR: how custom applications connect to a hospital information system

Most hospital applications in Canada get data as HL7 v2 messages through the interface engine, and more use FHIR APIs. Success depends on the work around the standard: mappings, testing, monitoring and a downtime plan.

The short answer

Custom applications connect to a hospital information system (HIS) in one of four ways: HL7 v2 messages through the interface engine, FHIR APIs, vendor APIs or scheduled files. HL7 v2 carries events such as admissions, orders and results; FHIR increasingly handles on-demand queries and updates. The hard part is rarely the standard but the mapping, testing, monitoring and agreeing with the interface team how changes and outages are handled.

How hospital systems exchange information

A main HIS (such as Epic, Oracle Health, formerly Cerner, or MEDITECH) runs alongside lab, imaging, pharmacy, scheduling and dozens of departmental systems. An interface engine in the middle receives, transforms and routes messages, queuing them when a receiving system is down.

Shared systems add steps. Many Canadian hospitals share one information system through a regional partnership or shared service organization. Requests then follow that team's intake, change process, test environment and release schedule: plan the time.

HL7 v2: the event messages

Text messages in segments, mostly sent when something happens.

MessageCarriesTypical use
ADTAdmissions, discharges, transfers, patient updatesCurrent patient lists, triggering follow-up
ORM, ORUOrders and observation resultsLab results, order status
SIUSchedulingReminders, clinic flow
MDMMedical documentsNotice that a report or note is ready

Feeds differ by hospital (version, optional fields, local codes, custom "Z" segments), so code built to the standard alone breaks: write the mapping specification from the hospital's sample messages first. MLLP, the usual transport, has no encryption of its own, so run it over TLS or a private network.

FHIR, vendor APIs and files

FHIR exchanges resources (Patient, Encounter, Observation, Appointment, DocumentReference) as JSON through web APIs, usually authorized with OAuth 2.0, often SMART on FHIR, so access can be limited to a user, a patient or a defined data set. It suits looking up or writing back data when a user acts but does not replace events: many applications query with FHIR and hear of changes through HL7 v2.

More detail: FHIR versions, vendor APIs and flat files
  • Many vendor FHIR APIs are based on Release 4 (R4), though later releases exist. What a vendor's API exposes, and what each hospital has switched on, varies.
  • Some data is only available through a vendor's own API or scheduled extracts, such as CSV files by secure file transfer. Both suit reporting and batch work.
  • Treat files as interfaces: define the format, validate every file, alert on missing or late files and encrypt the transfer.

Canadian standards and law to watch

Canada Health Infoway's CA Core+ (pan-Canadian core FHIR profiles) and HL7 Canada's Canadian Baseline are still evolving, and provinces have their own specifications: confirm which profiles a project must follow.

Not law yet. The Connected Care for Canadians Act, reintroduced in February 2026 as Bill S-5, would require health IT vendors to make products interoperable and prohibit data blocking, with details left to regulations. As of 22 October 2026 it is before the House of Commons and is not law. General information, not legal advice.

Doing it properly

Map in writing

Every field, code and transformation agreed. LOINC and SNOMED CT matter; Infoway keeps Canadian editions.

Test the edge cases

Synthetic or de-identified messages in the hospital's test environment: merges, cancellations, corrected results, no health card.

Handle errors

Acknowledge correctly, make repeats create no duplicates, send failures to a queue a person reviews.

Monitor every feed

Alert when a feed stops, slows or rejects messages, not when a clinician notices.

Plan downtime and replay

Agree behaviour during an HIS or engine outage, and how missed messages are replayed and reconciled.

Protect privacy

Only the data needed, no message content in ordinary logs, access recorded, encrypted in transit and at rest.

What usually goes wrong: coding before sample messages and a mapping specification; no place in the interface team's queue, so go-live slips; an unmonitored feed failing silently for days; corrected results and merges ignored, so data is outdated; one developer and no documentation.

Example: a discharge follow-up app
Demonstration, not a client project

A hospital wants an app that reminds discharged patients about appointments. It subscribes to ADT discharge and SIU scheduling messages through the interface engine, stores only the fields it needs, and looks up the patient's preferred language with a FHIR query at send time. After an outage it processes the engine's queued messages in order and flags any discharge without a matching appointment for staff review.

Rather talk it through? If your application needs data from the hospital information system, tell us what it needs and we will map the messages or APIs and the steps to go live. Talk to a Promatics specialist

When to bring in help

A standard feed and developers who know HL7 v2 or FHIR may need only the interface team's specification and test time. Bring in help when the application must receive events and write back, several systems or hospitals are involved, nobody owns monitoring after go-live, or an integration fails and nobody knows why. Our clinical systems integration service maps, builds, tests and monitors interfaces with your interface team; our hospital software partner checklist covers what else to ask.

Sources and further reading

Product capabilities and guidance change. These are the primary sources this article relies on, checked on the review date above.

  1. HL7 Version 2 Product Suite, HL7 International
  2. FHIR specification, HL7 International
  3. CA Core+ Implementation Guide, Canada Health Infoway
  4. Canadian Baseline (FHIR implementation guide, continuous build), HL7 Canada
  5. Bill S-5, Connected Care for Canadians Act, Parliament of Canada (LEGISinfo)

This article is general information, not legal, accounting or security advice for your specific situation. Examples are hypothetical unless stated otherwise.

Talk to Promatics

Connect your application to the HIS without surprises

Integration stalls when mappings, test environments and the interface team's queue are unplanned. Tell us what you need; we will map every step to launch.

  • Mapping specifications written before any code
  • Testing and go-live planned with your interface team
  • Monitoring, alerting and replay built in from day one