# Create a valueset

## Overview

[Video: Create a valueset](https://www.youtube.com/watch?v=QpXUtijzgRY)

This flow describes how to create a [valueset](https://docs.ohc.network/concepts/definitions/valueset.md) for your facility in facility settings. The new valueset has its own slug, and you can select it when you configure a questionnaire.

Note: A new facility valueset stays hidden from everyone in the facility, including you, until it is shared with a department. After that, members of the departments that it is shared with can see and use it. Members of their parent departments can too. These members need the Can Read ValueSets permission. A role in the facility's root organization does not show it to you. This is true even with Can Create/Update ValueSets, unless the valueset is shared with the root organization (**Administration**).

## Pre-requisites

* You are a member of a department of the facility.
* If you want to build on another valueset, that valueset is Active. It is in the **Shared catalogue**, or it is a valueset of your facility that you can see.
* You have the permissions listed below.

## Permissions

| Permission | Access |
| - | - |
| Can Create/Update ValueSets | Lets you see **Create ValueSet** and save the new valueset. You must hold it in the root organization. By default, the Facility Admin role holds this permission. |

You need no other permission to open the **ValueSets** page, choose a parent, verify codes, or preview the valueset.

## 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 3): the screen at this step, with the control for the step outlined](/assets/images/create-valueset-1-599060d05a714779dc74908ffdb089e6.webp)

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

![Step 1, Open the valueset list (3 of 3): the screen at this step, with the control for the step outlined](/assets/images/create-valueset-3-1631f342a8c5290f9f1e3b03d5622f11.webp)

### 2. Start a new valueset

Select **Create ValueSet**.

Care opens the **Create ValueSet** page.

Note: If you do not see **Create ValueSet**, you do not hold Can Create/Update ValueSets in the root organization.

![Step 2, Start a new valueset: the screen at this step, with the control for the step outlined](/assets/images/create-valueset-4-ecf7b70f97e3197ab41d05f06db436a8.webp)

### 3. Choose a starting point

The **Starting point** section lets you start from scratch or build on an existing valueset.

To start from scratch, leave **Parent value set** empty.

To build on another valueset, select it in **Parent value set**.

The list shows Active valuesets: those of your facility that you can see, marked **This facility**, and the shared valuesets, marked **Instance**.

Under **How will this value set be used?**, keep **Separate value set**.

Note: To replace a shared valueset in your facility, use **Facility customization** instead. See [Customize a shared valueset](https://docs.ohc.network/flows/definitions/valueset/customize-shared-valueset.md).

![Step 3, Choose a starting point: the screen at this step, with the control for the step outlined](/assets/images/create-valueset-5-1a97cdbdeb475c6837cadb6c5c58068a.webp)

### 4. Enter the basic information

Under **Basic Information**, complete the fields.

| Components | What it captures |
| - | - |
| Name | The name of the valueset. This field is required. When you type the name, Care fills in the **Slug**. |
| Slug | A short identifier for the valueset. This field is required. Use 5 to 50 characters: letters, numbers, underscores and hyphens. Start and end with a letter or a number. Care changes capital letters to small letters and removes other characters. |
| Status | The stage of the valueset: **Active**, **Draft**, **Retired** or **Unknown**. This field is required. Care selects **Active** for a new valueset. |
| Description | Text that explains the purpose of the valueset. This field is optional. |

Do not use the slug of a valueset in the **Shared catalogue**. Care shows an error if you do.

Do not put "system-" in the slug. Care refuses that slug when you save.

You cannot change the slug after you save the valueset.

While Care checks the slug against the shared catalogue, it shows **Checking this slug against the shared catalogue…** and you cannot save.

If the check fails, select **Try Again**.

![Step 4, Enter the basic information: the screen at this step, with the control for the step outlined](/assets/images/create-valueset-6-609848c2ef61fbd110395c51cb1b714a.webp)

### 5. Add the rules

Under **Definition**, add the include rules and the exclude rules.

You can save a valueset without rules.

For the full procedure, see [Build include and exclude rules](https://docs.ohc.network/flows/definitions/valueset/build-include-and-exclude-rules.md).

If you selected a parent, **Use parent rules** is on. The valueset then uses the rules of the parent together with the rules that you add.

To use only the rules that you add, turn off **Use parent rules**.

![Step 5, Add the rules: the screen at this step, with the control for the step outlined](/assets/images/create-valueset-7-96f874deea7f54d76062c4366b205600.webp)

### 6. Preview the codes

This step is optional.

Select **Preview** to see the codes that match the rules.

For the full procedure, see [Preview a valueset](https://docs.ohc.network/flows/definitions/valueset/preview-valueset.md).

![Step 6, Preview the codes: the screen at this step, with the control for the step outlined](/assets/images/create-valueset-8-ef41be4fb5ca7a1ac51c011e2e647046.webp)

### 7. Save the valueset

Select **Save**.

**Save** is available only after you change a field.

If a field needs a correction, 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 to confirm.

![Step 7, Save the valueset: the screen at this step, with the control for the step outlined](/assets/images/create-valueset-9-fb1dccf55e9be3c77e5fa303eb30b1b6.webp)

## Expected Outcome

* Care saves the valueset for your facility with the details that you entered.
* Care shows **ValueSet created successfully** and then **Not Found**.
* Care then shows an empty **Create ValueSet** form, with **No changes to save** and **Save** not available.
* The **Not Found** message and the empty form appear because the new valueset is hidden. It stays hidden until it is shared with a department. Your valueset is saved.
* The valueset does not appear on the **This facility** tab until it is shared with a department.
* After the valueset is shared, members of those departments and of their parent departments can open it.
* These members need Can Read ValueSets. They can then select the valueset in a questionnaire.
* You cannot use [Share a valueset with departments](https://docs.ohc.network/flows/definitions/valueset/share-valueset-with-departments.md) on the new valueset yet. That flow needs a valueset that is already shared with a department that you belong to.

## Related

Concepts:

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

Flows:

* [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)
* [Update or retire a valueset](https://docs.ohc.network/flows/definitions/valueset/update-or-retire-valueset.md)
