Lab Report Template

Introduction #

The LabReportTemplate, LabReportTemplateField, and LabReportTemplateFieldOption models represent the templates used for point-of-care (POC) labs and custom lab reports. Templates define the structure of a lab report, including what fields need to be filled in and what options are available for each field.

Basic Usage #

To retrieve a LabReportTemplate by identifier, use the get method on the model manager:

from canvas_sdk.v1.data.lab import LabReportTemplate

template = LabReportTemplate.objects.get(id="d2194110-5c9a-4842-8733-ef09ea5ead11")

To access the fields defined in a template:

from canvas_sdk.v1.data.lab import LabReportTemplate

template = LabReportTemplate.objects.get(id="d2194110-5c9a-4842-8733-ef09ea5ead11")
fields = template.fields.all()

Filtering #

Templates can be filtered by any attribute on the models.

By active status #

from canvas_sdk.v1.data.lab import LabReportTemplate

# Get all active templates
active_templates = LabReportTemplate.objects.active()

# Get inactive templates
inactive_templates = LabReportTemplate.objects.inactive()

By type #

from canvas_sdk.v1.data.lab import LabReportTemplate

# Get custom (user-created) templates
custom = LabReportTemplate.objects.custom()

# Get built-in (system) templates
builtin = LabReportTemplate.objects.builtin()

# Get point-of-care test templates
poc = LabReportTemplate.objects.point_of_care()

By search #

from canvas_sdk.v1.data.lab import LabReportTemplate

results = LabReportTemplate.objects.search("glucose")

Attributes #

LabReportTemplate #

Field NameType
idUUID
dbidInteger
nameString
codeString
code_systemString
search_keywordsString
activeBoolean
customBoolean
pocBoolean
fieldsLabReportTemplateField[]

LabReportTemplateField #

Field NameType
dbidInteger
report_templateLabReportTemplate
sequenceInteger
codeString
code_systemString
labelString
unitsString
typeFieldType
requiredBoolean
optionsLabReportTemplateFieldOption[]

LabReportTemplateFieldOption #

Field NameType
dbidInteger
fieldLabReportTemplateField
labelString
keyString

Enumeration types #

FieldType #

ValueLabel
floatFloat
selectSelect
textText
checkboxCheckbox
radioRadio
arrayArray
labReportLab Report
remoteFieldsRemote Fields
autocompleteAutocomplete
dateDate