臺灣電子處方箋與調劑單張實作指引(TW EMPD IG)
0.2.0 - ci-build

臺灣電子處方箋與調劑單張實作指引(TW EMPD IG), published by NHI. This guide is not an authorized publication; it is the continuous build for version 0.2.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/TWNHIFHIR/empd/ and changes regularly. See the Directory of published versions

## Resource Profile: 調劑單張-領藥者數位簽章

Official URL: https://nhicore.nhi.gov.tw/empd/StructureDefinition/Media-DS | Version: 0.2.0
Active as of 2024-01-02 | Computable Name: MediaDS

此Profiles用於描述調劑單張之領藥者數位簽章。 如為開立第一級、第二級及第三級管制藥品專用處方箋，此Profiles為必填

Usages:

- Use this Profile: 調劑單張-Bundle
- Refer to this Profile: 調劑單張-Composition
- Examples for this Profile: Media/media-ds
- CapabilityStatements using this Profile: 電子處方箋與調劑單張-用戶端 and 電子處方箋與調劑單張-伺服端

You can also check for usages in the FHIR IG Statistics

### Formal Views of Profile Content

Description of Profiles, Differentials, Snapshots and how the different presentations work.

- Key Elements Table
- Differential Table
- Snapshot Table
- Statistics/References
- All

Name | Flags | Card. | Type | Description & Constraints Filter: Bindings Constraints Obligations
--- | --- | --- | --- | ---
Media |  | 0..* | TWCoreMedia | 健康照護中獲取或使用的影像、影片或音檔，實際內容可能置於行內或透過直接參照提供。
implicitRules | ?!Σ | 0..1 | uri | 創建此內容所依據的一組規則
modifierExtension | ?! | 0..* | Extension | Extensions that cannot be ignored
status | ?!S Σ | 1..1 | code | preparation | in-progress | not-done | on-hold | stopped | completed | entered-in-error | unknown Binding: EventStatus (required): 代表事件生命週期階段的代碼；應填入所綁定值集中的其中一個代碼
subject | S Σ | 1..1 | Reference(TW Core PractitionerRole | Group | Device | TW Core Specimen | TW Core Location | 調劑單張-病人基本資料 | 調劑單張-醫事人員基本資料) | 多媒體紀錄的對象是誰或什麼？
encounter | Σ | 0..1 | Reference(調劑單張-門診基本資料) | 與此Media相關的就醫事件（Encounter）
content | S Σ | 1..1 | Attachment | Actual Media - reference or data。[應填入領藥者數位簽章]。開立第一級、第二級及第三級管制藥品專用處方箋，此欄位為必填
note | S | 0..* | Annotation | 對於QR Code相關之說明備註。
Documentation for this format

#### Terminology Bindings

Path | Status | Usage | ValueSet | Version | Source
Media.status | Base | required | EventStatus | 📍4.0.1 | FHIR Std.

#### Constraints

Id | Grade | Path(s) | Description | Expression
dom-2 | error | Media | If the resource is contained in another resource, it SHALL NOT contain nested Resources | `contained.contained.empty()`
dom-3 | error | Media | 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()`
dom-4 | error | Media | 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()`
dom-5 | error | Media | If a resource is contained in another resource, it SHALL NOT have a security label | `contained.meta.security.empty()`
dom-6 | best practice | Media | A resource should have narrative for robust management | `text.`div`.exists()`
ele-1 | error | **ALL** elements | All FHIR elements must have a @value or children | `hasValue() or (children().count() > id.count())`
ext-1 | error | **ALL** extensions | Must have either extensions or value[x], not both | `extension.exists() != value.exists()`

This structure is derived from TWCoreMedia

Name | Flags | Card. | Type | Description & Constraints Filter: Bindings Constraints Obligations
--- | --- | --- | --- | ---
Media |  |  | TWCoreMedia |
status | S | 1..1 | code | preparation | in-progress | not-done | on-hold | stopped | completed | entered-in-error | unknown
subject |  | 1..1 | Reference(TW Core PractitionerRole | Group | Device | TW Core Specimen | TW Core Location | 調劑單張-病人基本資料 | 調劑單張-醫事人員基本資料) | 多媒體紀錄的對象是誰或什麼？
encounter |  | 0..1 | Reference(調劑單張-門診基本資料) | 與此Media相關的就醫事件（Encounter）
content | S | 1..1 | Attachment | Actual Media - reference or data。[應填入領藥者數位簽章]。開立第一級、第二級及第三級管制藥品專用處方箋，此欄位為必填
note | S | 0..* | Annotation | 對於QR Code相關之說明備註。
Documentation for this format

