Appointment

A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s).

https://hl7.org/fhir/R4/appointment.html

This may result in one or more Encounters.

The appointment resource maps to both patient appointments as well as other events in Canvas. Instructions for configuring appointment and note types can be found here.

Related guides:

Attributes

id
string required

The identifier of the appointment

contained
array[json]

Used to store links for telehealth appointments. Requires a reference to “#appointment-meeting-endpoint” in the SupportingInformation attribute.

Click to view child attributes
resourceType
string
id
string
status
string
connectionType
json
payloadType
array[json]
address
string
status
string

The status of the appointment.

Canvas to FHIR Mapping
unconfirmed > proposed
attempted > pending
confirmed > booked
arrived > arrived
roomed > check-in
exited > fulfilled
no-showed > noshow
cancelled > cancelled
deleted > entered-in-error

appointmentType
json

The style of appointment or patient that has been booked in the slot (not service type). Canvas supports configurable apppointment and note types.

Click to view child attributes
coding
array[json]

The type of appointment

reasonCode
array[json]

Coded reason this appointment is scheduled. Canvas supports two ways to specify the reason for vist (RFV): structured and unstructured. Both the coding and text attributes are used for Structured RFVs, whereas unstructured RFVs only leverage the text attribute.

Click to view child attributes
coding
array[json]
text
string
description [deprecated]
string

Shown on a subject line in a meeting request, or appointment list.

Note: This field is being deprecated in favor of reasonCode. The text in reasonCode and this description attribute will always match.

supportingInformation
array[json]

Additional information to support the appointment. References are used to capture information about rescheduled appointments and the location of the appointment.

Rescheduled Appointments
If you see Previously Rescheduled Appointment in supportingInformation, it means that the appointment you are currently reading was created by rescheduling the appointment in that Reference. If you see Rescheduled Replacement Appointment in the supportingInformation, it means that the appointment you are currently reading is now outdated by a new appointment.

Click to view child attributes
reference
string
type
string
start
datetime

When appointment is to take place.

end
datetime

When appointment is to conclude.

participant
array[json]

Participants involved in appointment. Must include at least one entry for a practitioner. An optional 2nd entry may be used for the patient.

The actor.reference: Practitioner/<practitioner_id> maps to the rendering provider in Canvas.

Click to view child attributes
actor
json
status
string
post
/Appointment

Appointment create

Create an Appointment

Prevent Double Booking By default, Canvas does not prevent appointments from being created if there is already an existing appointment for that provider. However, Canvas has a config setting to disable double booking. If double booking is not allowed and the Appointment Create or Appointment Update request is trying to book an appointment for a given Provider that already has a scheduled appointment at that time, you will see a 422 error status with the following error message returned This appointment time is no longer available.

Attributes

id
string required

The identifier of the appointment

contained
array[json]

Custom Meeting Links for Virtual Appointments: You can specify a telehealth meeting link using a SupportingInformation reference of “#appointment-meeting-endpoint” with a type of “Endpoint”. You would need to specify the address url of the meeting link in a contained object along with the resourceType = Endpoint and the id = appointment-meeting-endpoint. All other fields are automatically populated by Canvas and are not required.

Click to view child attributes
resourceType
string
id
string
status
string
connectionType
json
payloadType
array[json]
address
string
status
string

Currently, Canvas only supports creating an appointment with the status “proposed”. Any other input will be ignored. If no status is added it defaults to “proposed”. A status can be updated later using the Appointment Update endpoint.

appointmentType
json

Canvas supports configurable appointment and note types. There are a few things to note with this field:

1.If the appointmentType attribute is omitted from the body completely, the note type that has Is default appointment type will be used (usually Office Visit if unchanged)

2.The appointmentType field must contain one coding, and it must be a SNOMED or INTERNAL coding.

3.If a code that does not exist is passed, you will see a 422 error status with error message Appointment Create Error: Appointment Type does not exist with system: {system} and code: {code}

4. If a code is passed that is not marked as Is Scheduleable, you will get a 422 error status with error message Appointment Create Error: Appointment type must be scheduleable.

