4.8 资源之编码系统(CodeSystem)

工作组:Vocabulary 成熟度: N Normative (from v4.0.0)Security Category: Anonymous Compartments: Not linked to any defined compartments

编码系统资源用于声明一个编码系统或编码系统附录及其关键属性的存在,并对其进行描述。对于它的部分或全部内容是否要定义在此资源中是可选的。

FHIR术语规范基于两个源自 HL7 v3 核心原理 的关键概念:

  • 编码系统 code system: 编码系统资源用于声明一个编码系统或编码系统附录及其关键属性的存在,并对其进行描述。对于它的部分或全部内容是否要定义在此资源中是可选的。也称为本体论、术语或枚举。
  • 值集 value set: 用于特定上下文的一组编码,其中每个编码都是从一个或多个编码系统中提取的。 值集将CodeSystem中的定义与如何在编码元素中使用这些定义联系在一起。

编码系统定义了有哪些编码(符号、表达式),以及如何理解它们。 值集从一个或多个编码系统中选择一组编码,以便在特定上下文中使用。

编码系统资源用于声明一个编码系统或编码系统附录及其关键属性的存在,包括:

  • 标识URL和版本
  • 说明、版权、发布日期和其他元数据
  • 编码系统本身的一些关键属性。例如,它是否表现出概念持久性,它是否定义了组合语法,以及它定义的编码是否区分大小写
  • 在ValueSet.compose元素中使用此编码系统的值集可以使用哪些筛选器
  • 编码系统定义了什么概念属性

另外,CodeSystem资源可以列出编码系统中的部分或全部概念,以及它们的基本属性(code, display, definition)、名称和附加属性。 编码系统资源也可用来定义附录——用附加的名称和属性来扩展现有的编码系统。

CodeSystem资源不支持维护编码系统的过程。 相反,重点是发布编码系统的属性和可选内容,以便在整个FHIR生态系统中使用,例如为支持值集扩展和验证的属性和内容。 请注意,目前主流的(大型)编码系统(SNOMED CT, LOINC, RxNorm, ICD系列等)都有自己的维护系统和分发格式, 而CodeSystem通常不是分发内容的有效方法,尽管可以用它来声明与这些编码系统相关联的过滤器和属性。

  • 编码系统在值集ValueSet 资源中使用
  • Coding 数据类型通过编码系统的规范URL引用CodeSystem资源
  • 从某种程度上说,CodeSystem资源是根据 HL7 CTS 2 规范所述编码系统功能来设计的。 CTS2服务器可用于维护编码系统,然后使用CodeSystem资源发布编码系统。
  • CodeSystem资源记录了编码系统的固有结构和功能,而术语能力 TerminologyCapabilities 资源以文档形式描述了承载编码系统的服务器(术语服务器)的能力

编码系统CodeSystem资源声明编码系统的存在,以及包括其首选标识符在内的关键属性。 命名系统NamingSystem资源标识编码系统或标识符系统的存在,并尽可能的列出其所有的标识符和首选项。 两者之间的关键区别在于谁创建和管理它们。 CodeSystem资源由编码系统的所有者或发布者管理,他们可以正确地定义编码系统功能和内容。 而NamingSystem资源通常由会用到编码系统的第三方定义,并需要对其使用情况进行说明,但无权定义功能和内容。 此外,编码系统可能有多个授权的NamingSystem资源, 但在理想情况下,只有一个由编码系统发布者提供的授权 CodeSystem资源(由其规范URL标识), 这个官方资源的多个副本分布在其它FHIR服务器或别处,并在需要时使用。

编码系统附录 CodeSystem.supplements 和概念映射 Concept Maps都可以用来定义概念在不同系统中之间的关系。 概念映射ConceptMaps明确的指出了在不同的使用场景中,概念之间关系,而编码系统附录CodeSystem.supplements 用于定义编码系统中概念的固有属性和语义。

在使用编码系统和值集时,正确区分编码系统和值集非常重要。在实践中,常常由此造成重大临床安全风险。 实施者应该对资源中使用编码的内容很熟悉。

编码系统有三种标识符。在FHIR上下文中可以使用CodeSystem.idCodeSystem.url来引用编码系统:

  • CodeSystem.id: 系统中CodeSystem资源实例的 逻辑ID ,——这通常会随着资源在不同服务器之间移动而变化。 URI地址是为“实例服务器基地址+资源类型+逻辑ID”构成的。 这个URI应该是一个可解析的URL,通过它可以从一个FHIR服务器上检索资源实例,它可能是一个服务器基URL的相对引用。
  • CodeSystem.url: 编码系统的规范URL-它永远不会变更,且在每个副本中都是相同的。 由于遗留的历史因素,元素被命名为url而非 uri ,强烈建议尽可能提供可解析的URL作为标识符。 此规范URL指向此特定编码系统的所有实例,可以跨所有服务器和系统使用。 理想情况下,这个URI应该是一个URL,它可以解析到编码系统主版本的位置,尽管这并不总是可能的。

例如,作为FHIR规范的一部分发布的编码系统都有一个(“文字的”)URI地址, 在那个特定版本的FHIR规范本身中可以作为URL来访问它们。 然而,虽然正在准备新版本的FHIR规范,但在当前的FHIR规范版本中找不到草稿中发布的编码系统。 即在线FHIR规范草稿版本的terminologies-systems.html中的“Internal(FHIR)”列表中的编码系统不会出现在正式版本的对应页面。

因为在本地复制(缓存)编码系统是常见的做法, 所以大多数对编码系统的引用既可以使用规范URL也可以用(“文字的”)URL地址。

第三个编码系统标识符通常用于对FHIR之外的编码系统的外部引用:

  • CodeSystem.identifier: 一对由“系统”和“值”(system/value)组织的标识符,用于在其他上下文(如HL7 v3规范中的OID)中标识编码系统。

有关资源标识的更多信息,请参阅 资源标识

这意味着每个编码系统都有两个不同的URI,都可以用来引用它:一是规范的URL(url元素), 二是含有id元素的本地位置(可以检索到它)。 因为通常会在本地复制(缓存)编码系统,所以对编码系统的大多数引用都使用规范的URL。

Alternatively, the identifier and version elements may be used to reference this code system in a design, a profile, a CDA template or HL7 v3 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.

This resource is referenced by Coding, itself, ConceptMap, TerminologyCapabilities and ValueSet

Structure

