FHIR AllergyIntolerance

Base Path: /fhir/4.0/AllergyIntolerance

Version: 1.1.0

The FHIR AllergyIntolerance API allows you to look up a patient's allergies and adverse reactions to substances or products. The endpoint provides the ability to:

  • Retrieve all AllergyIntolerance resources that match search criteria for a given patient.
  • Retrieve a specific AllergyIntolerance resource based on its resource ID.
  • 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 AllergyIntolerance API aggregates data from multiple sources, to learn about working with aggregated APIs refer to the Aggregated APIs 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 Allergies for a Patient

GET /fhir/4.0/AllergyIntolerance/

This method returns all allergies for the patient identified either by patient.identifier or by patient. Optionally, filtering the allergies using the other 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 both.


Sample Value: ORION|AAAA-0124-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 both.


Sample Value: IFAUCQJNGAYTENBNHBAE6USJJ5HA



Name:

clinical-status

optional

Type:

query

Data Type:

string

Description:

Filters the allergies to those having the specified status. Possible values are

  • active
  • inactive
  • resolved


Sample Value: active



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 parameter 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%20CDR%20AllergyIntolerance



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%20CDR%20AllergyIntolerance



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. The default value is 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. The default value is application/xml.


Sample Value: application/xml


Responses


application/json+fhir

200

Returns a FHIR Bundle containing 0..* OperationOutcome resources and 0..* AllergyIntolerance 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 Allergies for a Patient identified by a patient identifier
curl -X GET "https://developer-solution/fhir/4.0/AllergyIntolerance/?patient.identifier=ORION%7CAAAA-0124-8" \
-H 'Accept: application/json' \
-H 'Authorization: Basic bGV2ZWwxLnN5c19hOk9yaW9uc3k1IT8='

Retrieve Allergies for a Patient

POST /fhir/4.0/AllergyIntolerance/_search

This method returns all allergies for the patient identified either by patient.identifier or by patient. Optionally, filtering the allergies using the other parameters. 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.

Note: You must either define the patient.identifier or patient, not both.


Sample Value: ORION|AAAA-0124-8



Name:

patient

required

Type:

formData

Data Type:

string

Description:

The patient resource id.

Note: You must either define the patient.identifier or patient, not both.


Sample Value: IFAUCQJNGAYTENBNHBAE6USJJ5HA



Name:

clinical-status

optional

Type:

formData

Data Type:

string

Description:

Filters the allergies to those having the specified status. Possible values are

  • active
  • inactive
  • resolved


Sample Value: active



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 parameter 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%20CDR%20Allergies



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%20CDR%20Allergies



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. The default value is 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. The default value is application/xml.


Sample Value: application/xml


Responses


application/json+fhir

200

Returns a FHIR Bundle containing 0..* OperationOutcome resources and 0..* AllergyIntolerance 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 allergies with specific clinical status for a Patient identified by patient identifier
curl -X POST "https://developer-solution/fhir/4.0/AllergyIntolerance/_search" \
-H 'Accept: application/json' \
-H 'Authorization: Basic bGV2ZWwxLnN5c19hOk9yaW9uc3k1IT8=' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'patient.identifier=ORION%7CAAAA-0124-8' \
-d 'clinical-status=active'

Retrieve a single Allergy

GET /fhir/4.0/AllergyIntolerance/{id}

This method returns the AllergyIntolerance 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 AllergyIntolerance resource


Sample Value: shaBKPYOI7GALG7WJDEAP6D3XVX5DGCYCYYYQHHFR76CBZ6EPR3AOFA



Name:

vid

required

Type:

path

Data Type:

string

Description:

Version of the AllergyIntolerance resource


Sample Value: 2



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. The default value is 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. The default value is application/xml.


Sample Value: application/xml


Responses


application/json+fhir

200

Returns an AllergyIntolerance resource matching the 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 AllergyIntolerance resource found with the requested resource ID.

Sample Requests

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

Retrieve an Allergy's history

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

Returns the history of a specific AllergyIntolerance using a query based on the provided FHIR ID. The data returned is subject to privacy and permissions settings. AllergyIntolerance resource can be retrieved from multiple data sources, and not all sources are able to return history information for AllergyIntolerance resources.


Parameters

Name

Type

Data Type

Description


Name:

id

required

Type:

path

Data Type:

string

Description:

The id of the AllergyIntolerance resource


Sample Value: shaZN25XYQ47GG5MJOWYUL2BIFLZATMCVWKNYWBYF3BTSFYRXCTTA4A



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. The default value is 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. The default value is application/xml.


Sample Value: application/xml


Responses


application/json+fhir

200

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


application/json+fhir

404

  • No AllergyIntolerance resource found with the requested resource ID.
  • The source providing the AllergyIntolerance resource is not capable of returning history of AllergyIntolerance resources.

Sample Requests

Retrieve allergies with specific clinical status for a Patient identified by patient identifier
curl -X GET "https://developer-solution/fhir/4.0/AllergyIntolerance/shaZN25XYQ47GG5MJOWYUL2BIFLZATMCVWKNYWBYF3BTSFYRXCTTA4A/_history" \
-H 'Accept: application/json' \
-H 'Authorization: Basic bGV2ZWwxLnN5c19hOk9yaW9uc3k1IT8='