# Preview a valueset

## Overview

[Video: Preview a valueset](https://www.youtube.com/watch?v=Mlp4b-jJWKY)

This flow describes how to see which codes the rules of a [valueset](https://docs.ohc.network/concepts/definitions/valueset.md) give in Care. You can preview a valueset before you save it, and you can preview a saved valueset.

## Pre-requisites

* You are on the **Create ValueSet**, **Edit ValueSet**, or **Preview ValueSet** page. You can also start from the **Shared catalogue** tab of the **ValueSets** page.
* The valueset has at least one include or exclude rule. See [Build include and exclude rules](https://docs.ohc.network/flows/definitions/valueset/build-include-and-exclude-rules.md).
* You have the permissions listed below.

## Permissions

| Permission | Access |
| - | - |
| Can Read ValueSets | Lets you open a facility valueset on the **This facility** tab and preview it from its page. You must hold it in a department that the valueset is shared with, or in a parent department of one. Holding it in the facility's root organization (**Administration**) alone is not enough, unless the valueset is shared with the root organization. By default, the Facility Admin, Administrator, Doctor, Nurse, Staff, Pharmacist and Volunteer roles hold it. |
| Can Create/Update ValueSets | Lets you open the **Create ValueSet** page to preview a new valueset. You must hold it in the root organization. By default, the Facility Admin role holds it. |

Note: The preview itself needs no permission. Any member of the facility can preview a valueset on the **Shared catalogue** tab.

## Steps

### 1. Open the preview

Open the preview from one of these places:

* On the **Create ValueSet**, **Edit ValueSet**, or **Preview ValueSet** page, select **Preview** in the page header.
* On the **Shared catalogue** tab of the **ValueSets** page, select **Preview** on the row of the valueset.

Care opens the **Valueset Preview** panel. The panel shows the number of include rules and exclude rules.

If the valueset has no include or exclude rule, the panel shows **Add an include or exclude rule to preview this definition.**

Note: On the **Create ValueSet** and **Edit ValueSet** pages, the preview uses the current rules, including unsaved changes. The preview does not save anything.

Note: The preview does not include the rules of a parent valueset. If a parent is set and **Use parent rules** is on, the panel shows **This preview shows only the rules added here, not the complete definition with parent rules.**

![Step 1, Open the preview: the screen at this step, with the control for the step outlined](/assets/images/preview-valueset-1-10acc16cefdd1d8cea4872ec8d1e65a3.webp)

### 2. Check the codes

Care lists up to 20 concepts that match the rules, before you search.

Each concept shows its name, its **Code**, and its **System**.

Care shows how many concepts it lists, for example "Showing 20 concepts".

If no concept matches the rules, Care shows **No Results Found** and **No concepts match this definition. Review the inclusion and exclusion rules, then preview again.**

![Step 2, Check the codes: the screen at this step, with the control for the step outlined](/assets/images/preview-valueset-2-869f97396ae0c834319206c92c73cfc2.webp)

### 3. Search for a concept

Type a concept name in **Search for a concept in this valueset**.

Care lists up to 20 matching concepts. To narrow the results, type more of the name.

If no concept matches your search, Care shows **No Results Found** and **Try a different concept name, or clear the search.**

To clear the search, select **Clear search**.

![Step 3, Search for a concept: the screen at this step, with the control for the step outlined](/assets/images/preview-valueset-3-a8b90b21a0ced3d8c47ce2c9a39b434c.webp)

### 4. Close the preview

Select the close button in the panel header.

If you are creating or editing the valueset and the codes are not correct, change the rules. Then preview again.

![Step 4, Close the preview: the screen at this step, with the control for the step outlined](/assets/images/preview-valueset-4-6850dd5b98f01d11a0bc826dfac0ae8f.webp)

## Expected Outcome

* You see the codes that the rules of the valueset give.
* Care saves nothing. To keep changed rules, save the valueset.

## Related

Concepts:

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

Flows:

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