# Rename a file

## Overview

[Video: Rename a file](https://www.youtube.com/watch?v=8y0r-b-pvfU)

This flow describes how to change the name of a [file](https://docs.ohc.network/concepts/clinical/files.md) on the **Files** tab of a patient or of an encounter.

## Pre-requisites

* The file is on the **Files** tab of the patient or of the encounter. Patient files and encounter files are in separate lists.
* The file is not archived. An archived file has an **Archived** badge and no **More Actions** button. You cannot rename it on the **Files** tab.
* If the file is on an encounter, you opened the encounter from a facility, not from an organization.
* If the file is on an encounter, you look at the encounter that you opened. If you select another encounter of the patient on that page, Care does not show **Rename**.
* If the file is on an encounter, the encounter is not closed. Care treats an encounter as closed when its status is Completed, Cancelled, Entered in error or Discontinued.
* You have the permissions listed below.

## Permissions

| Permission | Access |
| - | - |
| Can Update a Patient's data | Rename patient files. Care shows **Rename** on the patient's **Files** tab only with this permission. Hold it through [a role on the patient](https://docs.ohc.network/concepts/clinical/files.md#permissions). By default, Staff, Doctor, Nurse, Administrator and Facility Admin hold it. |
| Update Encounter related clinical data | Rename encounter files. Hold it in a [department](https://docs.ohc.network/concepts/facility/department.md) of the encounter or of its current location. Nobody can rename the files of a closed encounter. By default, Doctor, Nurse and Facility Admin hold it. |
| Update Encounter non clinical | Care shows **Rename** on the encounter's **Files** tab only with this permission. Hold it through a role on the encounter. By default, Doctor, Nurse and Facility Admin hold it. |
| Can view clinical data about patients | Shows the patient's **Files** tab and lists the patient files. Hold it through [a role on the patient](https://docs.ohc.network/concepts/clinical/files.md#permissions). By default, Staff, Doctor, Nurse and Facility Admin hold it. |
| Can Read encounter related clinical data | Shows the encounter's **Files** tab and lists the encounter files. Hold it in a department of the encounter or of its current location. By default, Doctor, Nurse and Facility Admin hold it. |

Note: By default, the Administrator role holds "Can Update a Patient's data" but not "Can view clinical data about patients". So a user who has only the Administrator role cannot open the patient's **Files** tab, and cannot rename files there.

## Steps

### 1. Open the Files tab

Open the patient or the encounter that the file belongs to.

Select the **Files** tab. In an encounter, you can also press `g` and then `f`.

Make sure that the **Files** sub-tab is selected. Care selects it when you open the tab.

For help to find the file in the list, see [Find a file](https://docs.ohc.network/flows/clinical/files/find-a-file.md).

![The row of Scan 0412.pdf in the Files list](/assets/images/rename-a-file-1-fd94381b970bb81624f9f19ef32c902d.webp)

### 2. Open the More Actions menu

In the row of the file, select **More Actions**. This is the button with three vertical dots.

The menu shows **Download**. If you can change the files here, the menu also shows **Rename** and **Archive**.

If the menu shows only **Download**, you cannot change the files here. Check the pre-requisites and the permissions on this page.

![The More Actions menu of a file with Download, Rename and Archive](/assets/images/rename-a-file-2-f7b22c098c08906793abe8d1929fbc72.webp)

### 3. Select Rename

Select **Rename**. Care opens the **Rename File** dialog.

The **Enter the file name** box shows the current name of the file without its extension.

![The Rename File dialog with the current name Scan 0412 in the Enter the file name box](/assets/images/rename-a-file-3-5d6b472dea159f8f287887daf84c5a64.webp)

### 4. Enter the new name

Change the name in the **Enter the file name** box.

Do not add the extension. Care keeps the extension and shows it after the name in the list.

If the box is empty, you cannot select **Proceed**.

If the name has only spaces, Care shows **Please enter a name!** and does not change the name.

![The Rename File dialog with the new name Ultrasound report](/assets/images/rename-a-file-4-b876649b503b036fdf036804f31cc3b8.webp)

### 5. Save the new name

Select **Proceed**.

To close the dialog without a change, select **Cancel**.

![The message File name changed successfully, and Ultrasound report.pdf in the Files list](/assets/images/rename-a-file-5-51e4b80cd5d8582bed2b804617b0fe2e.webp)

## Expected Outcome

* Care shows **File name changed successfully**.
* Care refreshes the list. The file shows the new name, followed by its extension.
* Care changes only the name. The content of the file stays the same.

## Related

Concepts:

* [Files](https://docs.ohc.network/concepts/clinical/files.md)

Flows:

* [Find a file](https://docs.ohc.network/flows/clinical/files/find-a-file.md)
* [View or preview a file](https://docs.ohc.network/flows/clinical/files/view-or-preview-a-file.md)
* [Download a file](https://docs.ohc.network/flows/clinical/files/download-a-file.md)
* [Archive a file](https://docs.ohc.network/flows/clinical/files/archive-a-file.md)
* [Upload a file](https://docs.ohc.network/flows/clinical/files/upload-a-file.md)
