DocumentReference

Overview

The DocumentReference resource is used to reference a clinical document for a patient within the health system. This resource supports reading Continuity of Care Documents (CCD), returning a list of clinical documents, and a reference to retrieve a document as a PDF. Additionally, this resource supports writing an unstructured document. References to implicitRules, relatesTo, and modifierExtensions are NOT supported and will fail a create request.

For fields supported on write, see the create section.

The following fields are returned if valued for the docref operation (CCD read):

The following fields are returned if valued for clinical documents:

Terminology Bindings

DocumentReference.type
  • Description
    • Precise type of clinical document.
  • Details: LOINC Document Types
    System: http://loinc.org

    • Please note that the following is not the complete list of terminology bindings mapped for our sandbox. Our sandbox has many codes, but we only document a few to provide an example. This list also does not represent what would be mapped for one of our client’s domains. This is one of the things we evaluate and implement as needed when we are making apps available at client sites.

      Please contact us if there is a code you are interested in consuming, and we can evaluate adding it to our sandbox.
    • Supported Values
      • 18842-5 - Discharge Summary
      • 11488-4 - Consult Note
      • 11506-3 - Provider-unspecified Progress Note
      • 34840-9 - Rheumatology Note
      • 34839-1 - Rheumatology Consult Note
      • 68608-9 - Summary Note
      • 34133-9 - Summary of episode Note
      • 78280-5 - Surgery Education Note

Search for DocumentReferences that meet supplied query parameters:

GET /DocumentReference?:parameters

Implementation Notes

Authorization Types

Parameters

Name Required? Type Description
_id This, or one of patient or subject token The logical resource id associated with the resource. Example: _id=7499283
patient This, or one of _id or subject reference The patient to which the document reference belongs. Example: patient=1316024
subject This, or one of _id or patient reference The subject of the document reference. Must represent a Patient resource. May use the :Patient modifier. Example: subject=Patient/1316024 or subject:Patient=1316024
encounter No reference The encounter to which the document reference belongs. Must represent an Encounter resource. May include a single or comma separated list of references. Example: encounter=1621910
created No date A date/time the referenced document was created. Must use the ge and le prefixes. Example: created=le2017-01-5&created=ge2017-02-7
_count No number The maximum number of results to return.

Notes:

Headers

Accept: application/json+fhir
Authorization: <OAuth2 Bearer Token>

Example

Request

GET https://fhir-open.sandboxcerner.com/dstu2/0b8a0111-e8e6-4c26-a91c-5069cbc6b1ca/DocumentReference?patient=1316024&created=ge2016-01-06&created=le2016-01-07

Response

