Reference to a document

Retrieving a patient’s CCDA documents

The logical ID of the patient to retrieve is passed as part of the URL. The logical ID is found as the result of a search.

Name Required? Type Description
id yes URL The logical ID of the patient. This is retrieved using the search function.
date no string A string representing a date to include in the search. See below for more information.

A FHIR DocumentReference is returned.

Name Type Cardinality AAA Description
masterIdentifier Identifier 0..1 Master Version Specific Identifier.
identifier Identifier 0..* Other identifiers for the document.
subject Reference( Patient) 0..1 Who/what is the subject of the document.
type CodeableConcept 1..1 Kind of document. The value set includes content from LOINC. For more information on this value set, see condition-code.
indexed Instant 1..1 When this document reference was created
status code 1..1 Status of the document. Values include current, superseded, and entered-in-error. For more information on this value set, see document-reference-status.
description String 0..1 Human-readable description. The HTML version of the document.
content 1..* Document referenced
– content.attachment attachment 0..1 Where/How to access the document. See below for more detail.
– content. format code 0..1 Format of the document. For more information on this value set, see formatcodes.

Searching by date

Dates are passed as query parameters on the URL. Since the URL parameters cannot handle comparators (for example, >, <=) these are passed in as part of the date.


The following comparators are supported:

Comparator Description
eq equal
gt greater than
ge greater than or equal
lt less than
le less than or equal

To search for a date range, pass in the date twice.

e.g. date=ge2010-01-01&date=le2010-12-31

This search would include every day in the year 2010.

Get the CCDA document

The actual document is return as an attachment and can in the data element of the content.

"content": [{"attachment":       {
         "contentType": "application/hl7-sda+xml",
         "language": "en-US",
         "data": "PD94bWwtc3R5bGVzaGVldCB0eXBlPSJ0ZXh0L3h .... "

The CCDA is Base64 encoded.