Provenance

Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies.

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

In Canvas a Provenance record is created each time the following data types are create or updated in the Canvas database:

  • AllergyIntolerance
  • CarePlan
  • CareTeamMembership
  • Condition
  • ConsolidatedImmunization
  • Device
  • DiagnosticReport
  • DocumentReference
  • Goal
  • Observation
  • Patient
  • Prescription
  • Procedure
  • UpdateGoal
get
/Provenance/{id}

Provenance read

Read a Provenance resource.

Path Parameters

id required
string
The unique identifier for the Provenance

Response Payload Attributes

resourceType
string

The FHIR Resource name.

id
string

The identifier of the Provenance.

target
array[json]

Target Reference(s)

Click to view child attributes
reference
string

The reference string of the target in the format of "Patient/a39cafb9d1b445be95a2e2548e12a787".

type
string

Type the reference refers to (e.g. “Patient”).

Value Options Supported:
  • AllergyIntolerance
  • CarePlan
  • CareTeam
  • Condition
  • Device
  • DiagnosticReport
  • DocumentReference
  • Goal
  • Immunization
  • MedicationRequest
  • Observation
  • Organization
  • Patient
  • Practitioner
  • Procedure
display
string

Text alternative for the resource.

recorded
datetime

When the activity was recorded / updated.

location
json

Where the activity occurred, if relevant. Currently, this will always appear as absent data.

Click to view child attributes
extension
array[json]
Click to view child attributes
url
string
Value Options Supported:
  • http://hl7.org/fhir/StructureDefinition/data-absent-reason
valueCode
string
Value Options Supported:
  • unsupported
activity
json

Activity that occurred. Canvas supports a provenance of the record being either created or updated.

Click to view child attributes
coding
array[json]

Code defined by a terminology system.

Click to view child attributes
system
string

The system url of the coding.

Value Options Supported:
  • http://terminology.hl7.org/CodeSystem/v3-DataOperation
code
string

The code of the activity.

Value Options Supported:
  • CREATE
  • UPDATE
agent
array[json]

Actor involved.

The agent will be populated by the committer or originator in Canvas as the auther. If neither is found, it will default to the Canvas Organization as the composer.

Click to view child attributes
type
json
Click to view child attributes
coding
array[json]

Code defined by a terminology system.

Click to view child attributes
system
string

The system url of the coding.

Value Options Supported:
  • http://hl7.org/fhir/us/core/CodeSystem/us-core-provenance-participant-type
  • http://terminology.hl7.org/CodeSystem/provenance-participant-type
code
string

The code.

Value Options Supported:
  • author
  • composer
display
string

The display name of the coding.

Value Options Supported:
  • Author
  • Composer
who
json
Click to view child attributes
reference
string

The reference string of who the agent is in the format of "Practitioner/a39cafb9d1b445be95a2e2548e12a787". If the reference is Organization/00000000-0000-0000-0002-000000000000, a committer or originator couldn’t be found in Canvas as the agent, so Canvas Medical is the default agent.

type
string

Type the reference refers to (e.g. “Practitioner”, “Organization”).

display
string

Text alternative for the resource.

onBehalfOf
json

Who the agent is representing. This will always be the Canvas Medical Organization.

Click to view child attributes
reference
string

The reference string of who the organization is in the format of "Organization/00000000-0000-0000-0002-000000000000".

type
string

Type the reference refers to (e.g. “Organization”).

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

The identifier of the Provenance.

agent
string

Search by the agent of the Provenance record in the format "Practitioner/a39cafb9d1b445be95a2e2548e12a787" or Organization/00000000-0000-0000-0002-000000000000.

patient
string

Search by provenance records associated to a specific patient in the format Patient/a39cafb9d1b445be95a2e2548e12a787.

target
string

Search by records where the target is a specific patient or observation in the format Patient/a39cafb9d1b445be95a2e2548e12a787 or "Observation/920807d3-034b-4423-a65b-980068cb4bd1".

Response Payload Attributes

resourceType
string

The FHIR Resource name.

type
string

This element and value designate that the bundle is a search response. Search result bundles will always have the Bundle.type of searchset .

total
integer

The number of resources that match the search parameter.

link
array[json]

Attributes relevant to pagination, see our Pagination page for more detail.

Click to view child attributes
relation
enum [self|first|next|last]

The relation of the page search

url

The search url for the specific relation

entry
array[json]

The results bundle that lists out each object returned in the search

Click to view child attributes
resource
json

The attributes specific to the resource type, see the Attributes section below

Attributes

resourceType
string

The FHIR Resource name.

id
string

The identifier of the Provenance.

target
array[json]

Target Reference(s)

Click to view child attributes
reference
string

The reference string of the target in the format of "Patient/a39cafb9d1b445be95a2e2548e12a787".

type
string

Type the reference refers to (e.g. “Patient”).

Value Options Supported:
  • AllergyIntolerance
  • CarePlan
  • CareTeam
  • Condition
  • Device
  • DiagnosticReport
  • DocumentReference
  • Goal
  • Immunization
  • MedicationRequest
  • Observation
  • Organization
  • Patient
  • Practitioner
  • Procedure
display
string

Text alternative for the resource.

recorded
datetime

When the activity was recorded / updated.

location
json

Where the activity occurred, if relevant. Currently, this will always appear as absent data.

Click to view child attributes
extension
array[json]
Click to view child attributes
url
string
Value Options Supported:
  • http://hl7.org/fhir/StructureDefinition/data-absent-reason
valueCode
string
Value Options Supported:
  • unsupported
activity
json

Activity that occurred. Canvas supports a provenance of the record being either created or updated.

