Device

Introduction #

The Device model represents a type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device.

Basic usage #

To get a device by identifier, use the get method on the Device model manager:

from canvas_sdk.v1.data.device import Device

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

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

from canvas_sdk.v1.data.patient import Patient

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

Codings #

The type codings for a device can be accessed with the codings attribute on a Device object:

from canvas_sdk.v1.data.device import Device
from logger import log

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

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

Filtering #

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

Filtering for devices is done with the filter method on the Device model manager.

By attribute #

Specify an attribute with filter to filter by that attribute:

from canvas_sdk.v1.data.device import Device

devices = Device.objects.filter(manufacturer="ACME Biomedical", lot_number="M320")

Committed devices #

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

from canvas_sdk.v1.data.device import Device

committed_devices = Device.objects.committed()

Attributes #

Device #

Field NameType
idUUID
dbidInteger
createdDateTime
modifiedDateTime
originatorCanvasUser
committerCanvasUser
entered_in_errorCanvasUser
patientPatient
note_idInteger
labeled_contains_NRLBoolean
assigning_authorityString
scoping_entityString
udiString
diString
issuing_agencyString
lot_numberString
brand_nameString
mri_safety_statusString
version_model_numberString
company_nameString
gmdnPTNameString
statusString
expiration_dateDate
expiration_date_originalString
serial_numberString
manufacturing_date_originalString
manufacturing_dateDate
manufacturerString
procedure_idInteger
codingsDeviceCoding[]

DeviceCoding #

Field NameType
dbidInteger
createdDateTime
modifiedDateTime
systemString
versionString
codeString
displayString
user_selectedBoolean
deviceDevice