Task

post
/Task

Task create

Create a task.

Tasks created through this FHIR Endpoint will display in the patient chart via the tasks icon. Open tasks will also display in the Task Panel.

Attributes

id
string

The identifier of the task

extension
array[json]

An extension that optionally includes the following:

- The team that the task is assigned to. This optional field requires a reference to the team from the Group endpoint. In the Canvas UI, this will display under the field team in the task card.

- A permalink URL to the task.

status
string required

The current status of the task. Supported values are requested, cancelled and completed.

description
string required

Human-readable explanation of task

for
json

Beneficiary of the Task. This must be a Patient reference.

authoredOn
datetime

Task Creation Date. If omitted from the message, it will default to the current timestamp at the time of ingestion.

requester
json required

Who is asking for task to be done. This must be a Practitioner reference.

owner
json

Responsible individual. This must be a Practitioner reference.

intent
string required

Distinguishes whether the task is a proposal, plan or full order. Canvas does not have a mapping for this field, so it should always be set to unknown.

restriction
json

Constraints on fulfillment tasks. In Canvas, this field is used to represent the due date for a task.

note
array[json]

Comments made about the task. For each comment, the following values can be specified:
- The comment’s text
- Timestamp the comment was left. If omitted, this will default to current timestamp at data ingestion.
- Reference to the practitioner that left the specific comment

input
array[json]

Information used to perform the task. This field will add labels to the task in the Canvas UI. If the label doesn’t exist in Canvas already, it will be created.

Responses

201 Created
The server has successfully processed the request; the new resource has been created and is now ready for interaction.

Canvas returns the created resource's id as a UUID within the location header and a null response body.

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.
405 Method Not Allowed
The request performs an operation that is either not supported or allowed.
422 Unprocessable Entity
The request cannot be processed due to semantic issues or conflicts with the database state.
get
/Task/{id}

Task read

Read a Task resource.

Path Parameters

id required
string
The unique identifier for the Task

Response Payload Attributes

id
string

The identifier of the task

extension
array[json]

An extension that optionally includes the following:

- The team that the task is assigned to. This optional field requires a reference to the team from the Group endpoint. In the Canvas UI, this will display under the field team in the task card.

- A permalink URL to the task.

status
string

The current status of the task. Supported values are requested, cancelled and completed.

description
string

Human-readable explanation of task

for
json

Beneficiary of the Task. This must be a Patient reference.

authoredOn
datetime

Task Creation Date. If omitted from the message, it will default to the current timestamp at the time of ingestion.

requester
json

Who is asking for task to be done. This must be a Practitioner reference.

owner
json

Responsible individual. This must be a Practitioner reference.

intent
string

Distinguishes whether the task is a proposal, plan or full order. Canvas does not have a mapping for this field, so it should always be set to unknown.

restriction
json

Constraints on fulfillment tasks. In Canvas, this field is used to represent the due date for a task.

note
array[json]

Comments made about the task. For each comment, the following values can be specified:
- The comment’s text
- Timestamp the comment was left. If omitted, this will default to current timestamp at data ingestion.
- Reference to the practitioner that left the specific comment

input
array[json]

Information used to perform the task. This field will add labels to the task in the Canvas UI. If the label doesn’t exist in Canvas already, it will be created.

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.
put
/Task/{id}

Task update

Update a task.

Any note comments included in the update message body will not be checked if they already exist in Canvas. Canvas will always assume each Note is an addition to the Task Comments.

Omitting the group extension and authoredOn fields in an update body does not delete the contents of that field. They will remain set to the last value they were assigned.

Omitting the description, owner, restriction and input attributes will delete the contents of the field in the Canvas database. In order to have a Task keep the values in these fields after an update, they must be included.

Attributes

id
string

The identifier of the task

extension
array[json]

An extension that optionally includes the following:

- The team that the task is assigned to. This optional field requires a reference to the team from the Group endpoint. In the Canvas UI, this will display under the field team in the task card.

- A permalink URL to the task.

status
string required

The current status of the task. Supported values are requested, cancelled and completed.

