Coding ๐ฌ
Official URL: https://bcgov.github.io/nr-pies/docs/spec/element/data/coding
JSON Schema URL: https://raw.githubusercontent.com/bcgov/nr-pies/refs/heads/main/docs/spec/element/data/coding.schema.json
A Coding is a representation of a defined concept using a symbol from a defined
Code System. It is, at minimum, a combination of a code
, a code_set
and a
code_system
. A coding may contain a code_display
name.
The meaning of the Coding is defined by the code
. The code_system
provides the source of the definition of the code.
The code_display
is a human display for the text defined by the system; however it is not intended for computation.
Scopeโ
This data type is intended to represent an atomic representation of a specific, discrete concept, element or idea from a registered code system.
Structureโ
- A Coding shall always contain a
code
,code_set
andcode_system
attributes.- The
code
attribute is a Code string which represents the primary code value.- Should the
code
andcode_set
attributes conflict, thecode
attribute shall take precedence.
- Should the
- The
code_set
attribute is an array of Code which represents the code set value.- The code set is an ordered set of code symbols. The order of the code set is significant and shall be preserved.
- The code set shall contain at least one code symbol, but may contain multiple code symbols.
- The code set shall not contain duplicate code symbols.
- The last element of the code set shall be the primary code symbol and must be equal to the
code
attribute. - For code systems with an embedded hierarchy, the code set shall contain the full path to resolve the
code
concept being shared.
- The
code_system
attribute is an identifying string which represents the code system value.
- The
- A Coding may contain a
code_display
attribute.- The
code_display
attribute is a string which represents the human readable display name of the code value.- It is designed for human readability and not for computational purposes.
- The
Name | Cardinality | Type | Description & Constraints |
---|---|---|---|
code | 1..1 | Code | A code symbol representing the primary code value. It must match the last element of the code_set . |
code_display | 0..1 | string | A human-readable display name for the code value, intended for readability and not computation. |
code_set | 1..* | string[] | An ordered set of code symbols, where the last element must match the code attribute. The set must contain at least one symbol, preserve order, and not include duplicates. |
code_system | 1..1 | string | An identifying URI string representing the source code system for the code value. |
Specificationโ
- Schema
- Source
- Example
{
"$id": "https://raw.githubusercontent.com/bcgov/nr-pies/refs/heads/main/docs/spec/element/data/coding.schema.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Coding",
"description": "A representation of a defined concept using a symbol from a defined Code System.",
"type": "object",
"properties": {
"code": {
"$ref": "https://raw.githubusercontent.com/bcgov/nr-pies/refs/heads/main/docs/spec/element/data/code.schema.json"
},
"code_display": {
"type": "string",
"description": "A human-readable display name for the code value, intended for readability and not computation."
},
"code_set": {
"type": "array",
"description": "An ordered set of code symbols, where the last element must match the code attribute. The set must contain at least one symbol, preserve order, and not include duplicates.",
"items": {
"$ref": "https://raw.githubusercontent.com/bcgov/nr-pies/refs/heads/main/docs/spec/element/data/code.schema.json"
},
"minItems": 1,
"maxItems": 3,
"uniqueItems": true
},
"code_system": {
"type": "string",
"description": "An identifying URI string representing the source code system for the code value.",
"format": "uri",
"pattern": "^https://bcgov.github.io/nr-pies/docs/spec/code_system/.*$"
}
},
"required": [
"code",
"code_set",
"code_system"
]
}
{
"code": "referral",
"code_display": "Referral",
"code_set": [
"application",
"tech_review_comment",
"referral"
],
"code_system": "https://bcgov.github.io/nr-pies/docs/spec/code_system/application_process"
}
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.