Base Path: /fhir/1.0/Observation
Version: 2.0.0
The FHIR Observation API allows you to record and retrieve measurements and simple assertions made about a patient. Information that is typically recorded using an observation includes:
The endpoint provides the ability to:
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.
GET /fhir/1.0/Observation/
This method returns all observations for the patient identified by patient.identifier. Optionally, filtering by the code, date, and status of the observation.
Name
Type
Data Type
Description
Name:
subject.identifier
required
Type:
query
Data Type:
string
Description:
The subject 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%7cAAAA-0124-8
Name:
code
optional
Type:
query
Data Type:
string
Description:
Filters the observations to those that are of the specified code(s). For each specified code, both system and the code must be included, separated using a URL encoded |
character i.e. %7c
. Multiple codes can be provided as comma separated values.
Sample Value: http://loinc.org%7c8480-6,http://loinc.org%7c72166-2
Name:
date
optional
Type:
query
Data Type:
array
Description:
Filters the observations to those with a appliesDateTime or AppliesPeriod on, before, or after a specific date, date-time, or date range.
The supported prefixes are >, >=, < and <=. 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
.
Sample Value: >=2017-01-01T01:00:00%2B13:00
Name:
status
optional
Type:
query
Data Type:
string
Description:
Filters the observations to those having the specified status value(s). Multiple statuses can be specified as comma separated values. Possible values are
Sample Value: final,amended
Name:
_sort
optional
Type:
query
Data Type:
string
Description:
Sorts the returned observations based on the specified field. Possible values are
Sample Value: date
Name:
_count
optional
Type:
query
Data Type:
number
Description:
Limits the number of observations returned to a maximum of the given count value. When a no count value is specified, a default of 25 is used. Maximum supported count value is 100.
Sample Value: 50
200
Returns a FHIR Bundle containing 0.. OperationOutcome resources and 0.. Observation resources
curl -X GET "https://api.orionhealth.io/fhir/1.0/Observation/?subject.identifier=ORION%7cAAAA-0124-8&code=http://loinc.org%7c8480-6,http://loinc.org%7c72166-2&date=>=2017-01-01T01:00:00%2B13:00&status=final,amended&_sort=date&_count=50" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Access Token>'
POST /fhir/1.0/Observation/
This method provides the ability to create a single observation for a patient.
Name
Type
Data Type
Description
Name:
Content-Type
required
Type:
header
Data Type:
string
Description:
Request content type.
Sample Value: application/json
Name:
body
required
Type:
body
Data Type:
Description:
FHIR 1.0 Observation Resource
Sample Payload:
{
"resourceType": "Observation",
"status": "final",
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "61149-1",
"display": "Objective Note"
}
]
},
"subject": {
"reference": "Patient/GJAGIZLWFVYGC5DJMVXHI"
},
"effectiveDateTime": "2015-04-01T15:00:11+13:00",
"performer": [
{
"reference": "Practitioner/ABC123",
"display": "Nurse Nancy"
}
],
"valueString": "Here is a note"
}
201
The observation resource has been successfully created on the server.
400
The request is malformed.
401
The user is not allowed to create observations for the referenced subject.
403
The user does not have permission to create observations.
404
The specified resource type is not an Observation.
curl -X POST "https://api.orionhealth.io/fhir/1.0/Observation/" \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Access Token>' \
-d '{"resourceType":"Observation","status":"final","code":{"coding":[{"system":"http://loinc.org","code":"61149-1","display":"Objective Note"}]},"subject":{"reference":"Patient/GJAGIZLWFVYGC5DJMVXHI"},"effectiveDateTime":"2015-04-01T15:00:11+13:00","performer":[{"reference":"Practitioner/ABC123","display":"Nurse Nancy"}],"valueString":"Here is a note"}'
POST /fhir/1.0/Observation/_search
This method returns all observations for the patient identified by patient.identifier. Optionally, filtering by the code, date, and status of the observation. This is the secure alternative to the GET search.
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:
subject.identifier
required
Type:
formData
Data Type:
string
Description:
The subject 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%7cAAAA-0124-8
Name:
code
optional
Type:
formData
Data Type:
string
Description:
Filters the observations to those that are of the specified code(s). For each specified code, both system and the code must be included, separated using a URL encoded |
character i.e. %7c
. Multiple codes can be provided as comma separated values.
Sample Value: http://loinc.org%7c8480-6,http://loinc.org%7c72166-2
Name:
date
optional
Type:
formData
Data Type:
array
Description:
Filters the observations to those with a appliesDateTime or AppliesPeriod on, before, or after a specific date, date-time, or date range.
The supported prefixes are >, >=, <; and <=. 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
.
Sample Value: >=2017-01-01T01:00:00%2B13:00
Name:
status
optional
Type:
formData
Data Type:
string
Description:
Filters the observations to those having the specified status value(s). Multiple statuses can be specified as comma separated values. Possible values are
Sample Value: final,amended
Name:
_sort
optional
Type:
formData
Data Type:
string
Description:
Sorts the returned observations based on the specified field. Possible values are
Sample Value: date
Name:
_count
optional
Type:
formData
Data Type:
number
Description:
Limits the number of observations returned to a maximum of the given count value. When a no count value is specified, a default of 25 is used. Maximum supported count value is 100.
Sample Value: 50
200
Returns a FHIR Bundle containing 0.. OperationOutcome resources and 0.. Observation resources
curl -X POST "https://api.orionhealth.io/fhir/1.0/Observation/_search" \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Access Token>' \
-d 'subject.identifier=ORION%7cAAAA-0124-8' \
-d 'code=http://loinc.org%7c8480-6,http://loinc.org%7c72166-2' \
-d 'date=>=2017-01-01T01:00:00%2B13:00' \
-d 'status=final,amended' \
-d '_sort=date' \
-d '_count=50'
GET /fhir/1.0/Observation/{id}
This method returns the Observation resource matching the requested resource ID.
Name
Type
Data Type
Description
Name:
id
required
Type:
path
Data Type:
string
Description:
The id of the Observation resource
Sample Value: f2c8f238-bd87-4d0f-a5c7-00946b8d5f3e
200
Returns an Observation resource matching the the requested resource ID.
curl -X GET "https://api.orionhealth.io/fhir/1.0/Observation/f2c8f238-bd87-4d0f-a5c7-00946b8d5f3e" \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Access Token>'
PUT /fhir/1.0/Observation/{id}
This method updates the Observation which matches the specified resource ID.
Name
Type
Data Type
Description
Name:
If-Match
required
Type:
header
Data Type:
number
Description:
Current version number of an updatable observation resource.
Sample Value: 1
Name:
id
required
Type:
path
Data Type:
string
Description:
The id of the Observation resource to be updated
Sample Value: 06d617eb-60b0-40a7-b674-94710070a5ba
Name:
body
required
Type:
body
Data Type:
Description:
FHIR 1.0 Observation Resource.
Sample Payload:
{
"resourceType": "Observation",
"status": "final",
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "61149-1",
"display": "Objective Note"
}
]
},
"subject": {
"reference": "Patient/GJAGIZLWFVYGC5DJMVXHI"
},
"effectiveDateTime": "2015-04-01T15:00:11+13:00",
"performer": [
{
"reference": "Practitioner/ABC123",
"display": "Nurse Nancy"
}
],
"valueString": "Updated note."
}
200
The observation resource has been successfully updated.
400
The request is malformed.
401
The user is not allowed to create observations for the referenced subject.
403
The user does not have permission to create observations.
409
The version number specified in the If-Match HTTP Header is incorrect or no longer exists in the server.
412
If-Match HTTP Header version number is missing.
curl -X PUT "https://api.orionhealth.io/fhir/1.0/Observation/06d617eb-60b0-40a7-b674-94710070a5ba" \
-H 'If-Match: 1' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <Access Token>' \
-H 'Content-Type: application/json' \
-d '{"resourceType":"Observation","status":"final","code":{"coding":[{"system":"http://loinc.org","code":"61149-1","display":"Objective Note"}]},"subject":{"reference":"Patient/GJAGIZLWFVYGC5DJMVXHI"},"effectiveDateTime":"2015-04-01T15:00:11+13:00","performer":[{"reference":"Practitioner/ABC123","display":"Nurse Nancy"}],"valueString":"Updated note."}'