Status: 200 OK
{
  "resourceType": "Bundle",
  "id": "1d575f95-dfd5-47b3-a842-ddddd36daec6",
  "type": "searchset",
  "total": 4,
  "link": [
    {
      "relation": "self",
      "url": "https://fhir-open.sandboxcerner.com/dstu2/0b8a0111-e8e6-4c26-a91c-5069cbc6b1ca/DocumentReference?patient=1316024&created=ge2016-01-06&created=le2016-01-07"
    }
  ],
  "entry": [
    {
      "fullUrl": "https://fhir-open.sandboxcerner.com/dstu2/0b8a0111-e8e6-4c26-a91c-5069cbc6b1ca/DocumentReference/6589312",
      "resource": {
        "resourceType": "DocumentReference",
        "id": "6589312",
        "meta": {
          "versionId": "6589311",
          "lastUpdated": "2016-07-27T18:00:43.000Z"
        },
        "text": {
          "status": "generated",
          "div": "<div><p><b>DocumentReference</b></p><p><b>Patient Name</b>: PETERS, TIMOTHY</p><p><b>Document Type</b>: Rheumatology Consultation</p><p><b>Document Title</b>: Rheumatology Note</p><p><b>Date</b>: 2016-01-06T09:10:14.000Z</p><p><b>Status</b>: Auth (Verified)</p></div>"
        },
        "subject": {
          "reference": "Patient/1316024",
          "display": "PETERS, TIMOTHY"
        },
        "type": {
          "coding": [
            {
              "system": "http://loinc.org",
              "code": "34839-1"
            }
          ],
          "text": "Rheumatology Consultation"
        },
        "authenticator": {
          "reference": "Practitioner/2044324"
        },
        "created": "2016-01-06T09:10:14.000Z",
        "indexed": "2016-01-06T09:10:14.000Z",
        "status": "current",
        "docStatus": {
          "coding": [
            {
              "system": "http://hl7.org/fhir/composition-status",
              "code": "final",
              "display": "Final"
            }
          ],
          "text": "Auth (Verified)"
        },
        "description": "Rheumatology Note",
        "content": [
          {
            "attachment": {
              "contentType": "application/pdf",
              "url": "https://fhir-open.sandboxcerner.com/dstu2/0b8a0111-e8e6-4c26-a91c-5069cbc6b1ca/Binary/XR-6589312"
            }
          }
        ],
        "context": {
          "encounter": {
            "reference": "Encounter/1309918"
          }
        }
      }
    },
    {
      "fullUrl": "https://fhir-open.sandboxcerner.com/dstu2/0b8a0111-e8e6-4c26-a91c-5069cbc6b1ca/DocumentReference/6589307",
      "resource": {
        "resourceType": "DocumentReference",
        "id": "6589307",
        "meta": {
          "versionId": "6589306",
          "lastUpdated": "2016-07-27T17:38:08.000Z"
        },
        "text": {
          "status": "generated",
          "div": "<div><p><b>DocumentReference</b></p><p><b>Patient Name</b>: PETERS, TIMOTHY</p><p><b>Document Type</b>: Rheumatology Consultation</p><p><b>Document Title</b>: Rheumatology Note</p><p><b>Date</b>: 2016-01-06T09:10:14.000Z</p><p><b>Status</b>: Auth (Verified)</p></div>"
        },
        "subject": {
          "reference": "Patient/1316024",
          "display": "PETERS, TIMOTHY"
        },
        "type": {
          "coding": [
            {
              "system": "http://loinc.org",
              "code": "34839-1"
            }
          ],
          "text": "Rheumatology Consultation"
        },
        "authenticator": {
          "reference": "Practitioner/2044324"
        },
        "created": "2016-01-06T09:10:14.000Z",
        "indexed": "2016-01-06T09:10:14.000Z",
        "status": "current",
        "docStatus": {
          "coding": [
            {
              "system": "http://hl7.org/fhir/composition-status",
              "code": "final",
              "display": "Final"
            }
          ],
          "text": "Auth (Verified)"
        },
        "description": "Rheumatology Note",
        "content": [
          {
            "attachment": {
              "contentType": "application/pdf",
              "url": "https://fhir-open.sandboxcerner.com/dstu2/0b8a0111-e8e6-4c26-a91c-5069cbc6b1ca/Binary/XR-6589307"
            }
          }
        ],
        "context": {
          "encounter": {
            "reference": "Encounter/1309918"
          }
        }
      }
    },
    {
      "fullUrl": "https://fhir-open.sandboxcerner.com/dstu2/0b8a0111-e8e6-4c26-a91c-5069cbc6b1ca/DocumentReference/6589287",
      "resource": {
        "resourceType": "DocumentReference",
        "id": "6589287",
        "meta": {
          "versionId": "6589286",
          "lastUpdated": "2016-07-27T17:36:32.000Z"
        },
        "text": {
          "status": "generated",
          "div": "<div><p><b>DocumentReference</b></p><p><b>Patient Name</b>: PETERS, TIMOTHY</p><p><b>Document Type</b>: Rheumatology Consultation</p><p><b>Document Title</b>: Rheumatology Note</p><p><b>Date</b>: 2016-01-06T09:10:14.000Z</p><p><b>Status</b>: Auth (Verified)</p></div>"
        },
        "subject": {
          "reference": "Patient/1316024",
          "display": "PETERS, TIMOTHY"
        },
        "type": {
          "coding": [
            {
              "system": "http://loinc.org",
              "code": "34839-1"
            }
          ],
          "text": "Rheumatology Consultation"
        },
        "authenticator": {
          "reference": "Practitioner/2044324"
        },
        "created": "2016-01-06T09:10:14.000Z",
        "indexed": "2016-01-06T09:10:14.000Z",
        "status": "current",
        "docStatus": {
          "coding": [
            {
              "system": "http://hl7.org/fhir/composition-status",
              "code": "final",
              "display": "Final"
            }
          ],
          "text": "Auth (Verified)"
        },
        "description": "Rheumatology Note",
        "content": [
          {
            "attachment": {
              "contentType": "application/pdf",
              "url": "https://fhir-open.sandboxcerner.com/dstu2/0b8a0111-e8e6-4c26-a91c-5069cbc6b1ca/Binary/XR-6589287"
            }
          }
        ],
        "context": {
          "encounter": {
            "reference": "Encounter/1309918"
          }
        }
      }
    },
    {
      "fullUrl": "https://fhir-open.sandboxcerner.com/dstu2/0b8a0111-e8e6-4c26-a91c-5069cbc6b1ca/DocumentReference/6589283",
      "resource": {
        "resourceType": "DocumentReference",
        "id": "6589283",
        "meta": {
          "versionId": "6589282",
          "lastUpdated": "2016-07-27T17:35:23.000Z"
        },
        "text": {
          "status": "generated",
          "div": "<div><p><b>DocumentReference</b></p><p><b>Patient Name</b>: PETERS, TIMOTHY</p><p><b>Document Type</b>: Rheumatology Consultation</p><p><b>Document Title</b>: Rheumatology Note</p><p><b>Date</b>: 2016-01-06T09:10:14.000Z</p><p><b>Status</b>: Auth (Verified)</p></div>"
        },
        "subject": {
          "reference": "Patient/1316024",
          "display": "PETERS, TIMOTHY"
        },
        "type": {
          "coding": [
            {
              "system": "http://loinc.org",
              "code": "34839-1"
            }
          ],
          "text": "Rheumatology Consultation"
        },
        "authenticator": {
          "reference": "Practitioner/2044324"
        },
        "created": "2016-01-06T09:10:14.000Z",
        "indexed": "2016-01-06T09:10:14.000Z",
        "status": "current",
        "docStatus": {
          "coding": [
            {
              "system": "http://hl7.org/fhir/composition-status",
              "code": "final",
              "display": "Final"
            }
          ],
          "text": "Auth (Verified)"
        },
        "description": "Rheumatology Note",
        "content": [
          {
            "attachment": {
              "contentType": "application/pdf",
              "url": "https://fhir-open.sandboxcerner.com/dstu2/0b8a0111-e8e6-4c26-a91c-5069cbc6b1ca/Binary/XR-6589283"
            }
          }
        ],
        "context": {
          "encounter": {
            "reference": "Encounter/1309918"
          }
        }
      }
    }
  ]
}

