# Additional Property Definitions

Using the **Local Code System Editor**, Local Code Systems can be further configured by defining the properties for its Local Codes. For adding and defining these Additional Properties click on this button ![](https://snowowl.atlassian.net/wiki/download/attachments/1198358541/add-properties-enabled-icon.png?version=1\&modificationDate=1602678662565\&cacheVersion=1\&api=v2) at the right end side of the *Additional Properties* section bar.

![Local Code System editor with property definition context menu](https://snowowl.atlassian.net/wiki/download/attachments/1198358541/image2020-11-23_14-18-19.png?version=1\&modificationDate=1606137500198\&cacheVersion=1\&api=v2)

Local Code properties can be defined by the following attributes (\* are mandatory):

* **Name\***: unique name of the property
* **Type\***: type of the property

| Property types | Description                                                                                |
| -------------- | ------------------------------------------------------------------------------------------ |
| Boolean        | `true`\|`false`                                                                            |
| String         | text type                                                                                  |
| Integer        | integer numbers                                                                            |
| Decimal        | decimal numbers                                                                            |
| Date           | date with time part                                                                        |
| URI            | [Universal Resource Identifier](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier) |

* **Cardinality\***:

| Values | Description           |
| ------ | --------------------- |
| 0..1   | Optional              |
| 1..1   | Mandatory             |
| 0..\*  | Any                   |
| 1..\*  | Minimum one mandatory |

{% hint style="info" %}
The ![](https://snowowl.atlassian.net/wiki/download/attachments/1198358541/03.png?version=4\&modificationDate=1602684390858\&cacheVersion=1\&api=v2) icon warns the user that if the value of cardinality is reduced, properties may be deleted from that terminology. Hovering over the icon reveals the warning message.
{% endhint %}

* **Default value:** Initial value of the property.
* **Description:** String attribute to capture the description of the given property.
* **Validation expression**: JavaScript validation expression to evaluate when value is assigned to the property.
* **Validation message**: Validation message in case invalid property value entered (the validation expression evaluates to a `false`).

{% hint style="info" %}
Hovering over the name or its field of the property definition attributes brings up a tooltip, about the descriptions of the attributes.
{% endhint %}

![Example additional string property with a displayed tooltip information](https://snowowl.atlassian.net/wiki/download/attachments/1198358541/image2020-11-23_14-22-24.png?version=1\&modificationDate=1606137745891\&cacheVersion=1\&api=v2)

As a concrete example, the following definitions would need to be created for a Local Code System that groups codes related to medicinal products:

* **tradeName**
  * Type: `String`
  * Cardinality: `1..1`
  * Default value: `MYTEXT`
  * Description: `Trade name of the medicinal product.`
  * Validation expression: *`_this.value == _this.value.toUpperCase()`*
  * Validation message: `Trade name '%s' needs to be all uppercase.`
* **isVaccine**
  * Type: `Boolean`
  * Cardinality: `1..1`
* **numberOfTablets**
  * Type: `Integer`
  * Cardinality: `0..1`
  * Default value: `6`
  * Description: `The number of pills in the product.`
  * Validation expression: `_this.value > 0`
  * Validation message: `Number of tablets '%s' needs to be a positive number.`

{% hint style="info" %}
URI property types do not support validation expressions. In case of trying to enter something in the Validation expression field of a URI-type property, an error message will be present in the editor.
{% endhint %}

{% hint style="info" %}
Certain property names are reserved and cannot be used as names for additional properties. The following property names fall under the reserved category: *Code*, *Term*, *Alternative Terms*, *Is active*, and *Parent Concept Code*. Entering one of the reserved property names will trigger an error message in the editor.
{% endhint %}

![Example Local Code System with three additional property definitions](https://snowowl.atlassian.net/wiki/download/attachments/1198358541/05.png?version=4\&modificationDate=1602683984033\&cacheVersion=1\&api=v2)
