Health Data Flow
How FHIR bundles actually move — encrypted, peer-assisted, and fully asynchronous.
Once an HIU holds a granted consent artefact, it can request the covered records. This page walks the full data flow, including the encryption scheme.
End-to-end sequence
sequenceDiagram participant HIU participant GW as Gateway participant CM as HIE-CM participant HIP HIU->>GW: health-information request (artefact id, keys, dataPushUrl) GW->>CM: validate consent CM->>GW: forward to HIP GW->>HIP: health-information request HIP->>HIP: build FHIR bundles, encrypt HIP-->>HIU: POST encrypted data to dataPushUrl (direct) HIP->>GW: data transfer notification HIU->>GW: notify (TRANSFERRED / FAILED)
Steps:
- HIU request — includes the consent artefact ID, requested date range,
its ephemeral public key material, a nonce, and an HTTPS
dataPushUrl. - Validation — the CM checks the artefact is still valid (not expired or revoked) and matches the requested range.
- HIP prepares data — collects records for the consented care contexts and HI types, as FHIR R4 bundles.
- Direct push — the HIP encrypts each bundle and POSTs to the HIU's
dataPushUrl, chunked into pages with atransactionId. - Notifications — both sides notify the gateway of transfer status (health-information notify), which powers audit and retry visibility.
Why a direct push?
The gateway routes control-plane messages only. Bulk health data flows point-to-point between HIP and HIU so the gateway never handles plaintext or becomes a data bottleneck.
For HIP API steps, see Milestone 2 data transfer.
Encryption scheme
ABDM uses ECDH key agreement on Curve25519 with AES-GCM payload encryption (the "ECDH sender keys" model, based on the DHIS2/FIDELIUS reference implementation):
- Both HIP and HIU generate ephemeral X25519 key pairs and 32-byte nonces.
- The HIU sends its public key + nonce in the data request; the HIP returns
its own in the data push (
keyMaterial). - Each side derives the shared secret via ECDH, then derives the AES key using HKDF over the combined nonces.
- Bundles are encrypted with AES-GCM; the HIU decrypts with the same derived key.
{
"cryptoAlg": "ECDH",
"curve": "Curve25519",
"dhPublicKey": {
"expiry": "2025-01-16T10:00:00Z",
"parameters": "Curve25519/32byte random key",
"keyValue": "BASE64_PUBLIC_KEY"
},
"nonce": "BASE64_32_BYTE_NONCE"
}Don't hand-roll the crypto
NHA published FIDELIUS, a reference implementation of the key exchange and encryption (Java CLI; community ports exist for other languages). Use it or a well-tested port, and verify against the sandbox's echo tests.
HIP-side checklist
- Validate the consent artefact ID and date range on every request
- Paginate large record sets (
entrieswithcontentorlinkper page) - Push within the expected SLA, then send the data-transfer notification
- Handle re-requests idempotently (same
transactionId)
HIU-side checklist
- Host a reliable
dataPushUrlendpoint (TLS, auth by transaction context) - Decrypt, then validate checksums / integrity before use
- Send
notifywithTRANSFERRED/ERROREDstatus per transaction - Store data only as permitted (
accessMode), and purge atdataEraseAt
Sources
- ABDM Proposed Simplified Milestone 2 (DOCX→MD, 2026-08)