FHIR DocumentReference

Base Path: /fhir/4.0/DocumentReference

Version: 2.0.0

The FHIR DocumentReference API allows you to look up a patient's DocumentReference, which is used to index documents, clinical notes, and other binary objects to make them available within a healthcare system. The endpoint provides the ability to:

The endpoint provides the ability to:

  • Retrieve all DocumentReference resources that match search criteria for a given patient.
  • Retrieve a specific DocumentReference resource based on its resource ID.
  • Retrieve the history of a DocumentReference resource based on its FHIR ID.
  • Retrieve a specific version of a DocumentReference resource based on its FHIR ID and Version ID.
  • Retrieve DocumentReferences from third-party sources.
  • Supports exporting resources via FHIR Bulk.

The data returned in this API is subject to privacy and permissions settings. Refer to the Working with Privacy guide to learn how this might affect your application.

The DocumentReference API aggregates data from multiple sources. To learn about working with aggregated APIs, refer to the Working with Aggregation guide in the Knowledge Hub.

This API is based on the R4 release of the FHIR standard, for more information on this API refer to the official FHIR documentation.


Methods

Retrieve DocumentReferences for a Patient

GET /fhir/4.0/DocumentReference/

This method returns all DocumentReferences for the patient identified either by patient.identifier or by patient. Optionally filtering by using multiple search parameters.


Parameters

Name

Type

Data Type

Description


Name:

patient.identifier

required

Type:

query

Data Type:

string

Description:

The patient identifier consists of patient identifier namespace (also known as the system) and identifier, separated using a URL encoded | character i.e. %7c.

Note:

  • You must either define the patient.identifier or patient, not a combination of those parameters.
  • In addition to having the required patient.identifier or patient, you can defined chained patient elements to define filters on the reference, each of the chained parameters can specify multiple comma separated values.

    Sample format of the query is

    • patient.identifier={namespace}|{identifier}
    • patient.identifier={namespace}|{identifier}&patient.gender=male&patient.birthdate=2002-05-01


Sample Value: ORION%7CAAA-00001-8



Name:

patient

required

Type:

query

Data Type:

string

Description:

The patient resource id.

Note:

  • You must either define the patient.identifier or patient, not a combination of those parameters.
  • In addition to having the required patient.identifieror patient, you can defined chained patient elements to define filters on the reference, each of the chained parameters can specify multiple comma separated values.

    Sample format of the query is

    • patient={patient FHIRID}
    • patient={patient FHIRID}&patient.gender=male&patient.birthdate=2002-05-01


Sample Value: GZTDENJVGAZTIQCPJBBVA



Name:

authenticator

optional

Type:

query

Data Type:

array

Description:

Filters DocumentReferences based on the practitioner or organization that authenticated the document, identified by the DocumentReference.authenticator reference.

Note: authenticator can be chained to define filters on the reference. Each chained parameter can specify multiple comma-separated values.


Sample Value: - "authenticator:Organization.name=Auckland%20Hospital"



Name:

author

optional

Type:

query

Data Type:

array

Description:

Filters DocumentReferences based on the person, organization or device that authored the document, identified by the DocumentReference.author reference. Note: author can be chained to define filters on the reference. Each chained parameter can specify multiple comma-separated values.


Sample Value: - "author.identifier=authorNamespace|authorId&author.name=authorName,test"



Name:

category

optional

Type:

query

Data Type:

array

Description:

Filters DocumentReferences based on the categorization of the document, identified by DocumentReference.category. For each specified category, the system and code are separated using a URL-encoded | character i.e. %7c.

Note: Supports passing a comma-separated list of values.


Sample Value: 2.16.840.1.113883.6.1%7C34133-9,2.16.840.1.113883.3.88.12.80.46%7C18761-7



Name:

contenttype

optional

Type:

query

Data Type:

array

Description:

Filters DocumentReferences based on the MIME type of the content, identified by DocumentReference.content.attachment.contentType. For each specified type, the system and code are separated using a URL-encoded | character i.e. %7c.

Note: Supports passing a comma-separated list of values.


Sample Value: urn:ietf:bcp:13|image/png,urn:ietf:bcp:13|image/jpeg



Name:

custodian

optional

Type:

query

Data Type:

array

Description:

Filters DocumentReferences based on the organization that maintains the document, identified by the DocumentReference.custodian reference.

Note: custodian can be chained to define filters on the reference. Each chained parameter can specify multiple comma-separated values.


Sample Value: custodian.type=http://terminology.hl7.org/CodeSystem/organization-type|prov,http://terminology.hl7.org/CodeSystem/organization-type|dept&custodian.active=true



Name:

date

optional

Type:

query

Data Type:

array

Description:

Filters the DocumentReferences based on the date the DocumentReference was created, on, before, or after a specific date, date-time, or date range.

The supported prefixes are gt (greater than), ge (greater than or equal to), lt (less than), le (less than or equal to), and eq (equal to). If no prefix is used, exact date or date-time matching is implied.

Dates must be formatted according to ISO 8601, either as a date only (e.g., 1997-07-16) or as a date-time including the timezone (e.g., 1997-07-16T19:20:30+13:00). Ensure that special characters such as + are URL-encoded (i.e., %2B).

The format of the query is

  • date=gt{dateTimeValue}
  • date=ge{dateTimeValue}&date=le{dateTimeValue}


Sample Value: ge2021-01-23



Name:

description

optional

Type:

query

Data Type:

array

Description:

Filters DocumentReferences based on the description of the DocumentReference, identified by DocumentReference.description.

Note: Supports passing a comma-separated list of values.


Sample Value: Physical,Other



Name:

encounter

optional

Type:

query

Data Type:

array

Description:

