Skip to main content

Stage 7 — ACK

What happens

  1. Hl7v2AckBuilder generates an HL7v2 MSA|AA acknowledgement
  2. The ACK is returned on the same MLLP TCP connection
  3. The transaction log is finalised (status: SUCCESS, duration_ms, golden_patient_id)
  4. AtnaService writes the ATNA AuditEvent asynchronously

ACK format

MSH|^~\&|JAMBRIDGE|CHAIN|HHIMS|BR01|20260612143027||ACK^A01^ACK|ACK-001|P|2.5
MSA|AA|BR01-001|Patient admitted and stored in chain FHIR
  • MSA|AA — accept acknowledgement (message accepted)
  • MSA|AE — application error (consent denied, parse error, MPI failure)
  • MSA|AR — application reject (malformed message, wrong port)

ATNA AuditEvent

Two ATNA writes happen asynchronously (never blocking the ACK):

1. RFC 5425 TLS syslog (to syslog-ng):

<85>1 2026-06-12T14:30:27Z jambridge JAMBRIDGE - - -
ATNAMessage type=110110 ...

2. BALP FHIR AuditEvent (to HAPI):

{
"resourceType": "AuditEvent",
"type": {"code": "110106", "display": "Export"},
"action": "C",
"outcome": "0",
"agent": [{"who": {"reference": "Organization/org-br01-001"}, "requestor": false}],
"entity": [{"what": {"reference": "Patient/MRN123456"}}]
}

Transaction log finalisation

UPDATE hie_transaction_log SET
status = 'SUCCESS',
completed_at = NOW(),
duration_ms = :duration,
fhir_resource_id = :resourceId,
golden_patient_id = :goldenId
WHERE transaction_id = :txId;