Click to view child attributes
coding
array[json]

Code defined by a terminology system.

Click to view child attributes
system
string

The system url of the coding.

Value Options Supported:
  • http://terminology.hl7.org/CodeSystem/v3-DataOperation
code
string

The code of the activity.

Value Options Supported:
  • CREATE
  • UPDATE
agent
array[json]

Actor involved.

The agent will be populated by the committer or originator in Canvas as the auther. If neither is found, it will default to the Canvas Organization as the composer.

Click to view child attributes
type
json
Click to view child attributes
coding
array[json]

Code defined by a terminology system.

Click to view child attributes
system
string

The system url of the coding.

Value Options Supported:
  • http://hl7.org/fhir/us/core/CodeSystem/us-core-provenance-participant-type
  • http://terminology.hl7.org/CodeSystem/provenance-participant-type
code
string

The code.

Value Options Supported:
  • author
  • composer
display
string

The display name of the coding.

Value Options Supported:
  • Author
  • Composer
who
json
Click to view child attributes
reference
string

The reference string of who the agent is in the format of "Practitioner/a39cafb9d1b445be95a2e2548e12a787". If the reference is Organization/00000000-0000-0000-0002-000000000000, a committer or originator couldn’t be found in Canvas as the agent, so Canvas Medical is the default agent.

type
string

Type the reference refers to (e.g. “Practitioner”, “Organization”).

display
string

Text alternative for the resource.

onBehalfOf
json

Who the agent is representing. This will always be the Canvas Medical Organization.

Click to view child attributes
reference
string

The reference string of who the organization is in the format of "Organization/00000000-0000-0000-0002-000000000000".

type
string

Type the reference refers to (e.g. “Organization”).

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/Provenance/<id>' \
         --header 'Authorization: Bearer <token>' \
         --header 'accept: application/json'
    
  • import requests
    
    url = "https://fumage-example.canvasmedical.com/Provenance/<id>"
    
    headers = {
        "accept": "application/json",
        "Authorization": "Bearer <token>"
    }
    
    response = requests.get(url, headers=headers)
    
    print(response.text)
    
  • {
        "resourceType": "Provenance",
        "id": "db1631ed-bcd3-4e43-84a1-7e507e8aa44c",
        "target": [
            {
                "reference": "Patient/b8dfa97bdcdf4754bcd8197ca78ef0f0",
                "type": "Patient"
            }
        ],
        "recorded": "2023-09-18T14:42:14.981528+00:00",
        "activity": {
            "coding": [
                {
                    "system": "http://terminology.hl7.org/CodeSystem/v3-DataOperation",
                    "code": "CREATE"
                }
            ]
        },
        "agent": [
            {
                "type": {
                    "coding": [
                        {
                            "system": "http://terminology.hl7.org/CodeSystem/provenance-participant-type",
                            "code": "composer",
                            "display": "Composer"
                        }
                    ]
                },
                "who": {
                    "reference": "Organization/00000000-0000-0000-0002-000000000000",
                    "type": "Organization",
                    "display": "Canvas Medical"
                },
                "onBehalfOf": {
                    "reference": "Organization/00000000-0000-0000-0002-000000000000",
                    "type": "Organization"
                }
            }
        ]
    }
    
  • {
      "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 Provenance resource 'a47c7b0e-bbb4-42cd-bc4a-df259d148ea1'"
          }
        }
      ]
    }
    
  • curl --request GET \
         --url 'https://fumage-example.canvasmedical.com/Provenance?target=Patient/b8dfa97bdcdf4754bcd8197ca78ef0f0' \
         --header 'Authorization: Bearer <token>' \
         --header 'accept: application/json'
    
  • import requests
    
    url = "https://fumage-example.canvasmedical.com/Provenance?target=Patient/b8dfa97bdcdf4754bcd8197ca78ef0f0"
    
    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": "/Provenance?target=Patient%2Fb8dfa97bdcdf4754bcd8197ca78ef0f0&_count=10&_offset=0"
            },
            {
                "relation": "first",
                "url": "/Provenance?target=Patient%2Fb8dfa97bdcdf4754bcd8197ca78ef0f0&_count=10&_offset=0"
            },
            {
                "relation": "last",
                "url": "/Provenance?target=Patient%2Fb8dfa97bdcdf4754bcd8197ca78ef0f0&_count=10&_offset=0"
            }
        ],
        "entry": [
            {
                "resource": {
                    "resourceType": "Provenance",
                    "id": "db1631ed-bcd3-4e43-84a1-7e507e8aa44c",
                    "target": [
                        {
                            "reference": "Patient/b8dfa97bdcdf4754bcd8197ca78ef0f0",
                            "type": "Patient"
                        }
                    ],
                    "recorded": "2023-09-18T14:42:14.981528+00:00",
                    "activity": {
                        "coding": [
                            {
                                "system": "http://terminology.hl7.org/CodeSystem/v3-DataOperation",
                                "code": "CREATE"
                            }
                        ]
                    },
                    "agent": [
                        {
                            "type": {
                                "coding": [
                                    {
                                        "system": "http://terminology.hl7.org/CodeSystem/provenance-participant-type",
                                        "code": "composer",
                                        "display": "Composer"
                                    }
                                ]
                            },
                            "who": {
                                "reference": "Organization/00000000-0000-0000-0002-000000000000",
                                "type": "Organization",
                                "display": "Canvas Medical"
                            },
                            "onBehalfOf": {
                                "reference": "Organization/00000000-0000-0000-0002-000000000000",
                                "type": "Organization"
                            }
                        }
                    ]
                }
            }
        ]
    }
    
  • {
      "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"
          }
        }
      ]
    }