Filters DocumentReferences based on the context of the document content, identified by the DocumentReference.context.encounter reference.

Note: encounter can be chained to define filters on the reference. Each chained parameter can specify multiple comma-separated values.


Sample Value: encounter:Encounter.period=eq2013-01-14&encounter:Encounter.status=planned,finished&encounter:EpisodeOfCare.status=planned,finished



Name:

event

optional

Type:

query

Data Type:

array

Description:

Filters DocumentReferences based on the main clinical acts documented, identified by DocumentReference.context.event. For each specified event, the system and code are separated using a URL-encoded | character i.e. %7c.

Note: Supports passing a comma-separated list of values.


Sample Value: http://terminology.hl7.org/CodeSystem/v3-ActCode|CASH,http://terminology.hl7.org/CodeSystem/v3-ActCode|PROV



Name:

facility

optional

Type:

query

Data Type:

array

Description:

Filters DocumentReferences based on the type of facility where the patient was seen, identified by DocumentReference.context.facilityType. For each specified facility type, the system and code are separated using a URL-encoded | character i.e. %7c.

Note: Supports passing a comma-separated list of values.


Sample Value: http://snomed.info/sct|225732001,http://snomed.info/sct|79993009



Name:

format

optional

Type:

query

Data Type:

array

Description:

Filters DocumentReferences based on the format or content rules of the document, identified by DocumentReference.content.format. For each specified format, the system and code are separated using a URL-encoded | character i.e. %7c.

Note: Supports passing a comma-separated list of values.


Sample Value: http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem|urn:ihe:pcc:edr:2007,http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem|urn:ihe:pcc:xds-ms:2007



Name:

identifier

optional

Type:

query

Data Type:

array

Description:

Filters DocumentReferences based on the master version-specific identifier associated with the DocumentReference, identified by either DocumentReference.masterIdentifier or DocumentReference.identifier.

Note: The identifier can be a single item or a comma separated list of identifiers. Each identifier is defined by system and value, separated using a URL encoded | character i.e. %7c.


Sample Value: sysA|12345,sysB|67890



Name:

language

optional

Type:

query

Data Type:

array

Description:

Filters DocumentReferences based on the language of the document content, identified by DocumentReference.content.attachment.language. For each specified language, the system and code are separated using a URL-encoded | character i.e. %7c.

Note: Supports passing a comma-separated list of values.


Sample Value: urn:ietf:bcp:47|en,urn:ietf:bcp:47|es



Name:

location

optional

Type:

query

Data Type:

array

Description:

Filters the DocumentReferences based on the URI where the data can be found, identified by DocumentReference.content.attachment.url.

Note: Supports passing in a comma-separated list of values.


Sample Value: http://example.com/svc/fhir/Binary/1e404af3-077f-4bee-b7a6-a9be97e1ce3,http://example.org/xds/mhd/Binary/07a6483f-732b-461e-86b6-edb665c45510



Name:

period

optional

Type:

query

Data Type:

array

Description:

Filters the DocumentReferences based on the time of service documented, on, before, or after a specific date, date-time, or date range.

The supported prefixes are gt (greater than), ge (greater than or equal to), lt (less than), le (less than or equal to), and eq (equal to). If no prefix is used, exact date or date-time matching is implied.

Dates must be formatted according to ISO 8601, either as a date only (e.g., 1997-07-16) or as a date-time including the timezone (e.g., 1997-07-16T19:20:30+13:00). Ensure that special characters such as + are URL-encoded (i.e., %2B).

The format of the query is

  • period=gt{dateTimeValue}
  • period=ge{dateTimeValue}&period=le{dateTimeValue}


Sample Value: period=gt2012-01-01&period=lt2022-01-01



Name:

related

optional

Type:

query

Data Type:

array

Description:

Filters DocumentReferences based on the resources related to the DocumentReference, identified by the DocumentReference.context.related reference.

Note: related can be chained to define filters on the reference. Each chained parameter can specify multiple comma-separated values.


Sample Value: related:Encounter.period=eq2013-01-14&related:Encounter.status=planned,in-progress



Name:

relatesto

optional

Type:

query

Data Type:

array

Description:

Filters DocumentReferences based on the target DocumentReference in the relationship, identified by the DocumentReference.relatesTo.target reference.

Note: relatesto can be chained to define filters on the reference. Each chained parameter can specify multiple comma-separated values.


Sample Value: relatesto.date=eq2024-01-14&relatesto.status=superseded,entered-in-error



Name:

relation

optional

Type:

query

Data Type:

array

Description:

Filters DocumentReferences based on the type of relationship this document has with another document, identified by the DocumentReference.relatesTo.code. Multiple relations can be specified as comma-separated values.

Possible values are:

  • replaces
  • transforms
  • signs
  • appends

    Note:

    • If a relation system is specified, only http://hl7.org/fhir/document-relationship-type can be used.
    • Supports passing a comma-separated list of values.


Sample Value: replaces,transforms



Name:

security-label

optional

Type:

query

Data Type:

array

Description:

Filters DocumentReferences based on the type of security tags associated with the document, identified by DocumentReference.securityLabel. For each specified type, the system and code are separated using a URL-encoded | character i.e. %7c.

Note: Supports passing a comma-separated list of values.


Sample Value: http://terminology.hl7.org/CodeSystem/v3-Confidentiality|U,http://terminology.hl7.org/CodeSystem/v3-Confidentiality|R



Name:

setting

optional

Type:

query

Data Type:

array

Description:

Filters DocumentReferences based on additional details about the practice setting where the document content was created, identified by DocumentReference.context.practiceSetting. For each specified setting, the system and code are separated using a URL-encoded | character i.e. %7c.

Note: Supports passing a comma-separated list of values.


