AnyCodeListtypetype AnyCodeList = CodeList<string, string>;A code list of any name and codes.
A code list (commons data 0003-governance FR-001): the controlled vocabulary of a domain, a set of codes each with a label and, where the label is not enough, a definition. The names of its codes are literal types.
AnyCodeListtypetype AnyCodeList = CodeList<string, string>;A code list of any name and codes.
CodeListinterfaceno test imports itinterface CodeList<N extends string = string, K extends string = string>A code list.
| Member | Type | What it is |
|---|---|---|
kind | "codelist" | |
name | N | |
definition | string | |
codes | Readonly<Record<K, CodeSpec>> | |
annotations | readonly Annotation[] |
CodeListSpecinterfaceno test imports itinterface CodeListSpec<K extends string>What codeList is given.
| Member | Type | What it is |
|---|---|---|
definition? | string | |
codes | Readonly<Record<K, CodeSpec>> | |
annotations? | readonly Annotation[] |
CodeSpecinterfaceno test imports itinterface CodeSpecOne code: what a person is shown, and what it means where that is not enough.
| Member | Type | What it is |
|---|---|---|
label | string | |
definition? | string |
codeListfunctionfunction codeList<const N extends string, const K extends string>(name: N, spec: CodeListSpec<K>): CodeList<N, K>Makes a code list; total, it never fails (domain says what is wrong).
| Parameter | What it is |
|---|---|
name | its name |
spec | its definition, its codes and its annotations |
Returns: the code list, frozen