# Immunization _search

`POST /Immunization/_search`

This resource contains details for a vaccine that was administered or recorded by a healthcare organization. As a tip, the terms <u>immunization</u> and <u>vaccination</u> are used interchangeably in FHIR.

A patient, clinician, or other entity can report the immunization record.

You can review or retrieve immunization records.

> **Supported fields and schema examples**
>
> We support any valid FHIR field. However, we only display fields we’ve defined in our schema, which are usually based on what’s included in the U.S. Core profile. We recommend relying on U.S. Core requirements. 
>
> Our schema examples show the shape and possibility of each FHIR resource; they aren’t code for real-time API calls. We don’t currently recommend copying and pasting these schema examples for your API calls. [Consider reviewing FHIR API actions](/fhir-api-actions) for realistic examples for particular use cases.

### \_search

Query for vaccine administration details for a patient's current or historical immunization, as recorded by one provider. [Review tips for vaccination searches](https://docs.redoxengine.com/permalink/6zS5eOOIk16tPJP1QCbk30).

> **Flexible FHIR queries, different query parameters**
>
> FHIR queries are a flexible option with parameters to refine your search. The response returns a bundle of resources, known as a `searchset` bundle type. [Learn about bundles and bundle types](https://docs.redoxengine.com/permalink/23Q1Oku3NdxxvwYnQGJVrg) in our FHIR glossary.
>
> We add a `required` label only to query parameters _a FHIR server requires if you query it directly_. Remember that Redox <u>**data on demand**</u> isn’t a FHIR server, and your connection may not be either.
>
> _Query parameters vary between sites._ Work with your connection to find out which query parameters they require for a successful search.

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `patient` | Array of string | No | The patient to whom the immunization was administered |
| `patient.identifier` | Array of string | No | One or more external identifiers for the patient |
| `date` | Array of string | No | The date/time of the immunization (non-)administration |
| `status` | Array of string | No | The status of the immunization:	completed \| entered-in-error \| not-done |

## Request example

_Generated from the schema: the values are placeholders, not a real payload._

```bash
curl 'https://api.redoxengine.com/fhir/R4/{destinationSlug}/{environmentFlag}/Immunization/_search' \
--request POST \
--header 'Authorization: Bearer $API_TOKEN' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'patient=string' \
--data-urlencode 'patient.identifier=string' \
--data-urlencode 'date=string' \
--data-urlencode 'status=string'
```

## Responses

### 200

Search results (Bundle)

Response to an Immunization search operation

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `resourceType` | string | Yes | Identifies the type of the resource. Value: Bundle |
| `type` | string | Yes | Identifies this bundle as a response to a search. Value: searchset |
| `total` | number | Yes | The total number of matches |
| `entry` | Array of Immunization or Other | No | A resource matching the search criteria or related to a matching resource |
| `entry[] (Immunization).resource` | object | Yes | A record of an immunization that was administered to a patient |
| `entry[] (Immunization).resource.resourceType` | string | Yes | Identifies the type of the resource. Value: Immunization |
| `entry[] (Immunization).resource.status` | string | Yes | Indicates the current status of the immunization event. Possible values: (USCDI) completed, entered-in-error, not-done |
| `entry[] (Immunization).resource.vaccineCode` | object | Yes | Vaccine that was administered or was to be administered. |
| `entry[] (Immunization).resource.vaccineCode.coding` | Array of object | No | A reference to a code defined by a terminology system. |
| `entry[] (Immunization).resource.vaccineCode.coding[].system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `entry[] (Immunization).resource.vaccineCode.coding[].code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `entry[] (Immunization).resource.vaccineCode.text` | string | No | A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. |
| `entry[] (Immunization).resource.patient` | object | Yes | The patient who either received or did not receive the immunization. Must be a resource of type `Patient`. |
| `entry[] (Immunization).resource.patient.reference` | string | No | A reference to another resource. This is typically either a relative reference which includes the resource type and ID, or an internal reference which starts with `#` and refers to a contained resource. |
| `entry[] (Immunization).resource.occurrenceDateTime` | string | Yes | Date vaccine administered or was to be administered. |
| `entry[] (Immunization).resource.id` | string | No | The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes. |
| `entry[] (Immunization).resource.identifier` | Array of object | No | A unique identifier assigned to this immunization record. |
| `entry[] (Immunization).resource.identifier[].extension` | Array of Boolean or String or CodeableConcept or Coding or HumanName or Reference | No | May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. |
| `entry[] (Immunization).resource.identifier[].extension[] (Boolean).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `entry[] (Immunization).resource.identifier[].extension[] (Boolean).valueBoolean` | boolean | No | A single value for the extension. |
| `entry[] (Immunization).resource.identifier[].extension[] (String).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `entry[] (Immunization).resource.identifier[].extension[] (String).valueString` | string | No | A single value for the extension. |
| `entry[] (Immunization).resource.identifier[].extension[] (CodeableConcept).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `entry[] (Immunization).resource.identifier[].extension[] (CodeableConcept).valueCodeableConcept` | object | No | A single value for the extension. |
| `entry[] (Immunization).resource.identifier[].extension[] (CodeableConcept).valueCodeableConcept.coding` | Array of object | No | A reference to a code defined by a terminology system. |
| `entry[] (Immunization).resource.identifier[].extension[] (CodeableConcept).valueCodeableConcept.coding[].system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `entry[] (Immunization).resource.identifier[].extension[] (CodeableConcept).valueCodeableConcept.coding[].code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `entry[] (Immunization).resource.identifier[].extension[] (CodeableConcept).valueCodeableConcept.text` | string | No | A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. |
| `entry[] (Immunization).resource.identifier[].extension[] (Coding).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `entry[] (Immunization).resource.identifier[].extension[] (Coding).valueCoding` | object | No | A single value for the extension. |
| `entry[] (Immunization).resource.identifier[].extension[] (Coding).valueCoding.system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `entry[] (Immunization).resource.identifier[].extension[] (Coding).valueCoding.code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `entry[] (Immunization).resource.identifier[].extension[] (HumanName).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `entry[] (Immunization).resource.identifier[].extension[] (HumanName).valueHumanName` | object | No | A single value for the extension. |
| `entry[] (Immunization).resource.identifier[].extension[] (HumanName).valueHumanName.use` | string | No | Identifies the purpose for this name. Possible values: usual, official, temp, nickname, anonymous, old, maiden |
| `entry[] (Immunization).resource.identifier[].extension[] (HumanName).valueHumanName.family` | string | No | The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father. |
| `entry[] (Immunization).resource.identifier[].extension[] (HumanName).valueHumanName.given` | Array of string | No | Given name. |
| `entry[] (Immunization).resource.identifier[].extension[] (Reference).url` | string | Yes | Source of the definition for the extension code - a logical name or a URL. |
| `entry[] (Immunization).resource.identifier[].extension[] (Reference).valueReference` | object | No | A single value for the extension. |
| `entry[] (Immunization).resource.identifier[].extension[] (Reference).valueReference.reference` | string | No | A reference to another resource. This is typically either a relative reference which includes the resource type and ID, or an internal reference which starts with `#` and refers to a contained resource. |
| `entry[] (Immunization).resource.identifier[].use` | string | No | The purpose of this identifier. Possible values: usual, official, temp, secondary, old (If known) |
| `entry[] (Immunization).resource.identifier[].system` | string | No | Establishes the namespace for the value - that is, a URL that describes a set values that are unique. |
| `entry[] (Immunization).resource.identifier[].value` | string | No | The portion of the identifier typically relevant to the user and which is unique within the context of the system. |
| `entry[] (Immunization).resource.statusReason` | object | No | Indicates the reason the immunization event was not performed. |
| `entry[] (Immunization).resource.statusReason.text` | string | No | A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. |
| `entry[] (Immunization).resource.encounter` | object | No | The visit or admission or other contact between patient and health care provider the immunization was performed as part of. Must be a resource of type `Encounter`. |
| `entry[] (Immunization).resource.encounter.reference` | string | No | A reference to another resource. This is typically either a relative reference which includes the resource type and ID, or an internal reference which starts with `#` and refers to a contained resource. |
| `entry[] (Immunization).resource.primarySource` | boolean | No | An indication that the content of the record is based on information from the person who administered the vaccine. This reflects the context under which the data was originally recorded. **We do not support or retain this field in our database; however, we will pass the field through to your connection if the field exists in your request.** |
| `entry[] (Immunization).resource.manufacturer` | object | No | Name of vaccine manufacturer. Must be a resource of type `Organization`. |
| `entry[] (Immunization).resource.manufacturer.display` | string | No | Plain text narrative that identifies the resource in addition to the resource reference. |
| `entry[] (Immunization).resource.lotNumber` | string | No | Lot number of the  vaccine product. |
| `entry[] (Immunization).resource.route` | object | No | The path by which the vaccine product is taken into the body. |
| `entry[] (Immunization).resource.route.coding` | Array of object | No | A reference to a code defined by a terminology system. |
| `entry[] (Immunization).resource.route.coding[].system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `entry[] (Immunization).resource.route.coding[].code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `entry[] (Immunization).resource.route.text` | string | No | A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. |
| `entry[] (Immunization).resource.doseQuantity` | any | No | The quantity of vaccine product that was administered. See http://hl7.org/fhir/StructureDefinition/SimpleQuantity for more information |
| `entry[] (Immunization).search` | object | Yes | Information about the search process that lead to the creation of this entry. |
| `entry[] (Immunization).search.mode` | string | Yes | Identifies the Immunization as matching the search parameters. Value: match |
| `entry[] (Other).search` | object | Yes | Information about the search process that lead to the creation of this entry. |
| `entry[] (Other).search.mode` | string | No | Why this entry is in the result set - whether it's included as a match or because of an _include requirement, or to convey information or warning information about the search process. Possible values: match, include, outcome - why this is in the result set |

_Generated from the schema: the values are placeholders, not a real payload._

```json
{
  "resourceType": "Bundle",
  "type": "searchset",
  "total": 0,
  "entry": [
    {
      "resource": {
        "resourceType": "Immunization",
        "id": "RedoxImmunizationExampleMinimumCompleted",
        "identifier": [
          {
            "system": "urn:oid:1.2.840.114350.1.13.12345.1.7.2.798268",
            "value": "4620975"
          }
        ],
        "patient": {
          "reference": "Patient/RedoxPatientExampleTimothy"
        },
        "occurrenceDateTime": "2022-02-07T18:00:00.000Z",
        "status": "completed",
        "vaccineCode": {
          "coding": [
            {
              "code": "88",
              "system": "urn:oid:2.16.840.1.113883.6.59",
              "display": "Influenza virus vaccine"
            }
          ]
        },
        "manufacturer": {
          "display": "Health LS - Immuno Inc."
        },
        "route": {
          "coding": [
            {
              "code": "C28161",
              "system": "urn:oid:2.16.840.1.113883.3.26.1.1",
              "display": "Intramuscular injection"
            }
          ]
        },
        "doseQuantity": {
          "value": 50,
          "unit": "mcg"
        },
        "lotNumber": "AAJN11K"
      },
      "search": {
        "mode": "match"
      }
    }
  ]
}
```

### 400

Request could not be processed or failed validation

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `resourceType` | string | Yes | Identifies the type of the resource. Value: OperationOutcome |
| `issue` | Array of object | Yes | A structured respresentation of the error that occurred |
| `issue[].severity` | string | Yes | Generally `error` or `fatal` Possible values: fatal, error, warning, information |
| `issue[].code` | string | Yes | A FHIR category code that describes the general type of issue. See http://hl7.org/fhir/ValueSet/issue-type for details |
| `issue[].id` | string | No | If the error occurs in the RedoxEngine, this corresponds to an Error record in the organization. |
| `issue[].details` | object | No | Additional details about the error. This may be a text description of the error or a system code that identifies the error. |
| `issue[].details.coding` | Array of object | No | A more granular FHIR code for the specific error. Typically from http://hl7.org/fhir/ValueSet/operation-outcome |
| `issue[].details.coding[].system` | string | No | The identification of the code system that defines the meaning of the symbol in the code. |
| `issue[].details.coding[].code` | string | No | A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). |
| `issue[].details.text` | string | No | A human-readable interpretation of the issue code |
| `issue[].diagnostics` | string | No | Additional diagnostic information about the issue. |

