# Authoring

The authoring process of Custom Code Systems can flow on two different levels: [schema](#schema) and [concept](#concept).

## Schema

New property definitions can be added to the Code System on the _**Schema**_ page, after clicking on the <img src="https://241429605-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVwwvGKUkhNz5JGk0Ltmd%2Fuploads%2FNEKrfEYGqPmxLTeqA72c%2Fadd_property_button.png?alt=media&#x26;token=fa9790e2-94fb-405d-9bab-9f196ff1dd31" alt="" data-size="line"> button in the middle area.

![Add New Property Type](https://241429605-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVwwvGKUkhNz5JGk0Ltmd%2Fuploads%2Fgc4qFcdaTbMu1oznvxzx%2Fcode_system_schema_add_property.gif?alt=media\&token=7aa6c21e-20c0-4177-960c-df54abe302fd)

The following attributes can be specified for a property definition:

| Attribute         | Description                                             |
| ----------------- | ------------------------------------------------------- |
| **Name**          | Unique name of the property (mandatory)                 |
| **Type**          | [Type ](..#schema)of the property (mandatory)           |
| **Cardinality**   | Defines the [number of elements](..#schema) (mandatory) |
| **Default value** | Initial value of the property                           |
| **Description**   | Captures the purpose of the property                    |

{% hint style="info" %}
Once you added a property definition you can customize it by clicking in the text fields and entering an attribute value, or selecting one from the drop-down.
{% endhint %}

Changes to the property can be persisted by clicking the ![](https://241429605-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVwwvGKUkhNz5JGk0Ltmd%2Fuploads%2F56k9Lk6LnCgimC5sFch1%2Fcommit_change_icon.png?alt=media\&token=3b845d16-66b9-4824-97e0-f3a237f8ab4f) button.

{% hint style="info" %}
Different property types are indicated with different colors.
{% endhint %}

Existing properties can be edited after clicking the ![](https://241429605-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVwwvGKUkhNz5JGk0Ltmd%2Fuploads%2Fyj63Onv9VfwMmh6w36ej%2Fedit_icon_black.png?alt=media)button.&#x20;

## Concept

New concepts can be added to the Code System on the _**Content**_ page, after clicking on the ![](https://241429605-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVwwvGKUkhNz5JGk0Ltmd%2Fuploads%2FqoAxseHA2JvlTHPjy9Xi%2Fadd_concept_button.png?alt=media\&token=9eefa07c-5ef4-430e-acb9-2cac36dcf953)button.

![Create Code System Concept Wizard](https://241429605-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVwwvGKUkhNz5JGk0Ltmd%2Fuploads%2F5qbdVJFj8TBvs7MrZIHJ%2Fcreate_concept_wizard.png?alt=media\&token=a686d988-8991-40b1-9856-e7f1469ed1ee)

{% hint style="info" %}
If you select a concept from the tree, it will be considered the parent concept. You can change this in the creation wizard.
{% endhint %}

| Field      | Description                                                                                                                     |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------- |
| **Term**   | The name of the new concept (mandatory)                                                                                         |
| **Code**   | The identifier of the new concept. If you leave this field empty, the system will automatically generate an ID for your Concept |
| **Parent** | The concept under which the new concept will be created                                                                         |

After pressing the ![](https://241429605-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVwwvGKUkhNz5JGk0Ltmd%2Fuploads%2FWPAy1G5rvMG8zIjjC6Jk%2Fcreate_button.png?alt=media)button, the new concept will be added to the Code System tree and its editor will automatically open on the right side.

The preferred term of the concept - by default, the one defined during creation -  is indicated with an ![](https://241429605-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVwwvGKUkhNz5JGk0Ltmd%2Fuploads%2FFKRm0a0IflUUoviK8y6n%2Fpreferred_term_icon.png?alt=media\&token=a0cf3758-6b05-48b2-8776-49c5b3b0b620)icon.&#x20;

{% hint style="info" %}
You can specify alternative terms for a concept, and even move the preferred flag to the newly added terms.
{% endhint %}

### Properties

Property types defined in the Code System Schema are automatically displayed in the concept editor. Values can be added to the properties by pressing the <img src="https://241429605-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVwwvGKUkhNz5JGk0Ltmd%2Fuploads%2FNEKrfEYGqPmxLTeqA72c%2Fadd_property_button.png?alt=media&#x26;token=fa9790e2-94fb-405d-9bab-9f196ff1dd31" alt="" data-size="line"> button.

{% hint style="info" %}
If you specified a default value in the Schema, the property will automatically be populated with it when adding a new value.
{% endhint %}

{% hint style="warning" %}
If you restricted the potential number of values of a property, e.g. to`1..1`, the <img src="https://241429605-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVwwvGKUkhNz5JGk0Ltmd%2Fuploads%2FNEKrfEYGqPmxLTeqA72c%2Fadd_property_button.png?alt=media&#x26;token=fa9790e2-94fb-405d-9bab-9f196ff1dd31" alt="" data-size="line"> button won't appear and you won't be able to add more values to the given property.
{% endhint %}

### Issues

Users can raise issues related to specific Code System concepts using the ![](https://241429605-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVwwvGKUkhNz5JGk0Ltmd%2Fuploads%2FlhvxOkB61Df3FbWtNpwF%2Fraise_an_issue_icon.png?alt=media\&token=d0a9ea8d-5096-4106-9fcf-7dcdee52e36e) icon. Existing issues can be viewed by pressing the ![](https://241429605-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVwwvGKUkhNz5JGk0Ltmd%2Fuploads%2FHVafr9oNpkypWLcJkrQV%2Fdiscussions_icon.png?alt=media\&token=60f9c6d3-6af2-43fb-8b3d-d7058baf038d) icon.

{% hint style="info" %}
Want to find out more about issues? Visit the [Issue management](../../../issue-management) page for more information.
{% endhint %}
