FHIR DocumentReference

Base Path: /fhir/1.0/DocumentReference

Version: 1.1.0

The FHIR DocumentReference API allows you to look up and retrieve stored documents for a patient. The endpoint provides the ability to:

  • Retrieve all DocumentReference resources that match a search criteria for a given patient.
  • Retrieve a specific documents using a direct direct attachment URL

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.

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

Authorization: OAuth 2.0 Bearer token is required to access the resources of this API. Once signed up, credentials and URL to access the OAuth API can be found on My Apps Page.


Methods

Get Documents for a Patient

GET /fhir/1.0/DocumentReference/

This method returns all documents for the patient identified by patient.identifier. Optionally filtering by the document's class and type.


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.


Sample Value: ORION|AAAA-0124-8



Name:

class

optional

Type:

query

Data Type:

string

Description:

Filters the documents to those that are of the specified class. Multiple values can be provided as a comma separated string. Both a system and a code must be included for every provided class.


Sample Value: 2.16.840.1.113883.3.88.12.80.46|18842-5



Name:

type

optional

Type:

query

Data Type:

string

Description:

Filters the documents to those that are of the specified type. Multiple values can be provided as a comma separated string. Both a system and a code must be included for every provided type.


Sample Value: http://loinc.org|34133-9



Name:

contentType

optional

Type:

query

Data Type:

string

Description:

Filters the documents to those that are of the specified content types. Multiple values can be provided as a comma-separated string.


Sample Value: application/pdf


Responses


application/json+fhir

200

Returns a FHIR Bundle containing 0.. OperationOutcome resources and 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

Get all Documents References for a Patient
curl -X GET "https://api.orionhealth.io/fhir/1.0/DocumentReference/?patient.identifier=ORION%7CAAAA-0124-8" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Access Token>'
Get specific Documents References for a Patient
curl -X GET "https://api.orionhealth.io/fhir/1.0/DocumentReference/?patient.identifier=ORION%7CAAAA-0124-8&type=http://loinc.org%7C34133-9" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Access Token>'

Get Documents for a Patient

POST /fhir/1.0/DocumentReference/_search

This method returns all documents for the patient identified by patient.identifier. Optionally filtering by the document's class and type. This is the secure alternative to the GET search.


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.


Sample Value: ORION|AAAA-0124-8



Name:

class

optional

Type:

formData

Data Type:

string

Description:

Filters the documents to those that are of the specified class. Multiple values can be provided as a comma separated string. Both a system and a code must be included for every provided class.


Sample Value: 2.16.840.1.113883.3.88.12.80.46|18842-5



Name:

type

optional

Type:

formData

Data Type:

string

Description:

Filters the documents to those that are of the specified type. Multiple values can be provided as a comma separated string. Both a system and a code must be included for every provided type.


Sample Value: http://loinc.org|34133-9



Name:

contentType

optional

Type:

formData

Data Type:

string

Description:

Filters the documents to those that are of the specified content types. Multiple values can be provided as a comma-separated string.


Sample Value: application/pdf


Responses


application/json+fhir

200

Returns a FHIR Bundle containing 0.. OperationOutcome resources and 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

Get all Documents References for a Patient
curl -X POST "https://api.orionhealth.io/fhir/1.0/DocumentReference/_search" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Access Token>' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'patient.identifier=ORION%7CAAAA-0124-8'
Get specific Documents References for a Patient
curl -X POST "https://api.orionhealth.io/fhir/1.0/DocumentReference/_search" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Access Token>' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'patient.identifier=ORION%7CAAAA-0124-8' \
-d 'type=http://loinc.org%7C34133-9'