Name | Flags | Card. | Type | Description & Constraints Filter: Bindings Constraints Obligations
--- | --- | --- | --- | ---
Media |  | 0..* | TWCoreMedia | 健康照護中獲取或使用的影像、影片或音檔，實際內容可能置於行內或透過直接參照提供。
id | Σ | 0..1 | id | 不重複的ID用以識別儲存在特定FHIR Server中的Media紀錄，通常又稱為邏輯性ID。
meta | Σ | 0..1 | Meta | 此Media Resource的metadata
implicitRules | ?!Σ | 0..1 | uri | 創建此內容所依據的一組規則
language |  | 0..1 | code | 用以表述Media Resource內容的語言。 Binding: CommonLanguages (preferred): 人類語言；鼓勵使用CommonLanguages代碼表中的代碼，但不強制一定要使用此代碼表，你也可使用其他代碼表的代碼或單純以文字表示。
Additional Bindings | Purpose
AllLanguages | Max Binding
Example Value: zh-TW
text |  | 0..1 | Narrative | Media Resource之內容摘要以供人閱讀 This profile does not constrain the narrative in regard to content, language, or traceability to data elements
contained |  | 0..* | Resource | Contained, inline Resources
extension |  | 0..* | Extension | Additional content defined by implementations
modifierExtension | ?! | 0..* | Extension | Extensions that cannot be ignored
identifier | Σ | 0..* | Identifier | 影像的識別碼
basedOn | Σ | 0..* | Reference(ServiceRequest | CarePlan) | 導致產生此多媒體的程序
partOf | Σ | 0..* | Reference(Resource) | 參照事件的一部分
status | ?!S Σ | 1..1 | code | preparation | in-progress | not-done | on-hold | stopped | completed | entered-in-error | unknown Binding: EventStatus (required): 代表事件生命週期階段的代碼；應填入所綁定值集中的其中一個代碼
type | Σ | 0..1 | CodeableConceptTW | 將多媒體分類為影像、影片或音檔 Binding: MediaType (extensible): 應填入所綁定值集中適合的代碼，確定無適合的代碼才可以使用其他值集的代碼來表示。
modality | Σ | 0..1 | CodeableConceptTW | 取得影像的設備/過程 Binding: MediaModality (example): 可參考MediaModality代碼表，但此代碼表只是針對這個欄位的一個可能值的示例，不預期也不鼓勵使用者一定要使用此代碼表的代碼。
view | Σ | 0..1 | CodeableConceptTW | 影像視圖，從不同的角度拍攝醫學影像，例如：側位（Lateral，從旁邊看）或前後部位（Antero-posterior，從前面或後面看） Binding: MediaCollectionView/Projection (extensible): 應填入所綁定值集中適合的代碼，確定無適合的代碼才可以使用其他值集的代碼來表示。
subject | S Σ | 1..1 | Reference(TW Core PractitionerRole | Group | Device | TW Core Specimen | TW Core Location | 調劑單張-病人基本資料 | 調劑單張-醫事人員基本資料) | 多媒體紀錄的對象是誰或什麼？
encounter | Σ | 0..1 | Reference(調劑單張-門診基本資料) | 與此Media相關的就醫事件（Encounter）
created[x] | Σ | 0..1 |  | Media被收集的時間
createdDateTime |  |  | dateTime |
createdPeriod |  |  | Period |
issued | Σ | 0..1 | instant | 此版本提供的日期/時間
operator | Σ | 0..1 | Reference(TW Core Practitioner | TW Core PractitionerRole | TW Core Organization | TW Core CareTeam | TW Core Patient | Device | TW Core RelatedPerson) | 產生影像的人
reasonCode | Σ | 0..* | CodeableConceptTW | 為什麼會進行這個事件？ Binding: ProcedureReasonCodes (extensible): 應填入所綁定值集中適合的代碼，確定無適合的代碼才可以使用其他值集的代碼來表示。
bodySite | Σ | 0..1 | CodeableConceptTW | 接受檢驗檢查的身體部位 Binding: SNOMEDCTBodyStructures (extensible): 應填入所綁定值集中適合的代碼，確定無適合的代碼才可以使用其他值集的代碼來表示。
deviceName | Σ | 0..1 | string | 設備/製造商的名稱
device | Σ | 0..1 | Reference(Device | DeviceMetric | Device) | 影像、影片、音檔的補捉設備。
height | Σ | 0..1 | positiveInt | 以像素為單位的影像高度（影像/影像）
width | Σ | 0..1 | positiveInt | 以像素為單位的影像寬度（影像/影像）
frames | Σ | 0..1 | positiveInt | > 1 的影格（影像）。
duration | Σ | 0..1 | decimal | 以秒為單位的長度（音檔/影片）。
content | S Σ | 1..1 | Attachment | Actual Media - reference or data。[應填入領藥者數位簽章]。開立第一級、第二級及第三級管制藥品專用處方箋，此欄位為必填
note | S | 0..* | Annotation | 對於QR Code相關之說明備註。
Documentation for this format

