Clinical resources
Immunization
Learn about the Immunization resource for vaccination records.
Set up the SDK server client to run the examples using esus. The REST examples use a session token. To run them with the SDK’s API key, send X-API-Key instead of Authorization.
The Immunization resource records vaccine administration: which vaccine was given, when, and who administered it.
API convention: the patient, encounter, and location references are sent as flat string fields (
patientId,encounterId,locationId). Performer references use the standard FHIR shape. All ids are raw UUIDs (v4).
Creating an Immunization Record
curl -X POST https://api.esus.health/fhir/Immunization \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/fhir+json" \
-d '{
"status": "completed",
"patientId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"vaccineCode": {
"coding": [{
"system": "http://hl7.org/fhir/sid/cvx",
"code": "208",
"display": "COVID-19 mRNA vaccine"
}]
},
"occurrenceDateTime": "2026-04-21",
"primarySource": true,
"lotNumber": "EK5730",
"performer": [
{
"actor": {
"reference": "Practitioner/a7b1c2d3-e4f5-6789-abcd-ef0123456789",
"display": "Dr. Ana Lopez"
}
}
]
}'
const created = await esus.fhir.create("Immunization", {
"status": "completed",
"patientId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"vaccineCode": {
"coding": [
{
"system": "http://hl7.org/fhir/sid/cvx",
"code": "208",
"display": "COVID-19 mRNA vaccine"
}
]
},
"occurrenceDateTime": "2026-04-21",
"primarySource": true,
"lotNumber": "EK5730",
"performer": [
{
"actor": {
"reference": "Practitioner/a7b1c2d3-e4f5-6789-abcd-ef0123456789",
"display": "Dr. Ana Lopez"
}
}
]
});
Required: patientId and vaccineCode. If you omit status, it is stored as completed. The patient, encounter, and location must exist in your organization; otherwise the API answers 400.
Immunization Statuses
| Status | Meaning |
|---|---|
completed | The vaccine was administered |
entered-in-error | Recorded in error |
not-done | The vaccine was not given |
Important Fields
| Field | Description |
|---|---|
patientId | The patient who received the vaccine (UUID) |
vaccineCode | The vaccine administered (CVX or SNOMED codes) |
occurrenceDateTime | Date of administration |
recorded | When it was recorded |
primarySource | true if the data comes from whoever administered the vaccine |
performer[] | Who administered it: actor (reference, required) and optional function |
lotNumber / expirationDate | Lot and expiration |
manufacturer | Manufacturer (reference) |
site / route | Administration site and route (CodeableConcept) |
doseQuantity | Amount administered |
reasonCode[] | Why it was given |
isSubpotent | true if the dose is considered subpotent (can only be sent on create) |
note[] | Free-text notes |
Protocol Applied
{
"protocolApplied": [
{
"series": "Primary series",
"doseNumber": "1",
"targetDisease": [
{
"coding": [{
"system": "http://snomed.info/sct",
"code": "840539006",
"display": "COVID-19"
}]
}
]
}
]
}
doseNumber identifies this dose within a series and must be sent as a string (e.g. "1"). An integer does not match the schema and the API answers 422.
Searching Immunizations
| Parameter | Behavior |
|---|---|
_id | Exact id |
patient | Patient id (<uuid> or Patient/<uuid>) |
encounter | Encounter id |
status | Exact |
vaccine-code | Exact system|code, or partial text |
date | Date of occurrenceDateTime, with optional prefix eq, gt, lt, ge, or le; repeat it for a range (date=ge2026-01-01&date=lt2026-02-01) |
location | Location id |
lot-number | Partial text |
series | Partial text inside protocolApplied |
Page with _count and _offset, and sort with _sort by _lastUpdated, date, or status.
curl "https://api.esus.health/fhir/Immunization?patient=3fa85f64-5717-4562-b3fc-2c963f66afa6&_sort=-date" \
-H "Authorization: Bearer YOUR_TOKEN"
const { resources, total } = await esus.fhir.search("Immunization", {
"patient": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"_sort": "-date"
});
Read, update (PUT/PATCH), delete, and _history work the same as for Patient: see CRUD Operations.
Why Track Immunizations
Immunization records are essential for:
- Patient safety — avoiding duplicate doses
- Public health tracking
- School and travel requirements
- Knowing when the next dose is due