HL7 FHIR® US Core Implementation Guide STU 3

This page is part of the US Core (v2.1.0: STU3 Ballot 1) based on FHIR R4. The current version which supercedes this version is 5.0.1. For a full list of available versions, see the Directory of published versions

USCoreFetchDocumentReferences

OPERATION: USCoreFetchDocumentReferences

The official URL for this operation definition is:

http://hl7.org/fhir/us/core/OperationDefinition/docref

This operation is used to return all the references to documents related to a patient.

The operation takes the optional input parameters:

  • patient id
  • start date
  • end date
  • document type

and returns a Bundle of type "searchset" containing US Core DocumentReference Profiles for the patient. If the server has or can create documents that are related to the patient, and that are available for the given user, the server returns the DocumentReference profiles needed to support the records. The principle intended use for this operation is to provide a provider or patient with access to their available document information.

This operation is different from a search by patient and type and date range because:

  1. It is used to request a server generate a document based on the specified parameters.

  2. If no parameters are specified, the server SHALL return a DocumentReference to the patient's most current CCD

  3. If the server cannot generate a document based on the specified parameters, the operation will return an empty search bundle.

This operation is the same as a FHIR RESTful search by patient,type and date range because:

  1. References for existing documents that meet the requirements of the request SHOULD also be returned unless the client indicates they are only interested in 'on-demand' documents using the on-demand parameter.

Parameters

UseNameCardinalityTypeBindingDocumentation
INpatient1..1id

The id of the patient resource located on the server on which this operation is executed. If there is no match, an empty Bundle is returned

INstart0..1date

The date range relates to care dates, not record currency dates - e.g. all records relating to care provided in a certain date range. If no start date is provided, all documents prior to the end date are in scope. If neither a start date nor an end date is provided, the most recent or current document is in scope.

INend0..1date

The date range relates to care dates, not record currency dates - e.g. all records relating to care provided in a certain date range. If no end date is provided, all documents subsequent to the start date are in scope. If neither a start date nor an end date is provided, the most recent or current document is in scope

INtype0..1CodeableConcepthttp://hl7.org/fhir/ValueSet/c80-doc-typecodes (Required)

The type relates to document type e.g. for the LOINC code for a C-CDA Clinical Summary of Care (CCD) is 34133-9 (Summary of episode note). If no type is provided, the CCD document, if available, SHALL be in scope and all other document types MAY be in scope

INon-demand0..1boolean

This on-demand parameter allows client to dictate whether they are requesting only ‘on-demand’ or both ‘on-demand’ and 'stable' documents (or delayed/deferred assembly) that meet the query parameters

OUTreturn1..1Bundle

The bundle type is "searchset"containing US Core DocumentReference Profiles

  • The server is responsible for determining what resources, if any, to return as included resources rather than the client specifying which ones. This frees the client from needing to determine what it could or should ask for. For example, the server may return the referenced document as an included FHIR Binary resource within the return bundle. The server's CapabilityStatement should document this behavior.

  • The document itself can be subsequently retrieved using the link provided in the DocumentReference.content.attachment.url element. The link could be a FHIR endpoint to a Binary Resource or some other document repository.

  • It is assumed that the server has identified and secured the context appropriately, and can either associate the authorization context with a single patient, or determine whether the context has the rights to the nominated patient, if there is one. If there is no nominated patient (e.g. the operation is invoked at the system level) and the context is not associated with a single patient record, then the server should return an error. Specifying the relationship between the context, a user and patient records is outside the scope of this specification

The operation can be invoked using the GET Syntax if the complex type parameter is omitted:

GET [base]/DocumentReference/$docref?{parameters}

Otherwise the POST transaction is used as follows:

POST [base]/DocumentReference/$docref}


Example

Request the latest CCD for a patient using GET syntax

GET [base]/DocumentReference/$docref?patient=123

Request the latest CCD for a patient using POST syntax

POST [base]/DocumentReference/$docref}

POST request body:

    {
      "resourceType": "Parameters",
      "id": "get-ccd123",
      "parameter": [
        {
          "name": "patient",
          "valueId" : "123"
        }
      ]
    }

Response

HTTP/1.1 200 OK
[other headers]

Response body

    {
      "resourceType": "Bundle",
      "id": "get-ccd123-response",
      "type": "searchset",
      "total": 1,
      "entry": [{
        "fullUrl": "http://server/path/DocumentReference/get-ccd123",
        "resource":{
        "resourceType" : "DocumentReference",
        "id" : "get-ccd123",
        "meta" : {
          "profile" : [
            "http://fhir.org/guides/argonaut/StructureDefinition/argo-documentreference"
          ]
        },
        "identifier" : [
          {
            "system" : "urn:ietf:rfc:3986",
            "value" : "urn:oid:2.16.840.1.113883.19.5.99999.1"
          }
        ],
        "status" : "current",
        "type" : {
          "coding" : [
            {
              "system" : "http://loinc.org",
              "code" : "34133-9",
              "display" : "Summary of episode note"
            }
          ],
          "text" : "CCD Document"
        },
        "subject" : {
          "reference" : "Patient/example",
          "display" : "Amy Shaw"
        },
        "created" : "2006-09-01",
        "indexed" : "2016-03-09T15:29:46Z",
        "author" : [
          {
            "reference" : "Practitioner/practitioner-1",
            "display" : "Ronald Bone, MD"
          }
        ],
        "description" : "Pulmonology clinic acute visit",
        "content" : [
          {
            "attachment" : {
              "contentType" : "text/plain",
              "url" : "/Binary/1-note",
              "title" : "Uri where the data can be found: [base]/Binary/1-note"
            },
            "format" : {
              "system" : "urn:oid:1.3.6.1.4.1.19376.1.2.3",
              "code" : "urn:hl7-org:sdwg:ccda-structuredBody:2.1",
              "display" : "Documents following C-CDA constraints using a structured body"
            }
          }
        ],
        "context" : {
          "period" : {
            "start" : "2004-12-23T08:00:00+11:00",
            "end" : "2004-12-23T08:01:00+11:00"
          }
        }
      }
      }
      ]
    }