#### Terminology Bindings

Path | Status | Usage | ValueSet | Version | Source
Media.language | Base | preferred | Common Languages | 📦4.0.1 | FHIR Std.
Media.status | Base | required | EventStatus | 📍4.0.1 | FHIR Std.
Media.type | Base | extensible | Media Type | 📦4.0.1 | FHIR Std.
Media.modality | Base | example | Media Modality | 📦4.0.1 | FHIR Std.
Media.view | Base | extensible | Media Collection View/Projection | 📦4.0.1 | FHIR Std.
Media.reasonCode | Base | extensible | Procedure Reason Codes | 📦4.0.1 | FHIR Std.
Media.bodySite | Base | extensible | SNOMED CT Body Structures | 📦4.0.1 | FHIR Std.

#### Constraints

Id | Grade | Path(s) | Description | Expression
dom-2 | error | Media | If the resource is contained in another resource, it SHALL NOT contain nested Resources | `contained.contained.empty()`
dom-3 | error | Media | 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()`
dom-4 | error | Media | 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()`
dom-5 | error | Media | If a resource is contained in another resource, it SHALL NOT have a security label | `contained.meta.security.empty()`
dom-6 | best practice | Media | A resource should have narrative for robust management | `text.`div`.exists()`
ele-1 | error | **ALL** elements | All FHIR elements must have a @value or children | `hasValue() or (children().count() > id.count())`
ext-1 | error | **ALL** extensions | Must have either extensions or value[x], not both | `extension.exists() != value.exists()`

This structure is derived from TWCoreMedia

Summary

Mandatory: 1 element
Must-Support: 3 elements

Structures

This structure refers to these other structures:

- TW Core PractitionerRole (https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/PractitionerRole-twcore)
- TW Core Specimen (https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/Specimen-twcore)
- TW Core Location (https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/Location-twcore)
- 調劑單張-病人基本資料 (https://nhicore.nhi.gov.tw/empd/StructureDefinition/Patient-DS)
- 調劑單張-醫事人員基本資料 (https://nhicore.nhi.gov.tw/empd/StructureDefinition/Practitioner-DS)
- 調劑單張-門診基本資料 (https://nhicore.nhi.gov.tw/empd/StructureDefinition/Encounter-DS)

Key Elements View

Name | Flags | Card. | Type | Description & Constraints Filter: Bindings Constraints Obligations
--- | --- | --- | --- | ---
Media |  | 0..* | TWCoreMedia | 健康照護中獲取或使用的影像、影片或音檔，實際內容可能置於行內或透過直接參照提供。
implicitRules | ?!Σ | 0..1 | uri | 創建此內容所依據的一組規則
modifierExtension | ?! | 0..* | Extension | Extensions that cannot be ignored
status | ?!S Σ | 1..1 | code | preparation | in-progress | not-done | on-hold | stopped | completed | entered-in-error | unknown Binding: EventStatus (required): 代表事件生命週期階段的代碼；應填入所綁定值集中的其中一個代碼
subject | S Σ | 1..1 | Reference(TW Core PractitionerRole | Group | Device | TW Core Specimen | TW Core Location | 調劑單張-病人基本資料 | 調劑單張-醫事人員基本資料) | 多媒體紀錄的對象是誰或什麼？
encounter | Σ | 0..1 | Reference(調劑單張-門診基本資料) | 與此Media相關的就醫事件（Encounter）
content | S Σ | 1..1 | Attachment | Actual Media - reference or data。[應填入領藥者數位簽章]。開立第一級、第二級及第三級管制藥品專用處方箋，此欄位為必填
note | S | 0..* | Annotation | 對於QR Code相關之說明備註。
Documentation for this format

#### Terminology Bindings

Path | Status | Usage | ValueSet | Version | Source
Media.status | Base | required | EventStatus | 📍4.0.1 | FHIR Std.

#### Constraints

Id | Grade | Path(s) | Description | Expression
dom-2 | error | Media | If the resource is contained in another resource, it SHALL NOT contain nested Resources | `contained.contained.empty()`
dom-3 | error | Media | 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()`
dom-4 | error | Media | 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()`
dom-5 | error | Media | If a resource is contained in another resource, it SHALL NOT have a security label | `contained.meta.security.empty()`
dom-6 | best practice | Media | A resource should have narrative for robust management | `text.`div`.exists()`
ele-1 | error | **ALL** elements | All FHIR elements must have a @value or children | `hasValue() or (children().count() > id.count())`
ext-1 | error | **ALL** extensions | Must have either extensions or value[x], not both | `extension.exists() != value.exists()`

Differential View

This structure is derived from TWCoreMedia

Name | Flags | Card. | Type | Description & Constraints Filter: Bindings Constraints Obligations
--- | --- | --- | --- | ---
Media |  |  | TWCoreMedia |
status | S | 1..1 | code | preparation | in-progress | not-done | on-hold | stopped | completed | entered-in-error | unknown
subject |  | 1..1 | Reference(TW Core PractitionerRole | Group | Device | TW Core Specimen | TW Core Location | 調劑單張-病人基本資料 | 調劑單張-醫事人員基本資料) | 多媒體紀錄的對象是誰或什麼？
encounter |  | 0..1 | Reference(調劑單張-門診基本資料) | 與此Media相關的就醫事件（Encounter）
content | S | 1..1 | Attachment | Actual Media - reference or data。[應填入領藥者數位簽章]。開立第一級、第二級及第三級管制藥品專用處方箋，此欄位為必填
note | S | 0..* | Annotation | 對於QR Code相關之說明備註。
Documentation for this format

Snapshot View

Name | Flags | Card. | Type | Description & Constraints Filter: Bindings Constraints Obligations
--- | --- | --- | --- | ---
Media |  | 0..* | TWCoreMedia | 健康照護中獲取或使用的影像、影片或音檔，實際內容可能置於行內或透過直接參照提供。
id | Σ | 0..1 | id | 不重複的ID用以識別儲存在特定FHIR Server中的Media紀錄，通常又稱為邏輯性ID。
meta | Σ | 0..1 | Meta | 此Media Resource的metadata
implicitRules | ?!Σ | 0..1 | uri | 創建此內容所依據的一組規則
language |  | 0..1 | code | 用以表述Media Resource內容的語言。 Binding: CommonLanguages (preferred): 人類語言；鼓勵使用CommonLanguages代碼表中的代碼，但不強制一定要使用此代碼表，你也可使用其他代碼表的代碼或單純以文字表示。
Additional Bindings | Purpose
AllLanguages | Max Binding
Example Value: zh-TW
text |  | 0..1 | Narrative | Media Resource之內容摘要以供人閱讀 This profile does not constrain the narrative in regard to content, language, or traceability to data elements
contained |  | 0..* | Resource | Contained, inline Resources
extension |  | 0..* | Extension | Additional content defined by implementations
modifierExtension | ?! | 0..* | Extension | Extensions that cannot be ignored
identifier | Σ | 0..* | Identifier | 影像的識別碼
basedOn | Σ | 0..* | Reference(ServiceRequest | CarePlan) | 導致產生此多媒體的程序
partOf | Σ | 0..* | Reference(Resource) | 參照事件的一部分
status | ?!S Σ | 1..1 | code | preparation | in-progress | not-done | on-hold | stopped | completed | entered-in-error | unknown Binding: EventStatus (required): 代表事件生命週期階段的代碼；應填入所綁定值集中的其中一個代碼
type | Σ | 0..1 | CodeableConceptTW | 將多媒體分類為影像、影片或音檔 Binding: MediaType (extensible): 應填入所綁定值集中適合的代碼，確定無適合的代碼才可以使用其他值集的代碼來表示。
modality | Σ | 0..1 | CodeableConceptTW | 取得影像的設備/過程 Binding: MediaModality (example): 可參考MediaModality代碼表，但此代碼表只是針對這個欄位的一個可能值的示例，不預期也不鼓勵使用者一定要使用此代碼表的代碼。
view | Σ | 0..1 | CodeableConceptTW | 影像視圖，從不同的角度拍攝醫學影像，例如：側位（Lateral，從旁邊看）或前後部位（Antero-posterior，從前面或後面看） Binding: MediaCollectionView/Projection (extensible): 應填入所綁定值集中適合的代碼，確定無適合的代碼才可以使用其他值集的代碼來表示。
subject | S Σ | 1..1 | Reference(TW Core PractitionerRole | Group | Device | TW Core Specimen | TW Core Location | 調劑單張-病人基本資料 | 調劑單張-醫事人員基本資料) | 多媒體紀錄的對象是誰或什麼？
encounter | Σ | 0..1 | Reference(調劑單張-門診基本資料) | 與此Media相關的就醫事件（Encounter）
created[x] | Σ | 0..1 |  | Media被收集的時間
createdDateTime |  |  | dateTime |
createdPeriod |  |  | Period |
issued | Σ | 0..1 | instant | 此版本提供的日期/時間
operator | Σ | 0..1 | Reference(TW Core Practitioner | TW Core PractitionerRole | TW Core Organization | TW Core CareTeam | TW Core Patient | Device | TW Core RelatedPerson) | 產生影像的人
reasonCode | Σ | 0..* | CodeableConceptTW | 為什麼會進行這個事件？ Binding: ProcedureReasonCodes (extensible): 應填入所綁定值集中適合的代碼，確定無適合的代碼才可以使用其他值集的代碼來表示。
bodySite | Σ | 0..1 | CodeableConceptTW | 接受檢驗檢查的身體部位 Binding: SNOMEDCTBodyStructures (extensible): 應填入所綁定值集中適合的代碼，確定無適合的代碼才可以使用其他值集的代碼來表示。
deviceName | Σ | 0..1 | string | 設備/製造商的名稱
device | Σ | 0..1 | Reference(Device | DeviceMetric | Device) | 影像、影片、音檔的補捉設備。
height | Σ | 0..1 | positiveInt | 以像素為單位的影像高度（影像/影像）
width | Σ | 0..1 | positiveInt | 以像素為單位的影像寬度（影像/影像）
frames | Σ | 0..1 | positiveInt | > 1 的影格（影像）。
duration | Σ | 0..1 | decimal | 以秒為單位的長度（音檔/影片）。
content | S Σ | 1..1 | Attachment | Actual Media - reference or data。[應填入領藥者數位簽章]。開立第一級、第二級及第三級管制藥品專用處方箋，此欄位為必填
note | S | 0..* | Annotation | 對於QR Code相關之說明備註。
Documentation for this format

#### Terminology Bindings

Path | Status | Usage | ValueSet | Version | Source
Media.language | Base | preferred | Common Languages | 📦4.0.1 | FHIR Std.
Media.status | Base | required | EventStatus | 📍4.0.1 | FHIR Std.
Media.type | Base | extensible | Media Type | 📦4.0.1 | FHIR Std.
Media.modality | Base | example | Media Modality | 📦4.0.1 | FHIR Std.
Media.view | Base | extensible | Media Collection View/Projection | 📦4.0.1 | FHIR Std.
Media.reasonCode | Base | extensible | Procedure Reason Codes | 📦4.0.1 | FHIR Std.
Media.bodySite | Base | extensible | SNOMED CT Body Structures | 📦4.0.1 | FHIR Std.

#### Constraints

Id | Grade | Path(s) | Description | Expression
dom-2 | error | Media | If the resource is contained in another resource, it SHALL NOT contain nested Resources | `contained.contained.empty()`
dom-3 | error | Media | 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()`
dom-4 | error | Media | 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()`
dom-5 | error | Media | If a resource is contained in another resource, it SHALL NOT have a security label | `contained.meta.security.empty()`
dom-6 | best practice | Media | A resource should have narrative for robust management | `text.`div`.exists()`
ele-1 | error | **ALL** elements | All FHIR elements must have a @value or children | `hasValue() or (children().count() > id.count())`
ext-1 | error | **ALL** extensions | Must have either extensions or value[x], not both | `extension.exists() != value.exists()`

This structure is derived from TWCoreMedia

Summary

Mandatory: 1 element
Must-Support: 3 elements

Structures

This structure refers to these other structures:

- TW Core PractitionerRole (https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/PractitionerRole-twcore)
- TW Core Specimen (https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/Specimen-twcore)
- TW Core Location (https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/Location-twcore)
- 調劑單張-病人基本資料 (https://nhicore.nhi.gov.tw/empd/StructureDefinition/Patient-DS)
- 調劑單張-醫事人員基本資料 (https://nhicore.nhi.gov.tw/empd/StructureDefinition/Practitioner-DS)
- 調劑單張-門診基本資料 (https://nhicore.nhi.gov.tw/empd/StructureDefinition/Encounter-DS)

Other representations of profile: CSV, Excel, Schematron