NameFlagsCard.TypeDescription & Constraintsdoco
.. CodeSystem INDomainResourceDeclares the existence of and describes a code system or code system supplement
+ Warning: Name should be usable as an identifier for the module by machine processing applications such as code generation
+ Rule: Within a code system definition, all the codes SHALL be unique
Elements defined in Ancestors: id, meta, implicitRules, language, text, contained, extension, modifierExtension
... url Σ0..1uriCanonical identifier for this code system, represented as a URI (globally unique) (Coding.system)
... identifier Σ0..*IdentifierAdditional identifier for the code system (business identifier)
... version Σ0..1stringBusiness version of the code system (Coding.version)
... name ΣI0..1stringName for this code system (computer friendly)
... title Σ0..1stringName for this code system (human friendly)
... status ?!Σ1..1codedraft | active | retired | unknown
PublicationStatus (Required)
... experimental Σ0..1booleanFor testing purposes, not real usage
... date Σ0..1dateTimeDate last changed
... publisher Σ0..1stringName of the publisher (organization or individual)
... contact Σ0..*ContactDetailContact details for the publisher
... description 0..1markdownNatural language description of the code system
... useContext ΣTU0..*UsageContextThe context that the content is intended to support
... jurisdiction Σ0..*CodeableConceptIntended jurisdiction for code system (if applicable)
Jurisdiction (Extensible)
... purpose 0..1markdownWhy this code system is defined
... copyright 0..1markdownUse and/or publishing restrictions
... caseSensitive Σ0..1booleanIf code comparison is case sensitive
... valueSet Σ0..1canonical(ValueSet)Canonical reference to the value set with entire code system
... hierarchyMeaning Σ0..1codegrouped-by | is-a | part-of | classified-with
CodeSystemHierarchyMeaning (Required)
... compositional Σ0..1booleanIf code system defines a compositional grammar
... versionNeeded Σ0..1booleanIf definitions are not stable
... content Σ1..1codenot-present | example | fragment | complete | supplement
CodeSystemContentMode (Required)
... supplements Σ0..1canonical(CodeSystem)Canonical URL of Code System this adds designations and properties to
... count Σ0..1unsignedIntTotal concepts in the code system
... filter Σ0..*BackboneElementFilter that can be used in a value set
.... code Σ1..1codeCode that identifies the filter
.... description Σ0..1stringHow or why the filter is used
.... operator Σ1..*codeOperators that can be used with filter
FilterOperator (Required)
.... value Σ1..1stringWhat to use for the value
... property Σ0..*BackboneElementAdditional information supplied about each concept
.... code Σ1..1codeIdentifies the property on the concepts, and when referred to in operations
.... uri Σ0..1uriFormal identifier for the property
.... description Σ0..1stringWhy the property is defined, and/or what it conveys
.... type Σ1..1codecode | Coding | string | integer | boolean | dateTime | decimal
PropertyType (Required)
... concept 0..*BackboneElementConcepts in the code system
.... code 1..1codeCode that identifies concept
.... display 0..1stringText to display to the user
.... definition 0..1stringFormal definition
.... designation 0..*BackboneElementAdditional representations for the concept
..... language 0..1codeHuman language of the designation
Common Languages (Preferred but limited to AllLanguages)
..... use 0..1CodingDetails how this designation would be used
Designation Use (Extensible)
..... value 1..1stringThe text value for this designation
.... property 0..*BackboneElementProperty value for the concept
..... code 1..1codeReference to CodeSystem.property.code
..... value[x] 1..1Value of the property for this concept
...... valueCodecode
...... valueCodingCoding
...... valueStringstring
...... valueIntegerinteger
...... valueBooleanboolean
...... valueDateTimedateTime
...... valueDecimaldecimal
.... concept 0..*see conceptChild Concepts (is-a/contains/categorizes)

doco Documentation for this format

UML Diagram (Legend)

