Stage 1 — RECEIVE
What happens
- Raw HL7v2 bytes arrive on a Camel MLLP consumer (
camel-mllpcomponent) - The HAPI HL7v2 Terser parses the message into a typed Java object (
AdtPatient,OruObservation, etc.) - A transaction ID is generated and stamped
- 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 type | Java object | Key fields extracted |
|---|---|---|
| ADT | AdtPatient | PID-3, PID-5, PID-7, PID-8, PV1-2, PV1-3 |
| ORU | OruObservation | PID-3, OBR-4, OBX-3, OBX-5, OBX-6, OBX-8 |
| ORM/OML | OrmOrder | PID-3, ORC-1, OBR-4 |
| MDM | MdmDocument | PID-3, TXA-2, TXA-12 |
| RDE | RdePharmacy | PID-3, RXE-2, RXE-3, RXE-4 |
| SIU | SiuSchedule | PID-3, SCH-6, SCH-7, SCH-25 |
| MFN | MfnMasterFile | MFI-1, MFE-4 |