DocumentReference

Overview

The DocumentReference resource is used to reference a document within the health system. This resource supports reading Continuity of Care Documents (CCD), or 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):

Terminology Bindings

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

    • 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

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. Any LOINC representing a clinical document or note is supported and we will map the appropriate LOINCs in Production as applications get deployed to client sites.
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.
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

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.