# Edit a report template

## Overview

This flow describes how to change an existing [report template](https://docs.ohc.network/concepts/platform/report-template.md) in the **Template Builder**. Use the same flow to make a template Active or to retire it.

[Video: Edit a report template](https://www.youtube.com/watch?v=4aNLJMmElsQ)

## Pre-requisites

* The facility has the report template that you want to change.
* You have the permissions listed below.

## Permissions

| Permission | Access |
| - | - |
| Can Create Template on Facility | Shows the **Edit** button on each card if your permissions in the facility include it. To save your changes, you must hold it in the root organization of the facility, Administration. Facility Admin, Doctor and Nurse have it by default. |
| Can Read Template | Shows **Templates** in the facility settings, lists the templates, and opens the template. You can hold it in any organization of the facility. Facility Admin, Administrator, Staff, Doctor, Nurse, Volunteer and Pharmacist have it by default. |
| Can View Template Schema | Loads the contexts and their fields in the **Template Builder**. You can hold it in any organization of any facility. Only Facility Admin has it by default. |
| Can Preview Template | Needed only to preview the template in step 2. You can hold it in any organization of any facility. Only Facility Admin has it by default. |

By default, only a Facility Admin in Administration has all of these permissions. A Doctor or a Nurse has Can Create Template on Facility by default, but not Can View Template Schema or Can Preview Template.

## Steps

### 1. Open the template

In the facility sidebar, select **Settings**. In the settings sidebar, under **Forms**, select **Templates**.

Find the template with **Search templates** and the filters. See [View report templates](https://docs.ohc.network/flows/platform/report-template/view-report-templates.md).

On the card of the template, select **Edit**.

Care opens the template in the **Template Builder**, the same builder that you use to create a template.

![The Templates page with Ward typed in Search templates, and the Edit button on the Ward Discharge Summary card outlined](/assets/images/edit-a-report-template-1-828cd493f2765888d4ca2b5165b4a128.webp)

### 2. Change the template

Change the fields that you need.

| Components | What it captures |
| - | - |
| Template Name | The name of the template. |
| Slug | The short name of the template. You cannot change it when you edit the template. |
| Status | Draft, Active, or Retired. See step 3. |
| Default Format | HTML or PDF. If people print the report, select PDF. Only PDF reports open and print in Care. |
| Report Type | Discharge Summary, Patient Summary, or Account Report. |
| Select Context | The set of data that the template can use. It must match the report type. |
| Template HTML | The content of the report. |

**Select Context** shows the saved context of the template. If you change **Report Type**, select the context that matches the new report type.

| Report Type | Context to select |
| - | - |
| Discharge Summary | Encounter Report |
| Patient Summary | Patient Report |
| Account Report | Account Report |

To add data to the template body, use the **Fields** card. See [Create a report template](https://docs.ohc.network/flows/platform/report-template/create-a-report-template.md).

If you change the template body, preview it before you save. See [Preview a template](https://docs.ohc.network/flows/platform/report-template/preview-a-template.md).

![The Template Builder for Ward Discharge Summary, with PDF selected in the outlined Default Format box](/assets/images/edit-a-report-template-2-a7f04d23c9be9a795535a38914e86ffe.webp)

### 3. Set the status

Set **Status** to tell Care if the template is in use.

| Status | What it does |
| - | - |
| Draft | Care does not offer the template for reports. |
| Active | Care offers the template when someone generates a report of that report type. |
| Retired | Care no longer offers the template for new reports. |

To use the template for reports, set **Status** to **Active**.

To stop the use of the template, set **Status** to **Retired**.

Note: Care has no delete action for a report template. To take a template out of use, set **Status** to **Retired**.

![The Template Builder for Ward Discharge Summary, with Active selected in the outlined Status box](/assets/images/edit-a-report-template-3-1daf250eced535213f93bf85d25dff84.webp)

### 4. Save the template

Select **Save Template**.

If a required field is empty, Care shows "This field is required". Complete the field and save again.

If Care cannot save the template, it shows the reason in a message.

![The Template Builder for Ward Discharge Summary, with the Save Template button outlined](/assets/images/edit-a-report-template-4-644e14429b42b1d80a338b17ad11e65e.webp)

![The Template Builder with the message Report template updated successfully outlined at the top](/assets/images/edit-a-report-template-5-92de4558b68c1c67361b85c8cd75058f.webp)

## Expected Outcome

* Care saves your changes and shows the message "Report template updated successfully".
* If you set **Status** to **Active**, Care offers the template when someone generates a report of that report type.
* If you set **Status** to **Retired**, Care no longer offers the template for new reports.

## Related

Concepts:

* [Report Template](https://docs.ohc.network/concepts/platform/report-template.md)

Flows:

* [View report templates](https://docs.ohc.network/flows/platform/report-template/view-report-templates.md)
* [Create a report template](https://docs.ohc.network/flows/platform/report-template/create-a-report-template.md)
* [Preview a template](https://docs.ohc.network/flows/platform/report-template/preview-a-template.md)
* [Generate and view a report](https://docs.ohc.network/flows/platform/report-template/generate-and-view-a-report.md)