Sample Value: http://snomed.info/sct|394809005,http://snomed.info/sct|408467006



Name:

status

optional

Type:

query

Data Type:

array

Description:

Filters DocumentReferences based on the status of the DocumentReference, identified by the DocumentReference.status.

Possible values are:

  • current
  • superseded
  • entered-in-error

    Note:

    • If a status system is specified, only http://hl7.org/fhir/document-reference-status can be used.
    • Supports passing a comma-separated list of values.


Sample Value: superseded,entered-in-error



Name:

type

optional

Type:

query

Data Type:

array

Description:

Filters DocumentReferences based on document type, identified by DocumentReference.type. For each specified type, the system and code are separated using a URL-encoded | character i.e. %7c.

Note: Supports passing a comma-separated list of values.


Sample Value: http://loinc.org|55107-7,http://loinc.org|34862-3



Name:

_lastUpdated

optional

Type:

query

Data Type:

array

Description:

Allows the user to filter DocumentReferences by the lastUpdated date. The date value can be a single date, as well as lower and/or upper bound.

The supported operations are: =gt, =ge, =lt, =ne, =le, =eq. For more information about using these search operators, refer to the date section on the FHIR Search page.

The {dateTimeValue} value should be in the following format: 2013-01-01T23:00:00-05:00. However, the time portion can be excluded. If a time portion is provided, the time zone must be provided as well.

It is highly recommended to provide the time zone portion in any query. Ensure that special characters such as '+' are encoded so that it can be interpreted correctly. For example: "2014-01-01T00:00:00+13:00" should be encoded like this: "2014-01-01T00:00:00%2B13:00".

If a date query comes in without a time zone, the date will be interpreted according to the server's time zone.

Including this query parameter includes all DocumentReferences that match the specified DocumentReference.Meta.lastUpdated.


Sample Value: _lastUpdated=gt2012-01-01&_lastUpdated=lt2022-01-01



Name:

_summary

optional

Type:

query

Data Type:

string

Description:

Instructs the server to return a subset of the resource, reducing the size of the reponse payload. Possible values are

  • true: return summaries only
  • false: return full resources
  • count: return the count of search matches
  • text: return only the text, id, meta, and top-level mandatory elements
  • data: remove the text element


Sample Value: true



Name:

-include-sources

optional

Type:

query

Data Type:

array

Description:

The -include-sources parameter defines which sources should be queried for the results.

Note: Either -include-sources or -exclude-sources parameters can be specified, not both. If -include-sources is specified, ONLY the specified sources will be searched. Note that the sources specified should be enabled.


Sample Value: Orion%20Health%E2%84%A2%20R4%20HL7V2%20DocumentReferences



Name:

-exclude-sources

optional

Type:

query

Data Type:

array

Description:

The -exclude-sources parameter defines which sources should NOT be queried for the results.

Note: Either -include-sources or -exclude-sources parameter can be specified, not both. If -exclude-sources is specified, the specified sources will NOT be searched. Note that the sources specified should be enabled.


Sample Value: Orion%20Health%E2%84%A2%20R4%20HL7V2%20DocumentReferences



Name:

_elements

optional

Type:

query

Data Type:

string

Description:

Request a specific set of elements be returned, or excluded as part of a resource in the search results. Use _elements for the elements to include and _elements:exclude for the elements to exclude.


Sample Value: _elements=type,description,status,_elements:exclude=*.type



Name:

_format

optional

Type:

query

Data Type:

string

Description:

Media type of the response. It takes precedence over the accept header. Possible values are json and xml.


Default Value: xml

Sample Value: json



Name:

_pretty

optional

Type:

query

Data Type:

string

Description:

Ask for a pretty printed response for human convenience.


Default Value: true

Sample Value: true



Name:

-cursor

optional

Type:

query

Data Type:

string

Description:

This is a server internal parameter to navigate different pages, indicating the server a cursor till where result matches were already returned.

This parameter is returned by the server as part of the next link of a paginated query.




Name:

_count

optional

Type:

query

Data Type:

integer

Description:

Limit the number of match results to the specified _count. When _count is specified, the query will be paginated, and only _count or less results will be returned.

The returned bundle may contain a next link if more results could be available.


Sample Value: 100



Name:

_sort

optional

Type:

query

Data Type:

string

Description:

Request which order results should be returned in.

Supported _sort parameters are:

  • date to sort by DocumentReference.date ascending.
  • -date to sort by DocumentReference.date descending.
  • period to sort by DocumentReference.context.period.start ascending.
  • -period to sort by DocumentReference.context.period.start descending.
  • description to sort by DocumentReference.description in ascending alphabetical order.
  • -description to sort by DocumentReference.description in descending alphabetical order.
  • _lastUpdated to sort by DocumentReference.meta.lastUpdated ascending.
  • -_lastUpdated to sort by DocumentReference.meta.lastUpdated descending.

You can use any combination of the parameters.


Default Value: -date

Sample Value: -date,-_lastUpdated



Name:

X-Request-Id

optional

Type:

header

Data Type:

string

Description:

Supply a request Id to track the request.


Sample Value: X-Request-ID: adUEctf6urd



Name:

Accept

optional

Type:

header

Data Type:

string

Description:

Media type of the response. Possible values are application/json and application/xml.


Default Value: application/xml

Sample Value: application/json



Name:

Accept-Language

optional

Type:

header

Data Type:

string

Description:

Specifies the language that the results will be translated to. If not specified it will default to the server's locale. (e.g. fr-FR for french)


Sample Value: en-US



Name:

CSRF-Token

required

Type:

header

Data Type:

string

Description:

This header is required for CSRF protection. The CSRF-Token from the OHP session must be included in this header.

System will validate the token and reject the request if the token is invalid or not present.

