knowledge base

Integrating Stratosphere’s PACT with Epic EHR via HL7

Learn how Stratosphere’s PACT integrates with Epic via HL7 to create tamper-evident, cryptographically verifiable audit evidence—strengthening compliance, defensibility, and trust without disrupting clinical workflows.

Integrating Stratosphere’s PACT with Epic EHR via HL7

Step-by-Step Instructions for Forwarding EHR Events as Tamper-Evident Evidence


Introduction

Electronic Health Records such as Epic are authoritative systems of record, but authority alone is no longer enough. Regulators, auditors, and courts increasingly require independent proof that records were not altered after the fact.

Stratosphere’s PACT (Proof & Attestation Compliance Toolkit) provides that proof by transforming EHR events into cryptographically verifiable, tamper-evident evidence. This article focuses specifically on the how: the exact, practical steps required to create an HL7 interface that forwards Epic EHR output events to Stratosphere PACT.

The integration is non-invasive, does not modify Epic data, and does not disrupt clinical workflows.


Integration Overview

At a high level, the integration consists of:

  1. Configuring Epic to emit HL7 messages for selected events
  2. Routing those messages through an interface engine
  3. Transforming HL7 messages into PACT event envelopes
  4. Forwarding the events to Stratosphere’s PACT API

No database access, no write-back to Epic, and no schema changes are required.


Prerequisites

Before starting, ensure the following are available:

  • Epic environment with HL7 outbound capability
  • An interface engine (e.g., Mirth Connect, Rhapsody, or equivalent)
  • Network egress access to Stratosphere PACT endpoints
  • A PACT tenant ID and API credentials from Stratosphere
  • TLS certificates for secure transport

Step 1: Identify Epic HL7 Event Sources

Determine which Epic workflows should produce integrity evidence. Start with events that are compliance-sensitive.

Common Epic HL7 message types:

  • ADT – Admissions, Discharges, Transfers
  • ORM – Orders (labs, imaging, medications)
  • ORU – Results and observations
  • RXA / RDE – Medication administration and dispensing
  • DFT – Charges and financial events

You do not need every message. Select events where post-hoc alteration would pose compliance or legal risk.


Step 2: Configure Epic HL7 Outbound Interfaces

In Epic:

  1. Create or reuse an HL7 Outbound Interface
  2. Configure the interface to emit selected message types
  3. Set the destination to your interface engine (MLLP or TCP)
  4. Enable real-time or near-real-time delivery
  5. Ensure message acknowledgments are enabled (ACK/NACK)

No customization of Epic schemas is required.


Step 3: Receive HL7 Messages in the Interface Engine

In your interface engine:

  1. Create a new source channel (HL7 v2.x)
  2. Configure the listener to accept Epic connections
  3. Validate incoming messages for:
    • Message type (MSH-9)
    • Timestamp (MSH-7)
    • Sending facility (MSH-4)
  4. Log raw HL7 messages for troubleshooting only (optional)

At this stage, messages remain unmodified.


Step 4: Normalize HL7 Messages into Events

Transform each HL7 message into a normalized PACT event. This step does not store PHI—it extracts metadata required to prove integrity.

Required Mappings

PACT Field HL7 Source
event_id Generated UUID
event_type MSH-9 (e.g., ADT^A01, ORU^R01)
occurred_at MSH-7
tenant_id Static (provided by Stratosphere)
actor.system "Epic"
actor.user PV1-7 / ORC-12 / RXA-10 (as available)
payload_hash SHA-256 hash of canonical HL7 content

Canonicalization Rule

Before hashing:

  • Remove transport-specific fields
  • Normalize line endings
  • Preserve segment order
  • Exclude volatile routing metadata

This ensures deterministic hashing.


Step 5: Construct the PACT Event Envelope

Your interface engine should construct a JSON payload similar to the following:

{
  "event_id": "550e8400-e29b-41d4-a716-446655440000",
  "event_type": "ADT_A01",
  "event_version": "1.0",
  "tenant_id": "epic-prod-hospital-001",
  "occurred_at": "2026-07-01T14:22:10Z",
  "actor": {
    "system": "Epic",
    "user": "clinician_12345"
  },
  "action": "CREATE",
  "result": "SUCCESS",
  "integrity": {
    "payload_hash": "sha256:cafebabe...",
    "prev_event_hash": null
  },
  "payload_ref": "hl7://ADT^A01"
}

The full HL7 message is not required. The cryptographic hash alone is sufficient to prove integrity.


Step 6: Forward Events to Stratosphere PACT

Configure the interface engine to forward events using HTTPS.

Transport Requirements

  • HTTP Method: POST
  • Endpoint: Provided by Stratosphere
  • Authentication: API key or signed bearer token
  • TLS: Required

Example Request Headers

POST /v1/events Authorization: Bearer <PACT_API_TOKEN> Content-Type: application/json

The interface engine should retry transient failures using exponential backoff.


Step 7: Handle Errors and Acknowledgments

PACT responses are deterministic:

  • 200 OK – Event accepted and committed
  • 4xx – Invalid payload (do not retry)
  • 5xx – Temporary failure (retry permitted)

HL7 ACKs must continue flowing back to Epic regardless of PACT delivery status to prevent workflow disruption.

PACT must never block or delay clinical operations.


Step 8: Validate the Integration

To validate the implementation:

  1. Trigger known Epic events
  2. Capture the emitted HL7 messages
  3. Recompute payload hashes independently
  4. Verify them against PACT proofs
  5. Confirm public ledger anchoring timestamps

This establishes end-to-end cryptographic integrity.


Security and PHI Considerations

This integration is designed to simplify security and compliance approvals:

  • PHI can be excluded entirely
  • Hashes are one-way and irreversible
  • No write-back to Epic
  • No Epic database access
  • No workflow changes

PACT acts as an independent cryptographic witness, not a data repository.


Audit and Verification Workflow

During an audit or investigation:

  1. Export Epic records
  2. Recompute hashes using the same canonicalization rules
  3. Verify against PACT ledger proofs
  4. Validate timestamps using public blockchain anchors

Any alteration becomes mathematically provable.


Implementation Timeline

Typical implementation timelines:

  • Epic HL7 configuration: 1–3 days
  • Interface engine mapping: 2–4 days
  • PACT configuration and validation: 2–3 days

Most organizations complete integration in under two weeks.


Conclusion

By forwarding Epic HL7 output events to Stratosphere’s PACT, healthcare organizations gain something EHRs alone cannot provide: independent, cryptographic proof of integrity.

This approach requires no schema changes, no operational disruption, and no trust assumptions—only standard HL7 interfaces and sound cryptography.

PACT does not replace Epic.
It proves it.

Learn more at: https://pact.stratosphere.llc/features

Ready to build on Stratosphere?

Build once. Scale securely. Stay compliant.