DocumentReference

Work with FHIR R4 4.0.1 DocumentReference resources.

Choose an operation for this resource:

The diagram summarizes DocumentReference requests and responses. See Supported FHIR REST Interactions for the shared interaction model.


A FHIR client sends requests to the DDFS R4 DocumentReference API. Search returns a Bundle; create, read and update return a resource; vread returns one historical version; delete returns HTTP 204 without a body. Custom operations and FHIR-formatted errors can return OperationOutcome.

FHIR R4 definition: https://hl7.org/fhir/R4/documentreference.html. See interaction response codes and common error responses.

The base endpoint is /api/fhir/r4/DocumentReference. Store document metadata and attachment descriptions here. DDFS preserves the supplied content and historical versions, including extensions and primitive companion metadata. It does not fetch attachment URLs, expose a Binary endpoint, ingest external documents, or process document contents.

Interactions and responses

RequestSuccessful response
POST /DocumentReference201 Created; the server assigns the logical ID and version.
GET /DocumentReference/{id}200 with the current resource.
GET /DocumentReference/{id}/_history/{version}200 with the requested historical resource.
PUT /DocumentReference/{id}200 for replacement; 201 for PUT-as-create or restoration. The body ID must match the URL ID.
DELETE /DocumentReference/{id}204 after soft deletion. The resource is excluded from current searches.
GET /DocumentReference or form-encoded POST /DocumentReference/_search200 with a searchset Bundle.
POST /DocumentReference/{id}/$hardDelete200 with an OperationOutcome after permanent removal of a soft-deleted resource. Soft-delete the resource first.
POST /DocumentReference/$purgeDeleted200 with an OperationOutcome. Supply the existing FHIR Parameters body with before and limit; only eligible soft-deleted resources are purged.
DocumentReference capabilitySupport or requirement
Conditional createNot supported.
Conditional updateNot supported.
Transaction bundlesNot supported.

Create example

DocumentReference detailRequirement or behavior
StatusStatus and at least one content element are required; each content element requires an Attachment.
Resource ruleThe optional docStatus binding permits preliminary, final, amended and entered-in-error.
ReferencesReferences must use the targets allowed by the R4 resource definition.
Write provenanceThe generated Provenance describes the change to the reference resource.
POST /api/fhir/r4/DocumentReference
Content-Type: application/fhir+json

{
  "resourceType": "DocumentReference",
  "status": "current",
  "masterIdentifier": {"system": "urn:example:documents", "value": "synthetic-report-1"},
  "subject": {"reference": "Patient/patient-1"},
  "date": "2026-04-20T10:11:12Z",
  "content": [{"attachment": {"contentType": "text/plain", "url": "https://example.test/synthetic-report"}}],
  "context": {"period": {"start": "2026-02-01", "end": "2026-02-28"}}
}

Permissions and limits

ItemRequirement or behavior
LimitationsConditional create, conditional update and transaction participation are not supported.
ReferencesDoes not provide R6 DocumentReference endpoint, encounter/context filters, clinician/organization filters, full-text search, attachment retrieval service or US Core certification.