Play with FHIR ®

A lightweight REST-based access layer for standard HL7-defined data models. Read the spec

Get FHIR'd up! Epic's Sandbox now supports DSTU2 resources. All resources below are supported in Epic's 2015 release and forward.

New to FHIR? Check out our tutorial to get started!

Observation

The FHIR Observation resource defines information about a measurement or simple assertion made about a patient. The below documentation describes how the Observation resource is used to:

  • Provide measurements gathered as a vital sign or flowsheet data point.
  • Describe analyte level result information or sensitivities and isolates from a microbiology analysis.
  • Retrieve the patient's current smoking status.
To play in an interactive sandbox, navigate to this page
using Chrome, Safari, or Firefox ("FHIRFox"??).
 Click the button. Go on.
See more

Endpoints

Observation Search Interaction

Relative URL FHIR Interaction HTTP Method Action
/Observation?[parameter=value] Search Get Retrieves Observation resources that meet the specified search criteria

The Search interaction enables the client to query for all observations of a specific name or list of names that have been filed for a given patient. The client, having established the patient in question, now wishes to retrieve observations decribing, documented flowsheet data for a given type of vital sign for the patient, documented result component data for a given type of laboratory test for the patient, or documented smoking history of a patient. Clients can further refine the search to specify a date for the Observation resources in question. Epic's sandbox currently supports the following query parameters for observation queries:

Parameter Name Parameter Type Description
_id Reference Search for Observation resources using one or more server ids (equivalent to one or more Get /Observation/{ID} requests)
patient Reference Search for Observation resources for a specified patient ID. Both patient and code or category are required for a valid patient-based search.
code Token Search for Observation resources for a valid LOINC code. Both patient and code (or category) are required for a valid patient-based search.
category Token Search for Observation resourcesfor a valid category (vital-signs, social-history, laboratory). Both patient and category (or code) are required for a valid patient-based search.
date Date Further refine a search for a given set of result- or vital sign-based Observations by specifying a date or date range in XML format (YYYY-MM-DD) for when the observation was resulted or recorded.
issued Date Further refine a search for a smoking history Observations by specifying a date or date range in XML format (YYYY-MM-DD) for when the observation was recorded.
Examples
Query Result
/Observation?patient=Tbt3KuCY0B5PSrJvCu2j-PlK.aiHsu2xUjUM8bWpetXoB&code=8310-5 Returns all temperature (8310-5) Observations for Jason Argonaut.
/Observation?patient=Tbt3KuCY0B5PSrJvCu2j-PlK.aiHsu2xUjUM8bWpetXoB&code=3141-9&date=20131105 Returns all weight (3141-9) Observations for Jason Argonaut documented on November 5, 2013.
/Observation?patient=Tbt3KuCY0B5PSrJvCu2j-PlK.aiHsu2xUjUM8bWpetXoB&code=1975-2 Returns all bilirubin (1975-2) Observations for Jason Argonaut.
/Observation?patient=Tbt3KuCY0B5PSrJvCu2j-PlK.aiHsu2xUjUM8bWpetXoB&code=718-7&date=lt20160101 Returns all hemoglobin (718-7) Observations for Jason Argonaut resulted prior to 2016.
/Observation?patient=Tbt3KuCY0B5PSrJvCu2j-PlK.aiHsu2xUjUM8bWpetXoB&code=72166-2 Returns the current Smoking History status (72166-2) Observation for Jason Argonaut.

Observation Read Interaction

Relative URL FHIR Interaction HTTP Method Action
/Observation/{ID} Read Get Retrieve details about Observation ID

The Read interaction enables the look up of an Observation resource by a constant server ID. Clients can store only the server ID, and with a single request, retrieve the most up-to-date information about the observation. Read interactions typically begin with a client having previously established a relationship, often through querying for observations through the search interaction.

Observation Create Interaction

The create request sends an Observation resource through the request body to the server. For more technical details on our implementation of this resource, check out our App Orchard program.

Errors

When things go wrong, the Epic EMR responds with an error code and a human-readable description to describe the incorrect submission. Currently, the error code is not included in the REST version of the specification, but it is provided here for your reference. These codes are meant for developer use only - they should not be presented to end users. Instead, your application should interpret the codes and provide user-friendly resolution steps when data cannot be filed.

FHIR Errors come in two flavors:

  • Fatal Errors cause the response to contain no results and are usually due to requests from the client processed as invalid - missing or invalid data in the request, unauthorized access, or expired content in the system.
  • Warning Errors accompany a successful response and are used to indicate that part of a request could not be fulfilled - for example, if a status is unknown, but the request can be fulfilled, the API will return the data and indicate that part of the request couldn't be understood.

FHIR Error Codes

Error Code Severity Description Example
4100 Fatal The resource request contained an invalid parameter Invalid parameter such as a non existent patient ID: AllergyIntolerance?patient=foo
4101 Warning Resource request returns no results A request for data that was otherwise valid but no information was documented or found (i.e. a patient with no pertinent implanted devices, or a demographic search where no patients met the search criteria).
4102 Fatal The read resource request contained an invalid ID Invalid Resource ID: AllergyIntolerance/foo
4107 Fatal The read resource request has been merged Requesting a Patient which has been merged - in this event, in addition to the error response, we will respond with an HTTP Redirect status. To browsers and many HTTP clients, the redirect will be transparent.
4110 Fatal No parameters are provided in the search request An invalid search request such as : AllergyIntolerance?
4111 Fatal Required search parameter missing from request A request missing a required parameter (such as the patient): Condition?category=diagnosis
4112 Fatal The resource request contained an invalid combination of parameters A search containing multiple different patient ID: AllergyIntolerance?patient=[ID 1]&patient=[ID 2]
4113 Fatal Session ID for cached search results has expired. Making a request for previously accessed paginated search results after the search has expired.
4115 Fatal Required search parameter has an invalid value An invalid parameter required for searching: Condition?Patient=[ID]&category=foo
4117 Warning No CVX code for Immunization resource Request for an Immunization resource without a documented CVX code.
4118 Fatal User not authorized for request Request data that the authenticated user is not allowed access to view (i.e. a patient asking for data about a stranger's allergies).
4119 Warning Additional data may be present for patient Request data while authenticated as an authorized patient or patient proxy. Inidicates that data available to the patient may not be the complete medical record within the system.