Log in Request access

DocumentReference

Write a document — a report, note, or file — onto the patient's chart.

Create-only. user/DocumentReference.c lets your app attach documents to the chart; there is no read, search, update, or delete. The document content travels inline as a base64-encoded attachment. A successful create returns 201 Created with the stored resource and its server-assigned id in the Location header.

Advertises a validated CA Core+ profile.

Access

Mode Interactions Scopes
App launch create user/DocumentReference.c
Backend services create system/DocumentReference.c

Create-only in both authorization modes; your app cannot read documents back.

Attach a PDF report to the chart

POST /DocumentReference 201 Created
Request
curl -X POST "https://sandbox.avaemr.ca/fhir/r4/{partition_id}/DocumentReference" \
  -H "Authorization: Bearer $SMART_ACCESS_TOKEN" \
  -H "Content-Type: application/fhir+json" \
  -H "Accept: application/fhir+json" \
  -d '{
    "resourceType": "DocumentReference",
    "status": "current",
    "type": { "coding": [{ "system": "http://loinc.org", "code": "34133-9", "display": "Summary of episode note" }] },
    "subject": { "reference": "Patient/synthetic-patient-1" },
    "content": [{
      "attachment": {
        "contentType": "application/pdf",
        "data": "<base64-encoded document>",
        "title": "Visit summary"
      }
    }]
  }'
Response · launch context
{
  "resourceType": "DocumentReference",
  "id": "synthetic-docref-1",
  "meta": {
    "profile": ["http://fhir.infoway-inforoute.ca/io/CA-Core/StructureDefinition/documentreference-ca-core|1.1.0"]
  },
  "status": "current",
  "type": { "coding": [{ "system": "http://loinc.org", "code": "34133-9", "display": "Summary of episode note" }] },
  "subject": { "reference": "Patient/synthetic-patient-1" },
  "date": "2026-08-24T10:15:00-04:00",
  "content": [
    {
      "attachment": {
        "contentType": "application/pdf",
        "title": "Visit summary"
      }
    }
  ]
}