Click to view child attributes
coding
array[json]

The type of appointment

reasonCode
array[json]

Canvas only accepts the first item in the reasonCode list.

If you are taking advantage of our structured reason for visit feature, you can provide a coding that Canvas can use to look up the code value in configured in settings and display the structured RFV matching that code. If Appointment.reasonCode[0].coding[0].code is not a valid ReasonForVisitSettingCoding you will get the error “structured reason for visit with code {code} does not exist”.

The text attribute maps to the free text Reason For Visit command. If you are using the structured reason for visit feature, this text will display as the comment in the command. If you are not using the structured reason for visit feature, then only Appointment.reasonCode[0].text needs to be populated in your message - coding should be omitted.

Click to view child attributes
coding
array[json]
text
string
description [deprecated]
string

Shown on a subject line in a meeting request, or appointment list.

Note: This field is being deprecated in favor of reasonCode. The text in reasonCode and this description attribute will always match.

supportingInformation
array[json]

You can use a Location reference within the SupportingInformation attribute to specify the Location of the appointment,. To get the location id, use the Schedule Search endpoint. This will give you a resource.id like Location.1-Staff.c2ff4546548e46ab8959af887b563eab. The Location ID is the value displayed after the period. If your instance only has one practice location, the ID will always be 1.

Click to view child attributes
reference
string
type
string
start
datetime

The start attribute determines the start timestamp of the appointment. It is written in instant format for FHIR. Seconds and milliseconds can be omitted, but YYYY-MM-DDTHH:MM are required.

end
datetime

The end attribute is used with the start timestamp to determine the duration in minutes of the appointment. It is written in instant format for FHIR. Seconds and milliseconds can be omitted, but YYYY-MM-DDTHH:MM are required.

⚠ Currently, Canvas does not provide any validation on this end date. If you have an end_date before the start_date, it will result in a negative duration being displayed on the UI.

participant
array[json]

This list object requires one entry for a practitioner. An optional 2nd entry may be supplied for the patient.

• The first entry has the actor.reference specify Practitioner/<practitioner_id> for the provider. This id can be found through a Practitioner Search. If <practitioner_id> is left blank, the practitioner will be set to Canvas Bot by default.
• The second entry has the actor.reference specify Patient/<patient_id> for the patient this appointment is for. This id can be found through a Patient Search.

Per FHIR, status is required, but it is not used by Canvas. Canvas recommends sending “active”

Click to view child attributes
actor
json
status
string

Responses

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

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
/Appointment/{id}

Appointment read

Read an Appointment

Path Parameters

id required
string
The unique identifier for the Appointment

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
/Appointment/{id}

Appointment update

Update an Appointment This is almost identical to the Appointment Create. The update will only affect fields that are passed in to the body, if any fields are omitted they will be ignored and kept as co are currently set in the Canvas database.

Attributes

id
string required

The identifier of the appointment

contained
array[json]

Custom Meeting Links for Virtual Appointments: You can specify a telehealth meeting link using a SupportingInformation reference of “#appointment-meeting-endpoint” with a type of “Endpoint”. You would need to specify the address url of the meeting link in a contained object along with the resourceType = Endpoint and the id = appointment-meeting-endpoint. All other fields are automatically populated by Canvas and are not required.

Click to view child attributes
resourceType
string
id
string
status
string
connectionType
json
payloadType
array[json]
address
string
status
string

The update endpoint supports the following statuses: proposed, pending, booked, arrived, fulfilled, cancelled, noshow, checked-in

Canvas currently does not support marking an appointment as entered-in-error or waitlist. See Appointment Read for a better understanding of how these FHIR statuses are mapping in Canvas.

Once an appointment’s status is updated to “cancelled” it cannot be changed to a different status. If the status is removed, the update will default to what it was previously set to.

appointmentType
json

Canvas supports configurable appointment and note types. There are a few things to note with this field:

1.If appointmentType attribute is omitted from the body completely, the note type that has Is default appointment type will be used (usually Office Visit if unchanged)

2.The appointmentType field must contain one coding, and it must be a SNOMED or INTERNAL coding.