description
string required

Human-readable explanation of task

for
json

Beneficiary of the Task. This must be a Patient reference.

authoredOn
datetime

Task Creation Date. If omitted from the message, it will default to the current timestamp at the time of ingestion.

requester
json required

Who is asking for task to be done. This must be a Practitioner reference.

owner
json

Responsible individual. This must be a Practitioner reference.

intent
string required

Distinguishes whether the task is a proposal, plan or full order. Canvas does not have a mapping for this field, so it should always be set to unknown.

restriction
json

Constraints on fulfillment tasks. In Canvas, this field is used to represent the due date for a task.

note
array[json]

Comments made about the task. For each comment, the following values can be specified:
- The comment’s text
- Timestamp the comment was left. If omitted, this will default to current timestamp at data ingestion.
- Reference to the practitioner that left the specific comment

input
array[json]

Information used to perform the task. This field will add labels to the task in the Canvas UI. If the label doesn’t exist in Canvas already, it will be created.

Responses

200 OK
The server has successfully processed the request.

Canvas returns a null response body.

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.
404 Not Found
The requested resource was not found.
405 Method Not Allowed
The request performs an operation that is either not supported or allowed.
412 Precondition Failed
The request depends on a precondition that has not been met.
422 Unprocessable Entity
The request cannot be processed due to semantic issues or conflicts with the database state.

Query Parameters

_id
string

Search by a task id

_sort
string

Triggers sorting of the results by a specific criteria. Accepted values are _id and due-date. Use -_id or -due-date to sort in descending order.

description
string

Search by description

label
string

Search for a task with an associated label

owner
string

Search by task owner

patient
string

Search by patient

requester
string

Search by task requester

status
string

Search by task status

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

id
string

The identifier of the task

extension
array[json]

An extension that optionally includes the following:

- The team that the task is assigned to. This optional field requires a reference to the team from the Group endpoint. In the Canvas UI, this will display under the field team in the task card.

- A permalink URL to the task.

status
string

The current status of the task. Supported values are requested, cancelled and completed.

description
string

Human-readable explanation of task

for
json

Beneficiary of the Task. This must be a Patient reference.

authoredOn
datetime

Task Creation Date. If omitted from the message, it will default to the current timestamp at the time of ingestion.

requester
json

Who is asking for task to be done. This must be a Practitioner reference.

owner
json

Responsible individual. This must be a Practitioner reference.

intent
string

Distinguishes whether the task is a proposal, plan or full order. Canvas does not have a mapping for this field, so it should always be set to unknown.

restriction
json

Constraints on fulfillment tasks. In Canvas, this field is used to represent the due date for a task.

note
array[json]

Comments made about the task. For each comment, the following values can be specified:
- The comment’s text
- Timestamp the comment was left. If omitted, this will default to current timestamp at data ingestion.
- Reference to the practitioner that left the specific comment

input
array[json]