Note: Either CSRF-Token or X-Send-Open-API must be included in headers to do the CSRF protection.




Name:

X-Send-Open-API

required

Type:

header

Data Type:

string

Description:

This header is required for CSRF protection. This header is required to distinguish the api requests from known senders.

System will validate "X-Send-Open-API" request header is present or not. If it is not present, system will reject the request

Note: Either CSRF-Token or X-Send-Open-API must be included in headers to do the CSRF protection.



Responses


application/json+fhir

200

Returns a FHIR Bundle containing 0..* DocumentReference resources.


application/json+fhir

400

This response code is returned when the query is invalid e.g. an invalid parameter or a partial token in the search.

Sample Requests

Retrieve all DocumentReferences matching specified search criteria for a patient identified by a patient identifier
curl -X GET "https://developer-solution/fhir/4.0/DocumentReference?patient.identifier=ORION%7CAAA-00001-8&category=2.16.840.1.113883.6.1%7C34133-9,2.16.840.1.113883.3.88.12.80.46%7C18761-7&date=ge2021-01-23" \
-H 'Accept: application/json' \
-H 'Authorization: Basic bGV2ZWwxLnN5c19hOk9yaW9uc3k1IT8='

Retrieve DocumentReferences for a Patient

POST /fhir/4.0/DocumentReference/_search

This method returns all DocumentReferences for the patient identified either by patient.identifier or by patient. Optionally filtering by using multiple search parameters. This is a secure alternative to the GET method.


Parameters

Name

Type

Data Type

Description


Name:

Content-Type

required

Type:

header

Data Type:

string

Description:

Specifies how to encode the form data. The Content-Type value must be application/x-www-form-urlencoded


Sample Value: application/x-www-form-urlencoded



Name:

patient.identifier

required

Type:

formData

Data Type:

string

Description:

The patient identifier consists of patient identifier namespace (also known as the system) and identifier, separated using a URL encoded | character i.e. %7c.

Note:

  • You must either define the patient.identifier or patient, not a combination of those parameters.
  • In addition to having the required patient.identifier or patient, you can defined chained patient elements to define filters on the reference, each of the chained parameters can specify multiple comma separated values.

    Sample format of the query is

    • patient.identifier={namespace}|{identifier}
    • patient.identifier={namespace}|{identifier}&patient.gender=male&patient.birthdate=2002-05-01


Sample Value: OHCP|6f255034



Name:

patient

required

Type:

formData

Data Type:

string

Description:

The patient resource id.

Note:

  • You must either define the patient.identifier or patient, not a combination of those parameters.
  • In addition to having the required patient.identifieror patient, you can defined chained patient elements to define filters on the reference, each of the chained parameters can specify multiple comma separated values.

    Sample format of the query is

    • patient={patient FHIRID}
    • patient={patient FHIRID}&patient.gender=male&patient.birthdate=2002-05-01


Sample Value: GZTDENJVGAZTIQCPJBBVA



Name:

authenticator

optional

Type:

formData

Data Type:

array

Description:

Filters DocumentReferences based on the practitioner or organization that authenticated the document, identified by the DocumentReference.authenticator reference.

Note: authenticator can be chained to define filters on the reference. Each chained parameter can specify multiple comma-separated values.


Sample Value: - "authenticator:Organization.name=Auckland%20Hospital"



Name:

author

optional

Type:

formData

Data Type:

array

Description:

Filters DocumentReferences based on the person, organization or device that authored the document, identified by the DocumentReference.author reference. Note: author can be chained to define filters on the reference. Each chained parameter can specify multiple comma-separated values.


Sample Value: - "author.identifier=authorNamespace|authorId&author.name=authorName,test"



Name:

category

optional

Type:

formData

Data Type:

array

Description:

Filters DocumentReferences based on the categorization of the document, identified by DocumentReference.category. For each specified category, the system and code are separated using a URL-encoded | character i.e. %7c.

Note: Supports passing a comma-separated list of values.


Sample Value: urn:oid:2.16.840.1.113883.3.88.12.80.46|11369-6,urn:oid:2.16.840.1.113883.3.88.12.80.46|18761-7



Name:

contenttype

optional

Type:

formData

Data Type:

array

Description:

Filters DocumentReferences based on the MIME type of the content, identified by DocumentReference.content.attachment.contentType. For each specified type, the system and code are separated using a URL-encoded | character i.e. %7c.

Note: Supports passing a comma-separated list of values.


Sample Value: urn:ietf:bcp:13|image/png,urn:ietf:bcp:13|image/jpeg



Name:

custodian

optional

Type:

formData

Data Type:

array

Description:

Filters DocumentReferences based on the organization that maintains the document, identified by the DocumentReference.custodian reference.

Note: custodian can be chained to define filters on the reference. Each chained parameter can specify multiple comma-separated values.


Sample Value: custodian.type=http://terminology.hl7.org/CodeSystem/organization-type|prov,http://terminology.hl7.org/CodeSystem/organization-type|dept&custodian.active=true



Name:

date

optional

Type:

formData

Data Type:

array

Description:

Filters the DocumentReferences based on the date the DocumentReference was created, on, before, or after a specific date, date-time, or date range.

The supported prefixes are gt (greater than), ge (greater than or equal to), lt (less than), le (less than or equal to), and eq (equal to). If no prefix is used, exact date or date-time matching is implied.

Dates must be formatted according to ISO 8601, either as a date only (e.g., 1997-07-16) or as a date-time including the timezone (e.g., 1997-07-16T19:20:30+13:00). Ensure that special characters such as + are URL-encoded (i.e., %2B).

The format of the query is

  • date=gt{dateTimeValue}
  • date=ge{dateTimeValue}&date=le{dateTimeValue}


Sample Value: gt2019-09-12



