DocumentReference

A reference to a document of any kind for any purpose. Provides metadata about the document so that the document can be discovered and managed. The scope of a document is any seralized object with a mime-type, so includes formal patient centric documents (CDA), cliical notes, scanned paper, and non-patient specific documents like policy text.

http://hl7.org/fhir/us/core/STU3.1.1/StructureDefinition-us-core-documentreference.html

PDFs are generated for lab reports, imaging reports and invoicing associated with a patient.

Attributes

id
string required

The identifier of the document reference

identifier
array[json]

Other identifiers for the document

status
string

The status of the document reference. Supported values are: current, superseded and entered-in-error.

type
json

A coding for the type of document

category
array[json]

The categorization of the document. Supported category codes are: labreport, imagingreport, educationalmaterial and invoicefull.

subject
json

Who/what is the subject of the document

date
date

When this document reference was created

author
array[json]

Who and/or what authored the document

custodian
json

Organization which maintains the document

content
array[json]

Document referenced

context
json

Clinical context of document

get
/DocumentReference/{id}

DocumentReference read

Path Parameters

id required
string
The unique identifier for the DocumentReference

Responses

200 OK
Request was successful.

Errors

401 Unauthorized
The request requires user authentication.
403 Forbidden
The request requires user authorization.
404 Not Found
The requested resource was not found.

Query Parameters

_id
string

A Canvas-issued unique identifier

category
string

Categorization of document

date
date

The date the document was created

patient
string

The patient associated with the document

status
string

The status of the document reference

subject
string

The patient associated with the document. Can be used interchangeably with the patient parameter.

type
string

Kind of document (LOINC if possible)

Responses

200 OK
Request was successful.

Errors