Information used to perform the task. This field will add labels to the task in the Canvas UI. If the label doesn’t exist in Canvas already, it will be created.

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 POST \
         --url 'https://fumage-example.canvasmedical.com/Task' \
         --header 'Authorization: Bearer <token>' \
         --header 'accept: application/json' \
         --header 'content-type: application/json' \
         --data '
    {
        "resourceType": "Task",
        "extension": [
            {
                "url": "http://schemas.canvasmedical.com/fhir/extensions/task-group",
                "valueReference": {
                    "reference": "Group/0c59ba86-dd40-4fde-8179-6e0b91dc617b"
                }
            }
        ],
        "status": "requested",
        "description": "Ask patient for new insurance information.",
        "for": { "reference": "Patient/cfd91cd3bd9046db81199aa8ee4afd7f" },
        "authoredOn": "2023-09-22T14:00:00.000Z",
        "requester": { "reference": "Practitioner/4150cd20de8a470aa570a852859ac87e" },
        "owner": { "reference": "Practitioner/a02cbf2403e140f7bc9a355c6ed420f3" },
        "intent": "unknown",
        "restriction": { "period": { "end": "2023-09-23T14:00:00.000Z" } },
        "note": [
            {
                "text": "Please call patient to update insurance information.",
                "time": "2023-09-22T14:00:00.000Z",
                "authorReference": { "reference": "Practitioner/4150cd20de8a470aa570a852859ac87e" }
            }
        ],
        "input": [
            {
                "type": { "text": "label" },
                "valueString": "Urgent"
            }
        ]
    }
    '
    
  • import requests
    
    url = "https://fumage-example.canvasmedical.com/Task"
    
    payload = {
        "resourceType": "Task",
        "extension": [
            {
                "url": "http://schemas.canvasmedical.com/fhir/extensions/task-group",
                "valueReference": {
                    "reference": "Group/0c59ba86-dd40-4fde-8179-6e0b91dc617b"
                }
            }
        ],
        "status": "requested",
        "description": "Ask patient for new insurance information.",
        "for": { "reference": "Patient/cfd91cd3bd9046db81199aa8ee4afd7f" },
        "authoredOn": "2023-09-22T14:00:00.000Z",
        "requester": { "reference": "Practitioner/4150cd20de8a470aa570a852859ac87e" },
        "owner": { "reference": "Practitioner/a02cbf2403e140f7bc9a355c6ed420f3" },
        "intent": "unknown",
        "restriction": { "period": { "end": "2023-09-23T14:00:00.000Z" } },
        "note": [
            {
                "text": "Please call patient to update insurance information.",
                "time": "2023-09-22T14:00:00.000Z",
                "authorReference": { "reference": "Practitioner/4150cd20de8a470aa570a852859ac87e" }
            }
        ],
        "input": [
            {
                "type": { "text": "label" },
                "valueString": "Urgent"
            }
        ]
    }
    
    headers = {
        "accept": "application/json",
        "Authorization": "Bearer <token>",
        "content-type": "application/json"
    }
    
    response = requests.post(url, json=payload, headers=headers)
    
    print(response.text)
    
  • null
    
  • {
      "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"
          }
        }
      ]
    }
    
  • {
      "resourceType": "OperationOutcome",
      "issue": [
        {
          "severity": "error",
          "code": "not-supported",
          "details": {
            "text": "Operation is not supported"
          }
        }
      ]
    }
    
  • {
      "resourceType": "OperationOutcome",
      "issue": [
        {
          "severity": "error",
          "code": "business-rule",
          "details": {
            "text": "Unprocessable entity"
          }
        }
      ]
    }
    
  • curl --request GET \
         --url 'https://fumage-example.canvasmedical.com/Task/<id>' \
         --header 'Authorization: Bearer <token>' \
         --header 'accept: application/json'
    
  • import requests
    
    url = "https://fumage-example.canvasmedical.com/Task/<id>"
    
    headers = {
        "accept": "application/json",
        "Authorization": "Bearer <token>"
    }
    
    response = requests.get(url, headers=headers)
    
    print(response.text)
    
  •  {
        "resourceType": "Task",
        "id": "5f72fbcc-10ac-48ff-a2d2-02b229c38ce9",
        "extension":
        [
            {
                "url": "http://schemas.canvasmedical.com/fhir/extensions/task-group",
                "valueReference":
                {
                    "reference": "Group/0c59ba86-dd40-4fde-8179-6e0b91dc617b",
                    "type": "Group",
                    "display": "Payment Collection"
                }
            },
            {
                "url": "http://schemas.canvasmedical.com/fhir/extensions/task-permalink",
                "valueString": "http://example.canvasmedical.com/permalinks/v1/VGFzazo4OTo3MA=="
            }
        ],
        "status": "completed",
        "description": "Ask patient for new insurance information.",
        "for":
        {
            "reference": "Patient/cfd91cd3bd9046db81199aa8ee4afd7f",
            "type": "Patient"
        },
        "authoredOn": "2023-09-22T14:00:00+00:00",
        "requester":
        {
            "reference": "Practitioner/4150cd20de8a470aa570a852859ac87e",
            "type": "Practitioner"
        },
        "owner":
        {
            "reference": "Practitioner/a02cbf2403e140f7bc9a355c6ed420f3",
            "type": "Practitioner"
        },
        "intent": "unknown",
        "restriction":
        {
            "period":
            {
                "end": "2023-09-23T14:00:00+00:00"
            }
        },
        "note":
        [
            {
                "authorReference":
                {
                    "reference": "Practitioner/4150cd20de8a470aa570a852859ac87e",
                    "type": "Practitioner"
                },
                "time": "2023-09-22T14:00:00+00:00",
                "text": "Please call patient to update insurance information."
            }
        ],
        "input":
        [
            {
                "type":
                {
                    "text": "label"
                },
                "valueString": "Urgent"
            }
        ]
    }
    
  • {
      "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 Task resource 'a47c7b0e-bbb4-42cd-bc4a-df259d148ea1'"
          }
        }
      ]
    }
    
  • curl --request PUT \
         --url 'https://fumage-example.canvasmedical.com/Task/<id>' \
         --header 'Authorization: Bearer <token>' \
         --header 'accept: application/json' \
         --header 'content-type: application/json' \
         --data '
    {
        "resourceType": "Task",
        "extension": [
            {
                "url": "http://schemas.canvasmedical.com/fhir/extensions/task-group",
                "valueReference": {
                    "reference": "Group/0c59ba86-dd40-4fde-8179-6e0b91dc617b"
                }
            }
        ],
        "status": "completed",
        "description": "Ask patient for new insurance information.",
        "for": { "reference": "Patient/cfd91cd3bd9046db81199aa8ee4afd7f" },
        "authoredOn": "2023-09-22T14:00:00.000Z",
        "requester": { "reference": "Practitioner/4150cd20de8a470aa570a852859ac87e" },
        "owner": { "reference": "Practitioner/a02cbf2403e140f7bc9a355c6ed420f3" },
        "intent": "unknown",
        "restriction": { "period": { "end": "2023-09-23T14:00:00.000Z" } },
        "note": [
            {
                "text": "Please call patient to update insurance information.",
                "time": "2023-09-22T14:00:00.000Z",
                "authorReference": { "reference": "Practitioner/4150cd20de8a470aa570a852859ac87e" }
            }
        ],
        "input": [
            {
                "type": { "text": "label" },
                "valueString": "Urgent"
            }
        ]
    }
    '
    
  • import requests
    
    url = "https://fumage-example.canvasmedical.com/Task/<id>"
    
    payload = {
        "resourceType": "Task",
        "extension": [
            {
                "url": "http://schemas.canvasmedical.com/fhir/extensions/task-group",
                "valueReference": {
                    "reference": "Group/0c59ba86-dd40-4fde-8179-6e0b91dc617b"
                }
            }
        ],
        "status": "completed",
        "description": "Ask patient for new insurance information.",
        "for": { "reference": "Patient/cfd91cd3bd9046db81199aa8ee4afd7f" },
        "authoredOn": "2023-09-22T14:00:00.000Z",
        "requester": { "reference": "Practitioner/4150cd20de8a470aa570a852859ac87e" },
        "owner": { "reference": "Practitioner/a02cbf2403e140f7bc9a355c6ed420f3" },
        "intent": "unknown",
        "restriction": { "period": { "end": "2023-09-23T14:00:00.000Z" } },
        "note": [
            {
                "text": "Please call patient to update insurance information.",
                "time": "2023-09-22T14:00:00.000Z",
                "authorReference": { "reference": "Practitioner/4150cd20de8a470aa570a852859ac87e" }
            }
        ],
        "input": [
            {
                "type": { "text": "label" },
                "valueString": "Urgent"
            }
        ]
    }
    
    headers = {
        "accept": "application/json",
        "Authorization": "Bearer <token>",
        "content-type": "application/json"
    }
    
    response = requests.put(url, json=payload, headers=headers)
    
    print(response.text)
    
  • null
    
  • {
      "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"
          }
        }
      ]
    }
    
  • {
      "resourceType": "OperationOutcome",
      "issue": [
        {
          "severity": "error",
          "code": "not-found",
          "details": {
            "text": "Unknown Task resource 'a47c7b0e-bbb4-42cd-bc4a-df259d148ea1'"
          }
        }
      ]
    }
    
  • {
      "resourceType": "OperationOutcome",
      "issue": [
        {
          "severity": "error",
          "code": "not-supported",
          "details": {
            "text": "Operation is not supported"
          }
        }
      ]
    }
    
  • {
      "resourceType": "OperationOutcome",
      "issue": [
        {
          "severity": "error",
          "code": "conflict",
          "details": {
            "text": "Resource updated since If-Unmodified-Since date"
          }
        }
      ]
    }
    
  • {
      "resourceType": "OperationOutcome",
      "issue": [
        {
          "severity": "error",
          "code": "business-rule",
          "details": {
            "text": "Unprocessable entity"
          }
        }
      ]
    }
    
  • curl --request GET \
         --url 'https://fumage-example.canvasmedical.com/Task?owner=Practitioner%2Fa02cbf2403e140f7bc9a355c6ed420f3&label=Urgent' \
         --header 'Authorization: Bearer <token>' \
         --header 'accept: application/json'
    
  • import requests
    
    url = "https://fumage-example.canvasmedical.com/Task?owner=Practitioner%2Fa02cbf2403e140f7bc9a355c6ed420f3&label=Urgent"
    
    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": "/Task?owner=Practitioner%2Fa02cbf2403e140f7bc9a355c6ed420f3&label=Urgent&_count=10&_offset=0"
            },
            {
                "relation": "first",
                "url": "/Task?owner=Practitioner%2Fa02cbf2403e140f7bc9a355c6ed420f3&label=Urgent&_count=10&_offset=0"
            },
            {
                "relation": "last",
                "url": "/Task?owner=Practitioner%2Fa02cbf2403e140f7bc9a355c6ed420f3&label=Urgent&_count=10&_offset=0"
            }
        ],
        "entry":
        [
            {
                "resource":
                {
                    "resourceType": "Task",
                    "id": "5f72fbcc-10ac-48ff-a2d2-02b229c38ce9",
                    "extension":
                    [
                        {
                            "url": "http://schemas.canvasmedical.com/fhir/extensions/task-group",
                            "valueReference":
                            {
                                "reference": "Group/0c59ba86-dd40-4fde-8179-6e0b91dc617b",
                                "type": "Group",
                                "display": "Payment Collection"
                            }
                        },
                        {
                            "url": "http://schemas.canvasmedical.com/fhir/extensions/task-permalink",
                            "valueString": "http://example.canvasmedical.com/permalinks/v1/VGFzazo4OTo3MA=="
                        }
                    ],
                    "status": "completed",
                    "description": "Ask patient for new insurance information.",
                    "for":
                    {
                        "reference": "Patient/cfd91cd3bd9046db81199aa8ee4afd7f",
                        "type": "Patient"
                    },
                    "authoredOn": "2023-09-22T14:00:00+00:00",
                    "requester":
                    {
                        "reference": "Practitioner/4150cd20de8a470aa570a852859ac87e",
                        "type": "Practitioner"
                    },
                    "owner":
                    {
                        "reference": "Practitioner/a02cbf2403e140f7bc9a355c6ed420f3",
                        "type": "Practitioner"
                    },
                    "intent": "unknown",
                    "restriction":
                    {
                        "period":
                        {
                            "end": "2023-09-23T14:00:00+00:00"
                        }
                    },
                    "note":
                    [
                        {
                            "authorReference":
                            {
                                "reference": "Practitioner/4150cd20de8a470aa570a852859ac87e",
                                "type": "Practitioner"
                            },
                            "time": "2023-09-22T14:00:00+00:00",
                            "text": "Please call patient to update insurance information."
                        }
                    ],
                    "input":
                    [
                        {
                            "type":
                            {
                                "text": "label"
                            },
                            "valueString": "Urgent"
                        }
                    ]
                }
            }
        ]
    }
    
  • {
      "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"
          }
        }
      ]
    }