Name:

description

optional

Type:

formData

Data Type:

array

Description:

Filters DocumentReferences based on the description of the DocumentReference, identified by DocumentReference.description.

Note: Supports passing a comma-separated list of values.


Sample Value: Physical,Other



Name:

encounter

optional

Type:

formData

Data Type:

array

Description:

Filters DocumentReferences based on the context of the document content, identified by the DocumentReference.context.encounter reference.

Note: encounter can be chained to define filters on the reference. Each chained parameter can specify multiple comma-separated values.


Sample Value: encounter:Encounter.period=eq2013-01-14&encounter:Encounter.status=planned,finished&encounter:EpisodeOfCare.status=planned,finished



Name:

event

optional

Type:

formData

Data Type:

array

Description:

Filters DocumentReferences based on the main clinical acts documented, identified by DocumentReference.context.event. For each specified event, the system and code are separated using a URL-encoded | character i.e. %7c.

Note: Supports passing a comma-separated list of values.


Sample Value: http://terminology.hl7.org/CodeSystem/v3-ActCode|CASH,http://terminology.hl7.org/CodeSystem/v3-ActCode|PROV



Name:

facility

optional

Type:

formData

Data Type:

array

Description:

Filters DocumentReferences based on the type of facility where the patient was seen, identified by DocumentReference.context.facilityType. For each specified facility type, the system and code are separated using a URL-encoded | character i.e. %7c.

Note: Supports passing a comma-separated list of values.


Sample Value: http://snomed.info/sct|225732001,http://snomed.info/sct|79993009



Name:

format

optional

Type:

formData

Data Type:

array

Description:

Filters DocumentReferences based on the format or content rules of the document, identified by DocumentReference.content.format. For each specified format, the system and code are separated using a URL-encoded | character i.e. %7c.

Note: Supports passing a comma-separated list of values.


Sample Value: http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem|urn:ihe:pcc:edr:2007,http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem|urn:ihe:pcc:xds-ms:2007



Name:

identifier

optional

Type:

formData

Data Type:

array

Description:

Filters DocumentReferences based on the master version-specific identifier associated with the DocumentReference, identified by either DocumentReference.masterIdentifier or DocumentReference.identifier.

Note: The identifier can be a single item or a comma separated list of identifiers. Each identifier is defined by system and value, separated using a URL encoded | character i.e. %7c.


Sample Value: sysA|12345,sysB|67890



Name:

language

optional

Type:

formData

Data Type:

array

Description:

Filters DocumentReferences based on the language of the document content, identified by DocumentReference.content.attachment.language. For each specified language, the system and code are separated using a URL-encoded | character i.e. %7c.

Note: Supports passing a comma-separated list of values.


Sample Value: urn:ietf:bcp:47|en,urn:ietf:bcp:47|es



Name:

location

optional

Type:

formData

Data Type:

array

Description:

Filters the DocumentReferences based on the URI where the data can be found, identified by DocumentReference.content.attachment.url.

Note: Supports passing in a comma-separated list of values.


Sample Value: http://example.com/svc/fhir/Binary/1e404af3-077f-4bee-b7a6-a9be97e1ce3,http://example.org/xds/mhd/Binary/07a6483f-732b-461e-86b6-edb665c45510



Name:

period

optional

Type:

formData

Data Type:

array

Description:

Filters the DocumentReferences based on the time of service documented, on, before, or after a specific date, date-time, or date range.

The supported prefixes are gt (greater than), ge (greater than or equal to), lt (less than), le (less than or equal to), and eq (equal to). If no prefix is used, exact date or date-time matching is implied.

Dates must be formatted according to ISO 8601, either as a date only (e.g., 1997-07-16) or as a date-time including the timezone (e.g., 1997-07-16T19:20:30+13:00). Ensure that special characters such as + are URL-encoded (i.e., %2B).

The format of the query is

  • period=gt{dateTimeValue}
  • period=ge{dateTimeValue}&period=le{dateTimeValue}


Sample Value: period=gt2012-01-01&period=lt2022-01-01



Name:

related

optional

Type:

formData

Data Type:

array

Description:

Filters DocumentReferences based on the resources related to the DocumentReference, identified by the DocumentReference.context.related reference.

Note: related can be chained to define filters on the reference. Each chained parameter can specify multiple comma-separated values.


Sample Value: related:Encounter.period=eq2013-01-14&related:Encounter.status=planned,in-progress



Name:

relatesto

optional

Type:

formData

Data Type:

array

Description:

Filters DocumentReferences based on the target DocumentReference in the relationship, identified by the DocumentReference.relatesTo.target reference.

Note: relatesto can be chained to define filters on the reference. Each chained parameter can specify multiple comma-separated values.


Sample Value: relatesto.date=eq2024-01-14&relatesto.status=superseded,entered-in-error



Name:

relation

optional

Type:

formData

Data Type:

array

Description:

Filters DocumentReferences based on the type of relationship this document has with another document, identified by the DocumentReference.relatesTo.code. Multiple relations can be specified as comma-separated values.

Possible values are:

  • replaces
  • transforms
  • signs
  • appends

    Note:

    • If a relation system is specified, only http://hl7.org/fhir/document-relationship-type can be used.
    • Supports passing a comma-separated list of values.


Sample Value: replaces,transforms



Name:

security-label

optional

Type:

formData

Data Type:

array

Description:

Filters DocumentReferences based on the type of security tags associated with the document, identified by DocumentReference.securityLabel. For each specified type, the system and code are separated using a URL-encoded | character i.e. %7c.

Note: Supports passing a comma-separated list of values.


Sample Value: http://terminology.hl7.org/CodeSystem/v3-Confidentiality|U,http://terminology.hl7.org/CodeSystem/v3-Confidentiality|R



