java.lang.Object
。C#則是Object。那FHIR呢?首先得知道,FHIR的物件結構分成兩支,一個是Resource系列,一個是Data Type系列。
Data Type 系列
此系列的根元素是Element。其結構如下表:
Structure
Name | Flags | Card. | Type | Description & Constraints |
---|---|---|---|---|
Element | I | n/a | The base for all elements All FHIR elements must have a @value or children | |
id | 0..1 | string | Unique id for inter-element referencing | |
extension | 0..* | Extension | Additional content defined by implementations |
這個id稱之為internal Id,在xml結構中他是在屬性位置。一般是用在資源內部參照用。不過,也只有少數資源會用到,例如StructureDefinition。
只要在同一個Resource下保持唯一就符合規範。
這個根元素最重要的核心觀念是constrains。
Constraints
id | Level | Location | Description | Expression |
ele-1 | Rule | (base) | All FHIR elements must have a @value or children | hasValue() or (children().count() > id.count()) |
所以,最完整結構範例如下:
<status id="[internal id]" value="[value of code]""> <extension url="..."/> ... if there are any extensions <extension> </status>
一般而言,id很少出現。
Resource 系列
此系列的跟元素是Resource。其結構如下表:
Structure
Name | Flags | Card. | Type | Description & Constraints |
---|---|---|---|---|
Resource | N | n/a | Base Resource | |
id | Σ | 0..1 | id | Logical id of this artifact |
meta | Σ | 0..1 | Meta | Metadata about the resource |
implicitRules | ?!Σ | 0..1 | uri | A set of rules under which this content was created |
language | 0..1 | code | Language of the resource content Common Languages (Preferred but limited to AllLanguages) |
這個比較複雜點。
- id:這個就不是屬性囉,他是一個元素,其資料型態是id。他是邏輯ID。他是用來辨識不同資源者,就得要全域唯一了。也就是在同一台FHIR Server下,每個Resource的id必須要唯一。資料型態id的定義是:Any combination of upper- or lower-case ASCII letters。
- meta:其資料型態是Meta。存放一些有關於此Resource的中介資料。其結構為:
- versionId:版本控制用之Id。
- lastUpdated:最近更新之時間差戳記。
- source:用來紀錄這個Resource是從哪裡產生的。也許是FHIR Server或這是哪份文件、訊息等。
- profile:說明此Resource是遵循哪一份profile產生的。(什麼是profile又得另篇說明)
- security:標示安全等級。(這也得另篇說明,可以肯定應該會很久以後,先給原始資料吧。http://www.hl7.org/fhir/security-labels.html)
- tag:如字面解釋。我們可以利用這個tag,串起Resource的關聯性。
- implicitRules:其實每一個Resource都是由一堆規則所型塑起來的。千萬別以為FHIR就比CAD R2好用,都是抽象元素,都要加上一堆Constrains之後,來明確規範其用途。
- language:如字面說明。就是設定此Resource所採用的語言。台灣是
zh-TW Chinese (Taiwan)
Structure
Name | Flags | Card. | Type | Description & Constraints |
---|---|---|---|---|
Meta | ΣN | Element | Metadata about a resource Elements defined in Ancestors: id, extension | |
versionId | Σ | 0..1 | id | Version specific identifier |
lastUpdated | Σ | 0..1 | instant | When the resource version last changed |
source | Σ | 0..1 | uri | Identifies where the resource comes from |
profile | Σ | 0..* | canonical(StructureDefinition) | Profiles this resource claims to conform to |
security | Σ | 0..* | Coding | Security Labels applied to this resource SecurityLabels (Extensible) |
tag | Σ | 0..* | Coding | Tags applied to this resource Common Tags (Example) |
談到這得注意,所有的Resource不會直接繼承於Resource,而是繼承於DomainResource。其結構如下:
Structure
Name | Flags | Card. | Type | Description & Constraints |
---|---|---|---|---|
DomainResource | IN | Resource | A resource with narrative, extensions, and contained resources + Rule: If the resource is contained in another resource, it SHALL NOT contain nested Resources + Rule: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource + Rule: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated + Rule: If a resource is contained in another resource, it SHALL NOT have a security label + Guideline: A resource should have narrative for robust management Elements defined in Ancestors: id, meta, implicitRules, language | |
text | 0..1 | Narrative | Text summary of the resource, for human interpretation | |
contained | 0..* | Resource | Contained, inline Resources | |
extension | 0..* | Extension | Additional content defined by implementations | |
modifierExtension | ?! | 0..* | Extension | Extensions that cannot be ignored |
是不是又有一堆觀念需要理清呢?
別說FHIR很簡單,那是標準實作角度。從標準制定的角度就沒這麼容易了。只是國內不在意標準制定而已。
沒有留言:
張貼留言