Skip to main content

Stage 1 — RECEIVE

What happens

  1. Raw HL7v2 bytes arrive on a Camel MLLP consumer (camel-mllp component)
  2. The HAPI HL7v2 Terser parses the message into a typed Java object (AdtPatient, OruObservation, etc.)
  3. A transaction ID is generated and stamped
  4. MSH-10 deduplication check against hie_transaction_log

Deduplication

SELECT count(*) FROM hie_transaction_log
WHERE message_control_id = :msh10
AND started_at > NOW() - INTERVAL :window HOUR;

If count > 0, the message is a duplicate. JamBridge generates MSA|AA (accept) without re-processing — the sending system gets a clean ACK, preventing infinite retry loops.

The deduplication window defaults to 24 hours. Configure with deduplication.window-hours.

Transaction ID format

BR01-26060612-001
┬ ┬ ┬
│ │ └── 3-digit per-minute sequence counter
│ └─────────── Date YYYYMMDD
└───────────────── MSH-4 facility code (first 4 chars)

Parsed objects

HL7v2 message typeJava objectKey fields extracted
ADTAdtPatientPID-3, PID-5, PID-7, PID-8, PV1-2, PV1-3
ORUOruObservationPID-3, OBR-4, OBX-3, OBX-5, OBX-6, OBX-8
ORM/OMLOrmOrderPID-3, ORC-1, OBR-4
MDMMdmDocumentPID-3, TXA-2, TXA-12
RDERdePharmacyPID-3, RXE-2, RXE-3, RXE-4
SIUSiuSchedulePID-3, SCH-6, SCH-7, SCH-25
MFNMfnMasterFileMFI-1, MFE-4