Name:

setting

optional

Type:

formData

Data Type:

array

Description:

Filters DocumentReferences based on additional details about the practice setting where the document content was created, identified by DocumentReference.context.practiceSetting. For each specified setting, the system and code are separated using a URL-encoded | character i.e. %7c.

Note: Supports passing a comma-separated list of values.


Sample Value: http://snomed.info/sct|394809005,http://snomed.info/sct|408467006



Name:

status

optional

Type:

formData

Data Type:

array

Description:

Filters DocumentReferences based on the status of the DocumentReference, identified by the DocumentReference.status.

Possible values are:

  • current
  • superseded
  • entered-in-error

    Note:

    • If a status system is specified, only http://hl7.org/fhir/document-reference-status can be used.
    • Supports passing a comma-separated list of values.


Sample Value: superseded,entered-in-error



Name:

type

optional

Type:

formData

Data Type:

array

Description:

Filters DocumentReferences based on document type, identified by DocumentReference.type. For each specified type, the system and code are separated using a URL-encoded | character i.e. %7c.

Note: Supports passing a comma-separated list of values.


Sample Value: http://loinc.org|55107-7,http://loinc.org|34862-3



Name:

_lastUpdated

optional

Type:

formData

Data Type:

array

Description:

Allows the user to filter DocumentReferences by the lastUpdated date. The date value can be a single date, as well as lower and/or upper bound.

The supported operations are: =gt, =ge, =lt, =ne, =le, =eq. For more information about using these search operators, refer to the date section on the FHIR Search page.

The {dateTimeValue} value should be in the following format: 2013-01-01T23:00:00-05:00. However, the time portion can be excluded. If a time portion is provided, the time zone must be provided as well.

It is highly recommended to provide the time zone portion in any query. Ensure that special characters such as '+' are encoded so that it can be interpreted correctly. For example: "2014-01-01T00:00:00+13:00" should be encoded like this: "2014-01-01T00:00:00%2B13:00".

If a date query comes in without a time zone, the date will be interpreted according to the server's time zone.

Including this query parameter includes all DocumentReferences that match the specified DocumentReference.Meta.lastUpdated.


Sample Value: _lastUpdated=gt2012-01-01&_lastUpdated=lt2022-01-01



Name:

_summary

optional

Type:

formData

Data Type:

string

Description:

Instructs the server to return a subset of the resource, reducing the size of the reponse payload. Possible values are

  • true: return summaries only
  • false: return full resources
  • count: return the count of search matches
  • text: return only the text, id, meta, and top-level mandatory elements
  • data: remove the text element


Sample Value: true



Name:

-include-sources

optional

Type:

formData

Data Type:

array

Description:

The -include-sources parameter defines which sources should be queried for the results.

Note: Either -include-sources or -exclude-sources parameters can be specified, not both. If -include-sources is specified, ONLY the specified sources will be searched. Note that the sources specified should be enabled.


Sample Value: Orion%20Health%E2%84%A2%20R4%20HL7V2%20DocumentReferences



Name:

-exclude-sources

optional

Type:

formData

Data Type:

array

Description:

The -exclude-sources parameter defines which sources should NOT be queried for the results.

Note: Either -include-sources or -exclude-sources parameter can be specified, not both. If -exclude-sources is specified, the specified sources will NOT be searched. Note that the sources specified should be enabled.


Sample Value: Orion%20Health%E2%84%A2%20R4%20HL7V2%20DocumentReferences



Name:

_elements

optional

Type:

formData

Data Type:

string

Description:

Request a specific set of elements be returned, or excluded as part of a resource in the search results. Use _elements for the elements to include and _elements:exclude for the elements to exclude.


Sample Value: _elements=type,description,status,_elements:exclude=*.type



Name:

_format

optional

Type:

formData

Data Type:

string

Description:

Media type of the response. It takes precedence over the accept header. Possible values are json and xml.


Default Value: xml

Sample Value: json



Name:

_pretty

optional

Type:

formData

Data Type:

string

Description:

Ask for a pretty printed response for human convenience.


Default Value: true

Sample Value: true



Name:

-cursor

optional

Type:

formData

Data Type:

string

Description:

This is a server internal parameter to navigate different pages, indicating the server a cursor till where result matches were already returned.

This parameter is returned by the server as part of the next link of a paginated query.




Name:

_count

optional

Type:

formData

Data Type:

integer

Description:

Limit the number of match results to the specified _count. When _count is specified, the query will be paginated, and only _count or less results will be returned.

The returned bundle may contain a next link if more results could be available.


Sample Value: 100



Name:

_sort

optional

Type:

formData

Data Type:

string

Description:

Request which order results should be returned in.

Supported _sort parameters are:

  • date to sort by DocumentReference.date ascending.
  • -date to sort by DocumentReference.date descending.
  • period to sort by DocumentReference.context.period.start ascending.
  • -period to sort by DocumentReference.context.period.start descending.
  • description to sort by DocumentReference.description in ascending alphabetical order.
  • -description to sort by DocumentReference.description in descending alphabetical order.
  • _lastUpdated to sort by DocumentReference.meta.lastUpdated ascending.
  • -_lastUpdated to sort by DocumentReference.meta.lastUpdated descending.

You can use any combination of the parameters.


Default Value: -date

Sample Value: -date,-_lastUpdated



Name:

X-Request-Id

optional

Type:

header

Data Type:

string

Description:

Supply a request Id to track the request.


Sample Value: X-Request-ID: adUEctf6urd



Name:

Accept

optional

Type:

header

Data Type:

string

Description:

Media type of the response. Possible values are application/json and application/xml.


Default Value: application/xml

Sample Value: application/json



Name:

Accept-Language

optional