CodeSystem (DomainResource)An absolute URI that is used to identify this code system when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this code system is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the code system is stored on different servers. This is used in [Coding](datatypes.html#Coding).systemurl : uri [0..1]A formal identifier that is used to identify this code system when it is represented in other formats, or referenced in a specification, model, design or an instanceidentifier : Identifier [0..*]The identifier that is used to identify this version of the code system when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the code system author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. This is used in [Coding](datatypes.html#Coding).versionversion : string [0..1]A natural language name identifying the code system. This name should be usable as an identifier for the module by machine processing applications such as code generationname : string [0..1]A short, descriptive, user-friendly title for the code systemtitle : string [0..1]The date (and optionally time) when the code system resource was created or revised (this element modifies the meaning of other elements)status : code [1..1] « The lifecycle status of an artifact. (Strength=Required)PublicationStatus! »A Boolean value to indicate that this code system is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usageexperimental : boolean [0..1]The date (and optionally time) when the code system was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the code system changesdate : dateTime [0..1]The name of the organization or individual that published the code systempublisher : string [0..1]Contact details to assist a user in finding and communicating with the publishercontact : ContactDetail [0..*]A free text natural language description of the code system from a consumer's perspectivedescription : markdown [0..1]The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate code system instancesuseContext : UsageContext [0..*]A legal or geographic region in which the code system is intended to be usedjurisdiction : CodeableConcept [0..*] « Countries and regions within which this artifact is targeted for use. (Strength=Extensible)Jurisdiction ValueSet+ »Explanation of why this code system is needed and why it has been designed as it haspurpose : markdown [0..1]A copyright statement relating to the code system and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the code systemcopyright : markdown [0..1]If code comparison is case sensitive when codes within this system are compared to each othercaseSensitive : boolean [0..1]Canonical reference to the value set that contains the entire code systemvalueSet : canonical [0..1] « ValueSet »The meaning of the hierarchy of concepts as represented in this resourcehierarchyMeaning : code [0..1] « The meaning of the hierarchy of concepts in a code system. (Strength=Required)CodeSystemHierarchyMeaning! »The code system defines a compositional (post-coordination) grammarcompositional : boolean [0..1]This flag is used to signify that the code system does not commit to concept permanence across versions. If true, a version must be specified when referencing this code systemversionNeeded : boolean [0..1]The extent of the content of the code system (the concepts and codes it defines) are represented in this resource instancecontent : code [1..1] « The extent of the content of the code system (the concepts and codes it defines) are represented in a code system resource. (Strength=Required)CodeSystemContentMode! »The canonical URL of the code system that this code system supplement is adding designations and properties tosupplements : canonical [0..1] « CodeSystem »The total number of concepts defined by the code system. Where the code system has a compositional grammar, the basis of this count is defined by the system stewardcount : unsignedInt [0..1]FilterThe code that identifies this filter when it is used as a filter in [[[ValueSet]]].compose.include.filtercode : code [1..1]A description of how or why the filter is useddescription : string [0..1]A list of operators that can be used with the filteroperator : code [1..*] « The kind of operation to perform as a part of a property based filter. (Strength=Required)FilterOperator! »A description of what the value for the filter should bevalue : string [1..1]PropertyA code that is used to identify the property. The code is used internally (in CodeSystem.concept.property.code) and also externally, such as in property filterscode : code [1..1]Reference to the formal meaning of the property. One possible source of meaning is the [Concept Properties](codesystem-concept-properties.html) code systemuri : uri [0..1]A description of the property- why it is defined, and how its value might be useddescription : string [0..1]The type of the property value. Properties of type "code" contain a code defined by the code system (e.g. a reference to another defined concept)type : code [1..1] « The type of a property value. (Strength=Required)PropertyType! »ConceptDefinitionA code - a text symbol - that uniquely identifies the concept within the code systemcode : code [1..1]A human readable string that is the recommended default way to present this concept to a userdisplay : string [0..1]The formal definition of the concept. The code system resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the conceptdefinition : string [0..1]DesignationThe language this designation is defined forlanguage : code [0..1] « A human language. (Strength=Preferred)CommonLanguages? »A code that details how this designation would be useduse : Coding [0..1] « Details of how a designation would be used. (Strength=Extensible)DesignationUse+ »The text value for this designationvalue : string [1..1]ConceptPropertyA code that is a reference to CodeSystem.property.codecode : code [1..1]The value of this propertyvalue[x] : Type [1..1] « code|Coding|string|integer|boolean|dateTime| decimal »A filter that can be used in a value set compose statement when selecting concepts using a filterfilter[0..*]A property defines an additional slot through which additional information can be provided about a conceptproperty[0..*]Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etcdesignation[0..*]A property value for this conceptproperty[0..*]Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) - see hierarchyMeaningconcept[0..*]Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meanings of the hierarchical relationships areconcept[0..*]

XML Template

<CodeSystem xmlns="http://hl7.org/fhir"> doco
 <!-- from Resource: id, meta, implicitRules, and language -->
 <!-- from DomainResource: text, contained, extension, and modifierExtension -->
 <url value="[uri]"/><!-- 0..1 Canonical identifier for this code system, represented as a URI (globally unique) (Coding.system) -->
 <identifier><!-- 0..* Identifier Additional identifier for the code system (business identifier) --></identifier>
 <version value="[string]"/><!-- 0..1 Business version of the code system (Coding.version) -->
 <name value="[string]"/><!-- ?? 0..1 Name for this code system (computer friendly) -->
 <title value="[string]"/><!-- 0..1 Name for this code system (human friendly) -->
 <status value="[code]"/><!-- 1..1 draft | active | retired | unknown -->
 <experimental value="[boolean]"/><!-- 0..1 For testing purposes, not real usage -->
 <date value="[dateTime]"/><!-- 0..1 Date last changed -->
 <publisher value="[string]"/><!-- 0..1 Name of the publisher (organization or individual) -->
 <contact><!-- 0..* ContactDetail Contact details for the publisher --></contact>
 <description value="[markdown]"/><!-- 0..1 Natural language description of the code system -->
 <useContext><!-- 0..* UsageContext The context that the content is intended to support --></useContext>
 <jurisdiction><!-- 0..* CodeableConcept Intended jurisdiction for code system (if applicable) --></jurisdiction>
 <purpose value="[markdown]"/><!-- 0..1 Why this code system is defined -->
 <copyright value="[markdown]"/><!-- 0..1 Use and/or publishing restrictions -->
 <caseSensitive value="[boolean]"/><!-- 0..1 If code comparison is case sensitive -->
 <valueSet><!-- 0..1 canonical(ValueSet) Canonical reference to the value set with entire code system --></valueSet>
 <hierarchyMeaning value="[code]"/><!-- 0..1 grouped-by | is-a | part-of | classified-with -->
 <compositional value="[boolean]"/><!-- 0..1 If code system defines a compositional grammar -->
 <versionNeeded value="[boolean]"/><!-- 0..1 If definitions are not stable -->
 <content value="[code]"/><!-- 1..1 not-present | example | fragment | complete | supplement -->
 <supplements><!-- 0..1 canonical(CodeSystem) Canonical URL of Code System this adds designations and properties to --></supplements>
 <count value="[unsignedInt]"/><!-- 0..1 Total concepts in the code system -->
 <filter>  <!-- 0..* Filter that can be used in a value set -->
  <code value="[code]"/><!-- 1..1 Code that identifies the filter -->
  <description value="[string]"/><!-- 0..1 How or why the filter is used -->
  <operator value="[code]"/><!-- 1..* Operators that can be used with filter -->
  <value value="[string]"/><!-- 1..1 What to use for the value -->
 </filter>
 <property>  <!-- 0..* Additional information supplied about each concept -->
  <code value="[code]"/><!-- 1..1 Identifies the property on the concepts, and when referred to in operations -->
  <uri value="[uri]"/><!-- 0..1 Formal identifier for the property -->
  <description value="[string]"/><!-- 0..1 Why the property is defined, and/or what it conveys -->
  <type value="[code]"/><!-- 1..1 code | Coding | string | integer | boolean | dateTime | decimal -->
 </property>
 <concept>  <!-- 0..* Concepts in the code system -->
  <code value="[code]"/><!-- 1..1 Code that identifies concept -->
  <display value="[string]"/><!-- 0..1 Text to display to the user -->
  <definition value="[string]"/><!-- 0..1 Formal definition -->
  <designation>  <!-- 0..* Additional representations for the concept -->
   <language value="[code]"/><!-- 0..1 Human language of the designation -->
   <use><!-- 0..1 Coding Details how this designation would be used --></use>
   <value value="[string]"/><!-- 1..1 The text value for this designation -->
  </designation>
  <property>  <!-- 0..* Property value for the concept -->
   <code value="[code]"/><!-- 1..1 Reference to CodeSystem.property.code -->
   <value[x]><!-- 1..1 code|Coding|string|integer|boolean|dateTime|decimal Value of the property for this concept --></value[x]>
  </property>
  <concept><!-- 0..* Content as for CodeSystem.concept Child Concepts (is-a/contains/categorizes) --></concept>
 </concept>
</CodeSystem>

JSON Template

{doco
  "resourceType" : "CodeSystem",
  // from Resource: id, meta, implicitRules, and language
  // from DomainResource: text, contained, extension, and modifierExtension
  "url" : "<uri>", // Canonical identifier for this code system, represented as a URI (globally unique) (Coding.system)
  "identifier" : [{ Identifier }], // Additional identifier for the code system (business identifier)
  "version" : "<string>", // Business version of the code system (Coding.version)
  "name" : "<string>", // C? Name for this code system (computer friendly)
  "title" : "<string>", // Name for this code system (human friendly)
  "status" : "<code>", // R!  draft | active | retired | unknown
  "experimental" : <boolean>, // For testing purposes, not real usage
  "date" : "<dateTime>", // Date last changed
  "publisher" : "<string>", // Name of the publisher (organization or individual)
  "contact" : [{ ContactDetail }], // Contact details for the publisher
  "description" : "<markdown>", // Natural language description of the code system
  "useContext" : [{ UsageContext }], // The context that the content is intended to support
  "jurisdiction" : [{ CodeableConcept }], // Intended jurisdiction for code system (if applicable)
  "purpose" : "<markdown>", // Why this code system is defined
  "copyright" : "<markdown>", // Use and/or publishing restrictions
  "caseSensitive" : <boolean>, // If code comparison is case sensitive
  "valueSet" : { canonical(ValueSet) }, // Canonical reference to the value set with entire code system
  "hierarchyMeaning" : "<code>", // grouped-by | is-a | part-of | classified-with
  "compositional" : <boolean>, // If code system defines a compositional grammar
  "versionNeeded" : <boolean>, // If definitions are not stable
  "content" : "<code>", // R!  not-present | example | fragment | complete | supplement
  "supplements" : { canonical(CodeSystem) }, // Canonical URL of Code System this adds designations and properties to
  "count" : "<unsignedInt>", // Total concepts in the code system
  "filter" : [{ // Filter that can be used in a value set
    "code" : "<code>", // R!  Code that identifies the filter
    "description" : "<string>", // How or why the filter is used
    "operator" : ["<code>"], // R!  Operators that can be used with filter
    "value" : "<string>" // R!  What to use for the value
  }],
  "property" : [{ // Additional information supplied about each concept
    "code" : "<code>", // R!  Identifies the property on the concepts, and when referred to in operations
    "uri" : "<uri>", // Formal identifier for the property
    "description" : "<string>", // Why the property is defined, and/or what it conveys
    "type" : "<code>" // R!  code | Coding | string | integer | boolean | dateTime | decimal
  }],
  "concept" : [{ // Concepts in the code system
    "code" : "<code>", // R!  Code that identifies concept
    "display" : "<string>", // Text to display to the user
    "definition" : "<string>", // Formal definition
    "designation" : [{ // Additional representations for the concept
      "language" : "<code>", // Human language of the designation
      "use" : { Coding }, // Details how this designation would be used
      "value" : "<string>" // R!  The text value for this designation
    }],
    "property" : [{ // Property value for the concept
      "code" : "<code>", // R!  Reference to CodeSystem.property.code
      // value[x]: Value of the property for this concept. One of these 7:
      "valueCode" : "<code>"
      "valueCoding" : { Coding }
      "valueString" : "<string>"
      "valueInteger" : <integer>
      "valueBoolean" : <boolean>
      "valueDateTime" : "<dateTime>"
      "valueDecimal" : <decimal>
    }],
    "concept" : [{ Content as for CodeSystem.concept }] // Child Concepts (is-a/contains/categorizes)
  }]
}

Turtle Template

@prefix fhir: <http://hl7.org/fhir/> .doco


[ a fhir:CodeSystem;
  fhir:nodeRole fhir:treeRoot; # if this is the parser root

  # from Resource: .id, .meta, .implicitRules, and .language
  # from DomainResource: .text, .contained, .extension, and .modifierExtension
  fhir:CodeSystem.url [ uri ]; # 0..1 Canonical identifier for this code system, represented as a URI (globally unique) (Coding.system)
  fhir:CodeSystem.identifier [ Identifier ], ... ; # 0..* Additional identifier for the code system (business identifier)
  fhir:CodeSystem.version [ string ]; # 0..1 Business version of the code system (Coding.version)
  fhir:CodeSystem.name [ string ]; # 0..1 Name for this code system (computer friendly)
  fhir:CodeSystem.title [ string ]; # 0..1 Name for this code system (human friendly)
  fhir:CodeSystem.status [ code ]; # 1..1 draft | active | retired | unknown
  fhir:CodeSystem.experimental [ boolean ]; # 0..1 For testing purposes, not real usage
  fhir:CodeSystem.date [ dateTime ]; # 0..1 Date last changed
  fhir:CodeSystem.publisher [ string ]; # 0..1 Name of the publisher (organization or individual)
  fhir:CodeSystem.contact [ ContactDetail ], ... ; # 0..* Contact details for the publisher
  fhir:CodeSystem.description [ markdown ]; # 0..1 Natural language description of the code system
  fhir:CodeSystem.useContext [ UsageContext ], ... ; # 0..* The context that the content is intended to support
  fhir:CodeSystem.jurisdiction [ CodeableConcept ], ... ; # 0..* Intended jurisdiction for code system (if applicable)
  fhir:CodeSystem.purpose [ markdown ]; # 0..1 Why this code system is defined
  fhir:CodeSystem.copyright [ markdown ]; # 0..1 Use and/or publishing restrictions
  fhir:CodeSystem.caseSensitive [ boolean ]; # 0..1 If code comparison is case sensitive
  fhir:CodeSystem.valueSet [ canonical(ValueSet) ]; # 0..1 Canonical reference to the value set with entire code system
  fhir:CodeSystem.hierarchyMeaning [ code ]; # 0..1 grouped-by | is-a | part-of | classified-with
  fhir:CodeSystem.compositional [ boolean ]; # 0..1 If code system defines a compositional grammar
  fhir:CodeSystem.versionNeeded [ boolean ]; # 0..1 If definitions are not stable
  fhir:CodeSystem.content [ code ]; # 1..1 not-present | example | fragment | complete | supplement
  fhir:CodeSystem.supplements [ canonical(CodeSystem) ]; # 0..1 Canonical URL of Code System this adds designations and properties to
  fhir:CodeSystem.count [ unsignedInt ]; # 0..1 Total concepts in the code system
  fhir:CodeSystem.filter [ # 0..* Filter that can be used in a value set
    fhir:CodeSystem.filter.code [ code ]; # 1..1 Code that identifies the filter
    fhir:CodeSystem.filter.description [ string ]; # 0..1 How or why the filter is used
    fhir:CodeSystem.filter.operator [ code ], ... ; # 1..* Operators that can be used with filter
    fhir:CodeSystem.filter.value [ string ]; # 1..1 What to use for the value
  ], ...;
  fhir:CodeSystem.property [ # 0..* Additional information supplied about each concept
    fhir:CodeSystem.property.code [ code ]; # 1..1 Identifies the property on the concepts, and when referred to in operations
    fhir:CodeSystem.property.uri [ uri ]; # 0..1 Formal identifier for the property
    fhir:CodeSystem.property.description [ string ]; # 0..1 Why the property is defined, and/or what it conveys
    fhir:CodeSystem.property.type [ code ]; # 1..1 code | Coding | string | integer | boolean | dateTime | decimal
  ], ...;
  fhir:CodeSystem.concept [ # 0..* Concepts in the code system
    fhir:CodeSystem.concept.code [ code ]; # 1..1 Code that identifies concept
    fhir:CodeSystem.concept.display [ string ]; # 0..1 Text to display to the user
    fhir:CodeSystem.concept.definition [ string ]; # 0..1 Formal definition
    fhir:CodeSystem.concept.designation [ # 0..* Additional representations for the concept
      fhir:CodeSystem.concept.designation.language [ code ]; # 0..1 Human language of the designation
      fhir:CodeSystem.concept.designation.use [ Coding ]; # 0..1 Details how this designation would be used
      fhir:CodeSystem.concept.designation.value [ string ]; # 1..1 The text value for this designation
    ], ...;
    fhir:CodeSystem.concept.property [ # 0..* Property value for the concept
      fhir:CodeSystem.concept.property.code [ code ]; # 1..1 Reference to CodeSystem.property.code
      # CodeSystem.concept.property.value[x] : 1..1 Value of the property for this concept. One of these 7
        fhir:CodeSystem.concept.property.valueCode [ code ]
        fhir:CodeSystem.concept.property.valueCoding [ Coding ]
        fhir:CodeSystem.concept.property.valueString [ string ]
        fhir:CodeSystem.concept.property.valueInteger [ integer ]
        fhir:CodeSystem.concept.property.valueBoolean [ boolean ]
        fhir:CodeSystem.concept.property.valueDateTime [ dateTime ]
        fhir:CodeSystem.concept.property.valueDecimal [ decimal ]
    ], ...;
    fhir:CodeSystem.concept.concept [ See CodeSystem.concept ], ... ; # 0..* Child Concepts (is-a/contains/categorizes)
  ], ...;
]

Changes since R3

CodeSystem
CodeSystem.identifier
  • Max Cardinality changed from 1 to *
CodeSystem.status
  • Change value set from http://hl7.org/fhir/ValueSet/publication-status to http://hl7.org/fhir/ValueSet/publication-status|4.0.0
CodeSystem.experimental
  • No longer marked as Modifier
CodeSystem.valueSet
  • Type changed from uri to canonical(ValueSet)
CodeSystem.hierarchyMeaning
  • Change value set from http://hl7.org/fhir/ValueSet/codesystem-hierarchy-meaning to http://hl7.org/fhir/ValueSet/codesystem-hierarchy-meaning|4.0.0
CodeSystem.content
  • Change value set from http://hl7.org/fhir/ValueSet/codesystem-content-mode to http://hl7.org/fhir/ValueSet/codesystem-content-mode|4.0.0
CodeSystem.supplements
  • Added Element
CodeSystem.filter.operator
  • Change value set from http://hl7.org/fhir/ValueSet/filter-operator to http://hl7.org/fhir/ValueSet/filter-operator|4.0.0
CodeSystem.property.type
  • Change value set from http://hl7.org/fhir/ValueSet/concept-property-type to http://hl7.org/fhir/ValueSet/concept-property-type|4.0.0
CodeSystem.concept.designation.language
  • Change binding strength from extensible to preferred
CodeSystem.concept.property.value[x]
  • Add Type decimal

See the Full Difference for further information

This analysis is available as XML or JSON.

See R3 <--> R4 Conversion Maps (status = 4 tests that all execute ok. All tests pass round-trip testing and 3 r3 resources are invalid (0 errors).)

Structure

NameFlagsCard.TypeDescription & Constraintsdoco
.. CodeSystem INDomainResourceDeclares the existence of and describes a code system or code system supplement
+ Warning: Name should be usable as an identifier for the module by machine processing applications such as code generation
+ Rule: Within a code system definition, all the codes SHALL be unique
Elements defined in Ancestors: id, meta, implicitRules, language, text, contained, extension, modifierExtension
... url Σ0..1uriCanonical identifier for this code system, represented as a URI (globally unique) (Coding.system)
... identifier Σ0..*IdentifierAdditional identifier for the code system (business identifier)
... version Σ0..1stringBusiness version of the code system (Coding.version)
... name ΣI0..1stringName for this code system (computer friendly)
... title Σ0..1stringName for this code system (human friendly)
... status ?!Σ1..1codedraft | active | retired | unknown
PublicationStatus (Required)
... experimental Σ0..1booleanFor testing purposes, not real usage
... date Σ0..1dateTimeDate last changed
... publisher Σ0..1stringName of the publisher (organization or individual)
... contact Σ0..*ContactDetailContact details for the publisher
... description 0..1markdownNatural language description of the code system
... useContext ΣTU0..*UsageContextThe context that the content is intended to support
... jurisdiction Σ0..*CodeableConceptIntended jurisdiction for code system (if applicable)
Jurisdiction (Extensible)
... purpose 0..1markdownWhy this code system is defined
... copyright 0..1markdownUse and/or publishing restrictions
... caseSensitive Σ0..1booleanIf code comparison is case sensitive
... valueSet Σ0..1canonical(ValueSet)Canonical reference to the value set with entire code system
... hierarchyMeaning Σ0..1codegrouped-by | is-a | part-of | classified-with
CodeSystemHierarchyMeaning (Required)
... compositional Σ0..1booleanIf code system defines a compositional grammar
... versionNeeded Σ0..1booleanIf definitions are not stable
... content Σ1..1codenot-present | example | fragment | complete | supplement
CodeSystemContentMode (Required)
... supplements Σ0..1canonical(CodeSystem)Canonical URL of Code System this adds designations and properties to
... count Σ0..1unsignedIntTotal concepts in the code system
... filter Σ0..*BackboneElementFilter that can be used in a value set
.... code Σ1..1codeCode that identifies the filter
.... description Σ0..1stringHow or why the filter is used
.... operator Σ1..*codeOperators that can be used with filter
FilterOperator (Required)
.... value Σ1..1stringWhat to use for the value
... property Σ0..*BackboneElementAdditional information supplied about each concept
.... code Σ1..1codeIdentifies the property on the concepts, and when referred to in operations
.... uri Σ0..1uriFormal identifier for the property
.... description Σ0..1stringWhy the property is defined, and/or what it conveys
.... type Σ1..1codecode | Coding | string | integer | boolean | dateTime | decimal
PropertyType (Required)
... concept 0..*BackboneElementConcepts in the code system
.... code 1..1codeCode that identifies concept
.... display 0..1stringText to display to the user
.... definition 0..1stringFormal definition
.... designation 0..*BackboneElementAdditional representations for the concept
..... language 0..1codeHuman language of the designation
Common Languages (Preferred but limited to AllLanguages)
..... use 0..1CodingDetails how this designation would be used
Designation Use (Extensible)
..... value 1..1stringThe text value for this designation
.... property 0..*BackboneElementProperty value for the concept
..... code 1..1codeReference to CodeSystem.property.code
..... value[x] 1..1Value of the property for this concept
...... valueCodecode
...... valueCodingCoding
...... valueStringstring
...... valueIntegerinteger
...... valueBooleanboolean
...... valueDateTimedateTime
...... valueDecimaldecimal
.... concept 0..*see conceptChild Concepts (is-a/contains/categorizes)

doco Documentation for this format

UML Diagram (Legend)

CodeSystem (DomainResource)An absolute URI that is used to identify this code system when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which at which an authoritative instance of this code system is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the code system is stored on different servers. This is used in [Coding](datatypes.html#Coding).systemurl : uri [0..1]A formal identifier that is used to identify this code system when it is represented in other formats, or referenced in a specification, model, design or an instanceidentifier : Identifier [0..*]The identifier that is used to identify this version of the code system when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the code system author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. This is used in [Coding](datatypes.html#Coding).versionversion : string [0..1]A natural language name identifying the code system. This name should be usable as an identifier for the module by machine processing applications such as code generationname : string [0..1]A short, descriptive, user-friendly title for the code systemtitle : string [0..1]The date (and optionally time) when the code system resource was created or revised (this element modifies the meaning of other elements)status : code [1..1] « The lifecycle status of an artifact. (Strength=Required)PublicationStatus! »A Boolean value to indicate that this code system is authored for testing purposes (or education/evaluation/marketing) and is not intended to be used for genuine usageexperimental : boolean [0..1]The date (and optionally time) when the code system was published. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the code system changesdate : dateTime [0..1]The name of the organization or individual that published the code systempublisher : string [0..1]Contact details to assist a user in finding and communicating with the publishercontact : ContactDetail [0..*]A free text natural language description of the code system from a consumer's perspectivedescription : markdown [0..1]The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate code system instancesuseContext : UsageContext [0..*]A legal or geographic region in which the code system is intended to be usedjurisdiction : CodeableConcept [0..*] « Countries and regions within which this artifact is targeted for use. (Strength=Extensible)Jurisdiction ValueSet+ »Explanation of why this code system is needed and why it has been designed as it haspurpose : markdown [0..1]A copyright statement relating to the code system and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the code systemcopyright : markdown [0..1]If code comparison is case sensitive when codes within this system are compared to each othercaseSensitive : boolean [0..1]Canonical reference to the value set that contains the entire code systemvalueSet : canonical [0..1] « ValueSet »The meaning of the hierarchy of concepts as represented in this resourcehierarchyMeaning : code [0..1] « The meaning of the hierarchy of concepts in a code system. (Strength=Required)CodeSystemHierarchyMeaning! »The code system defines a compositional (post-coordination) grammarcompositional : boolean [0..1]This flag is used to signify that the code system does not commit to concept permanence across versions. If true, a version must be specified when referencing this code systemversionNeeded : boolean [0..1]The extent of the content of the code system (the concepts and codes it defines) are represented in this resource instancecontent : code [1..1] « The extent of the content of the code system (the concepts and codes it defines) are represented in a code system resource. (Strength=Required)CodeSystemContentMode! »The canonical URL of the code system that this code system supplement is adding designations and properties tosupplements : canonical [0..1] « CodeSystem »The total number of concepts defined by the code system. Where the code system has a compositional grammar, the basis of this count is defined by the system stewardcount : unsignedInt [0..1]FilterThe code that identifies this filter when it is used as a filter in [[[ValueSet]]].compose.include.filtercode : code [1..1]A description of how or why the filter is useddescription : string [0..1]A list of operators that can be used with the filteroperator : code [1..*] « The kind of operation to perform as a part of a property based filter. (Strength=Required)FilterOperator! »A description of what the value for the filter should bevalue : string [1..1]PropertyA code that is used to identify the property. The code is used internally (in CodeSystem.concept.property.code) and also externally, such as in property filterscode : code [1..1]Reference to the formal meaning of the property. One possible source of meaning is the [Concept Properties](codesystem-concept-properties.html) code systemuri : uri [0..1]A description of the property- why it is defined, and how its value might be useddescription : string [0..1]The type of the property value. Properties of type "code" contain a code defined by the code system (e.g. a reference to another defined concept)type : code [1..1] « The type of a property value. (Strength=Required)PropertyType! »ConceptDefinitionA code - a text symbol - that uniquely identifies the concept within the code systemcode : code [1..1]A human readable string that is the recommended default way to present this concept to a userdisplay : string [0..1]The formal definition of the concept. The code system resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the conceptdefinition : string [0..1]DesignationThe language this designation is defined forlanguage : code [0..1] « A human language. (Strength=Preferred)CommonLanguages? »A code that details how this designation would be useduse : Coding [0..1] « Details of how a designation would be used. (Strength=Extensible)DesignationUse+ »The text value for this designationvalue : string [1..1]ConceptPropertyA code that is a reference to CodeSystem.property.codecode : code [1..1]The value of this propertyvalue[x] : Type [1..1] « code|Coding|string|integer|boolean|dateTime| decimal »A filter that can be used in a value set compose statement when selecting concepts using a filterfilter[0..*]A property defines an additional slot through which additional information can be provided about a conceptproperty[0..*]Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etcdesignation[0..*]A property value for this conceptproperty[0..*]Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) - see hierarchyMeaningconcept[0..*]Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meanings of the hierarchical relationships areconcept[0..*]

XML Template

<CodeSystem xmlns="http://hl7.org/fhir"> doco
 <!-- from Resource: id, meta, implicitRules, and language -->
 <!-- from DomainResource: text, contained, extension, and modifierExtension -->
 <url value="[uri]"/><!-- 0..1 Canonical identifier for this code system, represented as a URI (globally unique) (Coding.system) -->
 <identifier><!-- 0..* Identifier Additional identifier for the code system (business identifier) --></identifier>
 <version value="[string]"/><!-- 0..1 Business version of the code system (Coding.version) -->
 <name value="[string]"/><!-- ?? 0..1 Name for this code system (computer friendly) -->
 <title value="[string]"/><!-- 0..1 Name for this code system (human friendly) -->
 <status value="[code]"/><!-- 1..1 draft | active | retired | unknown -->
 <experimental value="[boolean]"/><!-- 0..1 For testing purposes, not real usage -->
 <date value="[dateTime]"/><!-- 0..1 Date last changed -->
 <publisher value="[string]"/><!-- 0..1 Name of the publisher (organization or individual) -->
 <contact><!-- 0..* ContactDetail Contact details for the publisher --></contact>
 <description value="[markdown]"/><!-- 0..1 Natural language description of the code system -->
 <useContext><!-- 0..* UsageContext The context that the content is intended to support --></useContext>
 <jurisdiction><!-- 0..* CodeableConcept Intended jurisdiction for code system (if applicable) --></jurisdiction>
 <purpose value="[markdown]"/><!-- 0..1 Why this code system is defined -->
 <copyright value="[markdown]"/><!-- 0..1 Use and/or publishing restrictions -->
 <caseSensitive value="[boolean]"/><!-- 0..1 If code comparison is case sensitive -->
 <valueSet><!-- 0..1 canonical(ValueSet) Canonical reference to the value set with entire code system --></valueSet>
 <hierarchyMeaning value="[code]"/><!-- 0..1 grouped-by | is-a | part-of | classified-with -->
 <compositional value="[boolean]"/><!-- 0..1 If code system defines a compositional grammar -->
 <versionNeeded value="[boolean]"/><!-- 0..1 If definitions are not stable -->
 <content value="[code]"/><!-- 1..1 not-present | example | fragment | complete | supplement -->
 <supplements><!-- 0..1 canonical(CodeSystem) Canonical URL of Code System this adds designations and properties to --></supplements>
 <count value="[unsignedInt]"/><!-- 0..1 Total concepts in the code system -->
 <filter>  <!-- 0..* Filter that can be used in a value set -->
  <code value="[code]"/><!-- 1..1 Code that identifies the filter -->
  <description value="[string]"/><!-- 0..1 How or why the filter is used -->
  <operator value="[code]"/><!-- 1..* Operators that can be used with filter -->
  <value value="[string]"/><!-- 1..1 What to use for the value -->
 </filter>
 <property>  <!-- 0..* Additional information supplied about each concept -->
  <code value="[code]"/><!-- 1..1 Identifies the property on the concepts, and when referred to in operations -->
  <uri value="[uri]"/><!-- 0..1 Formal identifier for the property -->
  <description value="[string]"/><!-- 0..1 Why the property is defined, and/or what it conveys -->
  <type value="[code]"/><!-- 1..1 code | Coding | string | integer | boolean | dateTime | decimal -->
 </property>
 <concept>  <!-- 0..* Concepts in the code system -->
  <code value="[code]"/><!-- 1..1 Code that identifies concept -->
  <display value="[string]"/><!-- 0..1 Text to display to the user -->
  <definition value="[string]"/><!-- 0..1 Formal definition -->
  <designation>  <!-- 0..* Additional representations for the concept -->
   <language value="[code]"/><!-- 0..1 Human language of the designation -->
   <use><!-- 0..1 Coding Details how this designation would be used --></use>
   <value value="[string]"/><!-- 1..1 The text value for this designation -->
  </designation>
  <property>  <!-- 0..* Property value for the concept -->
   <code value="[code]"/><!-- 1..1 Reference to CodeSystem.property.code -->
   <value[x]><!-- 1..1 code|Coding|string|integer|boolean|dateTime|decimal Value of the property for this concept --></value[x]>
  </property>
  <concept><!-- 0..* Content as for CodeSystem.concept Child Concepts (is-a/contains/categorizes) --></concept>
 </concept>
</CodeSystem>

JSON Template

{doco
  "resourceType" : "CodeSystem",
  // from Resource: id, meta, implicitRules, and language
  // from DomainResource: text, contained, extension, and modifierExtension
  "url" : "<uri>", // Canonical identifier for this code system, represented as a URI (globally unique) (Coding.system)
  "identifier" : [{ Identifier }], // Additional identifier for the code system (business identifier)
  "version" : "<string>", // Business version of the code system (Coding.version)
  "name" : "<string>", // C? Name for this code system (computer friendly)
  "title" : "<string>", // Name for this code system (human friendly)
  "status" : "<code>", // R!  draft | active | retired | unknown
  "experimental" : <boolean>, // For testing purposes, not real usage
  "date" : "<dateTime>", // Date last changed
  "publisher" : "<string>", // Name of the publisher (organization or individual)
  "contact" : [{ ContactDetail }], // Contact details for the publisher
  "description" : "<markdown>", // Natural language description of the code system
  "useContext" : [{ UsageContext }], // The context that the content is intended to support
  "jurisdiction" : [{ CodeableConcept }], // Intended jurisdiction for code system (if applicable)
  "purpose" : "<markdown>", // Why this code system is defined
  "copyright" : "<markdown>", // Use and/or publishing restrictions
  "caseSensitive" : <boolean>, // If code comparison is case sensitive
  "valueSet" : { canonical(ValueSet) }, // Canonical reference to the value set with entire code system
  "hierarchyMeaning" : "<code>", // grouped-by | is-a | part-of | classified-with
  "compositional" : <boolean>, // If code system defines a compositional grammar
  "versionNeeded" : <boolean>, // If definitions are not stable
  "content" : "<code>", // R!  not-present | example | fragment | complete | supplement
  "supplements" : { canonical(CodeSystem) }, // Canonical URL of Code System this adds designations and properties to
  "count" : "<unsignedInt>", // Total concepts in the code system
  "filter" : [{ // Filter that can be used in a value set
    "code" : "<code>", // R!  Code that identifies the filter
    "description" : "<string>", // How or why the filter is used
    "operator" : ["<code>"], // R!  Operators that can be used with filter
    "value" : "<string>" // R!  What to use for the value
  }],
  "property" : [{ // Additional information supplied about each concept
    "code" : "<code>", // R!  Identifies the property on the concepts, and when referred to in operations
    "uri" : "<uri>", // Formal identifier for the property
    "description" : "<string>", // Why the property is defined, and/or what it conveys
    "type" : "<code>" // R!  code | Coding | string | integer | boolean | dateTime | decimal
  }],
  "concept" : [{ // Concepts in the code system
    "code" : "<code>", // R!  Code that identifies concept
    "display" : "<string>", // Text to display to the user
    "definition" : "<string>", // Formal definition
    "designation" : [{ // Additional representations for the concept
      "language" : "<code>", // Human language of the designation
      "use" : { Coding }, // Details how this designation would be used
      "value" : "<string>" // R!  The text value for this designation
    }],
    "property" : [{ // Property value for the concept
      "code" : "<code>", // R!  Reference to CodeSystem.property.code
      // value[x]: Value of the property for this concept. One of these 7:
      "valueCode" : "<code>"
      "valueCoding" : { Coding }
      "valueString" : "<string>"
      "valueInteger" : <integer>
      "valueBoolean" : <boolean>
      "valueDateTime" : "<dateTime>"
      "valueDecimal" : <decimal>
    }],
    "concept" : [{ Content as for CodeSystem.concept }] // Child Concepts (is-a/contains/categorizes)
  }]
}

Turtle Template

@prefix fhir: <http://hl7.org/fhir/> .doco


[ a fhir:CodeSystem;
  fhir:nodeRole fhir:treeRoot; # if this is the parser root

  # from Resource: .id, .meta, .implicitRules, and .language
  # from DomainResource: .text, .contained, .extension, and .modifierExtension
  fhir:CodeSystem.url [ uri ]; # 0..1 Canonical identifier for this code system, represented as a URI (globally unique) (Coding.system)
  fhir:CodeSystem.identifier [ Identifier ], ... ; # 0..* Additional identifier for the code system (business identifier)
  fhir:CodeSystem.version [ string ]; # 0..1 Business version of the code system (Coding.version)
  fhir:CodeSystem.name [ string ]; # 0..1 Name for this code system (computer friendly)
  fhir:CodeSystem.title [ string ]; # 0..1 Name for this code system (human friendly)
  fhir:CodeSystem.status [ code ]; # 1..1 draft | active | retired | unknown
  fhir:CodeSystem.experimental [ boolean ]; # 0..1 For testing purposes, not real usage
  fhir:CodeSystem.date [ dateTime ]; # 0..1 Date last changed
  fhir:CodeSystem.publisher [ string ]; # 0..1 Name of the publisher (organization or individual)
  fhir:CodeSystem.contact [ ContactDetail ], ... ; # 0..* Contact details for the publisher
  fhir:CodeSystem.description [ markdown ]; # 0..1 Natural language description of the code system
  fhir:CodeSystem.useContext [ UsageContext ], ... ; # 0..* The context that the content is intended to support
  fhir:CodeSystem.jurisdiction [ CodeableConcept ], ... ; # 0..* Intended jurisdiction for code system (if applicable)
  fhir:CodeSystem.purpose [ markdown ]; # 0..1 Why this code system is defined
  fhir:CodeSystem.copyright [ markdown ]; # 0..1 Use and/or publishing restrictions
  fhir:CodeSystem.caseSensitive [ boolean ]; # 0..1 If code comparison is case sensitive
  fhir:CodeSystem.valueSet [ canonical(ValueSet) ]; # 0..1 Canonical reference to the value set with entire code system
  fhir:CodeSystem.hierarchyMeaning [ code ]; # 0..1 grouped-by | is-a | part-of | classified-with
  fhir:CodeSystem.compositional [ boolean ]; # 0..1 If code system defines a compositional grammar
  fhir:CodeSystem.versionNeeded [ boolean ]; # 0..1 If definitions are not stable
  fhir:CodeSystem.content [ code ]; # 1..1 not-present | example | fragment | complete | supplement
  fhir:CodeSystem.supplements [ canonical(CodeSystem) ]; # 0..1 Canonical URL of Code System this adds designations and properties to
  fhir:CodeSystem.count [ unsignedInt ]; # 0..1 Total concepts in the code system
  fhir:CodeSystem.filter [ # 0..* Filter that can be used in a value set
    fhir:CodeSystem.filter.code [ code ]; # 1..1 Code that identifies the filter
    fhir:CodeSystem.filter.description [ string ]; # 0..1 How or why the filter is used
    fhir:CodeSystem.filter.operator [ code ], ... ; # 1..* Operators that can be used with filter
    fhir:CodeSystem.filter.value [ string ]; # 1..1 What to use for the value
  ], ...;
  fhir:CodeSystem.property [ # 0..* Additional information supplied about each concept
    fhir:CodeSystem.property.code [ code ]; # 1..1 Identifies the property on the concepts, and when referred to in operations
    fhir:CodeSystem.property.uri [ uri ]; # 0..1 Formal identifier for the property
    fhir:CodeSystem.property.description [ string ]; # 0..1 Why the property is defined, and/or what it conveys
    fhir:CodeSystem.property.type [ code ]; # 1..1 code | Coding | string | integer | boolean | dateTime | decimal
  ], ...;
  fhir:CodeSystem.concept [ # 0..* Concepts in the code system
    fhir:CodeSystem.concept.code [ code ]; # 1..1 Code that identifies concept
    fhir:CodeSystem.concept.display [ string ]; # 0..1 Text to display to the user
    fhir:CodeSystem.concept.definition [ string ]; # 0..1 Formal definition
    fhir:CodeSystem.concept.designation [ # 0..* Additional representations for the concept
      fhir:CodeSystem.concept.designation.language [ code ]; # 0..1 Human language of the designation
      fhir:CodeSystem.concept.designation.use [ Coding ]; # 0..1 Details how this designation would be used
      fhir:CodeSystem.concept.designation.value [ string ]; # 1..1 The text value for this designation
    ], ...;
    fhir:CodeSystem.concept.property [ # 0..* Property value for the concept
      fhir:CodeSystem.concept.property.code [ code ]; # 1..1 Reference to CodeSystem.property.code
      # CodeSystem.concept.property.value[x] : 1..1 Value of the property for this concept. One of these 7
        fhir:CodeSystem.concept.property.valueCode [ code ]
        fhir:CodeSystem.concept.property.valueCoding [ Coding ]
        fhir:CodeSystem.concept.property.valueString [ string ]
        fhir:CodeSystem.concept.property.valueInteger [ integer ]
        fhir:CodeSystem.concept.property.valueBoolean [ boolean ]
        fhir:CodeSystem.concept.property.valueDateTime [ dateTime ]
        fhir:CodeSystem.concept.property.valueDecimal [ decimal ]
    ], ...;
    fhir:CodeSystem.concept.concept [ See CodeSystem.concept ], ... ; # 0..* Child Concepts (is-a/contains/categorizes)
  ], ...;
]

Changes since Release 3

CodeSystem
CodeSystem.identifier
  • Max Cardinality changed from 1 to *
CodeSystem.status
  • Change value set from http://hl7.org/fhir/ValueSet/publication-status to http://hl7.org/fhir/ValueSet/publication-status|4.0.0
CodeSystem.experimental
  • No longer marked as Modifier
CodeSystem.valueSet
  • Type changed from uri to canonical(ValueSet)
CodeSystem.hierarchyMeaning
  • Change value set from http://hl7.org/fhir/ValueSet/codesystem-hierarchy-meaning to http://hl7.org/fhir/ValueSet/codesystem-hierarchy-meaning|4.0.0
CodeSystem.content
  • Change value set from http://hl7.org/fhir/ValueSet/codesystem-content-mode to http://hl7.org/fhir/ValueSet/codesystem-content-mode|4.0.0
CodeSystem.supplements
  • Added Element
CodeSystem.filter.operator
  • Change value set from http://hl7.org/fhir/ValueSet/filter-operator to http://hl7.org/fhir/ValueSet/filter-operator|4.0.0
CodeSystem.property.type
  • Change value set from http://hl7.org/fhir/ValueSet/concept-property-type to http://hl7.org/fhir/ValueSet/concept-property-type|4.0.0
CodeSystem.concept.designation.language
  • Change binding strength from extensible to preferred
CodeSystem.concept.property.value[x]
  • Add Type decimal

See the Full Difference for further information

This analysis is available as XML or JSON.

See R3 <--> R4 Conversion Maps (status = 4 tests that all execute ok. All tests pass round-trip testing and 3 r3 resources are invalid (0 errors).)

 

See the Profiles & Extensions and the alternate definitions: Master Definition XML + JSON, XML Schema/Schematron + JSON Schema, ShEx (for Turtle) + see the extensions & the dependency analysis

PathDefinitionTypeReference
CodeSystem.status The lifecycle status of an artifact.RequiredPublicationStatus
CodeSystem.jurisdiction Countries and regions within which this artifact is targeted for use.ExtensibleJurisdiction ValueSet
CodeSystem.hierarchyMeaning The meaning of the hierarchy of concepts in a code system.RequiredCodeSystemHierarchyMeaning
CodeSystem.content The extent of the content of the code system (the concepts and codes it defines) are represented in a code system resource.RequiredCodeSystemContentMode
CodeSystem.filter.operator The kind of operation to perform as a part of a property based filter.RequiredFilterOperator
CodeSystem.property.type The type of a property value.RequiredPropertyType
CodeSystem.concept.designation.language A human language.Preferred, but limited to AllLanguagesCommonLanguages
CodeSystem.concept.designation.use Details of how a designation would be used.ExtensibleDesignationUse

idLevelLocationDescriptionExpression
csd-0Warning (base)Name should be usable as an identifier for the module by machine processing applications such as code generationname.matches('[A-Z]([A-Za-z0-9_]){0,254}')
csd-1Rule (base)Within a code system definition, all the codes SHALL be uniqueconcept.code.combine($this.descendants().concept.code).isDistinct()

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 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 identifier which can be specified in CodeSystem.version. The version specific identifier 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 identifier, though HL7 recommends a date-based approach.

When the CodeSystem.versionNeeded is 'true', then the version identifier SHALL be used in 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.

在简单场景下,编码系统的所有概念及其编码、名称和属性全都包含在同一个CodeSystem资源实例中。但由于各种原因,编码系统可以由编码系统的管辖机构以一系列片段的形式发布,其他授权机构可以在附录中发布附加的名称和属性。

如果CodeSystem.content值是fragment,则表示此资源是分布式编码系统的其中一部分。

由于以下原因,编码系统可能以片段形式发布:

  • 编码系统中某些部分与其它部分的IP分配规则不同 评估建议内容的分发
  • 为了满足某此专用目的,编码系统中包含有专用模块
  • 需要将内容分开发布,以满足评估的需求。

以下规则适用于编码系统片段:

  • 属于同一编码系统的所有片段资源CodeSystem.url值得必须完全相同。
  • 片段只能由编码系统管辖机构发布,或者根据管辖机构定义的发布流程为已经定义过的编码系统发部新的片段。
  • 如果存在一个完整的编码系统,则必须保证片段中的所有编码、概念或属性都包含在完整版的编码系统之中。
  • 以分布式片段的方式发布编码系统可能会给术语服务器和术语服务使用者造成混淆。 发布片段的编码系统的发布应谨慎使用此方式,若确有分布式的必要,须尽可能说明清楚。

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
  • 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

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.

The impact of Code System supplements on value set expansion - and therefore value set validation - is subject to ongoing experimentation and implementation testing, and further clarification and additional rules might be proposed in future versions of this specification.

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. 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.

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.element.target.dependsOn.property and ConceptMap.element.target.product.property
  • ValueSet: ValueSet.compose.include.filter.property can refer to any defined code system property
  • $lookup operation: In Parameters.parameter.name when returning information about a code
  • $translate operation: In Parameters.parameter.part.name for dependencies and products
  • $find-matches operation: In Parameters.parameter.name when providing codes, and in Parameters.parameter.name when asking for codes

Properties are defined using the following elements:

Name Details Description
code code Used to identify the property, in the places shown in the list immediately above this table
uri optional uri Reference to the formal meaning of the property. One possible source of meaning is the Concept Properties code system. This part of the definition is optional, but is recommended to provide an additional level of definitional consistency
description optional string A description of the property- why it is defined, and how its value might be used
type code | Coding | string | integer | boolean | dateTime The type of the property value. Properties of type "code" contain a code defined by the code system (e.g. a reference to another defined concept)

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.

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, the words they use to describe the various status values they use, and some code systems have additional status values. HL7 uses Active and Retired. 除了这些状态编码码之外,概念还可以标记为“抽象的”(在某些情况下不可使用),并且注册了其弃用的日期。所有这些信息都在概念的属性及其值中体现。为了统一编码系统的一些基本属性,HL7定义了以下属性编码:

属性code:value[x]描述
http://hl7.org/fhir/concept-properties#status : codeA 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 - planned to be removed from use
  • retired - still present for historical reasons, but no longer allowed to be used
The HL7 defined code systems (whether defined by the FHIR project, the V3 framework, or the V2 standard) all use this property to define their status. HL7 uses "active" (and considers this the default status), and deprecated and retired (= inactive)
http://hl7.org/fhir/concept-properties#retirementDate : dateDate Concept was retired
http://hl7.org/fhir/concept-properties#deprecationDate : dateDate Concept was deprecated
http://hl7.org/fhir/concept-properties#parent : codeAn immediate parent of the concept in the hierarchy
http://hl7.org/fhir/concept-properties#child : codeAn immediate child of the concept in the hierarchy
http://hl7.org/fhir/concept-properties#notSelectable : booleanThis 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'

The parent and child properties are used when performing concept lookup (using the $lookup operation), and when using properties to indicate parent/child relationships (see below).

编码系统可以使用嵌套的concept元素来表示级联关系,级联关系含义通过CodeSystem.hierarchyMeaning来指定。编码系统的层级是树型结构,每个概念只有一个父级概念。

有一些编码系统定义了具有多个父级的概念。如果编码系统有这样的概念(常是被多个其他概念包含的概念),则不应使用编码系统资源中的层级(hierarchyMeaning)来表示,而应使用属性(properties)来定义概念之间的关系。即使要用层级来表示一个父级关系,也必须使用属性来表示嵌套层级概念中未能表达的其他父级。

编码系统中概念之间的关系不管是显式的通过属性来指定,还是暗含在层级概念中,调用操作(Operation)方法的返回结果都必须相同。

包含关系'subsume'、'subsumes'、'subsumed'和'subsumption'是和编码系统资源的层级元素(即CodeSystem.hierarchymeans的值)定义相关的。若满足以下条件,则概念A被视为被概念B所包含:
  • 如果概念A在编码系统资源的父概念层级中,概念B在子概念层级中
  • 如果在属性中声明了父/子关系,并且层级元素值为继承(Is-A)关系”

如果编码系统没有直接声明其层级含义,则必须手动查阅编码系统文档以确定如何确定包含关系。如果没有定义,那么此编码系统所有基于的包含关系(subsumption)特性都不可用。

基于的包含关系(subsumption)的逻辑在FHIR规范中的以下位置均有涉及:

The following filters are defined for all code systems:

Property Name Operation Value Definition Notes
[property] = [string] Includes all codes that have a property value equal to the specified string, where [property] is the code for any defined property
[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 The values cannot include ",", since it is being used as a delimiter

This draft section about the relationships between rich terminologies and structured content is still undergoing review.

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, but might also be useful for other code system related functionality (e.g. subsetting use Value Sets). This table summarizes how to treat these items as a terminology:

StructureDefinition The StructureDefinition.url (canonical URL) is the system. Each .snapshot.element.id in the snapshot is a code in the code system
Questionnaire The Questionnaire.url (canonical URL) is the system. Each .item.linkId in the snapshot is a code in the code system. Items with no linkId cannot be addressed
Medication Medication resources are a bit different, since they don't have a canonical URL, and there are not multiple items in a resource. So to refer to a medication resource, the system is [base]/Medication, where base is the server address. The Logical Id of the resource is the code

The use of these implicit code systems is not yet well tested, so this section remains informative.

For medications, the relationship between the code system and the medication resource is complex. Many medication related code systems (e.g. RxNorm, DM+D, AMT, etc.) represent more complex information than just code, display name and code system. These often contain information about the content of the medication A similar principle applies to observation definitions, which overlap significantly with LOINC and other related code systems, which contain a set of observation definitions, that contain methods, units, etc. Other similar arrangements exist for Location and many other kinds of resource.

In FHIR, these are handled by splitting the concept into two distinct parts - the Terminology, (Code System & ValueSet resources) is used to manage the codes, display names and relationships. A separate "detail" resource (e.g., Medication resource instances for RxNorm code details, ObservationDefinition instances for LOINC code details, or Location, etc.) is used to convey detailed information (dose form & strength, allowed data type or permitted values, address & hours of operation, etc.). One "detail" resource instance is created for each code.

This division accomplishes several things:

  • It allows generic systems that support terminology management to perform standard terminology operations on code systems dealing with complex structures - code lookup, validation, subsumption testing, mapping and translation.
  • It allows information to be exchanged about individual medications, data elements and locations. Codes can't be retrieved individually in FHIR - it is necessary to retrieve the entire resource. By packaging the detailed information in separate resources, independent retrieval and update is possible.
  • It supports use-cases for sharing medication, location, observation type and similar information in circumstances where the code may be unknown, unavailable or occasionally non-existent (e.g., custom compounds, non-registered locations). Having a distinct resource supports these capabilities, which would not be possible using CodeSystem/ValueSet.

Note that this division in FHIR does not imply that a similar division is required in the internal representation used by systems exposing a FHIR interface. Similarly, some systems may choose to only expose or maintain one aspect of such information types (i.e. only the discrete resource instances or only the value set).

The linkage between the "detail" resource and the Terminology resources is accomplished via the code element (or equivalent) on the detail resource. As well, the "name" or "title" on the detail resource generally corresponds with the display name on the matching code. Most detail resources will also have an "identifier" element. This can be set to the same value and namespace as the code, but if the only identifier a resource has is its defining code, it may be better to omit the identifier entirely. .

Search parameters for this resource. The common parameters also apply. See Searching for more information about searching in REST, messaging, and services.

NameTypeDescriptionExpressionIn Common
code TUtokenA code defined in the code systemCodeSystem.concept.code
content-mode TUtokennot-present | example | fragment | complete | supplementCodeSystem.content
context TUtokenA use context assigned to the code system(CodeSystem.useContext.value as CodeableConcept)
context-quantity TUquantityA quantity- or range-valued use context assigned to the code system(CodeSystem.useContext.value as Quantity) | (CodeSystem.useContext.value as Range)
context-type TUtokenA type of use context assigned to the code systemCodeSystem.useContext.code
context-type-quantity TUcompositeA use context type and quantity- or range-based value assigned to the code systemOn CodeSystem.useContext:
  context-type: code
  context-quantity: value.as(Quantity) | value.as(Range)
context-type-value TUcompositeA use context type and value assigned to the code systemOn CodeSystem.useContext:
  context-type: code
  context: value.as(CodeableConcept)
date TUdateThe code system publication dateCodeSystem.date
description TUstringThe description of the code systemCodeSystem.description
identifier TUtokenExternal identifier for the code systemCodeSystem.identifier
jurisdiction TUtokenIntended jurisdiction for the code systemCodeSystem.jurisdiction
language TUtokenA language in which a designation is providedCodeSystem.concept.designation.language
name TUstringComputationally friendly name of the code systemCodeSystem.name
publisher TUstringName of the publisher of the code systemCodeSystem.publisher
status TUtokenThe current status of the code systemCodeSystem.status
supplements TUreferenceFind code system supplements for the referenced code systemCodeSystem.supplements
(CodeSystem)
system TUuriThe system for any codes defined by this code system (same as 'url')CodeSystem.url
title TUstringThe human-friendly name of the code systemCodeSystem.title
url TUuriThe uri that identifies the code systemCodeSystem.url
version TUtokenThe business version of the code systemCodeSystem.version