Immunization

Introduction #

The Immunization model represents a record of immunization events and immunization statements for a patient. Immunizations can be actively administered medications or historical records of immunizations received elsewhere. The ImmunizationStatement model represents historical immunization records and vaccination history.

Basic usage #

To get an immunization by identifier, use the get method on the Immunization model manager:

from canvas_sdk.v1.data.immunization import Immunization

immunization = Immunization.objects.get(id="b80b1cdc-2e6a-4aca-90cc-ebc02e683f35")

If you have a patient object, the immunizations for a patient can be accessed with the immunizations attribute on a Patient object:

from canvas_sdk.v1.data.patient import Patient

patient = Patient.objects.get(id="1eed3ea2a8d546a1b681a2a45de1d790")
immunizations = patient.immunizations.all()

If you have a patient ID, you can get the immunizations for the patient with the for_patient method on the Immunization model manager:

from canvas_sdk.v1.data.immunization import Immunization

patient_id = "1eed3ea2a8d546a1b681a2a45de1d790"
immunizations = Immunization.objects.for_patient(patient_id)

Codings #

The codings for an immunization can be accessed with the codings attribute on an Immunization object:

from canvas_sdk.v1.data.immunization import Immunization
from logger import log

immunization = Immunization.objects.get(id="b80b1cdc-2e6a-4aca-90cc-ebc02e683f35")

for coding in immunization.codings.all():
    log.info(f"system:  {coding.system}")
    log.info(f"code:    {coding.code}")
    log.info(f"display: {coding.display}")

Filtering #

Immunizations can be filtered by any attribute that exists on the model.

Filtering for immunizations is done with the filter method on the Immunization model manager.

By attribute #

Specify an attribute with filter to filter by that attribute:

from canvas_sdk.v1.data.immunization import Immunization

immunizations = Immunization.objects.filter(status="completed")

By ValueSet #

Filtering by ValueSet works a little differently. The find method on the model manager is used to perform ValueSet filtering:

from canvas_sdk.v1.data.immunization import Immunization
from canvas_sdk.value_set.v2022.immunization import InfluenzaVaccine

immunizations = Immunization.objects.find(InfluenzaVaccine)

Immunization Statements #

To work with immunization statements (historical records), use the ImmunizationStatement model:

from canvas_sdk.v1.data.immunization import ImmunizationStatement

patient_id = "1eed3ea2a8d546a1b681a2a45de1d790"
immunization_statements = ImmunizationStatement.objects.for_patient(patient_id)

Attributes #

Immunization #

Field NameType
idUUID
dbidInteger
patientPatient
noteNote
statusImmunizationStatus
lot_numberString
manufacturerString
exp_date_originalString
exp_dateDate
sig_originalString
date_orderedDate
given_byStaff
consent_givenBoolean
take_quantityFloat
dose_formString
routeString
frequency_normalized_per_dayFloat
deletedBoolean
codingsImmunizationCoding[]

ImmunizationCoding #

Field NameType
dbidInteger
systemString
versionString
codeString
displayString
user_selectedBoolean
immunizationImmunization

ImmunizationStatement #

Field NameType
idUUID
dbidInteger
patientPatient
noteNote
date_originalString
dateDate
evidenceString
commentString
reason_not_givenImmunizationReasonsNotGiven
deletedBoolean
codingImmunizationStatementCoding[]

ImmunizationStatementCoding #

Field NameType
dbidInteger
systemString
versionString
codeString
displayString
user_selectedBoolean
immunization_statementImmunizationStatement

Enumeration types #

ImmunizationStatus #

ValueLabel
in-progressIn Progress
on-holdon-hold
completedcompleted
stoppedstopped

ImmunizationReasonsNotGiven #

ValueLabel
NAnot applicable
IMMUNEimmunity
MEDPRECmedical precaution
OSTOCKproduct out of stock
PATOBJpatient objection