MessageHeader-twcore
type: StructureDefinition
node role: treeRoot
id:
  v: MessageHeader-twcore
text:
  status:
    v: extensions
  div:
    v: Generated Narrative: StructureDefinition MessageHeader-twcore Name Flags Card. Type Description & Constraints<img src="[binary]" alt="doco" style="background-color: inherit"/> <a href="StructureDefinition-MessageHeader-twcore-definitions.html#MessageHeader" title="在系統之間交換資訊時，會使用一個稱為「message header（訊息表頭）」的資料項目來標記和組織這次交換的內容。無論是發出請求還是回應某個動作，「訊息表頭」都扮演著關鍵角色。它不僅包含了這次動作涉及的對象（例如：特定的資料或resources），還包含了與這次動作相關的其他資訊。#xA;#xA;這些資訊一般會放在一個稱為「Bundle」的resource中傳輸，而「Message Header」resource則是這個Bundle中的第一個resource。這種結構讓接收方可以從「Message Header」resource 開始解析整個bundle，了解這次訊息交換的上下文和目的。簡言之，「Message Header」resource就像是一封信的信頭，告訴接收者这封信的主要内容和目的。">MessageHeader 0..* MessageHeader 描述系統間交換的訊息的resources #xD; id 0..1 id 不重複的ID用以識別儲存在特定FHIR Server中的DocumentReference紀錄，通常又稱為邏輯性ID。 #xD; meta 0..1 Meta 此DocumentReference Resource的metadata #xD; implicitRules 0..1 uri 創建此內容所依據的一組規則 #xD; language 0..1 code 用以表述DocumentReference Resource內容的語言。 Binding: CommonLanguages (preferred): 人類語言；鼓勵使用CommonLanguages代碼表中的代碼，但不強制一定要使用此代碼表，你也可使用其他代碼表的代碼或單純以文字表示。 Additional Bindings Purpose AllLanguages Max Binding Example Value: zh-TW #xD; text 0..1 Narrative DocumentReference Resource之內容摘要以供人閱讀 #xD; event[x] 1..1 Coding, uri 此訊息代表的事件的代碼或連結到事件定義 Binding: MessageEvent (example): 可參考所綁定值集，但此值集只是針對這個欄位的一個可能值的範例，不預期也不鼓勵使用者一定要使用此值集的代碼。 #xD; destination 0..* BackboneElement 訊息目的地應用程式 #xD; name 0..1 string 系統的名稱 #xD; target 0..1 Reference(Device) 在訊息或資料發送的目的地中，指定一個具體的接收點。 #xD; endpoint 1..1 url 實際目的地地址或id #xD; receiver 0..1 Reference(TW Core Practitioner | TW Core PractitionerRole | TW Core Organization) 資料應該被發送給在現實生活中真正需要這些資訊的個人或機構 #xD; sender S 0..1 Reference(TW Core Practitioner | TW Core PractitionerRole | TW Core Organization) 訊息的實際發送端 #xD; enterer 0..1 Reference(TW Core Practitioner | TW Core PractitionerRole) 資料輸入的來源 #xD; author 0..1 Reference(TW Core Practitioner | TW Core PractitionerRole) 決策的來源 #xD; source 1..1 BackboneElement 訊息來源應用程式 #xD; name 0..1 string 系統的名稱 #xD; software 0..1 string 運行系統的軟體名稱 #xD; version 0..1 string…
url:
  v: https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/MessageHeader-twcore
  l: MessageHeader-twcore
version:
  v: 1.0.0
name:
  v: TWCoreMessageHeader
title:
  v: TW Core MessageHeader
status:
  v: active
date:
  v: 2026-01-07T07:13:09+00:00
contact:
  name:
    v: 衛生福利部
  telecom:
    system:
      v: url
    value:
      v: https://www.mohw.gov.tw/
  telecom:
    system:
      v: email
description:
  v: 此臺灣核心-訊息表頭（TW Core MessageHeader） Profile說明本IG如何進一步定義FHIR的MessageHeader Resource以呈現訊息表頭的詳細資料。
fhir version:
  v: 4.0.1
mapping:
  identity:
    v: v2
  uri:
    v: http://hl7.org/v2
    l: v2
  name:
    v: HL7 v2 Mapping
mapping:
  identity:
    v: rim
  uri:
    v: http://hl7.org/v3
    l: v3
  name:
    v: RIM Mapping
mapping:
  identity:
    v: w5
  uri:
    v: http://hl7.org/fhir/fivews
    l: fivews
  name:
    v: FiveWs Pattern Mapping
kind:
  v: resource
abstract:
  v: false
type:
  v: MessageHeader
  l: MessageHeader
base definition:
  v: http://hl7.org/fhir/StructureDefinition/MessageHeader
  l: MessageHeader
derivation:
  v: constraint
