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.
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
| Stage | Name | What happens | Failure behaviour |
|---|---|---|---|
| 1 | RECEIVE | MLLP ingest, HL7v2 parse, MSH-10 dedup | MSA|AE on parse failure, MSA|AA on duplicate |
| 2 | ENRICH | JamFR facility lookup + JamMPI Patient/$match | MSA|AE if MPI unavailable |
| 3 | TRANSFORM | HL7v2 → FHIR R4 mapping, JamTS terminology | MSA|AE on unmappable segment |
| 4 | GOVERN | AJ Consent check — fail-closed | MSA|AE on deny or unreachable |
| 5 | PERSIST | HAPI FHIR conditional create/update | Queue + retry (circuit breaker) |
| 6 | DISPATCH | FHIR subscriptions, JamConnect POST_WRITE | Non-blocking, best-effort |
| 7 | ACK | MSA|AA + ATNA AuditEvent | Always completes |
Timing
A typical ADT^A01 message completes the full pipeline in 3,000–6,000ms:
| Stage | Typical duration | Notes |
|---|---|---|
| RECEIVE | ~3ms | HAPI HL7v2 Terser parse |
| ENRICH (cached) | ~5ms | Facility + patient from cache |
| ENRICH (cache miss) | ~80ms | Network calls to JamFR + JamMPI |
| TRANSFORM | ~11ms | Local Java, no network call |
| GOVERN | ~25ms | JamConnect → AJ Consent |
| PERSIST | ~180ms | HAPI FHIR write (DB-dependent) |
| DISPATCH | non-blocking | Async, 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: