FHIR

DocumentReference vs DiagnosticReport vs Binary in FHIR: where a PDF, a scan or a lab report goes

Three FHIR resources handle reports and files. DiagnosticReport holds the result of a test with its Observations and conclusion; DocumentReference indexes any document such as a PDF letter or a scan; Binary holds raw content. When to use each, with the links between them.

by Published 2 min read

Short answer: Use DiagnosticReport for the result of a diagnostic test (a lab panel, an imaging study) with its individual results and the conclusion. Use DocumentReference to index any document, such as a scanned discharge letter or a PDF lab report, with its type, date, author and the patient it belongs to. Use Binary for the raw file content when it is stored on the server.

How they fit together

  • A lab panel: one DiagnosticReport (code: the panel; result: references to each Observation; conclusion; presentedForm: the PDF if available).
  • A scanned discharge letter: a DocumentReference (type, date, author, subject) whose content.attachment points to the PDF, stored as a Binary or at a URL.
  • An imaging study: a DiagnosticReport for the radiologist's report, and an ImagingStudy for the DICOM series. See DICOM vs FHIR.

A rule of thumb: if the data is structured and coded, use DiagnosticReport and Observations; if it is a document to be read by a person, use DocumentReference.

Why both often exist

Labs often send structured results and a PDF. Keeping both lets software chart the values while a person can still see the original layout and signature.

In Anpheros

In Anpheros, scanned letters and reports are DocumentReferences whose attachment points to the stored file, and the lab values extracted from them become Observations, so you keep both the original and the data. The Platform also supports DiagnosticReport; it does not expose Binary as a resource. See Documents in the app and, for developers, storing medical records in FHIR.

Sources

Frequently asked questions

Where do I store a PDF in FHIR?

Index it with a DocumentReference; the file itself goes in content.attachment, as a URL or a Binary resource.

When should I use DiagnosticReport?

For the result of a diagnostic test with its Observations and conclusion.

Can a DiagnosticReport include the PDF?

Yes, in presentedForm, alongside the structured results.

Is Binary a clinical resource?

No. It only holds raw content; the meaning comes from the DocumentReference or DiagnosticReport that points to it.

Anpheros Platform

Try it free in the sandbox

Your first FHIR call in 5 minutes. An HL7 FHIR R4 API with the patient's consent built in: try it in the sandbox, then connect your own app or clinic system.

Free · 30 synthetic patients · no card

This guide is for information and does not replace medical advice. For decisions about your health, talk to your doctor. In an emergency, call your local emergency number (112 in Europe).
Written by
The Anpheros team

Anpheros builds a medical record that the patient controls and can share with any clinic, on an HL7 FHIR R4 platform, based in the EU. These guides help you understand and organise your health; they do not replace your doctor.

About Anpheros →
Anpheros

The more you log, the clearer your record

Your health history in one place, under your control.

Symptom diaryPatterns show over time
Emergency cardQR in your phone's Wallet
All your resultsLabs and reports together
You decideWho sees what, and for how long
Create your free account

Free · Works in your browser · No card