Generated Narrative: StructureDefinition Media-twpas Name Flags Card. Type Description & Constraints Media TWCoreMedia #xD; meta 1..1 Meta 此Media Resource的metadata #xD; profile 1..1 canonical(StructureDefinition) Profiles this resource claims to conform to Required Pattern: https://nhicore.nhi.gov.tw/pas/StructureDefinition/Media-twpas #xD; subject 0..1 Reference(病人資訊-Patient TWPAS) 多媒體紀錄的對象是誰或什麼？ #xD; bodySite S 0..1 CodeableConceptTW 影像檢查的身體部位 Binding: SNOMEDCT-健保事前審查-身體部位值集 (required) #xD; content C 1..1 Attachment 實際的多媒體 - 參照或資料。 Constraints: UploadContent #xD; contentType S 1..1 code Mime type of the content, with charset etc. Binding: HL7-非DICOM影像MimeType值集 (required) #xD; url S 1..1 url 非DICOM影像（請填寫完整檔案路徑）。填寫上傳附件檔名，例如：file://US01.jpg，且需上傳壓縮後的影像圖檔。 Example General: file://US01.jpg #xD; Documentation for this format
此非DICOM影像-Media TWPAS Profile說明本IG如何進一步定義臺灣核心-多媒體(TW Core Media) Profile以呈現事前審查中疾病資訊之影像報告的非DICOM影像
健康照護中獲取或使用的影像、影片或音檔，實際內容可能置於行內或透過直接參照提供。
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中的Media紀錄，通常又稱為邏輯性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
影像相關的識別碼，可能包括影像本身的識別碼，以及用於其收集上下文（例如：系列識別碼）和其他工作流程識別碼，例如存取號等。
識別碼的標籤和使用可以用來確定它是什麼類型的識別碼
由創建此多媒體文件而完全或部分完成的程序。例如，如果多媒體文件是一張X光影像，那麼這個程序可能是一次X光檢查。
此功能可追蹤事件的授權情況，並追蹤建議或推薦是否已執行。
這個特定事件是更大事件的一部分，或者是一個步驟。
不應該使用此屬性將事件與一次就診關聯 - 請使用 Media.encounter 來完成這個目的。 [對於事件 resource，所允許的參照resources可能會根據需要進行調整。]
舉例來說，藥物管理可以是某個程序的一部分，而這個程序則可能是某個觀察過程的一部分等等。
preparation | in-progress | not-done | on-hold | stopped | completed | entered-in-error | unknown
可以在 事件模式文件中找到一個標準的狀態轉換圖。 「未知」不代表「其他」狀態 - 必須使用其中一個已定義的狀態，「未知」用於表示不確定當前狀態。
This element is labelled as a modifier because it is a status element that contains status entered-in-error which means that the resource should not be treated as valid
代表事件生命週期階段的代碼；應填入所綁定值集中的其中一個代碼
一個代碼，用於分類多媒體是否為影像、影片或音檔或其他多媒體類別。
Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination.
用於篩選取得和顯示的檢驗檢查結果
應填入所綁定值集中適合的代碼，確定無適合的代碼才可以使用其他值集的代碼來表示。
fhir:CodeableConcept rdfs:subClassOf dt:CD
在醫學影像領域中，描述多媒體類型（即影像）的細節時重要的幾個方面。通常，這包括影像是如何被獲取的，比如使用了什麼設備或技術。如果這些影像是從DICOM系統中獲得的，並且被存儲在一種稱為「Media resource」的格式中，那麼這個過程中用到的特定技術或設備類型被稱為「儀器(modality)」。儀器是指影像如何被產生，比如CT掃描、MRI掃描或X光等。
可參考MediaModality代碼表，但此代碼表只是針對這個欄位的一個可能值的示例，不預期也不鼓勵使用者一定要使用此代碼表的代碼。
影像視圖，從不同的角度拍攝醫學影像，例如：側位（Lateral，從旁邊看）或前後部位（Antero-posterior，從前面或後面看）
影像視圖的名稱，例如：側位或前後部位（AP）。
此多媒體是在什麼樣的就醫過程中產生或被使用的。例如：有一次具體的就診活動（比如病人因為某種疼痛去看醫生），在這次就醫中產生了這份X光影像，從而為這份影像提供了相關的就醫背景或情境。
這通常會是多媒體產生時所在的就醫情境
.inboundRelationship(typeCode=COMP].source[classCode<=PCPR, moodCode=EVN]
當一份多媒體資料（比如影像、文件等）經過專業人士的審查之後，確定無誤或達到一定標準，便會選擇一個時間點，把這份經過審查的多媒體版本提供給其他醫療專業人員或相關人士使用。這個「日期和時間」就是指這份多媒體資料被正式認可並開放給相關人士使用的具體時刻。
它可能與resource本身的最後更新時間相同。但對於那些確實需要對某些更新進行審查和驗證的Observations，如果更新是非臨床顯著的，則不需要對新版本進行再次審查和驗證，因此它也可能與resource本身的最後更新時間不同。
OBR.22 (or MSH.7), or perhaps OBX-19 (depends on who observation made)
以編碼或文字形式描述了事件發生的原因
表示在受檢者身上進行檢查的部位（即目標部位）
只有在Observation.code中發現的代碼中沒有隱含的情況下才使用。在許多系統中，這可能被表示為一個相關的觀察，而不是一個內聯元件。如果用例要求將BodySite作為一個單獨的resource來處理（例如，單獨識別和跟蹤），那麼就使用標準擴展 bodySite。
如果需要對設備進行進一步的類型化，應該使用擴展。用於支援收集多媒體的次要設備可以使用擴展或通過Observation.related資料項目表示。
以像素為單位的影像高度（影像/影像）
以像素為單位的影像高度（影像/影像）。
.outboundRelationship[typeCode="COMP].target[classCode="OBS", moodCode="EVN",code="<CODE>"].value
以像素為單位的影像寬度（影像/影像）
以像素為單位的影像寬度（影像/影像）。
這段話講述的是在某些情況下，一份影像或文件可能包含多個獨立的影像影格(frame)，而這些影格是組成整個文件的部分。例如：在醫療影像、動畫GIF圖像或多頁傳真文件中，可能會有多影格影像。如果一份文件或影像實際上包含多於一個的影像影格，那麼它需要標記一個具體的數值來表示這些影格的數量。這樣做的目的是為了讓使用這份文件或影像的軟體知道，它需要使用一種能夠顯示或處理多個影像影格的特殊工具或功能，稱為渲染小部件(rendering widget）。簡單來說，如果一個文件包含多個影像影格，那麼需要透過特定的方式告知相關的軟體，以便正確顯示或處理這些影格。
如果沒有提供幀的數量，該值可能是未知的。除非明確說明，否則應用程式不應假定只有一個框架。
錄製的持續時間，以秒為單位 - 對於音檔/影片。
如果記錄被暫停，持續時間可能與發生時間不同。
多媒體的實際內容 -內置或直接參照多媒體原始檔案。
推薦的內容類別型：image/jpeg, image/png, image/tiff, video/mpeg, audio/mp4, application/dicom。Application/dicom可以包含傳輸語法作為一個參數。對於涵蓋一段時期的多媒體（視頻/聲音），content.creationTime是結束時間。創建時間用於跟蹤、組織版本和查詢。
Mime type of the content, with charset etc.
Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.
Processors of the data need to be able to know how to interpret the data.
ED.2+ED.3/RP.2+RP.3. Note conversion may be needed if old style values are being used
The human language of the content. The value can be any valid value according to BCP 47.
Users need to be able to choose between the languages in a set of attachments.
The actual data of the attachment - a sequence of bytes, base64 encoded.
The base64-encoded data SHALL be expressed in the same character set as the base resource XML or JSON.
The data needs to able to be transmitted inline.
非DICOM影像（請填寫完整檔案路徑）。填寫上傳附件檔名，例如：file://US01.jpg，且需上傳壓縮後的影像圖檔。
A location where the data can be accessed.
If both data and url are provided, the url SHALL point to the same content as the data contains. Urls may be relative references or may reference transient locations such as a wrapping envelope using cid: though this has ramifications for using signatures. Relative URLs are interpreted relative to the service url, like a resource reference, rather than relative to the resource itself. If a URL is provided, it SHALL resolve to actual data.
The data needs to be transmitted by reference.
RP.1+RP.2 - if they refer to a URL (see v2.6)
Number of bytes of content (if url provided)
The number of bytes of data that make up this attachment (before base64 encoding, if that is done).
The number of bytes is redundant if the data is provided as a base64binary, but is useful if the data is provided as a url reference.
Representing the size allows applications to determine whether they should fetch the content automatically in advance, or refuse to fetch it at all.
The calculated hash of the data using SHA-1. Represented using base64.
The hash is calculated on the data prior to base64 encoding, if the data is based64 encoded. The hash is not intended to support digital signatures. Where protection against malicious threats a digital signature should be considered, see [Provenance.signature](http://hl7.org/fhir/R4/provenance-definitions.html#Provenance.signature) for mechanism to protect a resource with a digital signature.
Included so that applications can verify that the contents of a location have not changed due to technical failures (e.g., storage rot, transport glitch, incorrect version).
A label or set of text to display in place of the data.
Applications need a label to display to a human user in place of the actual data if the data cannot be rendered or perceived by the viewer.
The date that the attachment was first created.
This is often tracked as an integrity issue for use of the attachment.
執行者、對象或其他參與者對Media的意見
不能用於觀察、結論等。而是使用基於多媒體/影像研究resource的觀察。
.inboundRelationship(typeCode=SUBJ].source[classCode=ANNGEN, moodCode=EVN].value[xsi:type=ST]