Task
A task to be performed.
http://hl7.org/fhir/R4/task.html
Endpoints
Attributes
The identifier of the task
The current status of the task. Supported values are requested, cancelled and completed.
Human-readable explanation of task
Task Creation Date. If omitted from the message, it will default to the current timestamp at the time of ingestion.
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.
Constraints on fulfillment tasks. In Canvas, this field is used to represent the due date for a task.
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
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.
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
The identifier of the task
The current status of the task. Supported values are requested, cancelled and completed.
Human-readable explanation of task
Task Creation Date. If omitted from the message, it will default to the current timestamp at the time of ingestion.
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.
Constraints on fulfillment tasks. In Canvas, this field is used to represent the due date for a task.
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
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
Errors
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
The identifier of the task
The current status of the task. Supported values are requested, cancelled and completed.
Human-readable explanation of task
Task Creation Date. If omitted from the message, it will default to the current timestamp at the time of ingestion.
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.
Constraints on fulfillment tasks. In Canvas, this field is used to represent the due date for a task.
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
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
Errors
Task search
Search for a task
Query Parameters
Search by a task id
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.
Search by description
Search for a task with an associated label
Search by task owner
Search by patient
Search by task requester
Search by task status
Responses
Errors
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 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" } } ] }