FHIR Immunization

Base Path: /fhir/4.0/Immunization

Version: 1.1.0

The FHIR Immunization API allows you to look up and retrieve a patient's immunization information. The endpoint provides the ability to:

  • Retrieve all Immunization resources that match a search criteria for a given patient.
  • Retrieve a specific Immunization resource based on its resource ID.
  • Create an Immunization resource for a patient.
  • Update an existing Immunization resource based on its resource ID.

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 R4 release of the FHIR standard, for more information on this API refer to the official FHIR documentation.


Methods

Retrieve Immunizations for a Patient

GET /fhir/4.0/Immunization/

This method returns all immunizations for the patient identified by patient resource id or patient identifier. Optionally filtering by the immunization's date and status.


Parameters

Name

Type

Data Type

Description


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:

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: SYS_A|31231-3647



Name:

date

optional

Type:

query

Data Type:

array

Description:

Filters the immunizations to those with an immunization date on, before, or after a specific date, date-time, or date range. The supported prefixes are gt, ge, lt, le and eq. 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: 1995-09-20



Name:

status

optional

Type:

query

Data Type:

string

Description:

Filters the immunizations to those having the specified status. Possible values are:

  • completed
  • entered-in-error
  • not-done


Sample Value: not-done



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%20Immunizations



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%20Immunizations



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..* Immunization 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

Search for specific Immunizations for a Patient by patient identifier
curl -X GET "https://developer-solution/fhir/4.0/Immunization/?patient.identifier=SYS_A%7C31231-3647&date=1995-09-20&status=not-done" \
-H 'Accept: application/json' \
-H 'Authorization: Basic bGV2ZWwxLnN5c19hOk9yaW9uc3k1IT8='

Create an Immunization for a Patient

POST /fhir/4.0/Immunization/

This method creates an immunization for a patient in the system. Note: The create API requires to have s data source available to store the Immunizations. Currently storage solution is not part of the offering.


Parameters

Name

Type

Data Type

Description


Name:

Content-Type

required

Type:

header

Data Type:

string

Description:

Specifies how to encode the form data. Possible values are application/json and application/xml.


Sample Value: application/json



Name:

Immunization

required

Type:

body

Data Type:

Description:

Contains the fields of the Immunization resource to be created. The following fields should be present:

  • Immunization.patient
  • Immunization.id
  • Immunization.status
  • Immunization.vaccineCode
  • Immunization.occurrence

Note: If the Immunization resource Id is present it will be ignored. The patient should be known to the system.

Sample Payload:

{
  "resourceType": "Immunization",
  "id": "shaRCKMH6OERV6XXHV2BUJWTURNDOHMWT3YTFEZIRDH2WJBUYYWVEGQ",
  "identifier": [
    {
      "system": "urn:ietf:rfc:3986",
      "value": "urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234"
    }
  ],
  "status": "completed",
  "vaccineCode": {
    "coding": [
      {
        "system": "urn:oid:1.2.36.1.2001.1005.17",
        "code": "FLUVAX"
      }
    ],
    "text": "Fluvax (Influenza)"
  },
  "patient": {
    "reference": "Patient/GYZGCNDDMRSWMQCPJBBVA"
  },
  "encounter": {
    "reference": "Encounter/example"
  },
  "occurenceDateTime": "2013-01-10T00:00:00.000Z",
  "primarySource": true,
  "location": {
    "reference": "Location/1"
  },
  "doseQuantity": {
    "coding": [
      {
        "value": 5,
        "system": "https://unitsofmeasure.org",
        "code": "mg"
      }
    ]
  }
}



Responses


application/json+fhir

201

This response code is returned when a new Immunization is created successfully. The Immunization FHIR Id is in the header.


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, required fields are missing from the Immunization or Immunization patient reference is unknown.


application/json+fhir

401

This response code is returned when the user is not authorized to perform the operation. This could be due to invalid login or not having enough access rights to perform the operation. In order to create or update immunizations the user should either be a member of the "FHIR Immunization Administrator" or the "FHIR Write Administrator" Group, or have full access to the immunization patient.

Sample Requests

Create an Immunization
curl -X POST "https://developer-solution/fhir/4.0/Immunization/" \
-H 'Accept: application/json' \
-H 'Authorization: Basic bGV2ZWwxLnN5c19hOk9yaW9uc3k1IT8=' \
-d '{"resourceType":"Immunization","id":"shaRCKMH6OERV6XXHV2BUJWTURNDOHMWT3YTFEZIRDH2WJBUYYWVEGQ","identifier":[{"system":"urn:ietf:rfc:3986","value":"urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234"}],"status":"completed","vaccineCode":{"coding":[{"system":"urn:oid:1.2.36.1.2001.1005.17","code":"FLUVAX"}],"text":"Fluvax (Influenza)"},"patient":{"reference":"Patient/GYZGCNDDMRSWMQCPJBBVA"},"encounter":{"reference":"Encounter/example"},"occurenceDateTime":"2013-01-10T00:00:00.000Z","primarySource":true,"location":{"reference":"Location/1"},"doseQuantity":{"coding":[{"value":5,"system":"https://unitsofmeasure.org","code":"mg"}]}}'

Retrieve Immunizations for a Patient

POST /fhir/4.0/Immunization/_search

