DocumentReference

The FHIR R4 DocumentReference resource represents metadata about clinical documents such as C-CDAs, PDFs, imaging reports, and other unstructured records.

In Health Gorilla, DocumentReference is used to discover and access patient documents aggregated from multiple clinical data sources. It is the primary resource used to locate and retrieve document-based clinical data.

Overview

DocumentReference provides:

  • Metadata about a document (type, author, date, status)
  • References to the patient associated with the document
  • Links to the actual document content via content.attachment.url

It does not contain the document itself. To retrieve the document content, use the Binary endpoint referenced in the attachment.

Common Use Cases

  • Retrieve clinical documents for a patient
  • Discover available documents before retrieval
  • Access diagnostic reports, clinical notes, and discharge summaries
  • Download document content (PDF, CDA, images)
  • Support care coordination and transitions

HG-Specific Behavior

  • Documents may originate from multiple external networks and sources
  • Document metadata is normalized across sources for consistent access
  • Not all documents are fully structured or coded
  • Document content is accessed separately via the Binary endpoint
  • Some document retrieval workflows may involve asynchronous processing

Resource Structure

Commonly returned attributes include:

AttributeDescriptionExample ValuesFHIR Data Type
subjectPatient associated with the documentPatient/{id}Reference(Patient)
statusStatus of the document referencecurrent, supersededcode
typeType of documentclinical-note, discharge-summaryCodeableConcept
categoryClassification of the documentclinical-note, imagingCodeableConcept[]
dateDocument creation or indexing date2024-02-12T12:34:56ZdateTime
authorAuthor of the documentPractitioner/{id}Reference[]
contentAttachment metadata including document access URLBinary/{id}BackboneElement[]

Retrieve Documents

Search Documents

GET /fhir/R4/DocumentReference?patient={id}

Returns a Bundle of DocumentReference resources matching the search criteria.

Retrieve by ID

GET /fhir/R4/DocumentReference/{id}

Returns a single DocumentReference.

Operations

Download Document Content

To retrieve the actual document file, use the Binary endpoint referenced in:

content[].attachment.url

Example:

GET /fhir/R4/Binary/{id}
Authorization: Bearer {access_token}

Notes:

  • Binary content may be protected or time-limited
  • The required scope is typically the same as the referencing resource (for example, documentreference.read)

Search Behavior

  • Searches are scoped to the authenticated tenant
  • The patient parameter is required for most queries
  • Results are returned as a FHIR Bundle
  • Pagination is supported via Bundle.link

Common Search Parameters

ParameterDescriptionExample ValuesFHIR Data Type
patientFilter by patientPatient/{id}Reference
statusFilter by document statuscurrent, supersededtoken
typeFilter by document typedischarge-summary, clinical-notetoken
categoryFilter by document categoryclinical-note, imagingtoken
authorFilter by authorPractitioner/{id}Reference
dateFilter by document datege2024-01-01date

Authentication

All requests require OAuth 2.0 bearer token authentication.

Required scopes:

  • documentreference.read for read operations
  • documentreference.write for create, update, and delete operations

For more information, see: OAuth 2.0 Authentication

Notifications

The FHIR R4 API does not provide direct subscriptions for DocumentReference.

Document updates may be available through broader event or notification workflows depending on configuration.

Error Handling

All operations return standard FHIR OperationOutcome responses for errors.

For more information, see: Error Handling

Related Resources

  • Binary: Retrieve document content
  • Patient: Associated patient record
  • Provenance: Source and origin of documents

External Reference