Errors

The common errors may be returned.

Create

Create new documents. Currently limited to unstructured clinical notes or documentation. For example, a document with display formatting or styling can be written, but a CCD cannot.

POST /DocumentReference

Implementation Notes

Authorization Types

Headers

Authorization: <OAuth2 Bearer Token>
Accept: application/json+fhir
Content-Type: application/json+fhir

Body fields

Name Required Cardinality Type
resourceType Yes 1..1 string
  • Description
    • The type of the FHIR resource
  • Example
    • DocumentReference
  • Notes
    • resourceType must be DocumentReference
subject Yes 0..1 Reference (Patient)
  • Description
    • Who or what is the subject of the document.
  • Example
    • {
        "reference": "Patient/1234"
      }
      
type Yes 1..1 CodeableConcept
  • Description
    • Kind of document.
  • Example
    • {
        "coding": [
          {
            "system": "http://loinc.org",
            "code": "34840-9"
          }
        ]
      }
      
  • Notes
    • The type must include a loinc coding.

      Please note that the list in the terminology bindings section is not the complete list mapped for our sandbox. Our sandbox has many codes, but we only document a few to provide an example. The list does not represent what would be mapped for one of our client’s domains. This is one of the things we evaluate and implement as needed when we are making apps available at client sites.

      Please contact us if there is a code you are interested in consuming, and we can evaluate adding it to our sandbox.
