# Delete a schedule template

## Overview

[Video: Delete a schedule template](https://www.youtube.com/watch?v=tfbr50sJQsU)

This flow describes how to delete a [schedule template](https://docs.ohc.network/concepts/scheduling/schedule.md) in Care. Deleting a template also deletes its sessions and all their slots.

## Pre-requisites

* You are a member of the facility.
* A schedule template is created for the practitioner, location or healthcare service.
* No future slot of the template has an appointment. If one has, cancel that appointment or reschedule it to a slot of another template first.
* You have the permissions listed below.

## Permissions

| Permission | Access |
| - | - |
| Can Create on Schedule | Lets you delete the template. You must hold it in the place given below for the resource. By default, the Staff, Facility Admin, Doctor and Nurse roles hold it. |
| Can list schedule on Object | Lets you open the schedule page and the template. Care checks it in the same place as Can Create on Schedule. For a practitioner, Care shows the **Availability** tab only if you hold it in a department or team of the facility, or in its Administration organization. By default, the Staff, Facility Admin, Doctor, Nurse and Administrator roles hold it. |
| Can Read Healthcare Service | Lets you open **Services** and a service, on the way to the schedule of a location or a healthcare service. A role in any organization of the facility counts. By default, the Facility Admin, Administrator, Staff, Doctor, Nurse, Volunteer and Pharmacist roles hold it. |

Care accepts Can Create on Schedule and Can list schedule on Object only in these places:

* For a practitioner: the facility's Administration organization, a department or team that the practitioner belongs to, or a parent of it.
* For a location: a department linked to the location or to its parent location, a parent of that department, or the facility's Administration organization.
* For a healthcare service with a managing organization: that organization or a parent of it. The Administration organization does not count.
* For a healthcare service without a managing organization: only the facility's Administration organization.

Only roles that you hold in the facility's organizations count. A role in a governance organization above the facility does not count.

Care shows the pencil icon on a template if you hold Can Create on Schedule in the facility. A role in any department or team, or in the Administration organization, counts for this. Care deletes the template only if you hold the permission in the place given above.

## Steps

### 1. Open the schedule

Each practitioner, location and healthcare service has its own schedule page. Open it in one of these ways:

* For a practitioner: in the facility sidebar, select **Users**. On the user's card, select **See Details**. Then select the **Availability** tab.
* For your own schedule: open the account menu and select **Profile**. Then select the **Availability** tab.
* For a location: in the facility sidebar, select **Services**, then a service. On a location card, select **View appointments**. This link shows for services that are not a store, a pharmacy or a lab. In the location sidebar, under **Scheduling**, select **Schedule**.
* For a healthcare service: in the facility sidebar, select **Services**, then the service. In the service sidebar, under **Scheduling**, select **Schedule**.

Care can refuse to load the page and show "You do not have permission to update schedule". This means that you do not hold Can list schedule on Object in the place for this resource. Ask your administrator for it.

The page opens on the **Schedule** tab. It lists the schedule templates that cover the month shown on the calendar.

![The schedule page of the healthcare service General Medicine OP, with the Holiday Cover template card outlined above Saturday Clinic and Weekday General OP](/assets/images/delete-schedule-template-1-2661951fda65dcccd9e41c2e1438ff3a.webp)

### 2. Open the template

On the template card, select the pencil icon. The **Edit Schedule Template** sheet opens. The **Delete** button is inside this sheet.

### 3. Start the deletion

In the sheet, select **Delete**.

![The Delete button outlined next to Save in the Edit Schedule Template sheet for Holiday Cover](/assets/images/delete-schedule-template-2-26797a6ad42ffde4692f62216158ece8.webp)

Care asks "Are you sure?" and warns "This will permanently remove the scheduled template and cannot be undone".

### 4. Confirm the deletion

Select **Delete**. Care shows "Template has been deleted".

![The Are you sure? dialog outlined, with the warning This will permanently remove the scheduled template and cannot be undone, and the Cancel and Delete buttons](/assets/images/delete-schedule-template-3-08462fd0e615feb2fb77898499659b2d.webp)

![The message Template has been deleted outlined below an error message Not Found, with Holiday Cover gone from the template list](/assets/images/delete-schedule-template-4-d668582d5e2e06990a54fbb1fab33a3d.webp)

If a future slot of the template has an appointment, Care does not delete the template. The message is "Cannot delete schedule as there are future bookings associated with it".

If Care refuses with "You do not have permission to update schedule", ask your administrator for help. You need Can Create on Schedule in the place given under Permissions.

## Expected Outcome

* Care deletes the template, its sessions and all their slots.
* The exceptions of the practitioner, location or healthcare service stay as they are. An exception belongs to the resource, not to a template.
* A second message, "Not Found", can show right after. It does not mean that the deletion failed.

## Related

Concepts:

* [Schedule & Availability](https://docs.ohc.network/concepts/scheduling/schedule.md)

Flows:

* [Create a schedule template](https://docs.ohc.network/flows/scheduling/schedule/create-schedule-template.md)
* [View a schedule](https://docs.ohc.network/flows/scheduling/schedule/view-schedule-templates.md)
* [Edit a schedule template](https://docs.ohc.network/flows/scheduling/schedule/edit-schedule-template.md)
* [Add or remove a session in a schedule template](https://docs.ohc.network/flows/scheduling/schedule/add-or-remove-schedule-session.md)
* [Cancel an appointment](https://docs.ohc.network/flows/scheduling/appointment/cancel-appointment.md)
* [Reschedule an appointment](https://docs.ohc.network/flows/scheduling/appointment/reschedule-appointment.md)
