---
title: "Extract Immunizations"
canonical: "https://wiki.patientsknowbest.com/space/api/4979556389/Extract%20Immunizations"
format: markdown
---
> Macro (toc)

## What

> Macro (excerpt)
> 
> Enables you to pull out all immunizations sent from any FHIR source.  See the [Validation and Business rules](https://wiki.patientsknowbest.com/space/api/3364388935/Aggregated#Validation-and-business-rules) section for further details on what is included in the Aggregated endpoint.

## Prerequisites

> Macro (excerpt-include)



## How to

> Macro (excerpt)
> 
> - With a valid token, call the base URL with the Immunization resource, using the patient’s identifier (with the corresponding system) in the actor search parameter to pull back all of a patient’s immunizations you have access to in PKB.
>   - *National ID Example: *[https://aggregated-fhir.sandbox.patientsknowbest.com/fhir/Immunization?patient:Patient.identifier=https://fhir.nhs.uk/Id/nhs-number%7C9106771734](https://aggregated-fhir.sandbox.patientsknowbest.com/fhir/Immunization?patient:Patient.identifier=https://fhir.nhs.uk/Id/nhs-number%7C9106771734)
>   - *PKB Public ID Example:* [https://aggregated-fhir.sandbox.patientsknowbest.com/fhir/Immunization?patient:Patient.identifier=http://fhir.patientsknowbest.com/id/public-id%7C3838d6bc-fa0d-4e7f-bd17-bc62b02bebbd](https://aggregated-fhir.sandbox.patientsknowbest.com/fhir/Immunization?patient:Patient.identifier=http://fhir.patientsknowbest.com/id/public-id%7C3838d6bc-fa0d-4e7f-bd17-bc62b02bebbd)
> - You can add other supported search parameters onto that request to meet your specific use case.  See the [FHIR R4 Search](https://hl7.org/fhir/R4/search.html#3.1.1) page for further information.
>   - Example pulling back all of a patient’s immunizations administered since a certain date: [https://aggregated-fhir.sandbox.patientsknowbest.com/fhir/Immunization?patient:Patient.identifier=http://fhir.patientsknowbest.com/id/public-id%7C3838d6bc-fa0d-4e7f-bd17-bc62b02bebbd&date=gt1990-01-01](https://aggregated-fhir.sandbox.patientsknowbest.com/fhir/Immunization?patient:Patient.identifier=http://fhir.patientsknowbest.com/id/public-id%7C3838d6bc-fa0d-4e7f-bd17-bc62b02bebbd&date=gt1990-01-01)
> - A FHIR bundle is returned to you in json format with all of the patient’s immunizations that are in their PKB record.

> Macro (excerpt)
> 
> ## Useful links
> 
> - Further information on [connectivity and endpoints](https://wiki.patientsknowbest.com/space/api/4348444939/FHIR+API+-+Network+Connectivity).
> - PKB uses the [Immunization](https://hl7.org/fhir/R4/immunization.html) FHIR resource.  [You can read the full capability statement here.](https://wiki.patientsknowbest.com/space/api/3364389010/Capabilities:+Aggregated+Endpoint#Observation)

## **Example**

> Macro (excerpt)
> 
> Here’s an example response for pulling all of this patient’s immunizations that have been administered from 1st of January 1990 or more recent:
> 
> <span style="color: #36b37e">**GET**</span>** **[https://aggregated-fhir.sandbox.patientsknowbest.com/fhir/Immunization?patient:Patient.identifier=http://fhir.patientsknowbest.com/id/public-id%7C3838d6bc-fa0d-4e7f-bd17-bc62b02bebbd&date=gt1990-01-01](https://aggregated-fhir.sandbox.patientsknowbest.com/fhir/Immunization?patient:Patient.identifier=http://fhir.patientsknowbest.com/id/public-id%7C3838d6bc-fa0d-4e7f-bd17-bc62b02bebbd&date=gt1990-01-01)
> 
> ```
> {
>     "resourceType": "Bundle",
>     "meta": {
>         "versionId": "0",
>         "lastUpdated": "2025-09-03T14:34:49.654+00:00"
>     },
>     "type": "searchset",
>     "total": 1,
>     "link": [
>         {
>             "relation": "first",
>             "url": "/fhir/Immunization?patient:Patient.identifier=http://fhir.patientsknowbest.com/id/public-id%7C3838d6bc-fa0d-4e7f-bd17-bc62b02bebbd&date=gt1990-01-01&page=1"
>         },
>         {
>             "relation": "self",
>             "url": "/fhir/Immunization?patient:Patient.identifier=http://fhir.patientsknowbest.com/id/public-id%7C3838d6bc-fa0d-4e7f-bd17-bc62b02bebbd&date=gt1990-01-01"
>         }
>     ],
>     "entry": [
>         {
>             "link": [
>                 {
>                     "relation": "self",
>                     "url": "https://sandboxaggregated.fhir-api.sandbox.patientsknowbest.com/Immunization/ee8c5740-3705-3ca9-9949-5ccdedaf88ba"
>                 }
>             ],
>             "fullUrl": "https://sandboxaggregated.fhir-api.sandbox.patientsknowbest.com/Immunization/ee8c5740-3705-3ca9-9949-5ccdedaf88ba",
>             "resource": {
>                 "resourceType": "Immunization",
>                 "id": "ee8c5740-3705-3ca9-9949-5ccdedaf88ba",
>                 "meta": {
>                     "extension": [
>                         {
>                             "url": "http://fhir.patientsknowbest.com/structuredefinition/version-persisted",
>                             "valueDateTime": "2025-03-11T16:43:09.376+00:00"
>                         },
>                         {
>                             "url": "http://fhir.patientsknowbest.com/structuredefinition/access-route",
>                             "valueCoding": {
>                                 "system": "http://fhir.patientsknowbest.com/codesystem/access-route",
>                                 "code": "FHIR_API",
>                                 "display": "Integration (FHIR)"
>                             }
>                         },
>                         {
>                             "url": "ex:createdAt",
>                             "valueInstant": "2025-03-11T16:43:10.455854Z"
>                         }
>                     ],
>                     "versionId": "7728090",
>                     "lastUpdated": "2025-03-11T16:43:10.455854Z",
>                     "security": [
>                         {
>                             "system": "http://fhir.patientsknowbest.com/codesystem/source-organization",
>                             "code": "0c6478d8-ab0f-3337-84f6-4c94464e0222",
>                             "display": "Denormalized source information"
>                         },
>                         {
>                             "system": "http://fhir.patientsknowbest.com/codesystem/privacy-label",
>                             "code": "GENERAL_HEALTH"
>                         }
>                     ]
>                 },
>                 "text": {
>                     "status": "generated",
>                     "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">Booster diphtheria, tetanus and acellular pertussis (DTaP) vaccination</div>"
>                 },
>                 "status": "completed",
>                 "vaccineCode": {
>                     "coding": [
>                         {
>                             "system": "http://snomed.info/sct",
>                             "code": "838471000006118",
>                             "display": "Booster diphtheria, tetanus and acellular pertussis (DTaP) vaccination"
>                         }
>                     ]
>                 },
>                 "patient": {
>                     "reference": "Patient/2a43a24f-3b1d-3475-9511-bf3ca994afc9"
>                 },
>                 "occurrenceDateTime": "1991-09-07T12:23:00+01:00",
>                 "performer": [
>                     {
>                         "actor": {
>                             "reference": "Practitioner/ffc5ebc8-efa6-3f9a-9dfa-9a92a063ec2c",
>                             "display": "Mr PKB Test"
>                         }
>                     }
>                 ]
>             },
>             "search": {
>                 "mode": "match"
>             }
>         }
>     ]
> }
> ```

> Macro (excerpt)
> 
> ## Aggregated Immunization supported search parameters
> 
> ```json
> "searchParam": [
>                         {
>                             "name": "patient:Patient.identifier",
>                             "type": "token"
>                         },
>                         {
>                             "name": "_format",
>                             "type": "string"
>                         },
>                         {
>                             "name": "_total",
>                             "type": "string"
>                         },
>                         {
>                             "name": "date",
>                             "type": "date",
>                             "documentation": "Vaccination  (non)-Administration Date"
>                         },
>                         {
>                             "name": "identifier",
>                             "type": "token",
>                             "documentation": "Business identifier"
>                         },
>                         {
>                             "name": "location",
>                             "type": "reference",
>                             "documentation": "The service delivery location or facility in which the vaccine was / was to be administered"
>                         },
>                         {
>                             "name": "lot-number",
>                             "type": "string",
>                             "documentation": "Vaccine Lot Number"
>                         },
>                         {
>                             "name": "manufacturer",
>                             "type": "reference",
>                             "documentation": "Vaccine Manufacturer"
>                         },
>                         {
>                             "name": "page",
>                             "type": "string"
>                         },
>                         {
>                             "name": "performer",
>                             "type": "reference",
>                             "documentation": "The practitioner or organization who played a role in the vaccination"
>                         },
>                         {
>                             "name": "reaction",
>                             "type": "reference",
>                             "documentation": "Additional information on reaction"
>                         },
>                         {
>                             "name": "reason-code",
>                             "type": "token",
>                             "documentation": "Reason why the vaccine was administered"
>                         },
>                         {
>                             "name": "reason-reference",
>                             "type": "reference",
>                             "documentation": "Why immunization occurred"
>                         },
>                         {
>                             "name": "series",
>                             "type": "string",
>                             "documentation": "The series being followed by the provider"
>                         },
>                         {
>                             "name": "status",
>                             "type": "token",
>                             "documentation": "Immunization event status"
>                         },
>                         {
>                             "name": "status-reason",
>                             "type": "token",
>                             "documentation": "Reason why the vaccine was not administered"
>                         },
>                         {
>                             "name": "target-disease",
>                             "type": "token",
>                             "documentation": "The target disease the dose is being administered against"
>                         },
>                         {
>                             "name": "vaccine-code",
>                             "type": "token",
>                             "documentation": "Vaccine Product Administered"
>                         }
>                     ]
>                 },
> ```