400 Bad Request
The request was invalid or cannot be otherwise served. An accompanying error message will explain further.
401 Unauthorized
The request requires user authentication.
403 Forbidden
The request requires user authorization.
  • curl --request GET \
         --url 'https://fumage-example.canvasmedical.com/DocumentReference/<id>' \
         --header 'Authorization: Bearer <token>' \
         --header 'accept: application/json'
    
  • import requests
    
    url = "https://fumage-example.canvasmedical.com/DocumentReference/<id>"
    
    headers = {
        "accept": "application/json",
        "Authorization": "Bearer <token>"
    }
    
    response = requests.get(url, headers=headers)
    
    print(response.text)
    
  • {
        "resourceType": "DocumentReference",
        "id": "6f60ed1c-a6b3-4791-99f0-f618704e33d1",
        "status": "current",
        "type": {
            "coding": [
                {
                    "system": "http://loinc.org",
                    "code": "94093-2",
                    "display": "Itemized bill"
                }
            ]
        },
        "category": [
            {
                "coding": [
                    {
                        "code": "invoicefull"
                    }
                ]
            }
        ],
        "subject": {
            "reference": "Patient/f3d750f5d77d403c96baef6a6055c6e7",
            "type": "Patient"
        },
        "date": "2021-10-27T00:00:00+00:00",
        "author": [
            {
                "reference": "Practitioner/4150cd20de8a470aa570a852859ac87e",
                "type": "Practitioner"
            }
        ],
        "custodian": {
            "reference": "Organization/00000000-0000-0000-0002-000000000000",
            "type": "Organization"
        },
        "content": [
            {
                "attachment": {
                    "contentType": "application/pdf",
                    "url": "https://canvas-client-media.s3.amazonaws.com/training/invoices/f3d750f5d77d403c96baef6a6055c6e7_20211027_193132.pdf?AWSAccessKeyId=xxxx&Signature=xxxx&Expires=xxxx"
                },
                "format": {
                    "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem",
                    "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient",
                    "display": "mimeType Sufficient"
                }
            }
        ]
    }
    
  • {
      "resourceType": "OperationOutcome",
      "issue": [
        {
          "severity": "error",
          "code": "unknown",
          "details": {
            "text": "Authentication failed"
          }
        }
      ]
    }
    
  • {
      "resourceType": "OperationOutcome",
      "issue": [
        {
          "severity": "error",
          "code": "forbidden",
          "details": {
            "text": "Authorization failed"
          }
        }
      ]
    }
    
  • {
      "resourceType": "OperationOutcome",
      "issue": [
        {
          "severity": "error",
          "code": "not-found",
          "details": {
            "text": "Unknown DocumentReference resource '9b814d81-fb56-456b-a46d-c67fdaaec2ac'"
          }
        }
      ]
    }
    
  • curl --request GET \
         --url 'https://fumage-example.canvasmedical.com/DocumentReference?subject=Patient%2Fcfd91cd3bd9046db81199aa8ee4afd7f&status=current&type=http%3A%2F%2Floinc.org%7C11502-2' \
         --header 'Authorization: Bearer <token>' \
         --header 'accept: application/json'
    
  • import requests
    
    url = "https://fumage-example.canvasmedical.com/DocumentReference?subject=Patient%2Fcfd91cd3bd9046db81199aa8ee4afd7f&status=current&type=http%3A%2F%2Floinc.org%7C11502-2"
    
    headers = {
        "accept": "application/json",
        "Authorization": "Bearer <token>"
    }
    
    response = requests.get(url, headers=headers)
    
    print(response.text)
    
  • {
        "resourceType": "Bundle",
        "type": "searchset",
        "total": 1,
        "link":
        [
            {
                "relation": "self",
                "url": "/DocumentReference?subject=Patient%2Fcfd91cd3bd9046db81199aa8ee4afd7f&status=current&type=http%3A%2F%2Floinc.org%7C11502-2&_count=10&_offset=0"
            },
            {
                "relation": "first",
                "url": "/DocumentReference?subject=Patient%2Fcfd91cd3bd9046db81199aa8ee4afd7f&status=current&type=http%3A%2F%2Floinc.org%7C11502-2&_count=10&_offset=0"
            },
            {
                "relation": "last",
                "url": "/DocumentReference?subject=Patient%2Fcfd91cd3bd9046db81199aa8ee4afd7f&status=current&type=http%3A%2F%2Floinc.org%7C11502-2&_count=10&_offset=0"
            }
        ],
        "entry":
        [
            {
                "resource":
                {
                    "resourceType": "DocumentReference",
                    "id": "1cd418c3-3d7b-4b6e-a5d5-75efc9eae27e",
                    "status": "current",
                    "type":
                    {
                        "coding":
                        [
                            {
                                "system": "http://loinc.org",
                                "code": "11502-2",
                                "display": "Laboratory report"
                            }
                        ]
                    },
                    "category":
                    [
                        {
                            "coding":
                            [
                                {
                                    "code": "labreport"
                                }
                            ]
                        }
                    ],
                    "subject":
                    {
                        "reference": "Patient/cfd91cd3bd9046db81199aa8ee4afd7f",
                        "type": "Patient"
                    },
                    "date": "2023-09-18T00:00:00+00:00",
                    "author":
                    [
                        {
                            "reference": "Practitioner/4150cd20de8a470aa570a852859ac87e",
                            "type": "Practitioner"
                        }
                    ],
                    "custodian":
                    {
                        "reference": "Organization/00000000-0000-0000-0002-000000000000",
                        "type": "Organization"
                    },
                    "content":
                    [
                        {
                            "attachment":
                            {
                                "contentType": "application/pdf",
                                "url": "https://canvas-client-media.s3.amazonaws.com/instance/documents/5-Hiaa_Plasma_WgIqY6E.pdf?AWSAccessKeyId=xxx&Signature=xxxx&Expires=xxxx"
                            },
                            "format":
                            {
                                "system": "http://ihe.net/fhir/ValueSet/IHE.FormatCode.codesystem",
                                "code": "urn:ihe:iti:xds:2017:mimeTypeSufficient",
                                "display": "mimeType Sufficient"
                            }
                        }
                    ],
                    "context":
                    {
                        "encounter":
                        [
                            {
                                "reference": "Encounter/ca757171-c26c-4a83-ad02-d9d44024e01e",
                                "type": "Encounter"
                            }
                        ],
                        "period":
                        {
                            "start": "2023-09-18T23:38:43.252179+00:00"
                        }
                    }
                }
            }
        ]
    }
    
  • {
      "resourceType": "OperationOutcome",
      "issue": [
        {
          "severity": "error",
          "code": "invalid",
          "details": {
            "text": "Bad request"
          }
        }
      ]
    }
    
  • {
      "resourceType": "OperationOutcome",
      "issue": [
        {
          "severity": "error",
          "code": "unknown",
          "details": {
            "text": "Authentication failed"
          }
        }
      ]
    }
    
  • {
      "resourceType": "OperationOutcome",
      "issue": [
        {
          "severity": "error",
          "code": "forbidden",
          "details": {
            "text": "Authorization failed"
          }
        }
      ]
    }