Code ๐ฌ
Official URL: https://bcgov.github.io/nr-pies/docs/spec/element/data/code
JSON Schema URL: https://raw.githubusercontent.com/bcgov/nr-pies/refs/heads/main/docs/spec/element/data/code.schema.json
A code is a value taken from a set of controlled symbols defined within a Code System. Code values shall adhere to the SCREAMING_SNAKE_CASE convention, utilizing uppercase letters and underscores to delineate words. Code values may contain numeric digits, but they must not be the first character.
Scopeโ
This data type is intended to represent a finite set of controlled strings which represents a specific, discrete concept, element or idea.
Structureโ
Attribute | Value | Description & Constraints |
---|---|---|
Type | string | Shall be represented in UTF-8 format, as specified in RFC 3629, which is an extension of the ISO 10646-1 standard. |
Regex Pattern | ^[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)*$ | String which adheres to the SCREAMING_SNAKE_CASE convention: starts with an uppercase letter, followed by uppercase letters or digits, optionally separated by underscores, with no leading or trailing whitespace. |
Specificationโ
- Schema
- Source
{
"$id": "https://raw.githubusercontent.com/bcgov/nr-pies/refs/heads/main/docs/spec/element/data/code.schema.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Code",
"description": "A code symbol representing the primary code value.",
"type": "string",
"pattern": "^[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)*$"
}
Implementation Notesโ
This data structure is mainly meant to illustrate and restrict what is allowed to be encoded for an arbitrary code value. This is meant to only be used as a semantic reference point. This data structure is loosely inspired by the FHIR Code Type.