--- type: "resource" title: "CodeSystem" resource: "CodeSystem" --- # CodeSystem ## Introduction ## Scope and Usage The FHIR terminology specification is based on the concepts of code system and value set originally defined in [HL7 v3 Core Principles](http://www.hl7.org/documentcenter/public/standards/V3/core_principles/infrastructure/coreprinciples/v3modelcoreprinciples.html): Code systems define which codes (symbols and/or expressions) exist, and how they are understood. Value sets select a set of codes from one or more code systems to specify which codes can be used in a particular context. The CodeSystem resource is used to declare the existence of a code system, and its key properties: - Identifying URL and version - Description, Copyright, publication date, and other metadata - Some key properties of the code system itself - e.g. whether it exhibits concept permanence, whether it defines a compositional grammar, and whether the codes that it defines are case sensitive - What filters can be used in value sets that use the code system in a ValueSet.compose element - What concept properties are defined by the code system In addition, the CodeSystem resource may list some or all of the concepts in the code system, along with their basic properties (code, display, definition), designations, and additional properties. Code System resources may also be used to define supplements, which extend an existing code system with additional designations and properties. The CodeSystem resource is not intended to support the process of maintaining code systems. Instead, the focus is on publishing the properties and optionally the content of a code system for use throughout the FHIR eco-system, such as to support value set expansion and validation. Note that the important existing (large) code systems (SNOMED CT, LOINC, RxNorm, ICD family, etc.) all have their own maintenance systems and distribution formats, and CodeSystem is generally not an efficient way to distribute their content, though it is used as one way of declaring the filters and properties associated with those code systems. ## Boundaries and Relationships - Code systems are used in [ValueSet](valueset) resources - The system element in the [Coding](datatypes#Coding) (i.e. Coding.system) refers to a CodeSystem resource instance by its canonical URL (i.e. CodeSystem.url) - The CodeSystem resource design is based, in part, on the code system functionality described in the [HL7 CTS 2](http://www.omg.org/spec/CTS2/1.0/) specification. A CTS2 server can be used to maintain code systems which are then published using the CodeSystem resource - The CodeSystem resource documents the inherent structure and capabilities of code system, whereas the [TerminologyCapabilities](terminologycapabilities) resource documents what a server hosting the code system is capable of The `CodeSystem` resource declares the existence of a code system and its key properties including its preferred identifier. The `NamingSystem` resource identifies the existence of a code or identifier system, and its possible and preferred identifiers. The key difference between the resources is who creates and manages them - `CodeSystem` resources are managed by the owner or publisher of the code system, who can properly define the code system features and content. `NamingSystem` resources, on the other hand, are frequently defined by 3rd parties that encounter the code system in use, and need to describe the use, but do not have the authority to define the features and content. Additionally, there may be multiple authoritative `NamingSystem` resources for a code system, but ideally there would be only one authoritative `CodeSystem` resource (identified by its canonical URL) that is provided by the code system publisher, with multiple copies distributed on additional FHIR servers or elsewhere and used where needed. Both Code System supplements and [Concept Maps](conceptmap) may be used to define relationships between concepts in different systems. ConceptMaps are assertions of the relationships between different concepts that are associated with particular contexts of use, while CodeSystem supplements are used to define inherent properties and semantics of the concepts in the code system ## Background and Context When using code systems and value sets, proper differentiation between a code system and a value set is important. This is one very common area where significant clinical safety risks occur in practice. Implementers should be familiar with the content in [Using Codes in Resources](terminologies). ### CodeSystem Identification A code system has three identifiers. The first two can be used to reference the code system in the FHIR context: - `CodeSystem.id`: The [logical id](resource#id) on the system that holds the CodeSystem resource instance - this typically is expected to change as the resource moves from server to server. The location URI is constructed by appending the logical id to the server base address where the instance is found and the resource type. This URI should be a resolvable URL by which the resource instance may be retrieved, usually from a FHIR server, and it may be a relative reference typically to the server base URL. - `CodeSystem.url`: The canonical URL that never changes for this code system - it is the same in every copy. The element is named `url` rather than `uri` for legacy reasons and to strongly encourage providing a resolvable URL as the identifier whenever possible. This canonical URL is used to refer to all instances of this particular code system across all servers and systems. Ideally, this URI should be a URL which resolves to the location of the master version of the code system, though this is not always possible. > For example, for CodeSystems that are part of the FHIR specification, CodeSystem.url is the url where the CodeSystem may be accessed in the FHIR specification. However, while a new version of the FHIR specification is being prepared, new code systems that are published in CI build versions will not be found in the released FHIR specification version. The third code system identifier is used typically for external references to the code system outside of FHIR: - `CodeSystem.identifier`: A system/value pair that is used to identify the code system in other contexts (such as an OID in an [HL7 v3](https://www.hl7.org/implement/standards/product_brief.cfm?product_id=186) specification) For further information regarding resource identification, see [Resource Identity](resource#id). This means that each code system has 2 different URIs that can be used to reference it - its canonical URL (the `url` element), and its local location from which it may be retrieved (which includes the `id` element). Most references to code systems use the canonical URL because it is stable and does not change from one FHIR server instance to another. Alternatively, the `identifier` and `version` elements may be used to reference this code system in a design, a profile, a [CDA](http://www.hl7.org/implement/standards/product_brief.cfm?product_id=7) template or [HL7 v3](https://www.hl7.org/implement/standards/product_brief.cfm?product_id=186) message (in the CD data type codeSystem and codeSystemVersion properties). These different contexts may make additional restrictions on the possible values of these elements. The `identifier` is generally not needed when using code systems in a FHIR context, where the canonical URL is always the focus. ## Notes ## Versioning Code Systems Most code systems evolve over time, due to corrections, clarifications, and changes to approach or underlying knowledge or reality. If these changes lead to the meanings of existing codes changing significantly, then the interpretation of the code system becomes version dependent. This significantly complicates implementation based on the code system, to the point where it is not clear that safety can be assured, so changing the meaning of an existing code SHOULD be avoided whenever possible. It is preferable to assign a new identifier to a code system when any concepts in it have a significant change in meaning (for example, the German diagnostic classification code system ICD10GM2009 has a different _system_ to ICD10GM2008), but this also can have substantial impact on implementation, so is often not practical - for instance, [SNOMED CT](http://snomed.org) has a complex version release framework, which may lead to variations in meaning of concepts, but there is only one identifier for SNOMED CT. For this reason, a code system MAY provide a version which can be specified in `CodeSystem.version`. The version SHOULD be provided whenever there are potentially significant changes in meaning across multiple releases of a code system. There is no particular format requirement for the version, though HL7 recommends a date-based approach, or [sem-ver](https://semver.org). When the `CodeSystem.versionNeeded` is 'true', then the CodeSystem.version value SHALL be used in [Coding](datatypes#coding) instances that refer to the code system. Where the terminology does not clearly define what string should be used to identify code system versions, the recommendation is to use as the version string the date (expressed in FHIR date format) on which the version of the code system that is being used was officially published. ## Multi-part Code Systems The simple case for a code system is that the entire code system - all the concepts and their codes, designations and properties are distributed in a single `CodeSystem` resource. However, for a variety of reasons, code systems may be distributed by the code system authority in a set of fragments, and other authorities may issue additional designations and properties in supplements. ## Code System Fragments If the `CodeSystem.content` value is `fragment`, then the resource describes part of a code system. Code Systems may be distributed in fragments for the following reasons: - Different IP distribution rules for different parts of the code system - Special purpose modules for specific purposes - Distribution of proposed content for evaluation The following rules apply to code system fragments: - All fragments SHALL have the same CodeSystem.url - Fragments can only be published by the code system authority, or according to a process defined by the authority, if they have defined one - Fragments cannot contain any codes, concepts or properties that would not be found in a complete representation of the code system, if one exists. Implementers should note that a "complete representation" of the code system might not exist in a single authoritative publication (e.g., SNOMED International with all modules/extensions) - Publishing a code system in multiple fragments can create confusion for terminology servers and terminology service consumers. - The intent, bounds and consequences of the fragmentation are clearly defined in the fragment or the code system documentation. ## Code System Supplements If the `CodeSystem.content` value is `supplement`, then the resource describes a code system supplement. The following rules apply to code system supplements: - The `CodeSystem.supplements` element SHALL have a value, which is the URL of the code system being supplemented - The `CodeSystem.url` for a supplement SHALL never appear in a [Coding.system](datatypes#Coding) - The `CodeSystem.url` for a supplement must be under the control of the authority creating or publishing the supplement (e.g. not in the same space as the code system being supplemented, unless the supplement is being issued by the same authority as the original code system - A codesystem supplement cannot define any new CodeSystem.concept.code. i.e.: all CodeSystem.concept.code in the supplement must be a code from the "supplemented" code system. Some code systems reserve code space for local use without explicitly declaring codes; these codes may be referenced in a supplement If a supplement needs to define new concepts/codes to use as property values, it can be paired with a new (possibly contained) Code System and use the `Coding` type for the property values. ## Display, Definition and Designations Concepts have both a `display` and a `definition`. The display is a short text that represents the meaning of the concept to human users, while the definition is a more formal statement of the meaning of the concept, which is often longer. All concepts SHOULD have a `display` and a `definition`, though it is not mandatory because there are many cases where no such properties are provided, in spite of their utility and importance for clear and safe communication. In addition to the display and definition, a concept can have one or more `designation` elements. The display is equivalent to a special designation with an implied `designation.use` meaning "primary code/designation" and a language equal to the [Resource Language](resource#language). The designations can provide additional displays for other language, as well as designations for other purposes. When using concepts, applications use the `display` and `designation` unless the language or usage in context provides a reason to use one of the designations. ## Concept Properties Each code system can define one or more concept properties. Each concept defined by the code system may have one or more values for each concept property defined by the code system. Typical uses for properties include: - Tracking administrative status (inactive, deprecation date) - Providing additional statements about the meaning of the concept - Defining structured relationships with other concepts in the code system - Assigning scoring values to the concepts Properties are identified by their master URI (`CodeSystem.property.uri`), and then, by their code (`CodeSystem.property.code`), which is used both internally within the code system resource (`CodeSystem.concept.property.code`) and also externally, in the following places: - [ConceptMap](conceptmap-definitions#ConceptMap.group.element.target.dependsOn.property): `ConceptMap.element.target.dependsOn.property` and `ConceptMap.element.target.product.property` - [ValueSet](valueset-definitions#ValueSet.compose.include.filter.property): `ValueSet.compose.include.filter.property` can refer to any defined code system property - [$lookup operation](codesystem-operations#lookup): In `Parameters.parameter.name` when returning information about a code - [$translate operation](conceptmap-operations#translate): In `Parameters.parameter.part.name` for dependencies and products Properties are defined using the following elements: | **Name** | **Details** | **Description** | | --- | --- | --- | | code | [code](datatypes#code) | Used to identify the property, in the places shown in the list immediately above this table | | uri | optional [uri](datatypes#code) | Reference to the formal meaning of the property. One possible source of meaning is the [Concept Properties](codesystem-concept-properties) code system. This part of the definition is optional, but is recommended to provide an additional level of definitional consistency. See further comments below | | description | optional [string](datatypes#code) | A description of the property- why it is defined, and how its value might be used | | type | code | Coding | string | integer | boolean | dateTime | decimal | The type of the property value. The values for properties of type "code" (CodeSystem.concept.property.valueCode) are drawn from the codes defined in the CodeSystem instance. | Properties do not have to have a `uri` the formally defines them, but they SHOULD have a `uri`, and this is particularly important when using properties across multiple code systems. The following guidelines apply: - By convention, property URIs SHOULD have the form {canonical}#{code} where {canonical} is the CodeSystem URI, and {code} is the code for the property - The convention {canonical}#{code} is also used in some contexts to refer directly to a concept defined by the CodeSystem, so if there is a concept defined with the same code as the property, it is treated as a 'backing' concept, to allow reasoning and use in value sets - Properties are explicitly defined, not implied by the existence of a concept with the same code, and the definitions and properties of the concept to not contribute to the definition of the property - CodeSystems MAY (and should!) use properties defined in other code system. The [Concept Properties](codesystem-concept-properties) Code System exists for this purpose, and the properties defined there SHOULD always be used where applicable - When using a property defined in another code system, a code system SHOULD provide a full definition - `code`, `uri`, `description`, `type`, and [valueSet](https://hl7.org/fhir/extensions/StructureDefinition-codesystem-property-valueset.html) where applicable - In such cases, the definition of the property must be consistent with the source CodeSystem. CodeSystems MAY contain additional descriptive text around the use of the property, and MAY narrow the applicable value set if there is one - If any of these features are not redeclared, applications SHOULD assume that the source CodeSystem definitions apply Note that properties provide a common view of concept relationships that is common across all code systems. Some code systems define properties with more sophistication, such as groups of properties, or subsumption relationships between properties (e.g. SNOMED CT). Servers providing support for these code systems will need to know full details about the underlying relationships in order to provide the correct information about concepts and their properties, but this information does not surface in the resources or operations defined by the FHIR specification. ## Defined Concept Properties In order to assist with consistency between code systems, the following basic property URIs are defined in the [Concept Properties](codesystem-concept-properties) code system: Note: all the properties in the table below are prefixed by `http://hl7.org/fhir/concept-properties#` such that the url that identifies the `status` property is actually `http://hl7.org/fhir/concept-properties#status`. The prefix is omitted from the table to improve it's presentation. table.fixedfirst td:first-child { white-space: nowrap; } | URL Tail | Type | Description | | --- | --- | --- | | ...status![btn](icon_clipboard.png) | code | A property that indicates the status of the concept. If the property is identified by this URL, then it SHALL use at least these status values (where appropriate): - active - the concept is for normal use - experimental - provided for trial, but may be removed in the future - deprecated - the concept is outdated and planned to be withdrawn from use - retired - still present for historical reasons, but no longer allowed to be used | | ...inactive![btn](icon_clipboard.png) | boolean | True if the concept is not considered active - e.g. not a valid concept any more. Property type is boolean, default value is false | | ...effectiveDate![btn](icon_clipboard.png) | date | The date at which the concept status was last changed | | ...deprecationDate![btn](icon_clipboard.png) | date | Date Concept was deprecated | | ...retirementDate![btn](icon_clipboard.png) | date | Date Concept was retired | | ...notSelectable![btn](icon_clipboard.png) | boolean | This concept is a grouping concept and not intended to be used in the normal use of the code system (though may be used for filters etc.). This is also known as 'Abstract' | | ...parent![btn](icon_clipboard.png) | code | An immediate parent of the concept in the hierarchy | | ...child![btn](icon_clipboard.png) | code | An immediate child of the concept in the hierarchy | | ...partOf![btn](icon_clipboard.png) | code | The concept identified in this property (by its code) contains this concept as a component | | ...synonym![btn](icon_clipboard.png) | code | This property contains an alternative code that may be used to identify this concept instead of the primary code (deprecated: use `alternateCode`, and see the [discussion below](#synonyms)) | | ...alternateCode![btn](icon_clipboard.png) | code | This property contains the code for another representation of this concept, with the same real-world meaning, in this code system | | ...comment![btn](icon_clipboard.png) | string | A string that provides additional detail pertinent to the use or understanding of the concept | | ...itemWeight![btn](icon_clipboard.png) | decimal | A numeric value that allows the comparison (less than, greater than) or other numerical manipulation of a concept (e.g. Adding up components of a score). Scores are usually a whole number, but occasionally decimals are encountered in scores | | ...order![btn](icon_clipboard.png) | decimal | A property that indicates the order of the concept amongst its siblings in the code system e.g. severity. The code system specific purpose of the ordering is defined elsewhere | | ...definition![btn](icon_clipboard.png) | string | The definition of the concept. This corresponds to CodeSystem.concept.definition and is not used in the definition of CodeSystems but is used when clients request the definition property be included in an expansion | | ...lastVersionActive![btn](icon_clipboard.png) | string | If the code is not active (properties inActive or based on status), then this property conveys in what code system version it was last an active code | | ...replacedBy\[X\] | string | These two properties identify a concept that is considered to replace the use of this concept. These properties are generally only used on deprecated, withdrawn or inactive concepts. Variant #1: ...replacedByCode![btn](icon_clipboard.png): Identifies another concept in the same code system Variant #2: ...replacedByCoding![btn](icon_clipboard.png): Identifies another concept in a different code system Use cases: - replacing a with a new code/concept that corrects an error in a now retired concept - replacement of a temporary local code by something that's been added to LOINC or SNOMED CT and should be used instead | Code System representations SHOULD use these properties where possible and these codes for these properties. Code System representations SHOULD regard the codes for these properties (e.g. status, inactive, notSelectable, etc.) as reserved values in CodeSystem.property.code values and that when used they SHOULD refer to the properties defined in the concept properties code system. In the absence of CodeSystem.property data elements being provided, when properties with these code values are added to a concept (in CodeSystem.concept.property.code) the intended property SHOULD be assumed to refer to the defined concept properties in the [http://hl7.org/fhir/concept-properties](codesystem-concept-properties) code system. The parent and child properties are used when performing concept lookup (using the [$lookup](codesystem-operations#lookup) operation), and when using properties to indicate parent/child relationships (see below). ### Concept Status Many Code Systems have a 'status' associated with the concept. This may categorize the concept as: - Experimental - provided for trial, but may be removed in the future - Active - in normal use - Deprecated - planned to be removed from use - Retired - still present for historical reasons, but no longer allowed to be used There is wide variation in the life cycles supported by the different code systems and the words they use to describe the various status values they use, and some code systems have additional status values. HL7 uses Active, Deprecated and Retired. These ideas overlap with setting the concept to 'inactive'. In addition, concepts have dates associated with their retirement or deprecation and some code systems imply the status by providing dates. In addition to these status codes, concepts may also be labeled 'notSelectable' (aka 'Abstract'), which means "not to be used in some circumstances", though the exact circumstances need to be clarified somewhere. This is sometimes also considered a status, though it's usually dependent on the context of use (e.g. set in a ValueSet). The status value overlaps with other properties, in particular, the inactive property. In general, the following rules apply: - If concept status is some kind of active, inactive must be set to false if present, and the concept is treated as not inactive. - If concept status is some kind of inactive, inactive must be set to true if present, and the concept is treated as inactive. - If concept status is some kind of retired, inactive must be set to true if present, and the concept is treated as inactive. - If concept status indicates that the concept is experimental or deprecated, the determination of inactive is code system specific - If neither concept properties are present default behavior for the CodeSystem applies. The status also relates to properties such as deprecation and retirement date. The status of the concept SHOULD always be consistent with these other properties. ### Synonyms and Alternate Codes Many code systems define multiple codes for the same real world concept. Some code systems do this as a matter of policy (e.g. case-sensitive vs case insensitive) while others arise over time as the editorial process unfolds. Some established code systems treat these as synonym codes for the same concept, while others treat them as synonym concepts - duplicated concepts with the same real world meaning, though the definition sometimes differ. Another reason for duplicated concepts is to deal with implied poly-heirarchical concepts in systems that do not support formal poly-heirarchies. Whatever the reason, in FHIR code systems, all kinds of synonyms are represented the same way: as duplicate concepts with a declared relationship between them. The relationship is declared using the 'alternateCode' property, which identities another concept with the same real-world meaning that the code system defines. In most cases (but not necessarily all), the concepts related with the alternateCode property will have the same: - property values (with the exception of alternateCode, and administrative properties) - designations The alternateCode property allows CodeSystem resource instances to represent multiple codes for a concept defined in a code system. The correct way to use the alternateCode property for an instance of CodeSystem.concept (A): - the alternateCode value must be the code associated with a different CodeSystem.concept (B) in the same CodeSystem; and - B SHALL contain an instance of the alternateCode property with the value of the code for A. I.e. reflexivity is required (see csd-6 above) - All relationships shall be explicit - relationships (including transitivity and parent/child) must not be assumed. > **Note to Balloters:** This section is newly introduced in R6 after extensive consideration in committee, and comments are sought. ## Concept Hierarchy Code systems may be presented hierarchically using either nested concept elements or properties. When exclusively using nested concept elements the code system hierarchy is a single tree, and concepts have only one parent. When using properties, polyhierarchies are allowed (e.g. concepts may have more than one parent). If a code system hierarchy is represented using properties (typically, concepts that are subsumed by more than one other concept), nested concepts SHOULD NOT be used to represent any parts of the hierarchy structure in the Code System resource; the relationships between concepts should be defined using [properties](#properties). Operations based on the codeSystem resource SHALL have the same result whether or not the relationships are represented explicitly as properties or implicitly using the CodeSystem resource hierarchy. ## Subsumption Testing The words 'subsume', 'subsumes', 'subsumed' and 'subsumption' are defined in relation to the type of hierarchy (i.e. the value of [CodeSystem.hierarchyMeaning](codesystem-definitions#CodeSystem.hierarchyMeaning)) identified for the code system that is being represented by the CodeSystem resource. Concept A is considered to be subsumed by Concept B if it comes under Concept B in the hierarchy, or if a parent/child relationship is declared in the properties, and the hierarchyMeaning is "is-a"). Where a CodeSystem does not declare its hierarchy meaning directly, then the code system documentation must be consulted manually to determine how subsumption is determined. If there is no definition, none of the subsumption based features can be used with the code system. Subsumption based logic arises explicitly or implicitly in the following places in the FHIR specification: - [CodeSystem $subsumes operation](codesystem-operations#subsumes) - [CodeSystem $lookup operation](codesystem-operations#lookup) - [Search by subsumption](search#subsumption) - [ValueSet $expand operation](valueset-operations#expand) - [ValueSet $validate-code operation](valueset-operations#validate-code) ## Filters The following filters are defined for all code systems: | Property Name | Operation | Value | Definition | Notes | | --- | --- | --- | --- | --- | | code | regex | \[string\] | Matches any concept with the code matching the supplied string | The regex flavor is determined by the server | | \[property\] | \= | \[string\] | Includes all codes that have a property value equal to the specified string, where \[property\] is the code for any [defined property](#properties). Where the type of the property is on of `integer`, `dateTime` or `decimal`, the FHIR search prefixes and semantics apply (see below) | | | \[property\] | in | \[string,string...\] | Includes all codes that have a property value equal to one of the specified strings, where \[property\] is the code for any [defined property](#properties) | The values cannot include ",", since it is being used as a delimiter | | \[property\] | regex | \[string\] | Includes all codes that have a property value matching the specified regex | | | \[property\] | exists | true or false | When value is "true", includes all codes that have the specified property. When value is "false", includes all codes that lack the specified property | | | designation | \= | \[string\] | Matches any concept with a designation equal to the supplied string | Designations considered include the concept.display, which counts as a designation | | designation | regex | \[string\] | Matches any concept with a designation matching the supplied string | Designations considered include the concept.display, which counts as a designation | The following filters are defined for all code systems that support "is-a" relationships between concepts. (The filters can be used regardless of whether the "is-a" relationships are conveyed as concept properties or as concept nesting): | Property Name | Operation | Value | Definition | Notes | | --- | --- | --- | --- | --- | | concept | is-a | \[string\] concept code | Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, including the provided concept itself (include descendant codes and self). | | | concept | descendent-of | \[string\] concept code | Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, excluding the provided concept itself (i.e. include descendant codes only). | | | concept | in | not-in | \[string\] a comma separated list of codes, or a value set uri | Concepts in the list, or concepts in the value set expansion. | | | concept | is-not-a | \[string\] concept code | The specified property of the code does not have an is-a relationship with the provided value. | | | concept | generalizes | \[string\] concept code | Includes all concept ids that have a transitive is-a relationship from the concept Id provided as the value, including the provided concept itself (i.e. include ancestor codes and self). | | | concept | child-of | \[string\] concept code | Only concepts with a direct hierarchical relationship to the index code and no other concepts. This does not include the index code in the output. | | | concept | descendent-leaf | \[string\] concept code | Includes concept ids that have a transitive is-a relationship with the concept Id provided as the value, but which do not have any concept ids with transitive is-a relationships with themselves. | | ### FHIR Search Semantics If the `=` filter is used with a property that is defined on the CodeSystem, and if the property has a type of `integer`, `dateTime` or `decimal`, then the FHIR search rules apply. This means that the following prefixes may be used in the value of the filter: - **eq**: the code has a value for the property on the code and it is equal to the provided value - **ne**: the code has a value for the property on the code and it is not equal to the provided value - **gt**: the code has a value for the property on the code and it is greater than the provided value - **lt**: the code has a value for the property on the code and it is less than the provided value - **ge**: the code has a value for the property on the code and it is greater or equal to the provided value - **le**: the code has a value for the property on the code and it is less or equal to the provided value - **sa**: the code has a value for the property on the code and it is starts after the provided value - **eb**: the code has a value for the property on the code and it is ends before the provided value - **ap**: the code has a value for the property on the code and it is approximately the same to the provided value The semantics of prefixes are as explained on the search page with regard to precision and range considerations, particularly on dates and decimals. Note that `eq` is not redundant - in it's absence, the semantics are for a direct string match, not a smart match as defined by the search semantics. Some Examples: { "property": "retiredDate", "operator": "=", "value": "lt2021-01-01" } Any code that was retired before 2021. Regarding precision: { "property": "retiredDate", "operator": "=", "value": "eq2022" } would match a concept with a retiredDate of 2022-09-12. However: { "property": "retiredDate", "operator": "=", "value": "2022" } would not match a concept with a retiredDate of 2022-09-12. ## Implicit Code Systems Some other parts of the FHIR infrastructure define set of concepts that may also be treated as code systems. This is most useful when mapping between systems using [Concept Maps](conceptmap "[%resdesc ConceptMap%]"), but might also be useful for other code system related functionality (e.g. subsetting using [Value Sets](valueset "[%resdesc ValueSet%]")). The table below summarizes how to treat these items as a code system: | **[StructureDefinition](structuredefinition "[%resdesc StructureDefinition%]")** | **URL** (CodeSystem.url) | `[StructureDefinition.url](structuredefinition-definitions#StructureDefinition.url)` | | --- | --- | --- | | **Concept** (CodeSystem.concept) | Each `[StructureDefinition.snapshot.element](structuredefinition-definitions#StructureDefinition.snapshot.element)` element corresponds to a code system concept. | | **Code** (CodeSystem.concept.code) | `[StructureDefinition.snapshot.element.id](types-definitions#Element.id)` | | **Display** (CodeSystem.concept.display) | `[StructureDefinition.snapshot.element.label](elementdefinition-definitions#ElementDefinition.label)` if one exists, otherwise `[StructureDefinition.snapshot.element.short](elementdefinition-definitions#ElementDefinition.short)` | | **Definition** (CodeSystem.concept.definition) | `[StructureDefinition.snapshot.element.definition](elementdefinition-definitions#ElementDefinition.definition)` | | **[Questionnaire](questionnaire "[%resdesc Questionnaire%]")** | **URL** (CodeSystem.url) | `[Questionnaire.url](questionnaire-definitions#Questionnaire.url)` | | **Concept** (CodeSystem.concept) | Each `[Questionnaire.item](questionnaire-definitions#Questionnaire.item)` element corresponds to a code system concept. | | **Code** (CodeSystem.concept.code) | `[Questionnaire.item.linkId](questionnaire-definitions#Questionnaire.item.linkId)`. Note: `Questionnaire.item` elements without a linkId cannot be addressed. | | **Display** (CodeSystem.concept.display) | `[Questionnaire.item.text](questionnaire-definitions#Questionnaire.item.text)` | | **Definition** (CodeSystem.concept.definition) | Questionnaire-based implicit code system concepts do not have a definition. | | **[Requirements](requirements "[%resdesc Requirements%]")** | **URL** (CodeSystem.url) | `[Requirements.url](requirements-definitions#Requirements.url)` | | **Concept** (CodeSystem.concept) | Each `[Requirements.statement](requirements-definitions#Requirements.statement)` element corresponds to a code system concept. | | **Code** (CodeSystem.concept.code) | `[Requirements.statement.key](requirements-definitions#Requirements.statement.key)` | | **Display** (CodeSystem.concept.display) | `[Requirements.statement.label](requirements-definitions#Requirements.statement.label)` if one exists, otherwise `[Requirements.statement.key](requirements-definitions#Requirements.statement.key)`. | | **Definition** (CodeSystem.concept.definition) | `[Requirements.statement.requirement](requirements-definitions#Requirements.statement.requirement)` | | **[Measure](measure "[%resdesc Measure%]")** | **URL** (CodeSystem.url) | `[Measure.url](measure-definitions#Measure.url)` | | **Concept** (CodeSystem.concept) | Each Measure element with a `linkId` element corresponds to a code system concept. Specifically, - `[Measure.group](measure-definitions#Measure.group)` - `[Measure.group.population](measure-definitions#Measure.group.population)` - `[Measure.group.stratifier](measure-definitions#Measure.group.stratifier)` - `[Measure.group.stratifier.component](measure-definitions#Measure.group.stratifier.component)` - `[Measure.supplementalData](measure-definitions#Measure.supplementalData)` | | **Code** (CodeSystem.concept.code) | - `[Measure.group.linkId](measure-definitions#Measure.group.linkId)` for Measure.group concepts. - `[Measure.group.population.linkId](measure-definitions#Measure.group.population.linkId)` for Measure.group.population concepts. - `[Measure.group.stratifier.linkId](measure-definitions#Measure.group.stratifier.linkId)` for Measure.group.stratifier concepts. - `[Measure.group.stratifier.component.linkId](measure-definitions#Measure.group.stratifier.component.linkId)` for Measure.group.stratifier.component concepts. - `[Measure.supplementalData.linkId](measure-definitions#Measure.supplementalData.linkId)` for Measure.supplementalData concepts. | | **Display** (CodeSystem.concept.display) | - `[Measure.group.title](measure-definitions#Measure.group.title)` for Measure.group concepts. - `[Measure.group.population.title](measure-definitions#Measure.group.population.title)` for Measure.group.population concepts. - `[Measure.group.stratifier.title](measure-definitions#Measure.group.stratifier.title)` for Measure.group.stratifier concepts. - `[Measure.group.stratifier.component.code](measure-definitions#Measure.group.stratifier.component.code)` for Measure.group.stratifier.component concepts. - `[Measure.supplementalData.description](measure-definitions#Measure.supplementalData.description)` for Measure.supplementalData concepts. | | **Definition** (CodeSystem.concept.definition) | - `[Measure.group.description](measure-definitions#Measure.group.description)` for Measure.group concepts. - `[Measure.group.population.description](measure-definitions#Measure.group.population.description)` for Measure.group.population concepts. - `[Measure.group.stratifier.description](measure-definitions#Measure.group.stratifier.description)` for Measure.group.stratifier concepts. - `[Measure.group.stratifier.component.description](measure-definitions#Measure.group.stratifier.component.description)` for Measure.group.stratifier.component concepts. - `[Measure.supplementalData.description](measure-definitions#Measure.supplementalData.description)` for Measure.supplementalData concepts. | The above resource instances continue to use their `url` value as they normally would. However, whenever that URL appears as a value in the following fixed number of elements or parameters it SHALL be interpreted to be the implicit code system: - `[Coding.system](datatypes-definitions#Coding.system)` - `[ValueSet.compose.include.system](valueset-definitions#ValueSet.compose.include.system)` - `[ValueSet.compose.exclude.system](valueset-definitions#ValueSet.compose.exclude)` - `[ConceptMap.group.source](conceptmap-definitions#ConceptMap.group.source)` - `[ConceptMap.group.target](conceptmap-definitions#ConceptMap.group.target)` - `[TerminologyCapabilities.codeSystem.uri](terminologycapabilities-definitions#TerminologyCapabilities.codeSystem.uri)` - `exclude-system`, `system-version`, `check-system-version`, and `force-system-version` input parameters to `[$expand on ValueSet](valueset-operation-expand)` operation. - `system-version`, `check-system-version` and `force-system-version` input parameters to `[$validate-code on ValueSet](valueset-operation-validate-code)` operation. - `url` input parameter to `[$validate-code on CodeSystem](codesystem-operation-validate-code)` operation. > **Note to Balloters:** > > - The list may be expanded in future, but these are cases already in use by the implementer community. > - Code system properties are not defined at this time, but ballot feedback on this is welcome. ## StructureDefinition ### Elements (Simplified) - **[CodeSystem](/codesystem-definitions#CodeSystem)** [0..*]: - Declares the existence of and describes a code system or code system supplement - **[CodeSystem.url](/codesystem-definitions#CodeSystem.url)** [0..1]: [uri](/uri) Canonical identifier for this code system, represented as a URI (globally unique) (Coding.system) - **[CodeSystem.identifier](/codesystem-definitions#CodeSystem.identifier)** [0..*]: [Identifier](/Identifier) Additional identifier for the code system (business identifier) - **[CodeSystem.version](/codesystem-definitions#CodeSystem.version)** [0..1]: [string](/string) Business version of the code system (Coding.version) - **[CodeSystem.versionAlgorithm[x]](/codesystem-definitions#CodeSystem.versionAlgorithm%5Bx%5D)** [0..1]: [string](/string), [Coding](/Coding) extensible:[version-algorithm](/valueset-version-algorithm) How to compare versions - **[CodeSystem.name](/codesystem-definitions#CodeSystem.name)** [0..1]: [string](/string) Name for this code system (computer friendly) - **[CodeSystem.title](/codesystem-definitions#CodeSystem.title)** [0..1]: [string](/string) Name for this code system (human friendly) - **[CodeSystem.status](/codesystem-definitions#CodeSystem.status)** [1..1]: [code](/code) required:[publication-status](/valueset-publication-status) draft | active | retired | unknown - **[CodeSystem.experimental](/codesystem-definitions#CodeSystem.experimental)** [0..1]: [boolean](/boolean) For testing only - never for real usage - **[CodeSystem.date](/codesystem-definitions#CodeSystem.date)** [0..1]: [dateTime](/dateTime) Date last changed - **[CodeSystem.publisher](/codesystem-definitions#CodeSystem.publisher)** [0..1]: [string](/string) Name of the publisher/steward (organization or individual) - **[CodeSystem.contact](/codesystem-definitions#CodeSystem.contact)** [0..*]: [ContactDetail](/ContactDetail) Contact details for the publisher - **[CodeSystem.description](/codesystem-definitions#CodeSystem.description)** [0..1]: [markdown](/markdown) Natural language description of the code system - **[CodeSystem.useContext](/codesystem-definitions#CodeSystem.useContext)** [0..*]: [UsageContext](/UsageContext) The context that the content is intended to support - **[CodeSystem.jurisdiction](/codesystem-definitions#CodeSystem.jurisdiction)** [0..*]: [CodeableConcept](/CodeableConcept) extensible:[jurisdiction](/valueset-jurisdiction) Jurisdiction of the authority that maintains the code system (if applicable) - **[CodeSystem.purpose](/codesystem-definitions#CodeSystem.purpose)** [0..1]: [markdown](/markdown) Why this code system is defined - **[CodeSystem.copyright](/codesystem-definitions#CodeSystem.copyright)** [0..1]: [markdown](/markdown) Notice about intellectual property ownership, can include restrictions on use - **[CodeSystem.copyrightLabel](/codesystem-definitions#CodeSystem.copyrightLabel)** [0..1]: [string](/string) Copyright holder and year(s) - **[CodeSystem.approvalDate](/codesystem-definitions#CodeSystem.approvalDate)** [0..1]: [date](/date) When the CodeSystem was approved by publisher - **[CodeSystem.lastReviewDate](/codesystem-definitions#CodeSystem.lastReviewDate)** [0..1]: [date](/date) When the CodeSystem was last reviewed by the publisher - **[CodeSystem.effectivePeriod](/codesystem-definitions#CodeSystem.effectivePeriod)** [0..1]: [Period](/Period) When the CodeSystem is expected to be used - **[CodeSystem.topic](/codesystem-definitions#CodeSystem.topic)** [0..*]: [CodeableConcept](/CodeableConcept) example:[definition-topic](/valueset-definition-topic) E.g. Education, Treatment, Assessment, etc - **[CodeSystem.author](/codesystem-definitions#CodeSystem.author)** [0..*]: [ContactDetail](/ContactDetail) Who authored the CodeSystem - **[CodeSystem.editor](/codesystem-definitions#CodeSystem.editor)** [0..*]: [ContactDetail](/ContactDetail) Who edited the CodeSystem - **[CodeSystem.reviewer](/codesystem-definitions#CodeSystem.reviewer)** [0..*]: [ContactDetail](/ContactDetail) Who reviewed the CodeSystem - **[CodeSystem.endorser](/codesystem-definitions#CodeSystem.endorser)** [0..*]: [ContactDetail](/ContactDetail) Who endorsed the CodeSystem - **[CodeSystem.relatedArtifact](/codesystem-definitions#CodeSystem.relatedArtifact)** [0..*]: [RelatedArtifact](/RelatedArtifact) Additional documentation, citations, etc - **[CodeSystem.caseSensitive](/codesystem-definitions#CodeSystem.caseSensitive)** [0..1]: [boolean](/boolean) If code comparison is case sensitive - **[CodeSystem.valueSet](/codesystem-definitions#CodeSystem.valueSet)** [0..1]: [canonical](/canonical) Canonical reference to the value set with entire code system - **[CodeSystem.hierarchyMeaning](/codesystem-definitions#CodeSystem.hierarchyMeaning)** [0..1]: [code](/code) required:[codesystem-hierarchy-meaning](/valueset-codesystem-hierarchy-meaning) grouped-by | is-a | part-of | classified-with - **[CodeSystem.compositional](/codesystem-definitions#CodeSystem.compositional)** [0..1]: [boolean](/boolean) If code system defines a compositional grammar - **[CodeSystem.versionNeeded](/codesystem-definitions#CodeSystem.versionNeeded)** [0..1]: [boolean](/boolean) If definitions are not stable - **[CodeSystem.content](/codesystem-definitions#CodeSystem.content)** [1..1]: [code](/code) required:[codesystem-content-mode](/valueset-codesystem-content-mode) not-present | example | fragment | complete | supplement - **[CodeSystem.supplements](/codesystem-definitions#CodeSystem.supplements)** [0..1]: [canonical](/canonical) Canonical URL of Code System this adds designations and properties to - **[CodeSystem.count](/codesystem-definitions#CodeSystem.count)** [0..1]: [unsignedInt](/unsignedInt) Total concepts in the code system - **[CodeSystem.filter](/codesystem-definitions#CodeSystem.filter)** [0..*]: [BackboneElement](/BackboneElement) Filter that can be used in a value set - **[CodeSystem.filter.code](/codesystem-definitions#CodeSystem.filter.code)** [1..1]: [code](/code) Code that identifies the filter - **[CodeSystem.filter.description](/codesystem-definitions#CodeSystem.filter.description)** [0..1]: [string](/string) How or why the filter is used - **[CodeSystem.filter.operator](/codesystem-definitions#CodeSystem.filter.operator)** [1..*]: [code](/code) required:[filter-operator](/valueset-filter-operator) = | is-a | descendent-of | is-not-a | regex | in | not-in | generalizes | child-of | descendent-leaf | exists - **[CodeSystem.filter.value](/codesystem-definitions#CodeSystem.filter.value)** [1..1]: [string](/string) What to use for the value - **[CodeSystem.property](/codesystem-definitions#CodeSystem.property)** [0..*]: [BackboneElement](/BackboneElement) Additional information supplied about each concept - **[CodeSystem.property.code](/codesystem-definitions#CodeSystem.property.code)** [1..1]: [code](/code) Identifies the property on the concepts, and when referred to in operations - **[CodeSystem.property.uri](/codesystem-definitions#CodeSystem.property.uri)** [0..1]: [uri](/uri) Formal identifier for the property - **[CodeSystem.property.description](/codesystem-definitions#CodeSystem.property.description)** [0..1]: [string](/string) Why the property is defined, and/or what it conveys - **[CodeSystem.property.type](/codesystem-definitions#CodeSystem.property.type)** [1..1]: [code](/code) required:[concept-property-type](/valueset-concept-property-type) code | Coding | string | integer | boolean | dateTime | decimal - **[CodeSystem.concept](/codesystem-definitions#CodeSystem.concept)** [0..*]: [BackboneElement](/BackboneElement) Concepts in the code system - **[CodeSystem.concept.code](/codesystem-definitions#CodeSystem.concept.code)** [1..1]: [code](/code) Code that identifies concept - **[CodeSystem.concept.display](/codesystem-definitions#CodeSystem.concept.display)** [0..1]: [string](/string) Text to display to the user - **[CodeSystem.concept.definition](/codesystem-definitions#CodeSystem.concept.definition)** [0..1]: [string](/string) Formal definition - **[CodeSystem.concept.designation](/codesystem-definitions#CodeSystem.concept.designation)** [0..*]: [BackboneElement](/BackboneElement) Additional representations for the concept - **[CodeSystem.concept.designation.language](/codesystem-definitions#CodeSystem.concept.designation.language)** [0..1]: [code](/code) required:[all-languages](/valueset-all-languages) Human language of the designation - **[CodeSystem.concept.designation.use](/codesystem-definitions#CodeSystem.concept.designation.use)** [0..1]: [Coding](/Coding) extensible:[designation-use](/valueset-designation-use) Details how this designation would be used - **[CodeSystem.concept.designation.additionalUse](/codesystem-definitions#CodeSystem.concept.designation.additionalUse)** [0..*]: [Coding](/Coding) extensible:[designation-use](/valueset-designation-use) Additional ways how this designation would be used - **[CodeSystem.concept.designation.value](/codesystem-definitions#CodeSystem.concept.designation.value)** [1..1]: [string](/string) The text value for this designation - **[CodeSystem.concept.property](/codesystem-definitions#CodeSystem.concept.property)** [0..*]: [BackboneElement](/BackboneElement) Property value for the concept - **[CodeSystem.concept.property.code](/codesystem-definitions#CodeSystem.concept.property.code)** [1..1]: [code](/code) Reference to CodeSystem.property.code or a FHIR defined concept-property - **[CodeSystem.concept.property.value[x]](/codesystem-definitions#CodeSystem.concept.property.value%5Bx%5D)** [1..1]: [code](/code), [Coding](/Coding), [string](/string), [integer](/integer), [boolean](/boolean), [dateTime](/dateTime), [decimal](/decimal) Value of the property for this concept - **[CodeSystem.concept.concept](/codesystem-definitions#CodeSystem.concept.concept)** [0..*]: - Child Concepts (is-a/contains/categorizes) ## Mappings - [CodeSystem Mappings](/codesystem-mappings) — 17 mapping entries ## Implementation Guide ### implementationguide-CodeSystem-core.xml ```xml <status value="draft"/> <date value="1970-01-01T10:00:00+10:00"/> <publisher value="HL7"/> <description value="Core profiles and extensions defined for the CodeSystem resource"/> <definition> </definition> </ImplementationGuide> ``` ## Operations - [lookup](/codesystem-operation-lookup) — Concept Look Up & Decomposition — Given a code/system, or a Coding, get additional details about the concept, including definition, status, designations, and properties. - [subsumes](/codesystem-operation-subsumes) — Subsumption Testing — Test the subsumption relationship between code/Coding A and code/Coding B given the semantics of subsumption in the underlying code system (see [hierarchyMeaning](codesystem-definitions.html#CodeSystem.hierarchyMeaning)). - [validate-code](/codesystem-operation-validate-code) — Code System based Validation — Validate that a coded value is in the code system. [Full Operations](/codesystem-operations) ## Resource Packs ### list-CodeSystem-packs.xml ```xml <?xml version="1.0" encoding="UTF-8"?> <List xmlns="http://hl7.org/fhir"> <id value="CodeSystem-packs"/> <status value="current"/> <mode value="working"/> <entry> <item> <reference value="ImplementationGuide/CodeSystem-core"/> </item> </entry> </List> ``` ## Search Parameters - [code](/codesystem-search#code) — **token** — A code defined in the code system — `CodeSystem.repeat(concept).code` - [content-mode](/codesystem-search#content-mode) — **token** — not-present | example | fragment | complete | supplement — `CodeSystem.content` - [context](/codesystem-search#context) — **token** — A use context assigned to the code system — `(CodeSystem.useContext.value.ofType(CodeableConcept))` - [context-quantity](/codesystem-search#context-quantity) — **quantity** — A quantity- or range-valued use context assigned to the code system — `(CodeSystem.useContext.value.ofType(Quantity)) | (CodeSystem.useContext.value.ofType(Range))` - [context-type](/codesystem-search#context-type) — **token** — A type of use context assigned to the code system — `CodeSystem.useContext.code` - [context-type-quantity](/codesystem-search#context-type-quantity) — **composite** — A use context type and quantity- or range-based value assigned to the code system — `CodeSystem.useContext` - [context-type-value](/codesystem-search#context-type-value) — **composite** — A use context type and value assigned to the code system — `CodeSystem.useContext` - [date](/codesystem-search#date) — **date** — The code system publication date — `CodeSystem.date` - [description](/codesystem-search#description) — **string** — The description of the code system — `CodeSystem.description` - [identifier](/codesystem-search#identifier) — **token** — External identifier for the code system — `CodeSystem.identifier` - [jurisdiction](/codesystem-search#jurisdiction) — **token** — Jurisdiction of the authority that maintains the the code system — `CodeSystem.jurisdiction` - [language](/codesystem-search#language) — **token** — A language in which a designation is provided — `CodeSystem.repeat(concept).designation.language` - [name](/codesystem-search#name) — **string** — Computationally friendly name of the code system — `CodeSystem.name` - [publisher](/codesystem-search#publisher) — **string** — Name of the publisher of the code system — `CodeSystem.publisher` - [status](/codesystem-search#status) — **token** — The current status of the code system — `CodeSystem.status` - [supplements](/codesystem-search#supplements) — **reference** — Find code system supplements for the referenced code system — `CodeSystem.supplements` - [system](/codesystem-search#system) — **uri** — The system for any codes defined by this code system (same as 'url') — `CodeSystem.url` - [title](/codesystem-search#title) — **string** — The human-friendly name of the code system — `CodeSystem.title` - [url](/codesystem-search#url) — **uri** — The uri that identifies the code system — `CodeSystem.url` - [version](/codesystem-search#version) — **token** — The business version of the code system — `CodeSystem.version` - [effective](/codesystem-search#effective) — **date** — The time during which the CodeSystem is intended to be in use — `CodeSystem.effectivePeriod` - [derived-from](/codesystem-search#derived-from) — **reference** — A resource that the CodeSystem is derived from — `CodeSystem.relatedArtifact.where(type='derived-from').resource` - [predecessor](/codesystem-search#predecessor) — **reference** — The predecessor of the CodeSystem — `CodeSystem.relatedArtifact.where(type='predecessor').resource` - [topic](/codesystem-search#topic) — **token** — Topics associated with the CodeSystem — `CodeSystem.topic` - [experimental](/codesystem-search#experimental) — **token** — Whether the CodeSystem is experimental — `CodeSystem.experimental` [Full Search Parameters](/codesystem-search) ## Examples - [codesystem-example](/codesystem-example-codesystem-example) — codesystem-example - [codesystem-example-metadata](/codesystem-example-codesystem-example-metadata) — codesystem-example-metadata - [codesystem-example-metadata-2](/codesystem-example-codesystem-example-metadata-2) — codesystem-example-metadata-2 - [codesystem-example-summary](/codesystem-example-codesystem-example-summary) — codesystem-example-summary - [codesystem-example-supplement](/codesystem-example-codesystem-example-supplement) — codesystem-example-supplement - [codesystem-example-supplement-2](/codesystem-example-codesystem-example-supplement-2) — codesystem-example-supplement-2 - [codesystem-examples-header](/codesystem-example-codesystem-examples-header) — codesystem-examples-header - [example](/codesystem-example-example) — codesystem-example — Simple Code System - [example-metadata](/codesystem-example-example-metadata) — codesystem-example-metadata — Example Code System Metadata - [example-metadata-2](/codesystem-example-example-metadata-2) — codesystem-example-metadata-2 — Example Code System Metadata v2 - [example-supplement](/codesystem-example-example-supplement) — codesystem-example-supplement — Example Code System Supplement - [example-supplement-2](/codesystem-example-example-supplement-2) — codesystem-example-supplement-2 — Example Code System Supplement 2 - [nhin-purposeofuse](/codesystem-example-nhin-purposeofuse) — codesystem-nhin-purposeofuse — NHIN Purpose of Use - [summary](/codesystem-example-summary) — codesystem-example-summary — Code system summary [Full Examples](/codesystem-examples) ## Mapping Exceptions ### codesystem-fivews-mapping-exceptions.xml ### Unmapped Elements - **FiveWs.what** — Unknown - **FiveWs.author** — Unknown - **FiveWs.actor** — Unknown - **FiveWs.cause** — Unknown - **FiveWs.where** — Unknown - **FiveWs.context** — Unknown - **FiveWs.init** — Unknown - **FiveWs.source** — Unknown - **FiveWs.who** — Unknown - **FiveWs.grade** — Unknown - **FiveWs.planned** — Unknown - **FiveWs.done** — Unknown - **FiveWs.subject** — Unknown