This method returns all immunizations for the patient identified by patient resource id or patient identifier. Optionally filtering by the immunization's date and status. 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:

date

optional

Type:

formData

Data Type:

array

Description:

Filters the immunizations to those with an immunization date on, before, or after a specific date, date-time, or date range. The supported prefixes are gt, ge, lt, le and eq. 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: gt2013-01-01T01:00:00%2B13:00



Name:

status

optional

Type:

formData

Data Type:

string

Description:

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

  • completed
  • entered-in-error
  • not-done


Sample Value: completed



Name:

-include-sources

optional

Type:

formData

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%20Immunizations



Name:

-exclude-sources

optional

Type:

formData

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%20Immunizations



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..* Immunization 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

Search for specific Immunizations for a Patient by patient resource id
curl -X POST "https://developer-solution/fhir/4.0/Immunization/_search" \
-H 'Accept: application/json' \
-H 'Authorization: Basic bGV2ZWwxLnN5c19hOk9yaW9uc3k1IT8=' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'patient=IFAUCQJNGAYTENBNHBAE6USJJ5HA' \
-d 'date=gt2013-01-01T01:00:00%2B13:00' \
-d 'status=completed'

Retrieve a single Immunization

GET /fhir/4.0/Immunization/{id}

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


Sample Value: shaMG6WK4GWAZL2344CVA3LGH74CK4YAP5OLGGT6422LDV5S63AKDYA



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

Sample Requests

Retrieve Immunization with a specific resource id.
curl -X GET "https://developer-solution/fhir/4.0/Immunization/shaMG6WK4GWAZL2344CVA3LGH74CK4YAP5OLGGT6422LDV5S63AKDYA" \
-H 'Accept: application/json' \
-H 'Authorization: Basic bGV2ZWwxLnN5c19hOk9yaW9uc3k1IT8='

Update an Immunization

PUT /fhir/4.0/Immunization/{id}

This method updates the Immunization resource matching the requested resource ID. Note: The update API requires to have s data source available to store the Immunizations. Currently storage solution is not part of the offering.


Parameters

Name

Type

Data Type

Description


Name:

id

required

Type:

path

Data Type:

string

Description:

The ID of the Immunization resource.


Sample Value: shaRCKMH6OERV6XXHV2BUJWTURNDOHMWT3YTFEZIRDH2WJBUYYWVEGQ



Name:

Immunization

required

Type:

body

Data Type:

Description:

Contains the fields of the Immunization resource to be updated. The following fields must be present:

  • Immunization.patient
  • Immunization.id
  • Immunization.status
  • Immunization.vaccineCode
  • Immunization.occurrence

Sample Payload:

{
  "resourceType": "Immunization",
  "id": "shaRCKMH6OERV6XXHV2BUJWTURNDOHMWT3YTFEZIRDH2WJBUYYWVEGQ",
  "identifier": [
    {
      "system": "urn:ietf:rfc:3986",
      "value": "urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234"
    }
  ],
  "status": "completed",
  "vaccineCode": {
    "coding": [
      {
        "system": "urn:oid:1.2.36.1.2001.1005.17",
        "code": "FLUVAX"
      }
    ],
    "text": "Fluvax (Influenza)"
  },
  "patient": {
    "reference": "Patient/GYZGCNDDMRSWMQCPJBBVA"
  },
  "encounter": {
    "reference": "Encounter/example"
  },
  "occurenceDateTime": "2013-01-10T00:00:00.000Z",
  "primarySource": true,
  "location": {
    "reference": "Location/1"
  },
  "doseQuantity": {
    "coding": [
      {
        "value": 5,
        "system": "https://unitsofmeasure.org",
        "code": "mg"
      }
    ]
  }
}



Responses


application/json+fhir

201

The Immunization was updated. The immunization FHIR ID is in the header.


application/json+fhir

400

The required fields are missing from the Immunization or Immunization Patient reference is not known.


application/json+fhir

401

This code is returned when the user is not authorized to perform the operation.


application/json+fhir

404

No Immunization resource found with the requested resource ID.

Sample Requests

Update an existing Immunization with a specific resource id.
curl -X PUT "https://developer-solution/fhir/4.0/Immunization/shaRCKMH6OERV6XXHV2BUJWTURNDOHMWT3YTFEZIRDH2WJBUYYWVEGQ" \
-H 'Accept: application/json' \
-H 'Authorization: Basic bGV2ZWwxLnN5c19hOk9yaW9uc3k1IT8=' \
-d '{"resourceType":"Immunization","id":"shaRCKMH6OERV6XXHV2BUJWTURNDOHMWT3YTFEZIRDH2WJBUYYWVEGQ","identifier":[{"system":"urn:ietf:rfc:3986","value":"urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234"}],"status":"completed","vaccineCode":{"coding":[{"system":"urn:oid:1.2.36.1.2001.1005.17","code":"FLUVAX"}],"text":"Fluvax (Influenza)"},"patient":{"reference":"Patient/GYZGCNDDMRSWMQCPJBBVA"},"encounter":{"reference":"Encounter/example"},"occurenceDateTime":"2013-01-10T00:00:00.000Z","primarySource":true,"location":{"reference":"Location/1"},"doseQuantity":{"coding":[{"value":5,"system":"https://unitsofmeasure.org","code":"mg"}]}}'