3.If a code that does not exist is passed, you will see a 422 error status with error message Appointment Create Error: Appointment Type does not exist with system: {system} and code: {code}

4. If a code is passed that is not marked as Is Scheduleable, you will get a 422 error status with error message Appointment Create Error: Appointment type must be scheduleable.

Click to view child attributes
coding
array[json]

The type of appointment

reasonCode
array[json]

In the Canvas UI, if the reasonCode / description is changed, it will update the reason for visit on that appointment. The old reason for visit will be marked as entered-in-error, and the text will no longer display. Below is an example of what an appointment’s note will look like after changing the description multiple times. The originator and entered-in-error will be set to Canvas Bot, which can be seen if you click on the crossed off “Reason for Visit”.

api-update-rfv

Click to view child attributes
coding
array[json]
text
string
description [deprecated]
string

Shown on a subject line in a meeting request, or appointment list.

Note: This field is being deprecated in favor of reasonCode. The text in reasonCode and this description attribute will always match.

supportingInformation
array[json]

Additional information to support the appointment. References are used to capture information about rescheduled appointments and the location of the appointment.

Rescheduled Appointments
If you see Previously Rescheduled Appointment in supportingInformation, it means that the appointment you are currently reading was created by rescheduling the appointment in that Reference. If you see Rescheduled Replacement Appointment in the supportingInformation, it means that the appointment you are currently reading is now outdated by a new appointment.

Click to view child attributes
reference
string
type
string
start
datetime

When appointment is to take place.

end
datetime

When appointment is to conclude.

participant
array[json]

Participants involved in appointment. Must include at least one entry for a practitioner. An optional 2nd entry may be used for the patient.

The actor.reference: Practitioner/<practitioner_id> maps to the rendering provider in Canvas.

Click to view child attributes
actor
json
status
string

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.
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

A Canvas-issued unique identifier

appointment-type
string

Filter by the code value under appointmentType.coding

location
string

The location of the appointment

patient
string

A FHIR Patient reference

practitioner
string

A FHIR Practitioner reference

date
string

Search based on when the appointment is scheduled (UTC). Uses an operand and a date field in the format YYYY-MM-DD. eq, gt, ge, lt, and le are currently supported operands (eq is assumed if no operand is sent). Two date parameters are accepted to allow for date range searches. “/Appointment?date=ge2021-09-16”

status
string

The status of the appointment

_sort
string