Type:

header

Data Type:

string

Description:

Specifies the language that the results will be translated to. If not specified it will default to the server's locale. (e.g. fr-FR for french)


Sample Value: en-US



Name:

CSRF-Token

required

Type:

header

Data Type:

string

Description:

This header is required for CSRF protection. The CSRF-Token from the OHP session must be included in this header.

System will validate the token and reject the request if the token is invalid or not present.

Note: Either CSRF-Token or X-Send-Open-API must be included in headers to do the CSRF protection.




Name:

X-Send-Open-API

required

Type:

header

Data Type:

string

Description:

This header is required for CSRF protection. This header is required to distinguish the api requests from known senders.

System will validate "X-Send-Open-API" request header is present or not. If it is not present, system will reject the request

Note: Either CSRF-Token or X-Send-Open-API must be included in headers to do the CSRF protection.



Responses


application/json+fhir

200

Returns a FHIR Bundle containing 0..* DocumentRefeference resources.


application/json+fhir

400

This response code is returned when the query is invalid e.g. an invalid parameter or a partial token in the search.

Sample Requests

Retrieve all DocumentReferences that match specified search criteria for a patient identified by a patient resource id
curl -X POST "https://developer-solution/fhir/4.0/DocumentReference/_search" \
-H 'Accept: application/json' \
-H 'Authorization: Basic bGV2ZWwxLnN5c19hOk9yaW9uc3k1IT8=' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'patient=GZTDENJVGAZTIQCPJBBVA' \
-d 'status=superseded,entered-in-error'

Retrieve a single DocumentReference

GET /fhir/4.0/DocumentReference/{id}

This method returns the DocumentReference resource matching the requested resource ID.


Parameters

Name

Type

Data Type

Description


Name:

id

required

Type:

path

Data Type:

string

Description:

The ID of the DocumentReference resource.


Sample Value: sha2UY7OJJ5EEENJOYCHIDTPRPJLPF5XW2L7QPD2PCKJAOQM3CKFIPQ



Name:

_elements

optional

Type:

query

Data Type:

string

Description:

Request a specific set of elements be returned, or excluded as part of a resource in the search results. Use _elements for the elements to include and _elements:exclude for the elements to exclude.


Sample Value: _elements=type,description,status,_elements:exclude=*.type



Name:

_pretty

optional

Type:

query

Data Type:

string

Description:

Ask for a pretty printed response for human convenience.


Default Value: true

Sample Value: true



Name:

_format

optional

Type:

query

Data Type:

string

Description:

Media type of the response. It takes precedence over the accept header. Possible values are json and xml.


Default Value: xml

Sample Value: json



Name:

Accept

optional

Type:

header

Data Type:

string

Description:

Media type of the response. Possible values are application/json and application/xml.


Default Value: application/xml

Sample Value: application/json



Name:

X-Request-Id

optional

Type:

header

Data Type:

string

Description:

Supply a request Id to track the request.


Sample Value: X-Request-ID: adUEctf6urd



Name:

Accept-Language

optional

Type:

header

Data Type:

string

Description:

Specifies the language that the results will be translated to. If not specified it will default to the server's locale. (e.g. fr-FR for french)


Sample Value: en-US



Name:

CSRF-Token

required

Type:

header

Data Type:

string

Description:

This header is required for CSRF protection. The CSRF-Token from the OHP session must be included in this header.

System will validate the token and reject the request if the token is invalid or not present.

Note: Either CSRF-Token or X-Send-Open-API must be included in headers to do the CSRF protection.




Name:

X-Send-Open-API

required

Type:

header

Data Type:

string

Description:

This header is required for CSRF protection. This header is required to distinguish the api requests from known senders.

System will validate "X-Send-Open-API" request header is present or not. If it is not present, system will reject the request.

Note: Either CSRF-Token or X-Send-Open-API must be included in headers to do the CSRF protection.



Responses


application/json+fhir

200

Returns a DocumentReference resource matching the requested resource ID.


application/json+fhir

400

This code is returned when the FHIR ID is empty or not valid.


application/json+fhir

404

No DocumentReference resource found with the requested resource ID or protected by privacy restrictions.

Sample Requests

Retrieve DocumentReference identified by a specific id
curl -X GET "https://developer-solution/fhir/4.0/DocumentReference/sha2UY7OJJ5EEENJOYCHIDTPRPJLPF5XW2L7QPD2PCKJAOQM3CKFIPQ" \
-H 'Accept: application/json' \
-H 'Authorization: Basic bGV2ZWwxLnN5c19hOk9yaW9uc3k1IT8='

Retrieve a DocumentReference's history

GET /fhir/4.0/DocumentReference/{id}/_history

This method returns the change history for a DocumentReference resource matching the requested resource ID. DocumentReference resources can be retrieved from multiple data sources, and not all sources are able to return history information. This operation will return an empty set of data if no versions of the specified DocumentReference can be found, which includes cases where:

  • The specified DocumentReference resource cannot be found.
  • The data source for the DocumentReference is unable to return history information.


Parameters

Name

Type

Data Type

Description


Name:

id

required

Type:

path

Data Type:

string

Description:

The id of the DocumentReference resource.


Sample Value: sha2UY7OJJ5EEENJOYCHIDTPRPJLPF5XW2L7QPD2PCKJAOQM3CKFIPQ



Name:

_elements

optional

Type:

query

Data Type:

string

Description:

Request a specific set of elements be returned, or excluded as part of a resource in the search results. Use _elements for the elements to include and _elements:exclude for the elements to exclude.


Sample Value: _elements=type,description,status,_elements:exclude=*.type



Name:

_pretty

optional

Type:

query

Data Type:

string

Description:

Ask for a pretty printed response for human convenience.