author No 0..1 Reference (Practitioner)
  • Description
    • Who and/or what authored the document
  • Example
    • {
        "author": [
          {
            "reference": "Practitioner/2150097"
          }
        ]
      }
      
  • Notes
    • If author is not provided, the author will be determined based on the access token.
indexed Yes 1..1 instant
  • Description
    • When this document reference was created
  • Example
    • {
        "indexed": "2015-05-16T091014Z"
      }
      
status Yes 1..1 code
  • Description
    • The status of this document reference
  • Example
    • {
        "status": "current"
      }
      
  • Notes
    • Currently support current only
docStatus No 0..1 CodeableConcept
  • Description
    • The status of underlying document
  • Example
    • {
        "status": "final"
      }
      
  • Notes
    • Currently support final and preliminary
description No 0..1 string
  • Description
    • Human-readable description (title)
  • Example
    • {
        "description": "Rheumatology Note"
      }
      
content Yes 1..* BackboneElement
  • Description
    • The referenced document
content.attachment Yes 1..1 Attachment
  • Description
    • An array of document contents. Must contain exactly 1 attachment.
  • Example
    • {
        "content": [
          {
            "attachment": {
              "contentType": "application/xhtml+xml;charset=utf-8",
              "data": "snipped"
            }
          }
        ]
      }
      
content.attachment.contentType Yes 0..1 string
  • Description
    • Mime type of the content, with charset etc.
  • Example
    • {
        "content": [
          {
            "attachment": {
              "contentType": "application/xhtml+xml;charset=utf-8"
            }
          }
        ]
      }
      
  • Notes
    • contentType must be 'application/xhtml+xml;charset=utf-8'
content.attachment.data Yes 0..1 string
  • Description
    • Data inline, base64 encoded XHTML.
  • Example
    • {
        "content": [
          {
            "attachment": {
              "data": "PCFET0NUWVBFIGh0bWwNCiAgU1lTVEVNI...snipped"
            }
          }
        ]
      }
      
  • Notes
    • You can validate your document using any available strict XHTML 1.0 validator (eg: w3 validator or this html5 validator). Some sanitization is run on provided XHMTL. For example: Applet, iframe, link, script, and style tags will be removed completely. Other tags (a, button, form, frame, frameset, input, object, option, select, textarea) may be removed but the text within will remain. If a meta tag is provided, it must be self closed (example: <meta charset='UTF-8'/>).
context Yes 0..1 BackboneElement
  • Description
    • The clinical context in which the document was prepared
context.encounter Yes 0..1 Reference (Encounter)
  • Description
    • Context of the document content
  • Example
    • {
        "context": {
          "encounter": {
            "reference": "Encounter/4208053"
          }
        }
      }
      
context.period No 0..1 Period
  • Description
    • When the documented service was performed.
  • Example
    • {
        "context": {
          "period" : {
            "end": "2015-08-20T09:10:14Z"
          }
        }
      }
      
  • Notes
    • If provided, the service time must be set to context.period.end. If not provided, the document will be stored with the indexed dateTime.

Example

Request

POST https://fhir-ehr.sandboxcerner.com/dstu2/0b8a0111-e8e6-4c26-a91c-5069cbc6b1ca/DocumentReference

Body

