Resource CodeSystem - Content
CodeSystem已經是Normative等級之文件,並取得ANSI認可。
Scope and Usage
FHIR的術語規範深受HL7 v3所影響,透過CodeSystem可取得相關資訊。但在FHIR中,Value Set也是個非常重要觀念且直接使用。CodeSystem的主要是用在宣告。
- 辨識URL與版次。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
- 用來過濾欄位時,可知道ValueSet.Compose元素可下什麼條件。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
這個CodeSystem不是取代現有編碼系統的管理機制。但是,對於自訂編碼的部分,個人覺得就非常重要且好用。
Boundaries and Relationships
- CodeSystem是被用於ValueSet此Resource。
- Coding這個資料型態,可參照CodeSystem的正規網址(canonical URL)
- CodeSystem是HL7 CTS 2 。
- CodeSystem只紀錄了編碼系統的結構與相容性等資訊,真正具備有操作性的是使用TerminologyCapabilities。
Background and Context
使用CodeSystem時,有三個元素容易混淆。
- CodeSystem.id:這是FHIR Server給定的唯一編碼值。當然可以給流水號,或者是有意義的編碼。但他可視範圍是在此FHIR Server。
- CodeSystem.url:這是此Cody System的正規網址,你可以視為一個命名空間。這是整個標準應用環境下是唯一值。也就是說,台灣TW可以自己搞一套。
- CodeSystem.identifier:這個是把Code System拿去註冊取得OID編碼。他的唯一性,就看父層是掛誰了。
Resource Content
Name | Flags | Card. | Type | Description & Constraints |
CodeSystem | N | | CanonicalResource | Declares 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,
identifier, version, name, title, status, experimental, date, publisher, contact, description, useContext, jurisdiction, purpose, copyright |
url | Σ | 0..1 | uri | 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) |
version | Σ | 0..1 | string | Business version of the code system (Coding.version) |
name | ΣI | 0..1 | string | Name for this code system (computer friendly) |
title | Σ | 0..1 | string | Name for this code system (human friendly) |
status | ?!Σ | 1..1 | code | draft | active | retired | unknown
PublicationStatus (Required) |
experimental | Σ | 0..1 | boolean | For testing purposes, not real usage |
date | Σ | 0..1 | dateTime | Date last changed |
publisher | Σ | 0..1 | string | Name of the publisher (organization or individual) |
contact | Σ | 0..* | ContactDetail | Contact details for the publisher |
description | | 0..1 | markdown | Natural language description of the code system |
useContext | ΣTU | 0..* | UsageContext | The context that the content is intended to support |
jurisdiction | Σ | 0..* | CodeableConcept | Intended jurisdiction for code system (if applicable)
Jurisdiction (Extensible) |
purpose | | 0..1 | markdown | Why this code system is defined |
copyright | | 0..1 | markdown | Use and/or publishing restrictions |
caseSensitive | Σ | 0..1 | boolean | If code comparison is case sensitive |
valueSet | Σ | 0..1 | canonical(ValueSet) | Canonical reference to the value set with entire code system |
hierarchyMeaning | Σ | 0..1 | code | grouped-by | is-a | part-of | classified-with
CodeSystemHierarchyMeaning (Required) |
compositional | Σ | 0..1 | boolean | If code system defines a compositional grammar |
versionNeeded | Σ | 0..1 | boolean | If definitions are not stable |
content | Σ | 1..1 | code | not-present | example | fragment | complete | supplement
CodeSystemContentMode (Required) |
supplements | Σ | 0..1 | canonical(CodeSystem) | Canonical URL of Code System this adds designations and properties to |
count | Σ | 0..1 | unsignedInt | Total concepts in the code system |
filter | Σ | 0..* | BackboneElement | Filter that can be used in a value set |
code | Σ | 1..1 | code | Code that identifies the filter |
description | Σ | 0..1 | string | How or why the filter is used |
operator | Σ | 1..* | code | = | is-a | descendent-of | is-not-a | regex | in | not-in | generalizes | exists
FilterOperator (Required) |
value | Σ | 1..1 | string | What to use for the value |
property | Σ | 0..* | BackboneElement | Additional information supplied about each concept |
code | Σ | 1..1 | code | Identifies the property on the concepts, and when referred to in operations |
uri | Σ | 0..1 | uri | Formal identifier for the property |
description | Σ | 0..1 | string | Why the property is defined, and/or what it conveys |
type | Σ | 1..1 | code | code | Coding | string | integer | boolean | dateTime | decimal
PropertyType (Required) |
concept | | 0..* | BackboneElement | Concepts in the code system |
code | | 1..1 | code | Code that identifies concept |
display | | 0..1 | string | Text to display to the user |
definition | | 0..1 | string | Formal definition |
designation | | 0..* | BackboneElement | Additional representations for the concept |
language | | 0..1 | code | Human language of the designation
Common Languages (Preferred but limited to AllLanguages) |
use | | 0..1 | Coding | Details how this designation would be used
Designation Use (Extensible) |
value | | 1..1 | string | The text value for this designation |
property | | 0..* | BackboneElement | Property value for the concept |
code | | 1..1 | code | Reference to CodeSystem.property.code |
value[x] | | 1..1 | | Value of the property for this concept |
valueCode | | | code | |
valueCoding | | | Coding | |
valueString | | | string | |
valueInteger | | | integer | |
valueBoolean | | | boolean | |
valueDateTime | | | dateTime | |
valueDecimal | | | decimal | |
concept | | 0..* | see concept | Child Concepts (is-a/contains/categorizes) |
[在此必須假設讀者都有基礎了]
CodeSystem
繼承CanonicalResource(他又繼承DomainResource),所以,會有一堆不在結構上的元素。
這邊補充一下,CanonicalResource是被定義為抽象類別,所以,CodeSystem必須自己去實作他。所以,在結構中,有很多欄位其實是來自CanonicalResource,因為抽象,所以會再出現。
去看CanonicalResource時,會發現有{{title}}的東西,這個就是要等實作類別補上去的。例如說url這個元素,在CanonicalResource的說明是Canonical identifier for this {{title}}, represented as a URI (globally unique),
到了CodeSystem時,其說明變成了Canonical identifier for this code system, represented as a URI (globally unique) (Coding.system)。
元素到copyright基本上都是一致的,也就不用多解釋了。
CodeSystem.caseSensitive
是否區分大小寫。基數0..1。資料型態是boolean。若沒有題供內容值,上傳者應該要遵守大小寫不同之的原則。
CodeSystem.valueSet
指向valueSet。基數0..1。資料型態是canonical(ValueSet)。也就是有一個Resource ValueSet用來代表這整個codeSystem所維護的內容值。
CodeSystem.hierarchyMeaning
此CodeSystem在Concept之結構意義。基數0..1。資料型態code,綁定CodeSystemHierarchyMeaning (Required)。後面concept元素之下有concept元素,這樣所形成的結構意義是什麼。抱歉,也不是很懂。這個範例有用到
Code | Display | Definition |
grouped-by | Grouped By | No particular relationship between the concepts can be assumed, except what can be determined by inspection of the definitions of the elements (possible reasons to use this: importing from a source where this is not defined, or where various parts of the hierarchy have different meanings). |
is-a | Is-A | A hierarchy where the child concepts have an IS-A relationship with the parents - that is, all the properties of the parent are also true for its child concepts. Not that is-a is a property of the concepts, so additional subsumption relationships may be defined using properties or the [subsumes](extension-codesystem-subsumes.html) extension. |
part-of | Part Of | Child elements list the individual parts of a composite whole (e.g. body site). |
classified-with | Classified With | Child concepts in the hierarchy may have only one parent, and there is a presumption that the code system is a "closed world" meaning all things must be in the hierarchy. This results in concepts such as "not otherwise classified.". |
CodeSystem.compositional
此CodeSystem是否採用compositional語法。抱歉,不懂。
CodeSystem.versionNeeded
此CodeSystem是否需要版本定義。基數0..1,資料型態boolean。當此CodeSystem尚未穩定時,就需要使用版本管控資訊。
CodeSystem.content
此CodeSystem的內容值(concepts)目前處於什麼狀態。基數1..1,資料型態code,綁定CodeSystemContentMode (Required)。這是必要欄位,
Code | Display | Definition |
not-present | Not Present | None of the concepts defined by the code system are included in the code system resource. |
example | Example | A few representative concepts are included in the code system resource. There is no useful intent in the subset choice and there's no process to make it workable: it's not intended to be workable. |
fragment | Fragment | A subset of the code system concepts are included in the code system resource. This is a curated subset released for a specific purpose under the governance of the code system steward, and that the intent, bounds and consequences of the fragmentation are clearly defined in the fragment or the code system documentation. Fragments are also known as partitions. |
complete | Complete | All the concepts defined by the code system are included in the code system resource. |
supplement | Supplement | The resource doesn't define any new concepts; it just provides additional designations and properties to another code system. |
CodeSystem.supplements
此CodeSystem的補充說明。基數0..1,資料型態是cannonical(CodeSystem)。一般會補充CodeSystem的情境是增加其他語言支援。
CodeSystem.count
此CodySystem包含幾個Concept。基數0..1,資料型態是unsignedInt。
CodeSystem.filter
篩檢器。基數為0..*,資料型態為BackboneElement。可用來定義過濾篩檢現在Concept。
CodeSystem.filter.code
代碼。基數1..1,資料型態code。若要用filter此編碼就一定要給。這個會被用在ValueSet.composel.include.filter。
CodeSystem.filter.description
filter描述。基數0..1。
CodeSystem.filter.operator
運算子。基數1..*,資料型態code,綁定FilterOperator (Required)。
Code | Display | Definition |
= | Equals | The specified property of the code equals the provided value. |
is-a | Is A (by subsumption) | 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). |
descendent-of | Descendent Of (by subsumption) | 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). |
is-not-a | Not (Is A) (by subsumption) | The specified property of the code does not have an is-a relationship with the provided value. |
regex | Regular Expression | The specified property of the code matches the regex specified in the provided value. |
in | In Set | The specified property of the code is in the set of codes or concepts specified in the provided value (comma separated list). |
not-in | Not in Set | The specified property of the code is not in the set of codes or concepts specified in the provided value (comma separated list). |
generalizes | Generalizes (by Subsumption) | 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). |
exists | Exists | The specified property of the code has at least one value (if the specified value is true; if the specified value is false, then matches when the specified property of the code has no values). |
CodeSystem.filter.value
此過濾器內容值。基數1..1,資料型態string。
CodeSystem.property
提供更多關於concept的資訊。基數為0..*,資料型態為BackboneElement。[抱歉,還沒有理解]
CodeSystem.concept
此CodeSystem要維護的內容。基數0..*,資料型態為BackboneElement。
主要是用CodeSystem.concept.code與CodeSystem.concept.display。