Updating is done via our PATCH Appointments endpoints.
If you want to update a single appointment, use PATCH Appointment endpoint, passing appointment_id as the path parameter, and including fields you would like to update in JSON body payload:
curl --location --request PATCH 'https://api.leyr.io/api/emrs/{emr}/appointments/{appointment_id}'
--header 'x-leyr-client-id: {x-leyr-client-id}'
--header 'x-leyr-client-secret: {x-leyr-client-secret}'
--header 'x-leyr-standard: {x-leyr-standard}'
--data-raw '{
"start": {start},
"end": {end},
"resource_id": {resource_id},
"comment": {comment}
}'
status in the payload when you are updating appointments, as it is reserved for cancelling appointmentsstart, end, resource_id and comment) are optional by default, so you can only provide those you actually want to update; but start and end have to be provided togetherresource_id, we will check that there are time slots available for selected Resource:
start and end - we will check that rangestart and end - we assume you want to change the resource at the same time slot, and will use current start and end times of the appointment_id you are updatingstart and end, we will check that there are time slots available for selected time range:
resource_id - we will check for that Resourceresource_id - we assume you want to reschedule an appointment with the same Resource, and will use current resource_id of the appointment_id you are updatingIf you want to update multiple appointments at once, doing bulk cancel, use our PATCH Appointments. In that case you no longer pass appointment_id in path parameters. Instead, you pass ids in array in JSON body payload, together with the fields you would like to update:
curl --location --request PATCH 'https://api.leyr.io/api/emrs/{emr}/appointments'
--header 'x-leyr-client-id: {x-leyr-client-id}'
--header 'x-leyr-client-secret: {x-leyr-client-secret}'
--header 'x-leyr-standard: {x-leyr-standard}'
--data-raw '{
"ids": ["appointment_id_1", "appointment_id_2", "appointment_id_3"],
"start": {start},
"end": {end},
"resource_id": {resource_id},
"comment": {comment}
}'
status in the payload when you are updating appointments, as it is reserved for cancelling appointmentsstart, end, resource_id and comment) are optional by default, so you can only provide those you actually want to update; but start and end have to be provided togetherWe treat bulk update endpoint in two different "scenarios", based on if you provide start and end parameters or not
start and end - we will treat it as pure bulk update:
resource_id - we will validate if there is a time slot available with provided resource_id for each of the provided ids and move all of them to that Resource. If one of the appointments cannot be moved (there is no time slots available) - we will return a BAD_REQUEST response.start and end - we will treat it as a continuous reschedule. ids you provided have the same Patient, Resource, Healthcare Service and Care Unit.start to end time range and will fit provided ids to those time slots. start to end range is longer than that covered by ids. We will cancel extra appointments from provided ids, if provided start to end range is shorter that that covered by ids.\Cancel Appointment(s)
Cancelling is done via our PATCH Appointments endpoints.
Confirm Appointments
In some cases, Leyr will now prompt you to confirm an appointment that was requested (created via POST Appointments endpoint). You can now use our PATCH Appointments endpoint to confirm such appointments.