{
  "resourceType": "DocumentReference",
  "subject": {
    "reference": "Patient/53663272"
  },
  "type": {
    "coding": [
      {
        "system": "http://loinc.org",
        "code": "34840-9"
      }
    ]
  },
  "author": [
    {
      "reference": "Practitioner/21500981"
    }
  ],
  "indexed": "2015-11-18T18:00:00Z",
  "status": "current",
  "docStatus": {
    "coding": [
      {
        "system": "http://hl7.org/fhir/composition-status",
        "code": "final"
      }
    ]
  },
  "description": "Rheumatology Note",
  "content": [
    {
      "attachment": {
        "contentType": "application/xhtml+xml;charset=utf-8",
        "data": "<snipped for brevity>"
      }
    }
  ],
  "context": {
    "encounter": {
      "reference": "Encounter/4208059"
    },
    "period": {
      "end": "2015-08-20T09:10:14Z"
    }
  }
}

Response

Status: 201 Created
   Connection → Keep-Alive
   Content-Encoding → gzip
   Content-Length → 20
   Content-Type → text/html; charset=UTF-8
   Date → Wed, 06 Jan 2016 18:09:18 GMT
   Keep-Alive → timeout=15, max=100
   Status → 201 Created
   access-control-allow-methods → DELETE, GET, POST, PUT, OPTIONS, HEAD
   access-control-allow-origin → *
   access-control-expose-headers → ETag, Content-Location, Location, X-Request-Id, WWW-Authenticate, Date
   access-control-max-age → 0
   cache-control → no-cache
   location → https://fhir-ehr.sandboxcerner.com/dstu2/0b8a0111-e8e6-4c26-a91c-5069cbc6b1ca/DocumentReference/5789254
   server-response-time → 5497.564885
   strict-transport-security → max-age=631152000
   vary → Origin,User-Agent,Accept-Encoding
   x-content-type-options → nosniff
   x-frame-options → SAMEORIGIN
   x-request-id → 9c7510c0-0bb5-4148-b37e-51a774c4091b
   x-runtime → 5.497541
   x-xss-protection → 1; mode=block

Errors

The common errors may be returned. In addition, OperationOutcomes may be returned in the following scenarios:

HTTP Status Cause Severity Code
422 Body contained modifier extensions error extension
422 Body contained implicit rules error unsupported
422 Body contained relatesTo error unsupported

Retrieve by id

List an individual DocumentReference by its id:

GET /DocumentReference/:id

Implementation Notes

Authorization Types

Headers

Accept: application/json+fhir
Authorization: <OAuth2 Bearer Token>

Example

Request

GET https://fhir-open.sandboxcerner.com/dstu2/0b8a0111-e8e6-4c26-a91c-5069cbc6b1ca/DocumentReference/7499283

Response

Status: 200 OK
{
  "resourceType": "DocumentReference",
  "id": "7499283",
  "meta": {
    "versionId": "7499282",
    "lastUpdated": "2018-01-08T14:51:05.000Z"
  },
  "text": {
    "status": "generated",
    "div": "<div><p><b>DocumentReference</b></p><p><b>Patient Name</b>: PETERS, TIMOTHY</p><p><b>Document Type</b>: Depart Summary</p><p><b>Document Title</b>: Physician Emergency department Note</p><p><b>Date</b>: 2018-01-03T07:30:20.000Z</p><p><b>Status</b>: Auth (Verified)</p><p><b>Verifying Provider</b>: Portal, Portal</p></div>"
  },
  "subject": {
    "reference": "Patient/1316024",
    "display": "PETERS, TIMOTHY"
  },
  "type": {
    "coding": [
      {
        "system": "http://loinc.org",
        "code": "68608-9"
      }
    ],
    "text": "Depart Summary"
  },
  "authenticator": {
    "reference": "Practitioner/4464007",
    "display": "Portal, Portal"
  },
  "created": "2018-01-03T07:30:20.000Z",
  "indexed": "2018-01-03T07:30:20.000Z",
  "status": "current",
  "docStatus": {
    "coding": [
      {
        "system": "http://hl7.org/fhir/composition-status",
        "code": "final",
        "display": "Final"
      }
    ],
    "text": "Auth (Verified)"
  },
  "description": "Physician Emergency department Note",
  "content": [
    {
      "attachment": {
        "contentType": "application/pdf",
        "url": "https://fhir-open.sandboxcerner.com/dstu2/0b8a0111-e8e6-4c26-a91c-5069cbc6b1ca/Binary/XR-7499283"
      }
    }
  ],
  "context": {
    "encounter": {
      "reference": "Encounter/1621910"
    }
  }
}

