2020年2月27日 星期四

HL7 FHIR 資源詳解篇 - Terminology - CodeSystem

Resource CodeSystem - Content

CodeSystem已經是Normative等級之文件,並取得ANSI認可。

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不是取代現有編碼系統的管理機制。但是,對於自訂編碼的部分,個人覺得就非常重要且好用。

  • CodeSystem是被用於ValueSet此Resource。
  • Coding這個資料型態,可參照CodeSystem的正規網址(canonical URL)
  • CodeSystem是HL7 CTS 2 
  • CodeSystem只紀錄了編碼系統的結構與相容性等資訊,真正具備有操作性的是使用TerminologyCapabilities。
編碼系統在HL7的所有標準體系中都非常重要,可惜國內一直「強烈」忽視這一塊。想深入了解,可參考這份文件: Using Codes in Resources
使用CodeSystem時,有三個元素容易混淆。
  • CodeSystem.id:這是FHIR Server給定的唯一編碼值。當然可以給流水號,或者是有意義的編碼。但他可視範圍是在此FHIR Server。
  • CodeSystem.url:這是此Cody System的正規網址,你可以視為一個命名空間。這是整個標準應用環境下是唯一值。也就是說,台灣TW可以自己搞一套。
  • CodeSystem.identifier:這個是把Code System拿去註冊取得OID編碼。他的唯一性,就看父層是掛誰了。
NameFlagsCard.TypeDescription & Constraints
.. CodeSystemNCanonicalResourceDeclares 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: idmetaimplicitRuleslanguagetextcontainedextensionmodifierExtensionurl,
identifierversionnametitlestatusexperimentaldatepublishercontactdescriptionuseContextjurisdictionpurposecopyright
... 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)
... 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
... description0..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)
... purpose0..1markdownWhy this code system is defined
... copyright0..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..*code= | is-a | descendent-of | is-not-a | regex | in | not-in | generalizes | exists
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)
... concept0..*BackboneElementConcepts in the code system
.... code1..1codeCode that identifies concept
.... display0..1stringText to display to the user
.... definition0..1stringFormal definition
.... designation0..*BackboneElementAdditional representations for the concept
..... language0..1codeHuman language of the designation
Common Languages (Preferred but limited to AllLanguages)
..... use0..1CodingDetails how this designation would be used
Designation Use (Extensible)
..... value1..1stringThe text value for this designation
.... property0..*BackboneElementProperty value for the concept
..... code1..1codeReference to CodeSystem.property.code
..... value[x]1..1Value of the property for this concept
...... valueCodecode
...... valueCodingCoding
...... valueStringstring
...... valueIntegerinteger
...... valueBooleanboolean
...... valueDateTimedateTime
...... valueDecimaldecimal
.... concept0..*see conceptChild 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元素,這樣所形成的結構意義是什麼。抱歉,也不是很懂。這個範例有用到
Example NameidFormat
Canonical Definition for SNOMED CTsnomedctXMLJSONTurtle
CodeDisplayDefinition
grouped-byGrouped ByNo 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-aIs-AA 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-ofPart OfChild elements list the individual parts of a composite whole (e.g. body site).
classified-withClassified WithChild 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)。這是必要欄位,

CodeDisplayDefinition
not-presentNot PresentNone of the concepts defined by the code system are included in the code system resource.
exampleExampleA 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.
fragmentFragmentA 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.
completeCompleteAll the concepts defined by the code system are included in the code system resource.
supplementSupplementThe 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)。
CodeDisplayDefinition
=EqualsThe specified property of the code equals the provided value.
is-aIs 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-ofDescendent 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-aNot (Is A) (by subsumption)The specified property of the code does not have an is-a relationship with the provided value.
regexRegular ExpressionThe specified property of the code matches the regex specified in the provided value.
inIn SetThe specified property of the code is in the set of codes or concepts specified in the provided value (comma separated list).
not-inNot in SetThe specified property of the code is not in the set of codes or concepts specified in the provided value (comma separated list).
generalizesGeneralizes (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).
existsExistsThe 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。

沒有留言:

張貼留言