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!

Care Plan + Goal

The FHIR CarePlan resource is a broad container for summarizing the plan of treatment for a patient. It includes links to the Condition resource (the patient’s long term Problem List) and the Goal resource (the patient’s longitudinal goals) as well as details about upcoming appointments, referrals, and orders. The CarePlan resource is designed for provider planning and documentation, not patient interaction. By default, only the patient's longitudinal CarePlan is returned. However, encounter-level CarePlans can also be requested. These encounter-level CarePlans include narrative content, such as patient instructions, and assassment and plan of treatment notes that are not associated with any particular condition.

The FHIR Goal resource defines objectives for a patient based on a current condition or recent procedure. The goal may be long term, such as targeting a specific HgbA1c level after a diabetes diagnosis, or shorter term such as changing wound dressings routinely following a procedure. The Goal resource does not include inpatient care goals, and is designed for provider documentation rather than patient interaction.

To play in an interactive sandbox, navigate to this page
using Chrome, Safari, or Firefox ("FHIRFox"??).
 Click the button. Go on.
See more

Endpoints

CarePlan Search Interaction

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

The Search interaction enables the client to query for the care plan for a given patient. The client, having established the patient in question, now wishes to retrieve the plan of treatment for the patient. Epic's sandbox currently supports the following query parameters for CarePlan queries:

Note: To ensure clinical safety for a patient, searches filtered with a date search parameter will return all active and future activities in addition to other data returned in the search.
Parameter Name Parameter Type Description
_id Reference Search for CarePlan resources using one or more server ids (equivalent to one or more Get /CarePlan/{ID} requests)
patient Reference Search for CarePlan resources for a specified patient ID.
date Date Further refine the content within the CarePlan by providing by specifying a date or range of dates for what historical data should be included in the care plan. Note: all active historical data and all future data will be returned in the response in addition to other data returned in the search.
category Token Further refine which CarePlan resources are returned by category. There are two supported categories: 38717003 will return only the longitudinal care plan. 734163000 will return encounter-level care plans. If no category is specified, only the longitudinal care plan is returned.
Examples
Query Result
/CarePlan?patient=Tbt3KuCY0B5PSrJvCu2j-PlK.aiHsu2xUjUM8bWpetXoB Retrieve the CarePlan for Jason Argonaut.
/CarePlan?patient=Tbt3KuCY0B5PSrJvCu2j-PlK.aiHsu2xUjUM8bWpetXoB&category=38717003&category=734163000 Return both longitudinal and encounter-level CarePlans for Jason Argonaut

CarePlan Read Interaction

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

The read interaction enables the lookup of a CarePlan resource by a constant server ID. The read interaction allows clients to store only the server ID, and with a single request, retrieve the most up-to-date information about a procedure. Read interactions typically begin with a client having previously established a relationship, often through querying for CarePlan through the search interaction.

Goal Search Interaction

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

The Search interaction enables the client to query for the goals of a given patient. The client, having established the patient in question, now wishes to retrieve the documented goals for the patient. Epic's sandbox currently supports the following query parameters for Goal queries:

Note: To ensure clinical safety for a patient, searches filtered with a _lastUpdated search parameter will return all active goals in addition to other data returned in the search.
Parameter Name Parameter Type Description
_id Reference Search for Goal resources using one or more server ids (equivalent to one or more Get /Goal/{ID} requests)
patient Reference Search for Goal resources for a specified patient ID.
category Token Further refine a search for a given set of Goal resources for a given patient to a particular category.
status Token Further refine a search for a given set of Goal resources for a given patient to a particular status. Specify one or more of in-progress, achieved, or cancelled. By default, only in-progress goals are returned.
_lastUpdated Date Further refine a search for a Goals by specifying a date or range of dates for when the data in Epic was last updated for a particular goal. Note: all active goals will be returned in addition to any other search criteria.
Examples
Query Result
/Goal?patient=Tbt3KuCY0B5PSrJvCu2j-PlK.aiHsu2xUjUM8bWpetXoB Retrieve the Goals for Jason Argonaut.
/Goal?patient=Tbt3KuCY0B5PSrJvCu2j-PlK.aiHsu2xUjUM8bWpetXoB&status=achieved Retrieve the achieved Goals for Jason Argonaut.

Goal Read Interaction

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

The read interaction enables the lookup of a Goal resource by a constant server ID. The read interaction allows clients to store only the server ID, and with a single request, retrieve the most up-to-date information about a procedure. Read interactions typically begin with a client having previously established a relationship, often through querying for Goal through the search interaction.

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.