PatientAdministrativeDocument

PatientAdministrativeDocument #

The PatientAdministrativeDocument model represents patient-facing administrative documents: prior authorizations, advance directives and beneficiary notices, signed consent forms and agreements, insurance and prescription cards, driver’s licenses, intake forms, releases of information, powers of attorney, and workers’ compensation attachments. Each carries a document file and an optional DocumentCoding.

A signed consent form is one of these records: patient_consents lists the PatientConsent records it was signed for. The blank template the patient was sent lives on the consent itself, not here.

Basic Usage #

from canvas_sdk.v1.data import PatientAdministrativeDocument

# Get all administrative documents
documents = PatientAdministrativeDocument.objects.all()

# Get a specific record by its id
document = PatientAdministrativeDocument.objects.get(id="d2194110-5c9a-4842-8733-ef09ea5ead11")

# Get a patient's administrative documents
patient_documents = PatientAdministrativeDocument.objects.filter(
    patient__id="1eed3ea2a8d546a1b681a2a45de1d790"
)

Filtering #

Patient administrative documents can be filtered by any attribute that exists on the model.

By patient #

from canvas_sdk.v1.data import PatientAdministrativeDocument, Patient

patient = Patient.objects.get(id="b80b1cdc2e6a4aca90ccebc02e683f35")
documents = PatientAdministrativeDocument.objects.filter(patient=patient)

Accessing the document file #

The document_url property returns a presigned S3 URL for securely accessing the document file, or None when no file is present.

from canvas_sdk.v1.data import PatientAdministrativeDocument

document = PatientAdministrativeDocument.objects.exclude(document="").first()

# Returns a presigned S3 URL (valid for 1 hour)
url = document.document_url

The document reference #

Each record also has a DocumentReference pointing back at it — the record that carries the document’s coding, category and status, and that represents it in the FHIR API. document_url above is the direct route to the file itself; reach for the document reference when you want that surrounding metadata.

Resolve the ContentType at runtime from its stable app_label and model — never hardcode the per-environment dbid — and match object_id against the record’s dbid:

from canvas_sdk.v1.data import ContentType, DocumentReference, PatientAdministrativeDocument

record = PatientAdministrativeDocument.objects.get(
    id="d2194110-5c9a-4842-8733-ef09ea5ead11"
)

content_type = ContentType.objects.filter(
    app_label="api", model="patientadministrativedocument"
).first()

document = DocumentReference.objects.filter(
    content_type=content_type, object_id=record.dbid
).first()

Document codings #

The code field comes from the document’s type, which is drawn from a fixed list rather than set freely — either the type selected in Data Integration, or, when a document is created through the FHIR DocumentReference endpoint, the LOINC code supplied in type.coding, which must match one of the codes below. Every coding uses the LOINC system (http://loinc.org). The document types stored as patient administrative documents are:

Document typeCodeDisplay
Advance Beneficiary Notice53243-2Advanced beneficiary notice
Advance Directive42348-3Advance directives
Commercial Driver License53245-7Driver license
Insurance Card Image64290-0Health insurance card
Insurer Prior Authorization52034-6Payer letter
Patient Agreement80570-5Agreement
Patient Consent Documents59284-0Consent Document
Power of Attorney64298-3Power of attorney
Provider Order46209-3Provider orders
Release of Information Request101904-1Release of Information request
Uncategorized Administrative Document51851-4Administrative note
Workers Compensation Documents52070-0Workers compensation attachment
Disability Formnone
Handicap Parking Permitnone
Medicaid Documentsnone
Patient Assistance Documentsnone
Patient Intake Formnone
Prescription Card Documentsnone

Clinical document types are stored as UncategorizedClinicalDocument instead. Lab reports, imaging reports and specialist consult reports have their own models, so their codings never appear here.

Attributes #

PatientAdministrativeDocument #

Field NameType
idUUID
dbidInteger
createdDateTime
modifiedDateTime
patientPatient
originatorCanvasUser
assigned_byCanvasUser
teamTeam
integration_task_reviewIntegrationTaskReview
codeDocumentCoding
nameString
review_modeDocumentReviewMode
junkedBoolean
assigned_dateDateTime
team_assigned_dateDateTime
original_dateDate
commentString
priorityBoolean
documentString
document_urlString (property) — presigned S3 URL or None
patient_consentsQuerySet[PatientConsent] — the consents this document is a signed copy of

DocumentCoding #

A coding entry representing the type of document. Also used by UncategorizedClinicalDocument.

Field NameType
dbidInteger
systemString
versionString
codeString
displayString
user_selectedBoolean