# Validation

The following validation rules are enforced when creating a Local Code System

* **`ID`, `Title`, `URL`** fields are mandatory, ID and URL have to be unique.
* **`ID`*****,*****&#x20;`OID`*****,*****&#x20;`URL, Title`** fields cannot be edited after the creation.

The following validation rules are enforced when creating a Local Code

* **`Code`** and **`Preferred Term`** fields are mandatory, Code is autogenerated if it is not filled out.
* **`Code`** and **`Term`** are unique within the same terminology.
* **`Code`** field cannot be edited after creation.

## Run validation

The Local Code System validation can be executed via a toolbar menu option: `Tools > Validate Local Termonologies`.

<figure><img src="/files/dyyesHU9qPH4tPOrGPdU" alt=""><figcaption><p>Validate Local Terminologies option</p></figcaption></figure>

Once the validation wizard is invoked, the Local Code System targeted for validations needs to be selected from the list of available Local Code Systems.

![Validation configuration wizard](https://snowowl.atlassian.net/wiki/download/thumbnails/611027521/image2020-11-23_13-42-25.png?version=1\&modificationDate=1606135346387\&cacheVersion=1\&api=v2\&height=250)

The execution of the rules works the same as that of the general Snow Owl validation rules.

For the results, there is a dedicated tab within the **Validation Issues View**, where users can browse the reported rule violations. Double-clicking on one of the reported issues will open the relevant Local Code's editor.

<figure><img src="/files/I36kw6sis4ocTohTjvMR" alt=""><figcaption><p>Local Code System related results in the Validation Issues view</p></figcaption></figure>

## Editing and authoring Reference Sets

Local Codes can be added as a map target in Map type Reference Sets.

For more information about editing and authoring Reference Sets,  please refer to the section below.

{% content-ref url="/pages/-MX7i-krf6J65hDavyHm" %}
[Adding Reference Set Members](/snow-owl-authoring-platform/reference-sets/authoring/adding-reference-set-members.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.b2ihealthcare.com/snow-owl-authoring-platform/local-code-systems/validation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