Errors

The common errors may be returned.

Operation: docref

Argonaut operation for querying DocumentReferences for the supplied parameters:

GET /DocumentReference/$docref?:parameters

Implementation Notes

Authorization Types

Terminology Bindings

DocumentReference.type
  • Description
    • Precise type of clinical document.
  • Details: LOINC
    System: http://loinc.org

    • Supported Values
      • 34133-9 - Summary of episode note
DocumentReference.content.format

Parameters

Name Required? Type Description
patient Y reference A reference to the patient whose document references are required. Example: 14067892
type Y token The document reference type, can be a list of comma separated values. Example: http://loinc.org|34133-9
start N date The start of the date range from which document reference records should be included. If not provided, then all records from the beginning of time are included. Example: 2014-09-24T12:00:00.000Z
end N date The end of the date range till which document reference records should be included. If not provided, then all records up to the current date are included. Example: 2016-09-24T12:00:00.000Z

Notes:

Headers

Accept: application/json+fhir
Authorization: <OAuth2 Bearer Token>

Example

Request

GET https://fhir-open.sandboxcerner.com/dstu2/0b8a0111-e8e6-4c26-a91c-5069cbc6b1ca/DocumentReference/$docref?patient=1316035&type=http%3A%2F%2Floinc.org%7C34133-9

Response

Status: 200 OK
{
  "resourceType": "Bundle",
  "id": "5d1a7f94-8ee4-45aa-bbe6-1dd087fba40c",
  "type": "searchset",
  "total": 1,
  "link": [
    {
      "relation": "self",
      "url": "https://fhir-open.sandboxcerner.com/dstu2/0b8a0111-e8e6-4c26-a91c-5069cbc6b1ca/DocumentReference/$docref?patient=1316035&type=http%3A%2F%2Floinc.org%7C34133-9"
    }
  ],
  "entry": [
    {
      "fullUrl": "https://fhir-open.sandboxcerner.com/dstu2/0b8a0111-e8e6-4c26-a91c-5069cbc6b1ca/DocumentReference/e6e34022-942c-42b9-a1e3-5452bb274627",
      "resource": {
        "resourceType": "DocumentReference",
        "id": "e6e34022-942c-42b9-a1e3-5452bb274627",
        "subject": {
          "reference": "Patient/1316035"
        },
        "type": {
          "coding": [
            {
              "system": "http://loinc.org",
              "code": "34133-9",
              "display": "Summary of episode note"
            }
          ],
          "text": "Summary of episode note"
        },
        "indexed": "2017-01-03T11:08:02-06:00",
        "status": "current",
        "content": [
          {
            "attachment": {
              "contentType": "application/xml",
              "url": "https://fhir-open.sandboxcerner.com/dstu2/0b8a0111-e8e6-4c26-a91c-5069cbc6b1ca/Binary/$autogen-ccd-if?patient=1316035"
            },
            "format": [
              {
                "system": "urn:oid:1.3.6.1.4.1.19376.1.2.3",
                "code": "urn:hl7-org:sdwg:ccda-structuredBody:1.1",
                "display": "For documents following C-CDA constraints using a structured body."
              }
            ]
          }
        ]
      }
    }
  ]
}

Errors

The common errors may be returned.