Vaccine

Introduction #

The Vaccine model represents an entry in a Canvas instance’s vaccine catalog — what a provider can choose when documenting an Immunize command. VaccineLot represents a physical lot of one of those vaccines, along with how many doses remain on hand.

Basic usage #

A vaccine carries the CPT and CVX codes that identify it. The CVX code is on the vaccine; the CPT codes come from its charges, and those charges are what produce the billing line item when an Immunize command is committed.

from canvas_sdk.v1.data import Vaccine

vaccine = Vaccine.objects.filter(active=True, cvx_code="135").first()
print(vaccine.cvx_code, [charge.cpt_code for charge in vaccine.charges.all()])
# 135 ["90662"]

Each physical lot of a vaccine tracks how many doses remain, and committing an Immunize command decrements that count:

from canvas_sdk.v1.data import VaccineLot

lot = VaccineLot.objects.filter(lot_number="LOT-135-001").first()
print(lot.vaccine.short_name, lot.on_hand_inventory, lot.expiration_date)
# Fluzone High-Dose 25 2027-06-30

mvx_code holds a CDC MVX manufacturer code. The codes are declared as the field’s choices, so Django’s display helper resolves the manufacturer name:

from canvas_sdk.v1.data import VaccineLot

lot = VaccineLot.objects.filter(lot_number="LOT-135-001").first()
print(lot.mvx_code, "->", lot.get_mvx_code_display())
# ASZ -> AstraZeneca

Some instances record a single stock figure on the vaccine itself rather than tracking lots. That value lives in Vaccine.inventory as free text and is independent of VaccineLot.on_hand_inventory.

Filtering #

A vaccine is selectable on a note when it is active and carries an active CPT charge. Filtering the same way keeps a plugin in step with what a provider would see:

from datetime import date

from django.db.models import Q

from canvas_sdk.v1.data import Vaccine

today = date.today()
selectable = Vaccine.objects.filter(
    Q(active=True),
    Q(charges__effective_date__lte=today),
    Q(charges__end_date__isnull=True) | Q(charges__end_date__gte=today),
).distinct()
print([vaccine.short_name for vaccine in selectable])
# ["Fluzone High-Dose", "Trumenba", "Prevnar 13™"]

Lots are administrable while they have doses on hand:

from canvas_sdk.v1.data import VaccineLot

in_stock = VaccineLot.objects.filter(vaccine__cvx_code="135", on_hand_inventory__gt=0)
print([(lot.lot_number, lot.on_hand_inventory) for lot in in_stock])
# [("LOT-135-001", 25)]

Attributes #

Vaccine #

Field NameType
idUUID
dbidInteger
createdDateTime
modifiedDateTime
payerTransactor
chargesQuerySet[ChargeDescriptionMaster]
cvx_codeString
nameString
short_nameString
inventoryString
ndc_codeString
mvx_codeVaccineManufacturer
routeString
activeBoolean
unitsInteger
lotsQuerySet[VaccineLot]

A vaccine may appear more than once for the same cvx_code — instances commonly carry a payer-specific entry alongside a general one. Use payer to tell them apart.

VaccineLot #

Field NameType
idUUID
dbidInteger
createdDateTime
modifiedDateTime
vaccineVaccine
lot_numberString
ndc_codeString
mvx_codeVaccineManufacturer
expiration_dateDate
diluent_lot_numberString
diluent_expiration_dateDate
starting_inventoryInteger
quantity_adjustmentInteger
adjustment_notesString
on_hand_inventoryInteger
used_inventoryInteger

on_hand_inventory is derived from starting_inventory + quantity_adjustment - used_inventory.

Enumeration types #

VaccineManufacturer #

CDC MVX manufacturer codes. Prefer get_mvx_code_display() over mapping these yourself.

ValueLabel
ASZAstraZeneca
BBIBharat Biotech International Limited
BNBavarian Nordic A/S
BTPBiotest Pharmaceuticals Corporation
CANCanSino Biologics, Inc
DVCDynPort Vaccine Company, LLC
DVXDynavax, Inc
GEOGeoVax Labs, Inc
GRFGrifols
IDBID Biomedical
JNJJohnson and Johnson
JSNJanssen
KEDKedrion Biopharma
KGCKorea Green Cross Corporation
MBLMassachusetts Biologic Laboratories
MDOMedicago, Inc
MEDMedImmune, Inc. (AstraZeneca)
MIPEmergent BioSolutions
MODModerna US, Inc
MSDMerck and Co., Inc
MSPMSP Vaccine Company - (partnership Merck and Sanofi Pasteur)
NABNABI
NVXNovavax, Inc
OTHOther manufacturer
PAXEmergent Travel Health, Inc (Formerly PaxVax)
PFRPfizer, Inc
PMCSanofi Pasteur
PSCProtein Sciences
SEQSeqirus
SKBGlaxoSmithKline
SNVSinovac
SPHSinopharm-Biotech
TVATEVA Pharmaceuticals USA
UNKUnknown manufacturer
VALValneva
VBIVBI Vaccines, Inc
WALWyeth