Skip to main content

The 7-stage pipeline

Every HL7v2 message that enters JamBridge passes through the same 7-stage pipeline, regardless of type, port, or sending facility. The stages run sequentially. The order cannot be changed by configuration.

Why fixed order?

Clinical safety requires it. Consent must be checked before data is written. Identity must be resolved before transformation. A configurable pipeline is one where a misconfiguration can create a clinical safety event — patient data written without consent, or written to the wrong patient record.

Stage overview

StageNameWhat happensFailure behaviour
1RECEIVEMLLP ingest, HL7v2 parse, MSH-10 dedupMSA|AE on parse failure, MSA|AA on duplicate
2ENRICHJamFR facility lookup + JamMPI Patient/$matchMSA|AE if MPI unavailable
3TRANSFORMHL7v2 → FHIR R4 mapping, JamTS terminologyMSA|AE on unmappable segment
4GOVERNAJ Consent check — fail-closedMSA|AE on deny or unreachable
5PERSISTHAPI FHIR conditional create/updateQueue + retry (circuit breaker)
6DISPATCHFHIR subscriptions, JamConnect POST_WRITENon-blocking, best-effort
7ACKMSA|AA + ATNA AuditEventAlways completes

Timing

A typical ADT^A01 message completes the full pipeline in 3,000–6,000ms:

StageTypical durationNotes
RECEIVE~3msHAPI HL7v2 Terser parse
ENRICH (cached)~5msFacility + patient from cache
ENRICH (cache miss)~80msNetwork calls to JamFR + JamMPI
TRANSFORM~11msLocal Java, no network call
GOVERN~25msJamConnect → AJ Consent
PERSIST~180msHAPI FHIR write (DB-dependent)
DISPATCHnon-blockingAsync, does not add to ACK latency
ACK~1ms

The largest variable is PERSIST. HAPI FHIR write latency depends on your PostgreSQL configuration and hardware. At high volume, tune hapi.jpa.bulk_export_enabled and connection pool size.

Transaction ID

Every message receives a unique transaction ID at reception:

BR01-26060612-001
├── BR01 facility code (first 4 chars of MSH-4)
├── 26060612 date YYYYMMDD
└── 001 per-minute sequence counter

The ID is written to hie_transaction_log at reception and finalised with status, duration, and golden record ID at ACK.

Per-stage docs

Each stage has a dedicated page with implementation details, class names, SQL queries, and HTTP examples: