Staff objects are commonly used in related models, for example the Task model. To see all of a staff member’s assigned or created tasks, the following code can be used:
To show a Staff full name, credentialed name, the topmost clinical role or top role abbreviation use the properties full_name, credentialed_name, top_clinical_role or top_role_abbreviation.
fromcanvas_sdk.v1.data.staffimportStaffstaff=Staff.objects.get(id="4150cd20de8a470aa570a852859ac87e")staff.full_name# Larry Weed
staff.credentialed_name# Larry Weed MD
staff.top_clinical_role.name# Physician
staff.top_role_abbreviation# MD
When a staff member holds more than one role, top_clinical_role looks only at roles in a clinical domain — those whose domain is CLINICAL or HYBRID — and returns the one with the highest domain_privilege_level. Administrative roles are never selected, even if they carry a higher privilege level. If the staff member has no clinical or hybrid roles, both top_clinical_role and top_role_abbreviation are None. Because credentialed_name appends top_role_abbreviation, it reflects the same highest-privilege clinical role.
To get Staff licenses.
fromcanvas_sdk.v1.data.staffimportStaffstaff=Staff.objects.get(id="4150cd20de8a470aa570a852859ac87e")staff.licenses.all()# <QuerySet [<StaffLicense: CA License for Larry Weed>]>
The signature_url property returns a presigned S3 URL for securely accessing the staff member’s signature file, when one is on file. If no signature has been uploaded, the property returns None.
fromcanvas_sdk.v1.data.staffimportStaffstaff=Staff.objects.get(id="4150cd20de8a470aa570a852859ac87e")# Returns a presigned S3 URL (valid for 1 hour) or None
url=staff.signature_url
StaffMetadata is a free-form key/value store on a staff member, mirroring PatientMetadata. The (staff, key) pair is unique, so a given key has at most one value per staff member; use the StaffMetadata effect to upsert it from a plugin.
full_name: The staff member’s first and last name (for example, Larry Weed).
credentialed_name: The staff member’s full name suffixed with their topmost credential abbreviation (for example, Larry Weed MD).
top_clinical_role: The staff member’s highest-ranking clinical StaffRole, selected by privilege level when they hold more than one, or None if they have no clinical role.
top_role_abbreviation: The public credential abbreviation of the top_clinical_role (for example, MD), or None if there is no clinical role.
photo_url: The URL of the staff member’s photo, if available, or a placeholder image URL.
signature_url: A presigned S3 URL for the staff member’s signature file (valid for 1 hour), or None if no signature is on file.