Triggers sorting of the results by a specific criteria. Supported values are date, patient and practitioner. Use -date, -patient, -practitioner to sort in descending order.

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/Appointment/<id>' \
         --header 'Authorization: Bearer <token>' \
         --header 'accept: application/json'
    
  • import requests
    
    url = "https://fumage-example.canvasmedical.com/Appointment/<id>"
    
    headers = {
        "accept": "application/json",
        "Authorization": "Bearer <token>"
    }
    
    response = requests.get(url, headers=headers)
    
    print(response.text)
    
  • {
        "resourceType": "Appointment",
        "id": "621a66fc-9d5c-4de0-97fb-935d611ac176",
        "contained":
        [
            {
                "resourceType": "Endpoint",
                "id": "appointment-meeting-endpoint-0",
                "status": "active",
                "connectionType":
                {
                    "code": "https"
                },
                "payloadType":
                [
                    {
                        "coding":
                        [
                            {
                                "code": "video-call"
                            }
                        ]
                    }
                ],
                "address": "https://url-for-video-chat.example.com?meeting=abc123"
            }
        ],
        "status": "proposed",
        "appointmentType":
        {
            "coding":
            [
                {
                    "system": "http://snomed.info/sct",
                    "code": "448337001",
                    "display": "Telemedicine"
                }
            ]
        },
        "reasonCode":
        [
            {
                "coding":
                [
                    {
                        "system": "INTERNAL",
                        "code": "INIV",
                        "display": "Initial Visit",
                        "userSelected": false
                    }
                ],
                "text": "Initial 30 Minute Visit"
            }
        ],
        "description": "Initial 30 Minute Visit",
        "supportingInformation":
        [
            {
                "reference": "Location/1",
                "type": "Location"
            },
            {
                "reference": "#appointment-meeting-endpoint-0",
                "type": "Endpoint"
            },
            {
                "reference": "Encounter/23668e1a-e914-4eac-885c-1a2a27244ab7",
                "type": "Encounter"
            }
        ],
        "start": "2023-10-24T13:30:00+00:00",
        "end": "2023-10-24T14:00:00+00:00",
        "participant":
        [
            {
                "actor":
                {
                    "reference": "Practitioner/4150cd20de8a470aa570a852859ac87e",
                    "type": "Practitioner"
                },
                "status": "accepted"
            },
            {
                "actor":
                {
                    "reference": "Patient/ee1c7803325b47b492008f3e7c9d7a3d",
                    "type": "Patient"
                },
                "status": "accepted"
            }
        ]
    }
    
  • {
      "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 Appointment resource 'a47c7b0ebbb442cdbc4adf259d148ea1'"
          }
        }
      ]
    }
    
  • curl --request GET \
         --url 'https://fumage-example.canvasmedical.com/Appointment?patient=Patient%2Fa031d1ba40d74aebb8ed716716da05c2&practitioner=Practitioner%2F4150cd20de8a470aa570a852859ac87e' \
         --header 'Authorization: Bearer <token>' \
         --header 'accept: application/json'
    
  • import requests
    
    url = "https://fumage-example.canvasmedical.com/Appointment?patient=Patient%2Fa031d1ba40d74aebb8ed716716da05c2&practitioner=Practitioner%2F4150cd20de8a470aa570a852859ac87e"
    
    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": "/Appointment?patient=Patient%2Fa031d1ba40d74aebb8ed716716da05c2&practitioner=Practitioner%2F4150cd20de8a470aa570a852859ac87e&_count=10&_offset=0"
            },
            {
                "relation": "first",
                "url": "/Appointment?patient=Patient%2Fa031d1ba40d74aebb8ed716716da05c2&practitioner=Practitioner%2F4150cd20de8a470aa570a852859ac87e&_count=10&_offset=0"
            },
            {
                "relation": "last",
                "url": "/Appointment?patient=Patient%2Fa031d1ba40d74aebb8ed716716da05c2&practitioner=Practitioner%2F4150cd20de8a470aa570a852859ac87e&_count=10&_offset=0"
            }
        ],
        "entry":
        [
            {
                "resource":
                {
                    "resourceType": "Appointment",
                    "id": "f7bb6d7e-1cab-42cd-b3d2-40229e1bede7",
                    "contained":
                    [
                        {
                            "resourceType": "Endpoint",
                            "id": "appointment-meeting-endpoint-0",
                            "status": "active",
                            "connectionType":
                            {
                                "code": "https"
                            },
                            "payloadType":
                            [
                                {
                                    "coding":
                                    [
                                        {
                                            "code": "video-call"
                                        }
                                    ]
                                }
                            ],
                            "address": "https://url-for-video-chat.example.com?meeting=abc123"
                        }
                    ],
                    "status": "proposed",
                    "appointmentType":
                    {
                        "coding":
                        [
                            {
                                "system": "http://snomed.info/sct",
                                "code": "448337001",
                                "display": "Telemedicine"
                            }
                        ]
                    },
                    "reasonCode":
                    [
                        {
                            "coding":
                            [
                                {
                                    "system": "INTERNAL",
                                    "code": "INIV",
                                    "display": "Initial Visit",
                                    "userSelected": false
                                }
                            ],
                            "text": "Initial 30 Minute Visit"
                        }
                    ],
                    "description": "Initial 30 Minute Visit",
                    "supportingInformation":
                    [
                        {
                            "reference": "Location/1",
                            "type": "Location"
                        },
                        {
                            "reference": "#appointment-meeting-endpoint-0",
                            "type": "Endpoint"
                        },
                        {
                            "reference": "Encounter/797ccaae-2939-4e8a-9d91-5e9574a11a4e",
                            "type": "Encounter"
                        }
                    ],
                    "start": "2023-10-24T13:30:00+00:00",
                    "end": "2023-10-24T14:00:00+00:00",
                    "participant":
                    [
                        {
                            "actor":
                            {
                                "reference": "Practitioner/4150cd20de8a470aa570a852859ac87e",
                                "type": "Practitioner"
                            },
                            "status": "accepted"
                        },
                        {
                            "actor":
                            {
                                "reference": "Patient/a031d1ba40d74aebb8ed716716da05c2",
                                "type": "Patient"
                            },
                            "status": "accepted"
                        }
                    ]
                }
            }
        ]
    }
    
  • {
      "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"
          }
        }
      ]
    }
    
  • curl --request POST \
         --url 'https://fumage-example.canvasmedical.com/Appointment' \
         --header 'Authorization: Bearer <token>' \
         --header 'accept: application/json' \
         --header 'content-type: application/json' \
         --data '
    {
        "resourceType": "Appointment",
        "contained":
        [
            {
                "resourceType": "Endpoint",
                "id": "appointment-meeting-endpoint",
                "status": "active",
                "connectionType":
                {
                    "code": "https"
                },
                "payloadType":
                [
                    {
                        "coding":
                        [
                            {
                                "code": "video-call"
                            }
                        ]
                    }
                ],
                "address": "https://url-for-video-chat.example.com?meeting=abc123"
            }
        ],
        "status": "proposed",
        "appointmentType":
        {
            "coding":
            [
                {
                    "system": "http://snomed.info/sct",
                    "code": "448337001",
                    "display": "Telemedicine consultation with patient (procedure)"
                }
            ]
        },
        "reasonCode":
        [
            {
                "coding":
                [
                    {
                        "system": "INTERNAL",
                        "code": "INIV",
                        "display": "Initial Visit",
                        "userSelected": false
                    }
                ],
                "text": "Initial 30 Minute Visit"
            }
        ],
        "supportingInformation":
        [
            {
                "reference": "Location/1"
            },
            {
                "reference": "#appointment-meeting-endpoint",
                "type": "Endpoint"
            }
        ],
        "start": "2023-10-24T13:30:00.000Z",
        "end": "2023-10-24T14:00:00.000Z",
        "participant":
        [
            {
                "actor":
                {
                    "reference": "Patient/ee1c7803325b47b492008f3e7c9d7a3d"
                },
                "status": "accepted"
            },
            {
                "actor":
                {
                    "reference": "Practitioner/4150cd20de8a470aa570a852859ac87e"
                },
                "status": "accepted"
            }
        ]
    }
    '
    
  • import requests
    
    url = "https://fumage-example.canvasmedical.com/Appointment"
    
    headers = {
        "accept": "application/json",
        "Authorization": "Bearer <token>",
        "content-type": "application/json"
    }
    
    payload = {
        "resourceType": "Appointment",
        "contained":
        [
            {
                "resourceType": "Endpoint",
                "id": "appointment-meeting-endpoint",
                "status": "active",
                "connectionType":
                {
                    "code": "https"
                },
                "payloadType":
                [
                    {
                        "coding":
                        [
                            {
                                "code": "video-call"
                            }
                        ]
                    }
                ],
                "address": "https://url-for-video-chat.example.com?meeting=abc123"
            }
        ],
        "status": "proposed",
        "appointmentType":
        {
            "coding":
            [
                {
                    "system": "http://snomed.info/sct",
                    "code": "448337001",
                    "display": "Telemedicine consultation with patient (procedure)"
                }
            ]
        },
        "reasonCode":
        [
            {
                "coding":
                [
                    {
                        "system": "INTERNAL",
                        "code": "INIV",
                        "display": "Initial Visit",
                        "userSelected": False
                    }
                ],
                "text": "Initial 30 Minute Visit"
            }
        ],
        "supportingInformation":
        [
            {
                "reference": "Location/1"
            },
            {
                "reference": "#appointment-meeting-endpoint",
                "type": "Endpoint"
            }
        ],
        "start": "2023-10-24T13:30:00.000Z",
        "end": "2023-10-24T14:00:00.000Z",
        "participant":
        [
            {
                "actor":
                {
                    "reference": "Patient/ee1c7803325b47b492008f3e7c9d7a3d"
                },
                "status": "accepted"
            },
            {
                "actor":
                {
                    "reference": "Practitioner/4150cd20de8a470aa570a852859ac87e"
                },
                "status": "accepted"
            }
        ]
    }
    
    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/Appointment/<id>' \
         --header 'Authorization: Bearer <token>' \
         --header 'accept: application/json' \
         --header 'content-type: application/json' \
         --data '
    {
        "resourceType": "Appointment",
        "contained":
        [
            {
                "resourceType": "Endpoint",
                "id": "appointment-meeting-endpoint",
                "status": "active",
                "connectionType":
                {
                    "code": "https"
                },
                "payloadType":
                [
                    {
                        "coding":
                        [
                            {
                                "code": "video-call"
                            }
                        ]
                    }
                ],
                "address": "https://url-for-video-chat.example.com?meeting=abc123"
            }
        ],
        "status": "cancelled",
        "appointmentType":
        {
            "coding":
            [
                {
                    "system": "http://snomed.info/sct",
                    "code": "448337001",
                    "display": "Telemedicine consultation with patient (procedure)"
                }
            ]
        },
        "reasonCode":
        [
            {
                "coding":
                [
                    {
                        "system": "INTERNAL",
                        "code": "INIV",
                        "display": "Initial Visit",
                        "userSelected": false
                    }
                ],
                "text": "Initial 30 Minute Visit"
            }
        ],
        "supportingInformation":
        [
            {
                "reference": "Location/1"
            },
            {
                "reference": "#appointment-meeting-endpoint",
                "type": "Endpoint"
            }
        ],
        "start": "2023-10-24T13:30:00.000Z",
        "end": "2023-10-24T14:00:00.000Z",
        "participant":
        [
            {
                "actor":
                {
                    "reference": "Patient/ee1c7803325b47b492008f3e7c9d7a3d"
                },
                "status": "accepted"
            },
            {
                "actor":
                {
                    "reference": "Practitioner/4150cd20de8a470aa570a852859ac87e"
                },
                "status": "accepted"
            }
        ]
    }
    '
    
  • import requests
    
    url = "https://fumage-example.canvasmedical.com/Appointment/<id>"
    
    headers = {
        "accept": "application/json",
        "Authorization": "Bearer <token>",
        "content-type": "application/json"
    }
    
    payload = {
        "resourceType": "Appointment",
        "contained":
        [
            {
                "resourceType": "Endpoint",
                "id": "appointment-meeting-endpoint",
                "status": "active",
                "connectionType":
                {
                    "code": "https"
                },
                "payloadType":
                [
                    {
                        "coding":
                        [
                            {
                                "code": "video-call"
                            }
                        ]
                    }
                ],
                "address": "https://url-for-video-chat.example.com?meeting=abc123"
            }
        ],
        "status": "cancelled",
        "appointmentType":
        {
            "coding":
            [
                {
                    "system": "http://snomed.info/sct",
                    "code": "448337001",
                    "display": "Telemedicine consultation with patient (procedure)"
                }
            ]
        },
        "reasonCode":
        [
            {
                "coding":
                [
                    {
                        "system": "INTERNAL",
                        "code": "INIV",
                        "display": "Initial Visit",
                        "userSelected": False
                    }
                ],
                "text": "Initial 30 Minute Visit"
            }
        ],
        "supportingInformation":
        [
            {
                "reference": "Location/1"
            },
            {
                "reference": "#appointment-meeting-endpoint",
                "type": "Endpoint"
            }
        ],
        "start": "2023-10-24T13:30:00.000Z",
        "end": "2023-10-24T14:00:00.000Z",
        "participant":
        [
            {
                "actor":
                {
                    "reference": "Patient/ee1c7803325b47b492008f3e7c9d7a3d"
                },
                "status": "accepted"
            },
            {
                "actor":
                {
                    "reference": "Practitioner/4150cd20de8a470aa570a852859ac87e"
                },
                "status": "accepted"
            }
        ]
    }
    
    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 Appointment 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"
          }
        }
      ]
    }