EducationalMaterial

Introduction #

The EducationalMaterial model represents patient educational material recorded on a note through the Educational Material command — the selected article, its title and abstract, and the languages it is available in. It is a read-only data model.

Records are returned regardless of command state, so staged commands are included; use committed() to limit results to committed commands.

Basic Usage #

EducationalMaterial records can be retrieved by their UUID id, their integer dbid, or through a patient.

from canvas_sdk.v1.data import EducationalMaterial

# Get all educational material records
materials = EducationalMaterial.objects.all()

# Get a specific record by its UUID id
material = EducationalMaterial.objects.get(id="c9a7b1e2-d4f3-4e6a-8b5c-0d1e2f3a4b5c")

If you have a Patient object, its educational material records can be accessed with the education_material reverse relation:

from canvas_sdk.v1.data import Patient

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

Filtering #

By attribute #

from canvas_sdk.v1.data import EducationalMaterial

materials = EducationalMaterial.objects.filter(selected_language="en-us")

Committed records #

The committed method returns records that have been committed and not entered in error:

from canvas_sdk.v1.data import EducationalMaterial

committed = EducationalMaterial.objects.committed()

Accessing the article PDF #

EducationalMaterial holds the article’s metadata — its title, abstract, and languages — not the article file itself. When the command is committed, Canvas renders the article to a PDF and attaches it to a DocumentReference with the LOINC type 34895-3 (Education note).

To read a patient’s education note PDFs, filter DocumentReference by that type and use its document_url:

from canvas_sdk.v1.data import DocumentReference

education_notes = DocumentReference.objects.for_patient(
    "1eed3ea2a8d546a1b681a2a45de1d790"
).filter(type__code="34895-3")

for note in education_notes:
    url = note.document_url

Attributes #

EducationalMaterial #

Field NameType
idUUID
dbidInteger
createdDateTime
modifiedDateTime
originatorCanvasUser
committerCanvasUser
entered_in_errorCanvasUser
patientPatient
noteNote
article_idString
selected_languageEducationalMaterialLanguage
titleString
languagesString[]
abstractString

selected_language defaults to en-us.

languages holds the locale codes the article is available in, drawn from the same set of codes as EducationalMaterialLanguage. It is stored as a plain array of strings rather than an enum, so compare against the code values ("es-us") rather than expecting enum members.

Enumeration types #

EducationalMaterialLanguage #

ValueLabel
en-usEnglish
es-usSpanish
en-caEnglish CA
fr-caFrench CA
fr-frFrench FR
da-dkDanish DK
ar-egArabic Egypt
ar-usArabic
bn-usBengali
bs-baBosnian
bs-usBosnian
fa-irFarsi Iran
fa-usFarsi
hr-hrCroatian
ht-usHaitian
ko-usKorean
ru-ruRussian
ru-usRussian
sr-usSerbian
so-soSomalia
so-usSomalia
tl-usTagalog
vi-vnVietnamese
vi-usVietnamese
zh-cnChinese
zh-usChinese