Default Value: true

Sample Value: true



Name:

_format

optional

Type:

query

Data Type:

string

Description:

Media type of the response. It takes precedence over the accept header. Possible values are json and xml.


Default Value: xml

Sample Value: json



Name:

Accept

optional

Type:

header

Data Type:

string

Description:

Media type of the response. Possible values are application/json and application/xml.


Default Value: application/xml

Sample Value: application/json



Name:

X-Request-Id

optional

Type:

header

Data Type:

string

Description:

Supply a request Id to track the request.


Sample Value: X-Request-ID: adUEctf6urd



Name:

Accept-Language

optional

Type:

header

Data Type:

string

Description:

Specifies the language that the results will be translated to. If not specified it will default to the server's locale. (e.g. fr-FR for french)


Sample Value: en-US



Name:

CSRF-Token

required

Type:

header

Data Type:

string

Description:

This header is required for CSRF protection. The CSRF-Token from the OHP session must be included in this header.

System will validate the token and reject the request if the token is invalid or not present.

Note: Either CSRF-Token or X-Send-Open-API must be included in headers to do the CSRF protection.




Name:

X-Send-Open-API

required

Type:

header

Data Type:

string

Description:

This header is required for CSRF protection. This header is required to distinguish the api requests from known senders.

System will validate "X-Send-Open-API" request header is present or not. If it is not present, system will reject the request.

Note: Either CSRF-Token or X-Send-Open-API must be included in headers to do the CSRF protection.



Responses


application/json+fhir

200

A FHIR Bundle containing 1..* DocumentReference resources matching the requested resource ID.


application/json+fhir

400

The source providing the DocumentReference resource is not capable of returning history of DocumentReference resources.


application/json+fhir

404

  • No DocumentReference resource found with the requested resource ID.

Sample Requests

Retrieve the history of a DocumentReference identified by a resource id
curl -X GET "https://developer-solution/fhir/4.0/DocumentReference/sha2UY7OJJ5EEENJOYCHIDTPRPJLPF5XW2L7QPD2PCKJAOQM3CKFIPQ/_history" \
-H 'Accept: application/json' \
-H 'Authorization: Basic bGV2ZWwxLnN5c19hOk9yaW9uc3k1IT8='

Retrieve a specific version of a DocumentReference

GET /fhir/4.0/DocumentReference/{id}/_history/{versionid}

This method returns the specified version of a DocumentReference resource matching the requested resource ID. DocumentReference resources can be retrieved from multiple data sources. This operation will return an empty set of data if no versions of the specified DocumentReference can be found, which includes cases where:

  • The specified DocumentReference resource cannot be found.


Parameters

Name

Type

Data Type

Description


Name:

id

required

Type:

path

Data Type:

string

Description:

The id of the DocumentReference resource


Sample Value: sha2UY7OJJ5EEENJOYCHIDTPRPJLPF5XW2L7QPD2PCKJAOQM3CKFIPQ



Name:

versionid

required

Type:

path

Data Type:

integer

Description:

The version of the DocumentReference resource


Sample Value: 1



Name:

_elements

optional

Type:

query

Data Type:

string

Description:

Request a specific set of elements be returned, or excluded as part of a resource in the search results. Use _elements for the elements to include and _elements:exclude for the elements to exclude.


Sample Value: _elements=type,description,status,_elements:exclude=*.type



Name:

_pretty

optional

Type:

query

Data Type:

string

Description:

Ask for a pretty printed response for human convenience.


Default Value: true

Sample Value: true



Name:

_format

optional

Type:

query

Data Type:

string

Description:

Media type of the response. It takes precedence over the accept header. Possible values are json and xml.


Default Value: xml

Sample Value: json



Name:

Accept

optional

Type:

header

Data Type:

string

Description:

Media type of the response. Possible values are application/json and application/xml.


Default Value: application/xml

Sample Value: application/json



Name:

X-Request-Id

optional

Type:

header

Data Type:

string

Description:

Supply a request Id to track the request.


Sample Value: X-Request-ID: adUEctf6urd



Name:

Accept-Language

optional

Type:

header

Data Type:

string

Description:

Specifies the language that the results will be translated to. If not specified it will default to the server's locale. (e.g. fr-FR for french)


Sample Value: en-US



Name:

CSRF-Token

required

Type:

header

Data Type:

string

Description:

This header is required for CSRF protection. The CSRF-Token from the OHP session must be included in this header.

System will validate the token and reject the request if the token is invalid or not present.

Note: Either CSRF-Token or X-Send-Open-API must be included in headers to do the CSRF protection.




Name:

X-Send-Open-API

required

Type:

header

Data Type:

string

Description:

This header is required for CSRF protection. This header is required to distinguish the api requests from known senders.

System will validate "X-Send-Open-API" request header is present or not. If it is not present, system will reject the request

Note: Either CSRF-Token or X-Send-Open-API must be included in headers to do the CSRF protection.



Responses


application/json+fhir

200

Returns a DocumentReference resource matching the the requested resource ID and version id.


application/json+fhir

400

The source providing the DocumentReference resource is not capable of returning history of DocumentReference resources.


application/json+fhir

404

  • No DocumentReference resource found with the requested resource ID.
  • The version id specified does not exist for the DocumentReference resource with the requested resource ID.

Sample Requests

Retrieve the version of DocumentReference identified by a resource id and a version id
curl -X GET "https://developer-solution/fhir/4.0/DocumentReference/sha2UY7OJJ5EEENJOYCHIDTPRPJLPF5XW2L7QPD2PCKJAOQM3CKFIPQ/_history/1" \
-H 'Accept: application/json' \
-H 'Authorization: Basic bGV2ZWwxLnN5c19hOk9yaW9uc3k1IT8='