Zero-retention DICOM pipelines for HIPAA and GDPR
- A zero-retention DICOM pipeline forwards imaging data in memory without writing pixel bytes or patient tags to disk.
- Transient disk caching treats studies as data at rest, requiring encryption, backup exclusion, and deletion evidence.
- The HIPAA conduit exception is narrow, and services that terminate TLS or convert protocols are usually Business Associates.
- GDPR data minimisation and storage limitation principles favor pipelines that hold personal data only during transfer.
- Safe logging records transport metadata like byte counts and certificate IDs instead of DICOM patient tags.
A zero-retention DICOM pipeline sends medical imaging data from the sender to your destination without storing the study. It does not write pixel bytes or patient tags to disk, a queue, or a cache. The goal is simple: keep Protected Health Information (PHI) in transit, then hand it to the system that is meant to keep it.
This is engineering orientation, not legal advice; your counsel decides how HIPAA, GDPR, and product-specific rules apply.
Your ingestion architecture decides how much audit work you carry. Stateless forwarding and transient disk caching can both fit a compliant product. They create very different operational jobs.
How does zero-retention DICOM forwarding differ from caching?
In a stateless forwarding architecture, your gateway accepts an incoming DICOM C-STORE association or HTTP request. It sends incoming data to the downstream system without local file storage. A common destination is DICOMweb STOW-RS over HTTPS. When the transfer finishes, volatile memory clears. No patient tags remain in local files, persistent records, or queues.
A transient disk caching pipeline takes another path. It accepts an incoming DICOM instance and writes the full file to scratch storage, like /tmp/incoming/. A background worker picks up the file, routes it, and deletes it later.
That design may be valid. It also turns short-lived studies into data at rest. You now need disk encryption, operating system permissions, backup exclusions, and evidence that deletion works. These are known jobs, but they are jobs your team must own.
| Architectural aspect | Stateless forwarding | Transient disk caching |
|---|---|---|
| Storage medium | Volatile RAM only | Non-volatile block storage |
| HIPAA classification | Data in transit | Data at rest, even if short-lived |
| Incident review scope | No stored study files | Current queue files on disk |
| Failure handling | Upstream sender retries on error | Worker retries from local disk |
| Backups and snapshots | No PHI cleanup needed | Must exclude scratch volumes |
I would pick stateless forwarding for a connectivity layer unless you have a clear need for local offline retries. You give up a useful safety net. If your destination is down, the gateway returns an error and the modality or PACS retries on its own schedule. That trade is often worth it when your product already has storage later in the pipeline.
How does zero retention change HIPAA and BAA reviews?
Under 45 CFR 160.103, a third party that handles electronic PHI for a covered clinic or hospital may be a Business Associate. You should expect a Business Associate Agreement (BAA) before production patient studies move through the service.
Do not assume zero disk storage gives you the HIPAA conduit exception. The conduit exception is narrow. It fits pure transmission services that do not interact with the application payload. If your software terminates TLS, handles DICOM associations, or converts protocols, compliance teams will usually treat it as a Business Associate relationship.
Modality (Hospital) ──[mTLS / DIMSE]──► Ingestion Gateway ──[HTTPS]──► Destination
(In-Memory Stream)
• No disk writes
• No payload store
• Zero PHI at rest
Zero retention gives you a cleaner answer during BAA review. Hospital compliance teams will still ask direct questions. If your gateway writes DICOM files to disk, they can reasonably ask for:
- Encryption key rotation schedules for temporary volumes.
- Snapshot and backup exclusion policies for scratch storage.
- Secure disk sanitization procedures, such as NIST SP 800-88, when hosts are retired.
- Access logs for every operating system account that can read the staging directory.
With stateless forwarding, your answer is narrower: the service stores no PHI at rest. You still need transport security, access control, monitoring, and a signed agreement. The good news is that the discussion moves from “where are all the copied studies?” to “prove this path stays in transit.”
Building that path yourself means you keep it running for years and prove to every hospital, again and again, that it stores nothing. A managed gateway such as Dicomly handles zero-retention ingress, as its security page explains. It supports a BAA or GDPR Article 28 DPA before real studies are sent. That lets your team focus on the product that receives the study. The trade-off is less control over the gateway and a vendor relationship. It does not make your application compliant.
How does zero retention fit GDPR data minimisation?
European data protection law treats health data as special category data under Article 9 of the GDPR. For imaging ingestion, 2 Article 5 principles matter most.
- Data minimisation (Article 5(1)(c)): Personal data must be adequate, relevant, and limited to what is needed for the purpose. The ICO Guidance on Data Minimisation (Principle c) says systems should not collect or hold more personal data than they need.
- Storage limitation (Article 5(1)(e)): Personal data must not stay identifiable for longer than needed. The ICO Guidance on Storage Limitation (Principle e) says organisations must erase or anonymise data when its purpose ends.
A transient cache creates extra work for both principles. If a patient asks for erasure while files remain in dead-letter caches or staging directories, you need to find and clear those copies too. That is solvable, but it needs inventory, alarms, and runbooks.
Stateless forwarding has a simpler shape. The pipeline holds personal data only for the time needed to complete the network transfer. After delivery, retention in the ingress layer drops to zero by design. Your downstream archive or AI workflow still needs its own GDPR controls.
Where do zero-retention pipelines still leak PHI?
A pipeline can avoid stored image files and still leak PHI through logs. Debug logging is the usual failure. During an incident, an engineer may log a header, a parsed field, or a sample dataset to understand a failed transfer.
DICOM datasets carry patient metadata alongside pixel data. Standard tags include Patient Name (0010,0010), Patient ID (0010,0020), Date of Birth (0010,0030), and Accession Number (0008,0050).
// Bad: Writing DICOM tags to application logs creates PHI at rest
logger.info("Received instance", { patient: dataset.getString("PatientName") });
// Good: Log only transport metrics and cryptographic identifiers
logger.info("Delivered instance", {
endpointId: "ep_01HXYZ",
clientCertId: "cert_01J5ME",
bytesTransferred: 48291044,
durationMs: 412
});
Treat DICOM metadata as data your logs should not know. Safe logging records transport-level facts instead:
- Opaque endpoint or customer identifiers.
- Client certificate IDs from the mutual TLS handshake. See Mutual TLS for DICOM connections for the connection model.
- Byte counts and transfer duration in milliseconds.
- High-level transport error codes.
The IHE ATNA Profile expects audit logging to support node authentication and accountability. RFC 9325 gives current guidance for secure TLS use. Together, they point to a practical rule: log enough to operate the service, but not enough to recreate clinical content.
What should you check before building one?
When you design a zero-retention receiver, start with data flow rather than code. Draw every place DICOM bytes can pause. Include sockets, memory, logs, traces, worker handoffs, error handlers, backups, and crash dumps. This is a short exercise, and it catches most accidental storage early.
import http from 'node:http';
import https from 'node:https';
// Stream incoming binary DICOM bytes directly to destination without disk writes
const server = http.createServer((req, res) => {
const outboundOptions = {
hostname: 'destination.internal.health',
port: 443,
path: '/v1/studies',
method: 'POST',
headers: {
'content-type': req.headers['content-type'] || 'application/dicom',
'transfer-encoding': 'chunked'
}
};
const outbound = https.request(outboundOptions, (upstreamRes) => {
res.writeHead(upstreamRes.statusCode || 502, upstreamRes.headers);
upstreamRes.pipe(res);
});
outbound.on('error', () => {
res.writeHead(502);
res.end();
});
// Pipe the readable stream straight to the writable stream
req.pipe(outbound);
});
server.listen(8080);
This small example shows the shape, not a production receiver. Production also needs authentication, error mapping, certificate lifecycle, observability, and years of boring uptime. Those parts are manageable when you list them early instead of discovering them during a hospital onboarding call.
For your next step today, draw your own ingress path and mark every possible place where PHI could rest. Then compare that drawing with the connection flow in receiving DICOM from a hospital over the internet. If you are deciding whether to build or outsource the listener, use the questions in building a custom DICOM listener vs a managed gateway. Do that before you pick the operating model.
Dicomly builds infrastructure for healthcare software teams that receive DICOM studies from hospitals. Why we built Dicomly →