```json
{
  "resourceType": "OperationOutcome",
  "issue": [
    {
      "severity": "fatal",
      "code": "invalid",
      "details": {
        "coding": [
          {
            "code": "MSG_BAD_SYNTAX",
            "system": "http://terminology.hl7.org/CodeSystem/operation-outcome"
          }
        ],
        "text": "Invalid content found in request body."
      }
    }
  ]
}
```

### 401

Authorization is required

Same fields as 400.

```json
{
  "resourceType": "OperationOutcome",
  "issue": [
    {
      "severity": "fatal",
      "code": "unknown",
      "details": {
        "coding": [
          {
            "code": "MSG_AUTH_REQUIRED",
            "system": "http://terminology.hl7.org/CodeSystem/operation-outcome"
          }
        ],
        "text": "Invalid authorization token"
      }
    }
  ]
}
```

### 500

Internal server error

Same fields as 400.

```json
{
  "resourceType": "OperationOutcome",
  "issue": [
    {
      "severity": "fatal",
      "code": "processing",
      "details": {
        "coding": [
          {
            "code": "MSG_RESOURCE_ID_FAIL",
            "system": "http://terminology.hl7.org/CodeSystem/operation-outcome"
          }
        ],
        "text": "Unable to allocate resource id."
      }
    }
  ]
}
```

### 503

Service unavailable

Same fields as 400.

```json
{
  "resourceType": "OperationOutcome",
  "issue": [
    {
      "severity": "fatal",
      "code": "transient",
      "details": {
        "text": "System is unable to process this message at this time."
      }
    }
  ]
}
```