snapshot:
  extension:
    url:
      v: http://hl7.org/fhir/tools/StructureDefinition/snapshot-base-version
      l: snapshot-base-version
    value: String
      v: 4.0.1
  element:
    id:
      v: MessageHeader
    path:
      v: MessageHeader
    short:
      v: 描述系統間交換的訊息的resources
    definition:
      v: 在系統之間交換資訊時，會使用一個稱為「message header（訊息表頭）」的資料項目來標記和組織這次交換的內容。無論是發出請求還是回應某個動作，「訊息表頭」都扮演著關鍵角色。它不僅包含了這次動作涉及的對象（例如：特定的資料或resources），還包含了與這次動作相關的其他資訊。 這些資訊一般會放在一個稱為「Bundle」的resource中傳輸，而「Message Header」resource則是這個Bundle中的第一個resource。這種結構讓接收方可以從「Message Header」resource 開始解析整個bundle，了解這次訊息交換的上下文和目的。簡言之，「Message Header」resource就像是一封信的信頭，告訴接收者这封信的主要内容和目的。
    min:
      v: 0
    max:
      v: *
    base:
      path:
        v: MessageHeader
      min:
        v: 0
      max:
        v: *
    constraint:
      key:
        v: dom-2
      severity:
        v: error
      human:
        v: If the resource is contained in another resource, it SHALL NOT contain nested Resources
      expression:
        v: contained.contained.empty()
      xpath:
        v: not(parent::f:contained and f:contained)
      source:
        v: http://hl7.org/fhir/StructureDefinition/DomainResource
        l: DomainResource
    constraint:
      key:
        v: dom-3
      severity:
        v: error
      human:
        v: 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
      expression:
        v: contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()
      xpath:
        v: not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))
      source:
        v: http://hl7.org/fhir/StructureDefinition/DomainResource
        l: DomainResource
    constraint:
      key:
        v: dom-4
      severity:
        v: error
      human:
        v: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated
      expression:
        v: contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()
      xpath:
        v: not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))
      source:
        v: http://hl7.org/fhir/StructureDefinition/DomainResource
        l: DomainResource
    constraint:
      key:
        v: dom-5
      severity:
        v: error
      human:
        v: If a resource is contained in another resource, it SHALL NOT have a security label
      expression:
        v: contained.meta.security.empty()
      xpath:
        v: not(exists(f:contained/*/f:meta/f:security))
      source:
        v: http://hl7.org/fhir/StructureDefinition/DomainResource
        l: DomainResource
    constraint:
      extension:
        value: Boolean
      extension:
        value: Markdown
      key:
        v: dom-6
      severity:
        v: warning
      human:
        v: A resource should have narrative for robust management
      expression:
        v: text.`div`.exists()
      xpath:
        v: exists(f:text/h:div)
      source:
        v: http://hl7.org/fhir/StructureDefinition/DomainResource
        l: DomainResource
    is modifier:
      v: false
    is summary:
      v: false
    mapping:
      identity:
        v: rim
      map:
        v: Entity. Role, or Act
    mapping:
      identity:
        v: v2
      map:
        v: MSH / MSA / ERR
    mapping:
      identity:
        v: rim
      map:
        v: Message
  element:
    id:
      v: MessageHeader.id
    path:
      v: MessageHeader.id
    short:
      v: 不重複的ID用以識別儲存在特定FHIR Server中的DocumentReference紀錄，通常又稱為邏輯性ID。
    definition:
      v: resource的邏輯ID，在resource的URL中使用。一旦指定，這個值永遠不會改變。

Boolean
v: true

Markdown
v: When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time.

v: 一個resource使用新增操作（create operation）提交給伺服器時，此resource沒有id，它的id在resource被創建後由伺器分配/指定。

v: 0

v: 1

path:
  v: Resource.id
min:
  v: 0
max:
  v: 1

extension:
  url:
    v: http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type
    l: structuredefinition-fhir-type
  value: Url
    v: id
    l: id
code:
  v: http://hl7.org/fhirpath/System.String
  l: System.String

v: false

v: true

id:
  v: MessageHeader.meta
path:
  v: MessageHeader.meta
short:
  v: 此DocumentReference Resource的metadata
definition:
  v: 關於resource的metadata。這是由基礎建設維護的內容。內容的更改可能並不總是與resource的版本更改相關聯。
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Resource.meta
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Meta
    l: Meta
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true

id:
  v: MessageHeader.implicitRules
path:
  v: MessageHeader.implicitRules
short:
  v: 創建此內容所依據的一組規則
definition:
  v: 構建resource時遵循的一系列規則的參照，在處理內容時必須理解這些規則。通常這是對IG所定義之特殊規則及其他profiles的參照。
comment:
  v: 宣告這套規則限制了內容只能被有限的交易夥伴所理解。這從本質上限制了資料的長期有用性。然而，現有的健康生態體系高度分裂，還沒有準備好以普遍可計算的方式定義、收集和交換資料。只要有可能，實作者和/或規範編寫者應該避免使用這個資料項目。通常在使用時，此URL是對IG的參照，此IG將這些特殊規則與其他profiles、value sets等一起定義為其敘述的一部分。
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Resource.implicitRules
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: uri
    l: uri
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: true
is modifier reason:
  v: This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation
is summary:
  v: true

id:
  v: MessageHeader.language
path:
  v: MessageHeader.language
short:
  v: 用以表述DocumentReference Resource內容的語言。
definition:
  v: 編寫此resource的語言
comment:
  v: 提供語言是為了支援索引和可存取性（通常，文字表述轉語音等服務使用此語言標籤）。html lanuage tag適用於此敘述。resource上的語言標籤可用於指定從resource中的資料所產成的其他表述之語言。不是所有的內容都必須使用此語言。不應該假定Resource.language自動適用於敘述。如果指定語言，它也應該被指定在html中的div資料項目（關於xml:lang和html lang屬性之間的關係，見HTML5中的規則）。
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Resource.language
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: code
    l: code
example:
  label:
    v: Value
  value: String
    v: zh-TW
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: false
binding:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet
      l: elementdefinition-maxValueSet
    value: Canonical
      v: http://hl7.org/fhir/ValueSet/all-languages
      l: all-languages
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
      l: elementdefinition-bindingName
    value: String
      v: Language
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding
      l: elementdefinition-isCommonBinding
    value: Boolean
      v: true
  strength:
    v: preferred
  description:
    v: 人類語言；鼓勵使用CommonLanguages代碼表中的代碼，但不強制一定要使用此代碼表，你也可使用其他代碼表的代碼或單純以文字表示。
  value set:
    v: http://hl7.org/fhir/ValueSet/languages
    l: languages

id:
  v: MessageHeader.text
path:
  v: MessageHeader.text
short:
  v: DocumentReference Resource之內容摘要以供人閱讀
definition:
  v: 人可讀的敘述，包含resource的摘要，可用於向人表述resource的內容。敘述不需要對所有的結構化資料進行編碼，但需要包含足夠的細節使人在閱讀敘述時理解「臨床安全性」。resource定義有哪些內容應該在敘述中表示，以確保臨床安全。
comment:
  v: 內嵌（contained）的resource沒有敘述，非內嵌（contained）的resource則 **建議應該（SHOULD）** 有敘述。有時resource可能只有文字表述，很少或沒有額外的結構化資料（只要滿足所有minOccurs=1的資料項目）。這可能出現在舊系統的資料，當資訊以 「文字表述區塊（text blob） 」的形式被取得，或者文字表述是原始輸入或說明，而編碼資訊稍後再添加。
alias:
  v: narrative
alias:
  v: html
alias:
  v: xhtml
alias:
  v: display
min:
  v: 0
max:
  v: 1
base:
  path:
    v: DomainResource.text
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Narrative
    l: Narrative
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: Act.text?

id:
  v: MessageHeader.contained
path:
  v: MessageHeader.contained
short:
  v: Contained, inline Resources
definition:
  v: These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.
comment:
  v: This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags In their meta elements, but SHALL NOT have security labels.
alias:
  v: inline resources
alias:
  v: anonymous resources
alias:
  v: contained resources
min:
  v: 0
max:
  v: *
base:
  path:
    v: DomainResource.contained
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Resource
    l: Resource
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: N/A

id:
  v: MessageHeader.extension
path:
  v: MessageHeader.extension
short:
  v: Additional content defined by implementations
definition:
  v: May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.
comment:
  v: There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
alias:
  v: extensions
alias:
  v: user content
min:
  v: 0
max:
  v: *
base:
  path:
    v: DomainResource.extension
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Extension
    l: Extension
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
constraint:
  key:
    v: ext-1
  severity:
    v: error
  human:
    v: Must have either extensions or value[x], not both
  expression:
    v: extension.exists() != value.exists()
  xpath:
    v: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    l: Extension
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: N/A

id:
  v: MessageHeader.modifierExtension
path:
  v: MessageHeader.modifierExtension
short:
  v: Extensions that cannot be ignored
definition:
  v: May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
comment:
  v: There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
requirements:
  v: Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).
alias:
  v: extensions
alias:
  v: user content
min:
  v: 0
max:
  v: *
base:
  path:
    v: DomainResource.modifierExtension
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Extension
    l: Extension
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
constraint:
  key:
    v: ext-1
  severity:
    v: error
  human:
    v: Must have either extensions or value[x], not both
  expression:
    v: extension.exists() != value.exists()
  xpath:
    v: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    l: Extension
is modifier:
  v: true
is modifier reason:
  v: Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: N/A

id:
  v: MessageHeader.event[x]
path:
  v: MessageHeader.event[x]
short:
  v: 此訊息代表的事件的代碼或連結到事件定義
definition:
  v: 用於識別此訊息所代表的事件並將其與其定義連接的代碼。作為FHIR規範一部分定義的事件，其系統值（system value）為「http://terminology.hl7.org/CodeSystem/message-events」。或者是指向EventDefinition的URI。
comment:
  v: 事件的時間將在foscus resource中找到。訊息的時間將在[Bundle.timestamp](bundle-definitions.html#Bundle.timestamp)中找到。
requirements:
  v: 驅動與此訊息相關的行為
min:
  v: 1
max:
  v: 1
base:
  path:
    v: MessageHeader.event[x]
  min:
    v: 1
  max:
    v: 1
type:
  code:
    v: Coding
    l: Coding
type:
  code:
    v: uri
    l: uri
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
binding:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
      l: elementdefinition-bindingName
    value: String
      v: MessageEvent
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding
      l: elementdefinition-isCommonBinding
    value: Boolean
      v: true
  strength:
    v: example
  description:
    v: 可參考所綁定值集，但此值集只是針對這個欄位的一個可能值的範例，不預期也不鼓勵使用者一定要使用此值集的代碼。
  value set:
    v: http://hl7.org/fhir/ValueSet/message-events
    l: message-events
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.what[x]
mapping:
  identity:
    v: v2
  map:
    v: MSH-9.2
mapping:
  identity:
    v: rim
  map:
    v: ./payload[classCode="CACT" and moodCode="EVN" and isNormalAct()]/code[isNormalDatatype()]/code

id:
  v: MessageHeader.destination
path:
  v: MessageHeader.destination
short:
  v: 訊息目的地應用程式
definition:
  v: 訊息目的地應用程式
comment:
  v: 在發送訊息時，通常 **應該（SHOULD）** 至少有一個接收目的地。但在某些情況下，發送訊息的系統可能不會知道任何特定的接收目的地系統。
requirements:
  v: 訊息中會指定一個或多個接收方（目的地應用程式），用於確定訊息應該發送到哪裡去。這樣做的目的是為了確保訊息能夠正確地被送達到預定的接收者，並且允許接收訊息的系統或人員檢查自己是否是該訊息的目標接收者。簡言之，這是一種確認「這個訊息是不是發給我的」的機制。
min:
  v: 0
max:
  v: *
base:
  path:
    v: MessageHeader.destination
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: BackboneElement
    l: BackboneElement
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.subject[x]
mapping:
  identity:
    v: rim
  map:
    v: ./communicationFunction[typeCode="RCV"]
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.subject

id:
  v: MessageHeader.destination.id
path:
  v: MessageHeader.destination.id
representation:
  v: xmlAttr
short:
  v: Unique id for inter-element referencing
definition:
  v: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Element.id
  min:
    v: 0
  max:
    v: 1
type:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type
      l: structuredefinition-fhir-type
    value: Url
      v: string
      l: string
  code:
    v: http://hl7.org/fhirpath/System.String
    l: System.String
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: n/a

id:
  v: MessageHeader.destination.extension
path:
  v: MessageHeader.destination.extension
short:
  v: Additional content defined by implementations
definition:
  v: May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.
comment:
  v: There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
alias:
  v: extensions
alias:
  v: user content
min:
  v: 0
max:
  v: *
base:
  path:
    v: Element.extension
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Extension
    l: Extension
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
constraint:
  key:
    v: ext-1
  severity:
    v: error
  human:
    v: Must have either extensions or value[x], not both
  expression:
    v: extension.exists() != value.exists()
  xpath:
    v: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    l: Extension
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: n/a

id:
  v: MessageHeader.destination.modifierExtension
path:
  v: MessageHeader.destination.modifierExtension
short:
  v: Extensions that cannot be ignored even if unrecognized
definition:
  v: May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
comment:
  v: There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
requirements:
  v: Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).
alias:
  v: extensions
alias:
  v: user content
alias:
  v: modifiers
min:
  v: 0
max:
  v: *
base:
  path:
    v: BackboneElement.modifierExtension
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Extension
    l: Extension
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
constraint:
  key:
    v: ext-1
  severity:
    v: error
  human:
    v: Must have either extensions or value[x], not both
  expression:
    v: extension.exists() != value.exists()
  xpath:
    v: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    l: Extension
is modifier:
  v: true
is modifier reason:
  v: Modifier extensions are expected to modify the meaning or interpretation of the element that contains them
is summary:
  v: true
mapping:
  identity:
    v: rim
  map:
    v: N/A

id:
  v: MessageHeader.destination.name
path:
  v: MessageHeader.destination.name
short:
  v: 系統的名稱
definition:
  v: 目標系統的名稱
requirements:
  v: 可用於回應的路徑和/或支援稽核
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MessageHeader.destination.name
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: string
    l: string
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: v2
  map:
    v: MSH-5
mapping:
  identity:
    v: rim
  map:
    v: unique(./entity[determinerCode="INST" and (classCode=("DEV", "PSN", "ORG"]/name[type='ST' and isNormalDatatype()])

id:
  v: MessageHeader.destination.target
path:
  v: MessageHeader.destination.target
short:
  v: 在訊息或資料發送的目的地中，指定一個具體的接收點。
definition:
  v: 當發送的訊息首先被送達到一個中介系統而不是直接送到最終目的地時，需要明確識別出最終的接收系統是什麼。
requirements:
  v: 支援多點跳躍繞徑（multi-hop routing）
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MessageHeader.destination.target
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Device|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/Device
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: rim
  map:
    v: unique(./entity[determinerCode="INST" and (classCode=("DEV", "PSN", "ORG"]

id:
  v: MessageHeader.destination.endpoint
path:
  v: MessageHeader.destination.endpoint
short:
  v: 實際目的地地址或id
definition:
  v: 指明訊息應該被繞徑到哪裡
comment:
  v: 對於不使用標準網絡地址的系統，該id可能是一個無法解析的URI。
requirements:
  v: 指明應將訊息繞徑至何處
min:
  v: 1
max:
  v: 1
base:
  path:
    v: MessageHeader.destination.endpoint
  min:
    v: 1
  max:
    v: 1
type:
  code:
    v: url
    l: url
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: v2
  map:
    v: MSH-25 (or MSH-6)
mapping:
  identity:
    v: rim
  map:
    v: ./telecom

id:
  v: MessageHeader.destination.receiver
path:
  v: MessageHeader.destination.receiver
short:
  v: 資料應該被發送給在現實生活中真正需要這些資訊的個人或機構
definition:
  v: 當單純發送資料到一個特定的應用程式是不夠用時，這允許我們把訊息直接指定發送給具體的某個人或是某個部門。
requirements:
  v: 可以把訊息發送到更多的地方，不只是發到某個應用程式裡面。
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MessageHeader.destination.receiver
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/Practitioner-twcore
    l: Practitioner-twcore
  target profile:
    v: https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/PractitionerRole-twcore
    l: PractitionerRole-twcore
  target profile:
    v: https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/Organization-twcore
    l: Organization-twcore
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.subject[x]
mapping:
  identity:
    v: v2
  map:
    v: PRT-5:PRT-4='WAYR' / PRT-8:PRT-4='WAYR'
mapping:
  identity:
    v: rim
  map:
    v: Not directly supported. Could be shared using attentionLine.value with an appropriate keyWordText
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.subject

id:
  v: MessageHeader.sender
path:
  v: MessageHeader.sender
short:
  v: 訊息的實際發送端
definition:
  v: 識別發送端系統的身份，以便可以建立信任關係並進行後續操作。
comment:
  v: 這個使用案例是針對一個（受信任的）發送端系統負責管理多個機構的情況，因此單憑來源端點/身份驗證無法區分機構。
requirements:
  v: 不僅僅限制在應用程式層級的繞徑操作，可以進行更高層次的繞徑操作。
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MessageHeader.sender
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/Practitioner-twcore
    l: Practitioner-twcore
  target profile:
    v: https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/PractitionerRole-twcore
    l: PractitionerRole-twcore
  target profile:
    v: https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/Organization-twcore
    l: Organization-twcore
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
must support:
  v: true
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.subject[x]
mapping:
  identity:
    v: v2
  map:
    v: PRT-5:PRT-4='WAYR' / PRT-8:PRT-4='WAYR'
mapping:
  identity:
    v: rim
  map:
    v: Not directly supported. Could be shared using attentionLine.value with an appropriate keyWordText
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.subject

id:
  v: MessageHeader.enterer
path:
  v: MessageHeader.enterer
short:
  v: 資料輸入的來源
definition:
  v: 此訊息的資料輸入來源，即導致此訊息出現的人員或裝置。如果有多個可能的輸入者，則應選擇與訊息最相關的那個。如果有其他可能的輸入者，可以在擴充資料項目中提供其他輸入者資訊。
comment:
  v: 通常僅用於請求，但也可用於回應。
requirements:
  v: 需要知道這個訊息的來源是出於審計/追溯需求，可能也與授權有關。
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MessageHeader.enterer
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/Practitioner-twcore
    l: Practitioner-twcore
  target profile:
    v: https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/PractitionerRole-twcore
    l: PractitionerRole-twcore
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.author
mapping:
  identity:
    v: v2
  map:
    v: EVN-5 / ORC-10 / PRT-5:PRT-4='EP' / ROL where ROL.3 is EP or ORC.10
mapping:
  identity:
    v: rim
  map:
    v: unique(./controlAct[classCode="CACT" and classCode="EVN" and isNormalAct()]/participation[typeCode="ENT" and isNormalParticipation]/role[classCode="ASSIGNED" and isNormalRole()]/player[isNormalEntity() and classCode=("DEV", "PSN") and determinerCode="INST"])

id:
  v: MessageHeader.author
path:
  v: MessageHeader.author
short:
  v: 決策的來源
definition:
  v: 這是在描述訊息的作者，也就是決定所描述事件應該發生的人或設備。如果有多個可能的候選者，應該選擇最接近消息標頭的那個。在需要時，可以在擴充資料項目中提供其他作者的相關資訊。
comment:
  v: 通常僅用於請求，但也可用於回應。
requirements:
  v: 需要知道這個訊息的來源是出於審計/追溯需求，可能也與授權有關。
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MessageHeader.author
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/Practitioner-twcore
    l: Practitioner-twcore
  target profile:
    v: https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/PractitionerRole-twcore
    l: PractitionerRole-twcore
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.author
mapping:
  identity:
    v: v2
  map:
    v: ORC-19 / PRT-5:PRT-4='AUT' / ROL where ROL.3 is IP or ORC.12
mapping:
  identity:
    v: rim
  map:
    v: unique(./controlAct[classCode="CACT" and classCode="EVN" and isNormalAct()]/participation[isHighest(priorityCode) and typeCode="AUT" and isNormalParticipation]/role[classCode="ASSIGNED" and isNormalRole()]/player[isNormalEntity() and classCode=("DEV", "PSN") and determinerCode="INST"])

id:
  v: MessageHeader.source
path:
  v: MessageHeader.source
short:
  v: 訊息來源應用程式
definition:
  v: 此訊息來源應用程式
requirements:
  v: 允許回應，支援稽核。
min:
  v: 1
max:
  v: 1
base:
  path:
    v: MessageHeader.source
  min:
    v: 1
  max:
    v: 1
type:
  code:
    v: BackboneElement
    l: BackboneElement
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.actor
mapping:
  identity:
    v: rim
  map:
    v: unique(./communicationFunction[typeCode="SND"])

id:
  v: MessageHeader.source.id
path:
  v: MessageHeader.source.id
representation:
  v: xmlAttr
short:
  v: Unique id for inter-element referencing
definition:
  v: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Element.id
  min:
    v: 0
  max:
    v: 1
type:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type
      l: structuredefinition-fhir-type
    value: Url
      v: string
      l: string
  code:
    v: http://hl7.org/fhirpath/System.String
    l: System.String
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: n/a

id:
  v: MessageHeader.source.extension
path:
  v: MessageHeader.source.extension
short:
  v: Additional content defined by implementations
definition:
  v: May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.
comment:
  v: There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
alias:
  v: extensions
alias:
  v: user content
min:
  v: 0
max:
  v: *
base:
  path:
    v: Element.extension
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Extension
    l: Extension
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
constraint:
  key:
    v: ext-1
  severity:
    v: error
  human:
    v: Must have either extensions or value[x], not both
  expression:
    v: extension.exists() != value.exists()
  xpath:
    v: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    l: Extension
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: n/a

id:
  v: MessageHeader.source.modifierExtension
path:
  v: MessageHeader.source.modifierExtension
short:
  v: Extensions that cannot be ignored even if unrecognized
definition:
  v: May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
comment:
  v: There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
requirements:
  v: Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).
alias:
  v: extensions
alias:
  v: user content
alias:
  v: modifiers
min:
  v: 0
max:
  v: *
base:
  path:
    v: BackboneElement.modifierExtension
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Extension
    l: Extension
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
constraint:
  key:
    v: ext-1
  severity:
    v: error
  human:
    v: Must have either extensions or value[x], not both
  expression:
    v: extension.exists() != value.exists()
  xpath:
    v: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    l: Extension
is modifier:
  v: true
is modifier reason:
  v: Modifier extensions are expected to modify the meaning or interpretation of the element that contains them
is summary:
  v: true
mapping:
  identity:
    v: rim
  map:
    v: N/A

id:
  v: MessageHeader.source.name
path:
  v: MessageHeader.source.name
short:
  v: 系統的名稱
definition:
  v: 系統的名稱
requirements:
  v: 可用於支援稽核
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MessageHeader.source.name
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: string
    l: string
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: v2
  map:
    v: MSH-3
mapping:
  identity:
    v: rim
  map:
    v: unique(./entity[determinerCode="INST" and classCode="DEV"]/name[type='ST' and isNormalDatatype()])

id:
  v: MessageHeader.source.software
path:
  v: MessageHeader.source.software
short:
  v: 運行系統的軟體名稱
definition:
  v: 可能包含設定或其他對於除錯有用的資訊
requirements:
  v: 支援稽核功能，也可能涉及到介面引擎（Interface Engine）的操作。介面引擎是一種軟體工具或平台，用於在不同的資訊系統、應用程式或資料庫之間傳輸和轉換資料。
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MessageHeader.source.software
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: string
    l: string
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: v2
  map:
    v: SFT-3 ( +SFT-1)
mapping:
  identity:
    v: rim
  map:
    v: unique(./entity[determinerCode="INST" and classCode="DEV"]/softwareName[isNormalDatatype()])

id:
  v: MessageHeader.source.version
path:
  v: MessageHeader.source.version
short:
  v: 軟體運行的版本
definition:
  v: 可以在訊息經過多方處理的情況下，傳達多個系統的版本資訊。
requirements:
  v: 支援稽核功能，也可能涉及到介面引擎（Interface Engine）的操作。介面引擎是一種軟體工具或平台，用於在不同的資訊系統、應用程式或資料庫之間傳輸和轉換資料。
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MessageHeader.source.version
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: string
    l: string
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: v2
  map:
    v: SFT-2
mapping:
  identity:
    v: rim
  map:
    v: (Not supported)

id:
  v: MessageHeader.source.contact
path:
  v: MessageHeader.source.contact
short:
  v: 提供人工聯絡途徑以處理問題
definition:
  v: 提供電子郵件、電話、網站或其他聯絡方式，用以解決訊息溝通上的問題。
requirements:
  v: 允許對技術問題進行升級處理
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MessageHeader.source.contact
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: ContactPoint
    l: ContactPoint
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: v2
  map:
    v: (MSH-22?)
mapping:
  identity:
    v: rim
  map:
    v: unique(./entity[determinerCode="INST" and classCode="DEV"]/scopesRole[normalRole() and classCode="CON" and layer[classCode="PSN"]/telecom[isNormalDatatype()])

id:
  v: MessageHeader.source.endpoint
path:
  v: MessageHeader.source.endpoint
short:
  v: 實際訊息來源地址或ID
definition:
  v: 要把確認訊息發給哪個地方？
comment:
  v: 這個 id 可能是一個無法在不使用標準基於網路地址的系統中解析的 URI
requirements:
  v: 指明回應訊息應該發送到的地方，這個指定可能會對系統的安全權限產生影響。
min:
  v: 1
max:
  v: 1
base:
  path:
    v: MessageHeader.source.endpoint
  min:
    v: 1
  max:
    v: 1
type:
  code:
    v: url
    l: url
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: v2
  map:
    v: MSH-24
mapping:
  identity:
    v: rim
  map:
    v: ./telecom[isNormalDatatype()]

id:
  v: MessageHeader.responsible
path:
  v: MessageHeader.responsible
short:
  v: 事件的最終責任
definition:
  v: 承擔整個訊息內容的最終責任的個人或機構，這意味著訊息事件發生在負責方的政策下。
comment:
  v: 通常僅用於請求，但也可以在回應中使用。
requirements:
  v: 需要知道這一點是為了滿足稽核/追踪需求，可能也是為了授權。
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MessageHeader.responsible
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/Practitioner-twcore
    l: Practitioner-twcore
  target profile:
    v: https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/PractitionerRole-twcore
    l: PractitionerRole-twcore
  target profile:
    v: https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/Organization-twcore
    l: Organization-twcore
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.witness
mapping:
  identity:
    v: v2
  map:
    v: ORC-12 / PRT-5:PRT-4='OP' / PRT-8:PRT-4='OP' / ROL where ROL.3 is RO or ORC.11
mapping:
  identity:
    v: rim
  map:
    v: unique(./controlAct[classCode="CACT" and classCode="EVN" and isNormalAct()]/participation[isHighest(priorityCode) and typeCode="RESP" and isNormalParticipation]/role[classCode="ASSIGNED" and isNormalRole()]/player[isNormalEntity() and classCode="PSN" and determinerCode="INST"] or ./controlAct[classCode="CACT" and classCode="EVN" and isNormalAct()]/participation[isHighest(priorityCode) and typeCode="RESP" and isNormalParticipation]/role[classCode="ASSIGNED" and isNormalRole()]/scoper[isNormalEntity() and classCode="ORG" and determinerCode="INST"])

id:
  v: MessageHeader.reason
path:
  v: MessageHeader.reason
short:
  v: 事件的原因
definition:
  v: 這是對事件原因的編碼指示，表示了此訊息關注（focus）事件發生的原因。
requirements:
  v: 需要能夠追蹤為何resource被更改，並在resource的稽核日誌/歷史記錄中報告，但這可能會影響授權。
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MessageHeader.reason
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: CodeableConcept
    l: CodeableConcept
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
binding:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
      l: elementdefinition-bindingName
    value: String
      v: EventReason
  strength:
    v: example
  description:
    v: 可參考所綁定值集，但此值集只是針對這個欄位的一個可能值的範例，不預期也不鼓勵使用者一定要使用此值集的代碼。
  value set:
    v: http://hl7.org/fhir/ValueSet/message-reason-encounter
    l: message-reason-encounter
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.why[x]
mapping:
  identity:
    v: v2
  map:
    v: EVN.4 / ORC.16 / OBR-31-reason for study / BPO-13-BP indication for use / RXO-20-indication / RXE-27-give indication / RXD-21-indication / RXG-22-indication / RXA-19-indication
mapping:
  identity:
    v: rim
  map:
    v: unique(./controlAct[classCode="CACT" and classCode="EVN" and isNormalAct()]/reasonCode[isNormalDatatype()])

id:
  v: MessageHeader.response
path:
  v: MessageHeader.response
short:
  v: 這是對先前訊息的回應
definition:
  v: 如果這是對先前訊息的回應，則包含有關此訊息的回應訊息。
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MessageHeader.response
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: BackboneElement
    l: BackboneElement
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: v2
  map:
    v: MSA
mapping:
  identity:
    v: rim
  map:
    v: ./conveyedAcknowledgement

id:
  v: MessageHeader.response.id
path:
  v: MessageHeader.response.id
representation:
  v: xmlAttr
short:
  v: Unique id for inter-element referencing
definition:
  v: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Element.id
  min:
    v: 0
  max:
    v: 1
type:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type
      l: structuredefinition-fhir-type
    value: Url
      v: string
      l: string
  code:
    v: http://hl7.org/fhirpath/System.String
    l: System.String
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: n/a

id:
  v: MessageHeader.response.extension
path:
  v: MessageHeader.response.extension
short:
  v: Additional content defined by implementations
definition:
  v: May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.
comment:
  v: There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
alias:
  v: extensions
alias:
  v: user content
min:
  v: 0
max:
  v: *
base:
  path:
    v: Element.extension
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Extension
    l: Extension
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
constraint:
  key:
    v: ext-1
  severity:
    v: error
  human:
    v: Must have either extensions or value[x], not both
  expression:
    v: extension.exists() != value.exists()
  xpath:
    v: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    l: Extension
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: n/a

id:
  v: MessageHeader.response.modifierExtension
path:
  v: MessageHeader.response.modifierExtension
short:
  v: Extensions that cannot be ignored even if unrecognized
definition:
  v: May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
comment:
  v: There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.
requirements:
  v: Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).
alias:
  v: extensions
alias:
  v: user content
alias:
  v: modifiers
min:
  v: 0
max:
  v: *
base:
  path:
    v: BackboneElement.modifierExtension
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Extension
    l: Extension
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
constraint:
  key:
    v: ext-1
  severity:
    v: error
  human:
    v: Must have either extensions or value[x], not both
  expression:
    v: extension.exists() != value.exists()
  xpath:
    v: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    l: Extension
is modifier:
  v: true
is modifier reason:
  v: Modifier extensions are expected to modify the meaning or interpretation of the element that contains them
is summary:
  v: true
mapping:
  identity:
    v: rim
  map:
    v: N/A

id:
  v: MessageHeader.response.identifier
path:
  v: MessageHeader.response.identifier
short:
  v: 原始訊息的Id
definition:
  v: 此訊息所回應的原始訊息的MessageHeader.id
requirements:
  v: 讓接收者知道正在回應哪個訊息
min:
  v: 1
max:
  v: 1
base:
  path:
    v: MessageHeader.response.identifier
  min:
    v: 1
  max:
    v: 1
type:
  code:
    v: id
    l: id
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: v2
  map:
    v: MSA-2
mapping:
  identity:
    v: rim
  map:
    v: ./acknowledges.id[isNormalDatatype()]

id:
  v: MessageHeader.response.code
path:
  v: MessageHeader.response.code
short:
  v: ok | transient-error | fatal-error
definition:
  v: 指明訊息回應類型的代碼 - 表示它是否成功，是否應該重新發送。
comment:
  v: 這是對請求訊息的一般性回應。回應的具體資料將在MessageHeader.focus中找到。
requirements:
  v: 允許確認訊息的發送者知道請求是否成功，或是否需要採取行動。
min:
  v: 1
max:
  v: 1
base:
  path:
    v: MessageHeader.response.code
  min:
    v: 1
  max:
    v: 1
type:
  code:
    v: code
    l: code
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
binding:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
      l: elementdefinition-bindingName
    value: String
      v: ResponseType
  strength:
    v: required
  description:
    v: 訊息回應類型；應填入所綁定值集中的其中一個代碼。
  value set:
    v: http://hl7.org/fhir/ValueSet/response-code|4.0.1
    l: http://hl7.org/fhir/ValueSet/response-code
mapping:
  identity:
    v: v2
  map:
    v: MSA-1
mapping:
  identity:
    v: rim
  map:
    v: ./typeCode[isNormalDatatype()]

id:
  v: MessageHeader.response.details
path:
  v: MessageHeader.response.details
short:
  v: 特定的提示/警告/錯誤清單
definition:
  v: 訊息中發現的任何問題細節
comment:
  v: 這些問題 **必須（SHALL）** 被包含在 bundle 中。如果其中有任何錯誤，則回應代碼 **必須（SHALL）** 是錯誤。
requirements:
  v: 允許訊息的發送者確定具體的問題是什麼
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MessageHeader.response.details
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/OperationOutcome|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/OperationOutcome
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: v2
  map:
    v: ERR
mapping:
  identity:
    v: rim
  map:
    v: AcknowledgementDetail or Observation[classCode="ALRT" and moodCode="EVN"]

id:
  v: MessageHeader.focus
path:
  v: MessageHeader.focus
short:
  v: 訊息的實際內容
definition:
  v: 訊息的實際資料 - 這是指向事件的root/focus class的參照。
comment:
  v: 每個訊息事件都涉及實際資料，即在事件定義中識別的單個 resource，可能還包括一些或所有關聯 resources。
requirements:
  v: 每個訊息事件都牽涉到實際的資料，就是在定義異動/交易類型時標識的單一 resource，有時還可能包括一些或全部相關聯的 resources。這些資料是在定義異動/交易類型時所定義的，異動/交易資料始終包含在完整訊息的 Bundle 中。這裡僅指定了root resource，它所參照的其他 resources 應該包含在 Bundle 中但並未在這裡列出。允許多次重複以處理具有多個焦點（focus）目標的合併和其他情況。
min:
  v: 0
max:
  v: *
base:
  path:
    v: MessageHeader.focus
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Resource|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/Resource
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
must support:
  v: true
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: rim
  map:
    v: unique(./controlAct[classCode="CACT" and classCode="EVN" and isNormalAct()]/participation[typeCode="SUBJ" and isNormalParticipation]/role or ./controlAct[classCode="CACT" and classCode="EVN" and isNormalAct()]/outboundRelationship[typeCode="SBJ" and isNormalActRelatoinship]/target)

id:
  v: MessageHeader.definition
path:
  v: MessageHeader.definition
short:
  v: 這個訊息的定義連結
definition:
  v: 此訊息的 MessageDefinition 的永久連結
requirements:
  v: 允許發送者定義訊息的預期內容
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MessageHeader.definition
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: canonical
    l: canonical
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/MessageDefinition|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/MessageDefinition
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: rim
  map:
    v: Not directly supported.

element:
  id:
    v: MessageHeader
  path:
    v: MessageHeader
  short:
    v: 描述系統間交換的訊息的resources
  definition:
    v: 在系統之間交換資訊時，會使用一個稱為「message header（訊息表頭）」的資料項目來標記和組織這次交換的內容。無論是發出請求還是回應某個動作，「訊息表頭」都扮演著關鍵角色。它不僅包含了這次動作涉及的對象（例如：特定的資料或resources），還包含了與這次動作相關的其他資訊。 這些資訊一般會放在一個稱為「Bundle」的resource中傳輸，而「Message Header」resource則是這個Bundle中的第一個resource。這種結構讓接收方可以從「Message Header」resource 開始解析整個bundle，了解這次訊息交換的上下文和目的。簡言之，「Message Header」resource就像是一封信的信頭，告訴接收者这封信的主要内容和目的。
element:
  id:
    v: MessageHeader.id
  path:
    v: MessageHeader.id
  short:
    v: 不重複的ID用以識別儲存在特定FHIR Server中的DocumentReference紀錄，通常又稱為邏輯性ID。
  definition:
    v: resource的邏輯ID，在resource的URL中使用。一旦指定，這個值永遠不會改變。
  comment:
    v: 一個resource使用新增操作（create operation）提交給伺服器時，此resource沒有id，它的id在resource被創建後由伺器分配/指定。
element:
  id:
    v: MessageHeader.meta
  path:
    v: MessageHeader.meta
  short:
    v: 此DocumentReference Resource的metadata
  definition:
    v: 關於resource的metadata。這是由基礎建設維護的內容。內容的更改可能並不總是與resource的版本更改相關聯。
element:
  id:
    v: MessageHeader.implicitRules
  path:
    v: MessageHeader.implicitRules
  short:
    v: 創建此內容所依據的一組規則
  definition:
    v: 構建resource時遵循的一系列規則的參照，在處理內容時必須理解這些規則。通常這是對IG所定義之特殊規則及其他profiles的參照。
  comment:
    v: 宣告這套規則限制了內容只能被有限的交易夥伴所理解。這從本質上限制了資料的長期有用性。然而，現有的健康生態體系高度分裂，還沒有準備好以普遍可計算的方式定義、收集和交換資料。只要有可能，實作者和/或規範編寫者應該避免使用這個資料項目。通常在使用時，此URL是對IG的參照，此IG將這些特殊規則與其他profiles、value sets等一起定義為其敘述的一部分。
element:
  id:
    v: MessageHeader.language
  path:
    v: MessageHeader.language
  short:
    v: 用以表述DocumentReference Resource內容的語言。
  definition:
    v: 編寫此resource的語言
  comment:
    v: 提供語言是為了支援索引和可存取性（通常，文字表述轉語音等服務使用此語言標籤）。html lanuage tag適用於此敘述。resource上的語言標籤可用於指定從resource中的資料所產成的其他表述之語言。不是所有的內容都必須使用此語言。不應該假定Resource.language自動適用於敘述。如果指定語言，它也應該被指定在html中的div資料項目（關於xml:lang和html lang屬性之間的關係，見HTML5中的規則）。
  example:
    label:
      v: Value
    value: String
      v: zh-TW
  binding:
    extension:
      url:
        v: http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet
        l: elementdefinition-maxValueSet
      value: Canonical
        v: http://hl7.org/fhir/ValueSet/all-languages
        l: all-languages
    extension:
      url:
        v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
        l: elementdefinition-bindingName
      value: String
        v: Language
    extension:
      url:
        v: http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding
        l: elementdefinition-isCommonBinding
      value: Boolean
        v: true
    strength:
      v: preferred
    description:
      v: 人類語言；鼓勵使用CommonLanguages代碼表中的代碼，但不強制一定要使用此代碼表，你也可使用其他代碼表的代碼或單純以文字表示。
    value set:
      v: http://hl7.org/fhir/ValueSet/languages
      l: languages
element:
  id:
    v: MessageHeader.text
  path:
    v: MessageHeader.text
  short:
    v: DocumentReference Resource之內容摘要以供人閱讀
  definition:
    v: 人可讀的敘述，包含resource的摘要，可用於向人表述resource的內容。敘述不需要對所有的結構化資料進行編碼，但需要包含足夠的細節使人在閱讀敘述時理解「臨床安全性」。resource定義有哪些內容應該在敘述中表示，以確保臨床安全。
  comment:
    v: 內嵌（contained）的resource沒有敘述，非內嵌（contained）的resource則 **建議應該（SHOULD）** 有敘述。有時resource可能只有文字表述，很少或沒有額外的結構化資料（只要滿足所有minOccurs=1的資料項目）。這可能出現在舊系統的資料，當資訊以 「文字表述區塊（text blob） 」的形式被取得，或者文字表述是原始輸入或說明，而編碼資訊稍後再添加。
element:
  id:
    v: MessageHeader.event[x]
  path:
    v: MessageHeader.event[x]
  short:
    v: 此訊息代表的事件的代碼或連結到事件定義
  definition:
    v: 用於識別此訊息所代表的事件並將其與其定義連接的代碼。作為FHIR規範一部分定義的事件，其系統值（system value）為「http://terminology.hl7.org/CodeSystem/message-events」。或者是指向EventDefinition的URI。
  comment:
    v: 事件的時間將在foscus resource中找到。訊息的時間將在[Bundle.timestamp](bundle-definitions.html#Bundle.timestamp)中找到。
  requirements:
    v: 驅動與此訊息相關的行為
  binding:
    extension:
      url:
        v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
        l: elementdefinition-bindingName
      value: String
        v: MessageEvent
    extension:
      url:
        v: http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding
        l: elementdefinition-isCommonBinding
      value: Boolean
        v: true
    strength:
      v: example
    description:
      v: 可參考所綁定值集，但此值集只是針對這個欄位的一個可能值的範例，不預期也不鼓勵使用者一定要使用此值集的代碼。
    value set:
      v: http://hl7.org/fhir/ValueSet/message-events
      l: message-events
element:
  id:
    v: MessageHeader.destination
  path:
    v: MessageHeader.destination
  short:
    v: 訊息目的地應用程式
  definition:
    v: 訊息目的地應用程式
  comment:
    v: 在發送訊息時，通常 **應該（SHOULD）** 至少有一個接收目的地。但在某些情況下，發送訊息的系統可能不會知道任何特定的接收目的地系統。
  requirements:
    v: 訊息中會指定一個或多個接收方（目的地應用程式），用於確定訊息應該發送到哪裡去。這樣做的目的是為了確保訊息能夠正確地被送達到預定的接收者，並且允許接收訊息的系統或人員檢查自己是否是該訊息的目標接收者。簡言之，這是一種確認「這個訊息是不是發給我的」的機制。
element:
  id:
    v: MessageHeader.destination.name
  path:
    v: MessageHeader.destination.name
  short:
    v: 系統的名稱
  definition:
    v: 目標系統的名稱
  requirements:
    v: 可用於回應的路徑和/或支援稽核
element:
  id:
    v: MessageHeader.destination.target
  path:
    v: MessageHeader.destination.target
  short:
    v: 在訊息或資料發送的目的地中，指定一個具體的接收點。
  definition:
    v: 當發送的訊息首先被送達到一個中介系統而不是直接送到最終目的地時，需要明確識別出最終的接收系統是什麼。
  requirements:
    v: 支援多點跳躍繞徑（multi-hop routing）
element:
  id:
    v: MessageHeader.destination.endpoint
  path:
    v: MessageHeader.destination.endpoint
  short:
    v: 實際目的地地址或id
  definition:
    v: 指明訊息應該被繞徑到哪裡
  comment:
    v: 對於不使用標準網絡地址的系統，該id可能是一個無法解析的URI。
  requirements:
    v: 指明應將訊息繞徑至何處
element:
  id:
    v: MessageHeader.destination.receiver
  path:
    v: MessageHeader.destination.receiver
  short:
    v: 資料應該被發送給在現實生活中真正需要這些資訊的個人或機構
  definition:
    v: 當單純發送資料到一個特定的應用程式是不夠用時，這允許我們把訊息直接指定發送給具體的某個人或是某個部門。
  requirements:
    v: 可以把訊息發送到更多的地方，不只是發到某個應用程式裡面。
  type:
    code:
      v: Reference
      l: Reference
    target profile:
      v: https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/Practitioner-twcore
      l: Practitioner-twcore
    target profile:
      v: https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/PractitionerRole-twcore
      l: PractitionerRole-twcore
    target profile:
      v: https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/Organization-twcore
      l: Organization-twcore
element:
  id:
    v: MessageHeader.sender

v: MessageHeader.sender

v: 訊息的實際發送端

v: 識別發送端系統的身份，以便可以建立信任關係並進行後續操作。

v: 這個使用案例是針對一個（受信任的）發送端系統負責管理多個機構的情況，因此單憑來源端點/身份驗證無法區分機構。

v: 不僅僅限制在應用程式層級的繞徑操作，可以進行更高層次的繞徑操作。

code:
  v: Reference
  l: Reference
target profile:
  v: https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/Practitioner-twcore
  l: Practitioner-twcore
target profile:
  v: https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/PractitionerRole-twcore
  l: PractitionerRole-twcore
target profile:
  v: https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/Organization-twcore
  l: Organization-twcore

v: true

id:
  v: MessageHeader.enterer
path:
  v: MessageHeader.enterer
short:
  v: 資料輸入的來源
definition:
  v: 此訊息的資料輸入來源，即導致此訊息出現的人員或裝置。如果有多個可能的輸入者，則應選擇與訊息最相關的那個。如果有其他可能的輸入者，可以在擴充資料項目中提供其他輸入者資訊。
comment:
  v: 通常僅用於請求，但也可用於回應。
requirements:
  v: 需要知道這個訊息的來源是出於審計/追溯需求，可能也與授權有關。
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/Practitioner-twcore
    l: Practitioner-twcore
  target profile:
    v: https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/PractitionerRole-twcore
    l: PractitionerRole-twcore

id:
  v: MessageHeader.author
path:
  v: MessageHeader.author
short:
  v: 決策的來源
definition:
  v: 這是在描述訊息的作者，也就是決定所描述事件應該發生的人或設備。如果有多個可能的候選者，應該選擇最接近消息標頭的那個。在需要時，可以在擴充資料項目中提供其他作者的相關資訊。
comment:
  v: 通常僅用於請求，但也可用於回應。
requirements:
  v: 需要知道這個訊息的來源是出於審計/追溯需求，可能也與授權有關。
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/Practitioner-twcore
    l: Practitioner-twcore
  target profile:
    v: https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/PractitionerRole-twcore
    l: PractitionerRole-twcore

id:
  v: MessageHeader.source
path:
  v: MessageHeader.source
short:
  v: 訊息來源應用程式
definition:
  v: 此訊息來源應用程式
requirements:
  v: 允許回應，支援稽核。

id:
  v: MessageHeader.source.name
path:
  v: MessageHeader.source.name
short:
  v: 系統的名稱
definition:
  v: 系統的名稱
requirements:
  v: 可用於支援稽核

id:
  v: MessageHeader.source.software
path:
  v: MessageHeader.source.software
short:
  v: 運行系統的軟體名稱
definition:
  v: 可能包含設定或其他對於除錯有用的資訊
requirements:
  v: 支援稽核功能，也可能涉及到介面引擎（Interface Engine）的操作。介面引擎是一種軟體工具或平台，用於在不同的資訊系統、應用程式或資料庫之間傳輸和轉換資料。

id:
  v: MessageHeader.source.version
path:
  v: MessageHeader.source.version
short:
  v: 軟體運行的版本
definition:
  v: 可以在訊息經過多方處理的情況下，傳達多個系統的版本資訊。
requirements:
  v: 支援稽核功能，也可能涉及到介面引擎（Interface Engine）的操作。介面引擎是一種軟體工具或平台，用於在不同的資訊系統、應用程式或資料庫之間傳輸和轉換資料。

id:
  v: MessageHeader.source.contact
path:
  v: MessageHeader.source.contact
short:
  v: 提供人工聯絡途徑以處理問題
definition:
  v: 提供電子郵件、電話、網站或其他聯絡方式，用以解決訊息溝通上的問題。
requirements:
  v: 允許對技術問題進行升級處理

id:
  v: MessageHeader.source.endpoint
path:
  v: MessageHeader.source.endpoint
short:
  v: 實際訊息來源地址或ID
definition:
  v: 要把確認訊息發給哪個地方？
comment:
  v: 這個 id 可能是一個無法在不使用標準基於網路地址的系統中解析的 URI
requirements:
  v: 指明回應訊息應該發送到的地方，這個指定可能會對系統的安全權限產生影響。

id:
  v: MessageHeader.responsible
path:
  v: MessageHeader.responsible
short:
  v: 事件的最終責任
definition:
  v: 承擔整個訊息內容的最終責任的個人或機構，這意味著訊息事件發生在負責方的政策下。
comment:
  v: 通常僅用於請求，但也可以在回應中使用。
requirements:
  v: 需要知道這一點是為了滿足稽核/追踪需求，可能也是為了授權。
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/Practitioner-twcore
    l: Practitioner-twcore
  target profile:
    v: https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/PractitionerRole-twcore
    l: PractitionerRole-twcore
  target profile:
    v: https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/Organization-twcore
    l: Organization-twcore

id:
  v: MessageHeader.reason
path:
  v: MessageHeader.reason
short:
  v: 事件的原因
definition:
  v: 這是對事件原因的編碼指示，表示了此訊息關注（focus）事件發生的原因。
requirements:
  v: 需要能夠追蹤為何resource被更改，並在resource的稽核日誌/歷史記錄中報告，但這可能會影響授權。
binding:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
      l: elementdefinition-bindingName
    value: String
      v: EventReason
  strength:
    v: example
  description:
    v: 可參考所綁定值集，但此值集只是針對這個欄位的一個可能值的範例，不預期也不鼓勵使用者一定要使用此值集的代碼。
  value set:
    v: http://hl7.org/fhir/ValueSet/message-reason-encounter
    l: message-reason-encounter

id:
  v: MessageHeader.response
path:
  v: MessageHeader.response
short:
  v: 這是對先前訊息的回應
definition:
  v: 如果這是對先前訊息的回應，則包含有關此訊息的回應訊息。

id:
  v: MessageHeader.response.identifier
path:
  v: MessageHeader.response.identifier
short:
  v: 原始訊息的Id
definition:
  v: 此訊息所回應的原始訊息的MessageHeader.id
requirements:
  v: 讓接收者知道正在回應哪個訊息

id:
  v: MessageHeader.response.code
path:
  v: MessageHeader.response.code
definition:
  v: 指明訊息回應類型的代碼 - 表示它是否成功，是否應該重新發送。
comment:
  v: 這是對請求訊息的一般性回應。回應的具體資料將在MessageHeader.focus中找到。
requirements:
  v: 允許確認訊息的發送者知道請求是否成功，或是否需要採取行動。
binding:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
      l: elementdefinition-bindingName
    value: String
      v: ResponseType
  strength:
    v: required
  description:
    v: 訊息回應類型；應填入所綁定值集中的其中一個代碼。
  value set:
    v: http://hl7.org/fhir/ValueSet/response-code|4.0.1
    l: http://hl7.org/fhir/ValueSet/response-code

id:
  v: MessageHeader.response.details
path:
  v: MessageHeader.response.details
short:
  v: 特定的提示/警告/錯誤清單
definition:
  v: 訊息中發現的任何問題細節
comment:
  v: 這些問題 **必須（SHALL）** 被包含在 bundle 中。如果其中有任何錯誤，則回應代碼 **必須（SHALL）** 是錯誤。
requirements:
  v: 允許訊息的發送者確定具體的問題是什麼

id:
  v: MessageHeader.focus
path:
  v: MessageHeader.focus
short:
  v: 訊息的實際內容
definition:
  v: 訊息的實際資料 - 這是指向事件的root/focus class的參照。
comment:
  v: 每個訊息事件都涉及實際資料，即在事件定義中識別的單個 resource，可能還包括一些或所有關聯 resources。
requirements:
  v: 每個訊息事件都牽涉到實際的資料，就是在定義異動/交易類型時標識的單一 resource，有時還可能包括一些或全部相關聯的 resources。這些資料是在定義異動/交易類型時所定義的，異動/交易資料始終包含在完整訊息的 Bundle 中。這裡僅指定了root resource，它所參照的其他 resources 應該包含在 Bundle 中但並未在這裡列出。允許多次重複以處理具有多個焦點（focus）目標的合併和其他情況。
must support:
  v: true

id:
  v: MessageHeader.definition
path:
  v: MessageHeader.definition
short:
  v: 這個訊息的定義連結
definition:
  v: 此訊息的 MessageDefinition 的永久連結
requirements:
  v: 允許發送者定義訊息的預期內容