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
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.