Generated Narrative: 结构定义 MessageHeader-tb-reporting Name Flags Card. Type Description & Constraints MessageHeader TWCoreMessageHeader #xD; meta #xD; lastUpdated S 0..1 instant 最後修改日期時間，YYYY-MM-DDThh:mm:ss.sss+zz:zz。 #xD; Slices for event[x] 1..1 Coding, uri 此訊息代表的事件的代碼或連結到事件定義 Slice: Unordered, Open by type:$this #xD; event[x]:eventCoding 0..1 Coding 此訊息代表的事件的代碼或連結到事件定義 #xD; system 0..1 uri Identity of the terminology system Required Pattern: https://tb.cdc.gov.tw/tb/CodeSystem/cdc-message-event #xD; code 0..1 code Symbol in syntax defined by the system Required Pattern: reporting #xD; sender 1..1 Reference(醫事機構-Organization TB) 實驗室收件單位 #xD; focus 1..* Reference(實驗室報告-DiagnosticReport TB Reporting) 訊息的實際內容 #xD; Documentation for this format
此檢驗通報訊息-MessageHeader TB Reporting Profile說明本IG如何進一步定義臺灣核心-訊息表頭（TW Core MessageHeader） Profile以呈現TB檢驗通報訊息
在系統之間交換資訊時，會使用一個稱為「message header（訊息表頭）」的資料項目來標記和組織這次交換的內容。無論是發出請求還是回應某個動作，「訊息表頭」都扮演著關鍵角色。它不僅包含了這次動作涉及的對象（例如：特定的資料或resources），還包含了與這次動作相關的其他資訊。 這些資訊一般會放在一個稱為「Bundle」的resource中傳輸，而「Message Header」resource則是這個Bundle中的第一個resource。這種結構讓接收方可以從「Message Header」resource 開始解析整個bundle，了解這次訊息交換的上下文和目的。簡言之，「Message Header」resource就像是一封信的信頭，告訴接收者这封信的主要内容和目的。
If the resource is contained in another resource, it SHALL NOT contain nested Resources
not(parent::f:contained and f:contained)
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
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()
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='#'])]))
If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated
contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()
not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))
If a resource is contained in another resource, it SHALL NOT have a security label
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.
A resource should have narrative for robust management
不重複的ID用以識別儲存在特定FHIR Server中的DocumentReference紀錄，通常又稱為邏輯性ID。
一個resource使用新增操作（create operation）提交給伺服器時，此resource沒有id，它的id在resource被創建後由伺器分配/指定。
關於resource的metadata。這是由基礎建設維護的內容。內容的更改可能並不總是與resource的版本更改相關聯。
All FHIR elements must have a @value or children
hasValue() or (children().count() > id.count())
Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
Extensions are always sliced by (at least) url
Additional content defined by implementations
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.
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.
Must have either extensions or value[x], not both
exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])
The version specific identifier, as it appears in the version portion of the URL. This value changes when the resource is created, updated, or deleted.
The server assigns this value, and ignores what the client specifies, except in the case that the server is imposing version integrity on updates/deletes.
When the resource last changed - e.g. when the version changed.
This value is always populated except when the resource is first being created. The server / resource manager sets this value; what a client provides is irrelevant. This is equivalent to the HTTP Last-Modified and SHOULD have the same value on a [read](http://hl7.org/fhir/R4/http.html#read) interaction.
Identifies where the resource comes from
A uri that identifies the source system of the resource. This provides a minimal amount of [Provenance](http://hl7.org/fhir/R4/provenance.html#) information that can be used to track or differentiate the source of information in the resource. The source may identify another FHIR server, document, message, database, etc.
In the provenance resource, this corresponds to Provenance.entity.what[x]. The exact use of the source (and the implied Provenance.entity.role) is left to implementer discretion. Only one nominated source is allowed; for additional provenance details, a full Provenance resource should be used. This element can be used to indicate where the current master source of a resource that has a canonical URL if the resource is no longer hosted at the canonical URL.
Profiles this resource claims to conform to
A list of profiles (references to [StructureDefinition](http://hl7.org/fhir/R4/structuredefinition.html#) resources) that this resource claims to conform to. The URL is a reference to [StructureDefinition.url](http://hl7.org/fhir/R4/structuredefinition-definitions.html#StructureDefinition.url).
It is up to the server and/or other infrastructure of policy to determine whether/how these claims are verified and/or updated over time. The list of profile URLs is a set.
Security Labels applied to this resource
Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.
The security labels can be updated without changing the stated version of the resource. The list of security labels is a set. Uniqueness is based the system/code, and version and display are ignored.
Security Labels from the Healthcare Privacy and Security Classification System.
Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.
The tags can be updated without changing the stated version of the resource. The list of tags is a set. Uniqueness is based the system/code, and version and display are ignored.
Codes that represent various types of tags, commonly workflow-related; e.g. "Needs review by Dr. Jones".
構建resource時遵循的一系列規則的參照，在處理內容時必須理解這些規則。通常這是對IG所定義之特殊規則及其他profiles的參照。
宣告這套規則限制了內容只能被有限的交易夥伴所理解。這從本質上限制了資料的長期有用性。然而，現有的健康生態體系高度分裂，還沒有準備好以普遍可計算的方式定義、收集和交換資料。只要有可能，實作者和/或規範編寫者應該避免使用這個資料項目。通常在使用時，此URL是對IG的參照，此IG將這些特殊規則與其他profiles、value sets等一起定義為其敘述的一部分。
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
提供語言是為了支援索引和可存取性（通常，文字表述轉語音等服務使用此語言標籤）。html lanuage tag適用於此敘述。resource上的語言標籤可用於指定從resource中的資料所產成的其他表述之語言。不是所有的內容都必須使用此語言。不應該假定Resource.language自動適用於敘述。如果指定語言，它也應該被指定在html中的div資料項目（關於xml:lang和html lang屬性之間的關係，見HTML5中的規則）。
人類語言；鼓勵使用CommonLanguages代碼表中的代碼，但不強制一定要使用此代碼表，你也可使用其他代碼表的代碼或單純以文字表示。
人可讀的敘述，包含resource的摘要，可用於向人表述resource的內容。敘述不需要對所有的結構化資料進行編碼，但需要包含足夠的細節使人在閱讀敘述時理解「臨床安全性」。resource定義有哪些內容應該在敘述中表示，以確保臨床安全。
內嵌（contained）的resource沒有敘述，非內嵌（contained）的resource則 **建議應該（SHOULD）** 有敘述。有時resource可能只有文字表述，很少或沒有額外的結構化資料（只要滿足所有minOccurs=1的資料項目）。這可能出現在舊系統的資料，當資訊以 「文字表述區塊（text blob） 」的形式被取得，或者文字表述是原始輸入或說明，而編碼資訊稍後再添加。
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.
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.
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.
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).
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).
Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them
此訊息代表的事件的代碼或連結到事件定義
用於識別此訊息所代表的事件並將其與其定義連接的代碼。作為FHIR規範一部分定義的事件，其系統值（system value）為「http://terminology.hl7.org/CodeSystem/message-events」。或者是指向EventDefinition的URI。
事件的時間將在foscus resource中找到。訊息的時間將在[Bundle.timestamp](http://hl7.org/fhir/R4/bundle-definitions.html#Bundle.timestamp)中找到。
可參考所綁定值集，但此值集只是針對這個欄位的一個可能值的範例，不預期也不鼓勵使用者一定要使用此值集的代碼。
./payload[classCode="CACT" and moodCode="EVN" and isNormalAct()]/code[isNormalDatatype()]/code
The identification of the code system that defines the meaning of the symbol in the code.
The URI may be an OID (urn:oid:...) or a UUID (urn:uuid:...). OIDs and UUIDs SHALL be references to the HL7 OID registry. Otherwise, the URI should come from HL7's list of FHIR defined special URIs or it should reference to some definition that establishes the system clearly and unambiguously.
Need to be unambiguous about the source of the definition of the symbol.
fhir:Coding.system rdfs:subPropertyOf dt:CDCoding.codeSystem
The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured, and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.
Where the terminology does not clearly define what string should be used to identify code system versions, the recommendation is to use the date (expressed in FHIR date format) on which that version was officially published as the version date.
fhir:Coding.version rdfs:subPropertyOf dt:CDCoding.codeSystemVersion
A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).
Need to refer to a particular code in the system.
fhir:Coding.code rdfs:subPropertyOf dt:CDCoding.code
A representation of the meaning of the code in the system, following the rules of the system.
Need to be able to carry a human-readable meaning of the code for readers that do not know the system.
C*E.2 - but note this is not well followed
fhir:Coding.display rdfs:subPropertyOf dt:CDCoding.displayName
If this coding was chosen directly by the user
Indicates that this coding was chosen by a user directly - e.g. off a pick list of available items (codes or displays).
Amongst a set of alternatives, a directly chosen code is the most appropriate starting point for new translations. There is some ambiguity about what exactly 'directly chosen' implies, and trading partner agreement may be needed to clarify the use of this element and its consequences more completely.
This has been identified as a clinical safety criterium - that this exact system/code pair was chosen explicitly, rather than inferred by the system based on some rules or language processing.
fhir:Coding.userSelected fhir:mapsTo dt:CDCoding.codingRationale. fhir:Coding.userSelected fhir:hasMap fhir:Coding.userSelected.map. fhir:Coding.userSelected.map a fhir:Map; fhir:target dt:CDCoding.codingRationale. fhir:Coding.userSelected\#true a [ fhir:source "true"; fhir:target dt:CDCoding.codingRationale\#O ]
在發送訊息時，通常 **應該（SHOULD）** 至少有一個接收目的地。但在某些情況下，發送訊息的系統可能不會知道任何特定的接收目的地系統。
訊息中會指定一個或多個接收方（目的地應用程式），用於確定訊息應該發送到哪裡去。這樣做的目的是為了確保訊息能夠正確地被送達到預定的接收者，並且允許接收訊息的系統或人員檢查自己是否是該訊息的目標接收者。簡言之，這是一種確認「這個訊息是不是發給我的」的機制。
Extensions that cannot be ignored even if unrecognized
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).
Modifier extensions are expected to modify the meaning or interpretation of the element that contains them
unique(./entity[determinerCode="INST" and (classCode=("DEV", "PSN", "ORG"]/name[type='ST' and isNormalDatatype()])
在訊息或資料發送的目的地中，指定一個具體的接收點。
當發送的訊息首先被送達到一個中介系統而不是直接送到最終目的地時，需要明確識別出最終的接收系統是什麼。
unique(./entity[determinerCode="INST" and (classCode=("DEV", "PSN", "ORG"]
對於不使用標準網絡地址的系統，該id可能是一個無法解析的URI。
資料應該被發送給在現實生活中真正需要這些資訊的個人或機構
當單純發送資料到一個特定的應用程式是不夠用時，這允許我們把訊息直接指定發送給具體的某個人或是某個部門。
可以把訊息發送到更多的地方，不只是發到某個應用程式裡面。
Not directly supported. Could be shared using attentionLine.value with an appropriate keyWordText
識別發送端系統的身份，以便可以建立信任關係並進行後續操作。
這個使用案例是針對一個（受信任的）發送端系統負責管理多個機構的情況，因此單憑來源端點/身份驗證無法區分機構。
不僅僅限制在應用程式層級的繞徑操作，可以進行更高層次的繞徑操作。
此訊息的資料輸入來源，即導致此訊息出現的人員或裝置。如果有多個可能的輸入者，則應選擇與訊息最相關的那個。如果有其他可能的輸入者，可以在擴充資料項目中提供其他輸入者資訊。
需要知道這個訊息的來源是出於審計/追溯需求，可能也與授權有關。
EVN-5 / ORC-10 / PRT-5:PRT-4='EP' / ROL where ROL.3 is EP or ORC.10
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"])
這是在描述訊息的作者，也就是決定所描述事件應該發生的人或設備。如果有多個可能的候選者，應該選擇最接近消息標頭的那個。在需要時，可以在擴充資料項目中提供其他作者的相關資訊。
ORC-19 / PRT-5:PRT-4='AUT' / ROL where ROL.3 is IP or ORC.12
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"])
unique(./entity[determinerCode="INST" and classCode="DEV"]/name[type='ST' and isNormalDatatype()])
可能包含設定或其他對於除錯有用的資訊
支援稽核功能，也可能涉及到介面引擎（Interface Engine）的操作。介面引擎是一種軟體工具或平台，用於在不同的資訊系統、應用程式或資料庫之間傳輸和轉換資料。
unique(./entity[determinerCode="INST" and classCode="DEV"]/softwareName[isNormalDatatype()])
可以在訊息經過多方處理的情況下，傳達多個系統的版本資訊。
提供電子郵件、電話、網站或其他聯絡方式，用以解決訊息溝通上的問題。
unique(./entity[determinerCode="INST" and classCode="DEV"]/scopesRole[normalRole() and classCode="CON" and layer[classCode="PSN"]/telecom[isNormalDatatype()])
這個 id 可能是一個無法在不使用標準基於網路地址的系統中解析的 URI
指明回應訊息應該發送到的地方，這個指定可能會對系統的安全權限產生影響。
承擔整個訊息內容的最終責任的個人或機構，這意味著訊息事件發生在負責方的政策下。
通常僅用於請求，但也可以在回應中使用。
需要知道這一點是為了滿足稽核/追踪需求，可能也是為了授權。
ORC-12 / PRT-5:PRT-4='OP' / PRT-8:PRT-4='OP' / ROL where ROL.3 is RO or ORC.11
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"])
這是對事件原因的編碼指示，表示了此訊息關注（focus）事件發生的原因。
需要能夠追蹤為何resource被更改，並在resource的稽核日誌/歷史記錄中報告，但這可能會影響授權。
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
unique(./controlAct[classCode="CACT" and classCode="EVN" and isNormalAct()]/reasonCode[isNormalDatatype()])
如果這是對先前訊息的回應，則包含有關此訊息的回應訊息。
指明訊息回應類型的代碼 - 表示它是否成功，是否應該重新發送。
這是對請求訊息的一般性回應。回應的具體資料將在MessageHeader.focus中找到。
允許確認訊息的發送者知道請求是否成功，或是否需要採取行動。
訊息回應類型；應填入所綁定值集中的其中一個代碼。
這些問題 **必須（SHALL）** 被包含在 bundle 中。如果其中有任何錯誤，則回應代碼 **必須（SHALL）** 是錯誤。
允許訊息的發送者確定具體的問題是什麼
AcknowledgementDetail or Observation[classCode="ALRT" and moodCode="EVN"]
每個訊息事件都涉及實際資料，即在事件定義中識別的單個 resource，可能還包括一些或所有關聯 resources。
每個訊息事件都牽涉到實際的資料，就是在定義異動/交易類型時標識的單一 resource，有時還可能包括一些或全部相關聯的 resources。這些資料是在定義異動/交易類型時所定義的，異動/交易資料始終包含在完整訊息的 Bundle 中。這裡僅指定了root resource，它所參照的其他 resources 應該包含在 Bundle 中但並未在這裡列出。允許多次重複以處理具有多個焦點（focus）目標的合併和其他情況。
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)