# Update or retire a valueset

## Overview

[Video: Update or retire a valueset](https://www.youtube.com/watch?v=upcO9j92ZTU)

This flow describes how to change a facility [valueset](https://docs.ohc.network/concepts/definitions/valueset.md) in Care. It also describes how to retire a valueset that your facility no longer uses.

## Pre-requisites

* The valueset is on the **This facility** tab of the **ValueSets** page.
* The valueset is shared with your department, or with one of its sub-departments. See [Share a valueset with departments](https://docs.ohc.network/flows/definitions/valueset/share-valueset-with-departments.md).
* You have the permissions listed below.

Note: You cannot change a valueset on the **Shared catalogue** tab from facility settings. To change one for your facility, see [Customize a shared valueset](https://docs.ohc.network/flows/definitions/valueset/customize-shared-valueset.md).

## Permissions

| Permission | Access |
| - | - |
| Can Create/Update ValueSets | Lets you see **Edit**, change the valueset, and save it. You must hold it in the facility's root organization (**Administration**). Without it there, Care shows **View** and opens the valueset read only. By default, the Facility Admin role holds it. |
| Can Read ValueSets | Lets you find the valueset in the list and open it. You must hold it in a department that the valueset is shared with, or in a parent department of one. Holding it in the root organization alone is not enough, unless the valueset is shared with the root organization (**Administration**). By default, the Facility Admin, Administrator, Doctor, Nurse, Staff, Pharmacist and Volunteer roles hold it. |
| Can View Facility Organizations | Lets you see the departments in the **Select Department** list. If you hold it in the root organization, the list shows every department, including the root organization. If you hold it only in a department, the list leaves out the root organization. By default, the Facility Admin, Administrator, Doctor, Nurse, Staff and Volunteer roles hold it. |

## Steps

### 1. Open the valueset list

In the facility sidebar, select **Settings**.

In the settings sidebar, under **Forms**, select **ValueSets**.

Care opens the **ValueSets** page on the **This facility** tab.

![Step 1, Open the valueset list (1 of 2): the screen at this step, with the control for the step outlined](/assets/images/update-or-retire-valueset-1-599060d05a714779dc74908ffdb089e6.webp)

![Step 1, Open the valueset list (2 of 2): the screen at this step, with the control for the step outlined](/assets/images/update-or-retire-valueset-2-4feafb711b43addce788294b9df6d775.webp)

### 2. Find the valueset

To find the valueset by name, type in **Search ValueSets**.

The list shows **Active** valuesets. To find a valueset with another status, change **Status**.

Each row shows the name and slug, the status, and the description of a valueset.

![Step 2, Find the valueset: the screen at this step, with the control for the step outlined](/assets/images/update-or-retire-valueset-3-2309693f66dc8015ac3906c2101c2ee9.webp)

### 3. Open the valueset

On the row of the valueset, select **Edit**.

Care opens the **Edit ValueSet** page.

If the row shows **View** in place of **Edit**, you do not hold Can Create/Update ValueSets in the root organization.

**View** opens the **Preview ValueSet** page with a **Read only** badge and the note **You do not have permission to edit this value set**.

![Step 3, Open the valueset: the screen at this step, with the control for the step outlined](/assets/images/update-or-retire-valueset-4-6a9a73e032178c50932c3345cfd1bfd9.webp)

### 4. Change the details

Change the fields that you want to change.

| Components | What it captures |
| - | - |
| **Name** | The name of the valueset. This field is required. |
| **Slug** | The slug of the valueset. You cannot change it after the valueset is created. |
| **Status** | The stage of the valueset: **Active**, **Draft**, **Retired**, or **Unknown**. This field is required. |
| **Description** | More information about the valueset. This field is optional. |
| **Departments with access** | The departments whose members can see and use the valueset. Care saves a change to this field at once. See [Share a valueset with departments](https://docs.ohc.network/flows/definitions/valueset/share-valueset-with-departments.md). |
| **Use parent rules** | Whether Care adds the rules of the parent valueset to the rules on this page. |
| **Include rules** and **Exclude rules** | The rules that add codes to the valueset and remove codes from it. See [Build include and exclude rules](https://docs.ohc.network/flows/definitions/valueset/build-include-and-exclude-rules.md). |

To check the codes before you save, see [Preview a valueset](https://docs.ohc.network/flows/definitions/valueset/preview-valueset.md).

![Step 4, Change the details: the screen at this step, with the control for the step outlined](/assets/images/update-or-retire-valueset-5-f86b190cd778c585505742105caf5bc8.webp)

### 5. Save the changes

Select **Save**.

The button stays inactive until you change a field.

If a field has an error, Care lists it under **Review these fields before saving**.

To leave without saving, select the back arrow next to the page title.

If you have unsaved changes, Care asks **You have unsaved changes. Leave without saving?**

![Step 5, Save the changes (1 of 2): the screen at this step, with the control for the step outlined](/assets/images/update-or-retire-valueset-6-e42c9545807a032fb4c5680afec8bee2.webp)

![Step 5, Save the changes (2 of 2): the screen at this step, with the control for the step outlined](/assets/images/update-or-retire-valueset-7-e24271dcdf720ac6bc2af543a04b89bf.webp)

### 6. Retire the valueset

Do this step only when your facility no longer uses the valueset.

If you saved changes in step 5, Care is back on the **ValueSets** page. Open the valueset again: on its row, select **Edit**.

1. In **Status**, select **Retired**.
2. Select **Save**.

Note: The pages have no delete action for a valueset. Retire the valueset instead.

To use a retired valueset again, set its **Status** back to **Active** and save it.

![Step 6, Retire the valueset (1 of 2): the screen at this step, with the control for the step outlined](/assets/images/update-or-retire-valueset-8-734416a55d3f3a3a54ac137c125e8c9f.webp)

![Step 6, Retire the valueset (2 of 2): the screen at this step, with the control for the step outlined](/assets/images/update-or-retire-valueset-9-023a898104bf86e0a0fb06f79e37fea3.webp)

## Expected Outcome

* Care shows **ValueSet updated successfully** and returns to the **ValueSets** page.
* If you retired the valueset, the list shows it only when **Status** is set to **Retired**.
* If you retired a **Facility customization**, fields that find their valueset by this slug stop using it. They go back to the shared valueset, or to another Active facility valueset with that slug.
* A questionnaire question with this valueset in **Select a value set** still searches its codes after you retire it.

## Related

Concepts:

* [Valueset](https://docs.ohc.network/concepts/definitions/valueset.md)

Flows:

* [Create a valueset](https://docs.ohc.network/flows/definitions/valueset/create-valueset.md)
* [Customize a shared valueset](https://docs.ohc.network/flows/definitions/valueset/customize-shared-valueset.md)
* [Share a valueset with departments](https://docs.ohc.network/flows/definitions/valueset/share-valueset-with-departments.md)
* [Build include and exclude rules](https://docs.ohc.network/flows/definitions/valueset/build-include-and-exclude-rules.md)
* [Preview a valueset](https://docs.ohc.network/flows/definitions/valueset/preview-valueset.md)
