臺灣核心實作指引(TW Core IG)
0.3.3 - Ci-Build Trial Use

臺灣核心實作指引(TW Core IG), published by 衛生福利部. This guide is not an authorized publication; it is the continuous build for version 0.3.3 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/MOHW-TWCoreIG/cctwFHIRterm/ and changes regularly. See the Directory of published versions

Resource Profile: TW Core DocumentReference

Official URL: https://twcore.mohw.gov.tw/ig/twcore/StructureDefinition/DocumentReference-twcore Version: 0.3.3
Active as of 2025-11-21 Computable Name: TWCoreDocumentReference

此臺灣核心-文件參照(TW Core DocumentReference) Profile說明本IG如何進一步定義FHIR的DocumentReference Resource以呈現文件參照的詳細資料。

Resource DocumentReference - 內容

這是一個指向任何種類、用於任何用途的文件的參照。它提供了文件的基本資訊,幫助我們找到並管理這個文件。文件可以是任何有MIME類型的序列化物件,包括專門針對病人的正式文件(如CDA)、臨床筆記、掃描過的紙本文件,以及像是政策文件這樣不特定於病人的文件。

範圍與使用

DocumentReference resource 是用來索引文件、臨床筆記和其他以二進制格式存儲的資料物件,使它們能被醫療系統存取。文件是一系列可以被識別的位元組序列,它建立了自己的上下文(例如:可以向使用者展示什麼主題、作者等),並且有明確的更新管理。DocumentReference resource 可以用於任何具有公認MIME類型且符合此定義的文件格式。

通常,DocumentReference resources 被用在文件索引系統中,像是IHE XDS,如同在IHE行動式存取健康紀錄文件(Mobile access to Health Documents,MHD))中概述的那樣。

DocumentReference是描述文件的metadata,比如:

  • 在FHIR系統中的CDA文件
  • 存儲在其他地方的FHIR文件(即遵循XDS Profile的註冊中心/儲存庫)
  • PDF文件、掃描的紙本文件和傳真的數位紀錄
  • 各種形式的臨床筆記
  • 影像文件(例如:JPEG、GIF、TIFF)
  • 非標準格式(例如:WORD)
  • 其他類型的文件,如處方或疫苗接種記錄

界限與關聯

FHIR不僅定義文件格式,還定義了文件參照DocumentReference。FHIR文件是指那些在FHIR中創建和組裝的文件,DocumentReference主要是透用參照找到那些已經組裝好的文件。

被參照的文件可以是另一個伺服器上的FHIR文件、或者儲存在特殊的FHIR 二進制 resource (Binary Resource)中,或者存儲在其他任何伺服器上。DocumentReference也能夠指向透過服務呼叫來查詢文件,例如XDS.b的RetrieveDocumentSet操作、DICOM交換、或是HL7 v2訊息查詢 — 但這些服務的具體運作方式需要在其外部標準或其他文件中明確說明。

DocumentReference 描述另一份文件,這意味著這裡涉及到兩套「基本資訊(provenance)」,意即「文件本身」以及「DocumentReference」的出處、版本號、創建日期等基本資訊。有時候,這些基本資訊是密切相關的,比如當文件製作者也製作了 DocuementReference 時;但在其他工作流中,DocumentReference 可能由其他角色在後續階段產生。在 DocumentReference resource 中, meta 內容段指的是參照本身的基本資訊,而其 resource下半部內容描述涉及它所參照的文件。 就像其他所有 resources 一樣, DocumentReference resource 主要資訊和在Provenance resource 中的資訊之間有重疊。這在Provenance resource的描述有討論。

這個 resource 被許多其他 FHIR resources 參照,包括醫療不良事件(AdverseEvent)、照護計畫(CarePlan)、通訊 (Communication)、 通訊請求(CommunicationRequest)、同意書(Consent)、合約(Contract)、設備請求(DeviceRequest)、設備使用聲明(DeviceUseStatement)、文件參照(DocumentReference)、家庭成員病史(FamilyMemberHistory)、指導回應(GuidanceResponse)、影像檢査(ImagingStudy)、 藥品知識(MedicationKnowledge)、醫藥產品(MedicinalProduct)、檢驗檢查(Observation)、 處置(Procedure)、一組請求(RequestGroup)、 風險評估(RiskAssessment)、服務請求(ServiceRequest)、物質參照資訊(SubstanceReferenceInformation)、物質規格(SubstanceSpecification)及供應品請求(SupplyRequest)DocumentReference resource 在FHIR框架中扮演著一個重要的角色,連接不同的 resources 和提供關於文件的重要基本資訊。

Usages:

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.

NameFlagsCard.TypeDescription & Constraints    Filter: Filtersdoco
.. DocumentReference 0..* DocumentReference 文件的參照
... id Σ 0..1 id 不重複的ID用以識別儲存在特定FHIR Server中的DocumentReference紀錄,通常又稱為邏輯性ID。
... meta Σ 0..1 Meta 此DocumentReference Resource的metadata
... implicitRules ?!Σ 0..1 uri 創建此內容所依據的一組規則
... text 0..1 Narrative DocumentReference Resource之內容摘要以供人閱讀
This profile does not constrain the narrative in regard to content, language, or traceability to data elements
... modifierExtension ?! 0..* Extension Extensions that cannot be ignored
... masterIdentifier SΣ 0..1 Identifier 主版本的識別碼
... identifier Σ 0..* Identifier 文件的其他的識別碼
... status ?!SΣ 1..1 code current | superseded | entered-in-error
Binding: DocumentReferenceStatus (required): 文件參照的狀態;應填入所綁定值集中的其中一個代碼。
... docStatus Σ 0..1 code preliminary | final | amended | entered-in-error
Binding: CompositionStatus (required): 基礎文件的狀態;應填入所綁定值集中的其中一個代碼。
... type SΣ 0..1 CodeableConceptTW 文件的類型(如果可能,使用 LOINC 代碼)
Binding: LOINC Code Document Type值集 (extensible): 應填入所綁定值集中適合的代碼,確定無適合的代碼才可以使用其他值集的代碼來表示。
... category SΣ 0..* CodeableConceptTW 文件的類別
Binding: LOINC Document Class值集 (extensible): 應填入所綁定值集中適合的代碼,確定無適合的代碼才可以使用其他值集的代碼來表示。
... subject SΣ 1..1 Reference(TW Core Patient | TW Core Practitioner | Group | Device) 文件描述的對象是誰/是什麼?
... date SΣ 0..1 instant 文件參照的創建時間是何時?
... author SΣ 0..* Reference(TW Core Practitioner | TW Core PractitionerRole | TW Core Organization | Device | TW Core Patient | TW Core RelatedPerson) 誰以及/或什麼創建了文件
... authenticator 0..1 Reference(TW Core Practitioner | TW Core PractitionerRole | TW Core Organization) 誰/什麼對文件進行了認證
... custodian 0..1 Reference(TW Core Organization) 維護此文件的機構
... relatesTo Σ 0..* BackboneElement 與其他文件的關係
.... modifierExtension ?!Σ 0..* Extension Extensions that cannot be ignored even if unrecognized
.... code Σ 1..1 code replaces | transforms | signs | appends
Binding: DocumentRelationshipType (required): 文件之間的關係類型;應填入所綁定值集中的其中一個代碼。
.... target Σ 1..1 Reference(TW Core DocumentReference) 存在此關係的目標文件
... description Σ 0..1 string 人可讀的描述。
... securityLabel Σ 0..* CodeableConceptTW 文件的安全標籤(security-tags)
Binding: All Security Labels (extensible): 應填入所綁定值集中適合的代碼,確定無適合的代碼才可以使用其他值集的代碼來表示。
... content SΣ 1..* BackboneElement 被參照的文件
.... modifierExtension ?!Σ 0..* Extension Extensions that cannot be ignored even if unrecognized
.... attachment Σ 1..1 Attachment 存取文件的位置
.... format Σ 0..1 Coding 文件的格式/內容規則。
Binding: DocumentReferenceFormatCodeSet (preferred): 鼓勵使用所綁定值集中的代碼,但不強制一定要使用此值集,你也可使用其他值集的代碼或單純以文字表示。
... context Σ 0..1 BackboneElement 文件的臨床背景
.... modifierExtension ?!Σ 0..* Extension Extensions that cannot be ignored even if unrecognized
.... encounter 0..* Reference(TW Core Encounter | EpisodeOfCare) 文件內容的臨床背景
.... event 0..* CodeableConceptTW 正在記錄的主要臨床行為
Binding: v3 Code System ActCode (example): 可參考所綁定值集,但此值集只是針對這個欄位的一個可能值的範例,不預期也不鼓勵使用者一定要使用此值集的代碼。
.... period Σ 0..1 Period 被記錄的服務時間
.... facilityType 0..1 CodeableConcept 病人接受治療的機構類型
Binding: FacilityTypeCodeValueSet (example): 可參考所綁定值集,但此值集只是針對這個欄位的一個可能值的範例,不預期也不鼓勵使用者一定要使用此值集的代碼。
.... practiceSetting 0..1 CodeableConceptTW 內容創建的額外細節(例如:臨床專業)
Binding: PracticeSettingCodeValueSet (example): 可參考所綁定值集,但此值集只是針對這個欄位的一個可能值的範例,不預期也不鼓勵使用者一定要使用此值集的代碼。
.... sourcePatientInfo 0..1 Reference(TW Core Patient) 來源的病人人口統計資料
.... related 0..* Reference(Resource) 相關的識別碼或resources

doco Documentation for this format

Terminology Bindings

Path Status Usage ValueSet Version Source
DocumentReference.language Base preferred Common Languages 📦4.0.1 FHIR Std.
DocumentReference.status Base required DocumentReferenceStatus 📍4.0.1 FHIR Std.
DocumentReference.docStatus Base required CompositionStatus 📍4.0.1 FHIR Std.
DocumentReference.type Base extensible LOINC Code Document Type值集 📦2.77 This IG
DocumentReference.category Base extensible LOINC Document Class值集 📦2.77 This IG
DocumentReference.relatesTo.​code Base required DocumentRelationshipType 📍4.0.1 FHIR Std.
DocumentReference.securityLabel Base extensible SecurityLabels 📦4.0.1 FHIR Std.
DocumentReference.content.​format Base preferred DocumentReference Format Code Set 📦4.0.1 FHIR Std.
DocumentReference.context.​event Base example v3 Code System ActCode 📦3.0.0 THO v7.0
DocumentReference.context.​facilityType Base example Facility Type Code Value Set 📦4.0.1 FHIR Std.
DocumentReference.context.​practiceSetting Base example Practice Setting Code Value Set 📦4.0.1 FHIR Std.

Constraints

Id Grade Path(s) Description Expression
dom-2 error DocumentReference If the resource is contained in another resource, it SHALL NOT contain nested Resources contained.contained.empty()
dom-3 error DocumentReference 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 DocumentReference 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 DocumentReference If a resource is contained in another resource, it SHALL NOT have a security label contained.meta.security.empty()
dom-6 best practice DocumentReference 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 DocumentReference

NameFlagsCard.TypeDescription & Constraints    Filter: Filtersdoco
.. DocumentReference 0..* DocumentReference 文件的參照
... id 0..1 id 不重複的ID用以識別儲存在特定FHIR Server中的DocumentReference紀錄,通常又稱為邏輯性ID。
... meta 0..1 Meta 此DocumentReference Resource的metadata
... implicitRules 0..1 uri 創建此內容所依據的一組規則
... text 0..1 Narrative DocumentReference Resource之內容摘要以供人閱讀
... masterIdentifier S 0..1 Identifier 主版本的識別碼
... identifier 0..* Identifier 文件的其他的識別碼
... status S 1..1 code current | superseded | entered-in-error
Binding: DocumentReferenceStatus (required): 文件參照的狀態;應填入所綁定值集中的其中一個代碼。
... docStatus 0..1 code preliminary | final | amended | entered-in-error
Binding: CompositionStatus (required): 基礎文件的狀態;應填入所綁定值集中的其中一個代碼。
... type S 0..1 CodeableConceptTW 文件的類型(如果可能,使用 LOINC 代碼)
Binding: LOINC Code Document Type值集 (extensible): 應填入所綁定值集中適合的代碼,確定無適合的代碼才可以使用其他值集的代碼來表示。
... category S 0..* CodeableConceptTW 文件的類別
Binding: LOINC Document Class值集 (extensible): 應填入所綁定值集中適合的代碼,確定無適合的代碼才可以使用其他值集的代碼來表示。
... subject S 1..1 Reference(TW Core Patient | TW Core Practitioner | Group | Device) 文件描述的對象是誰/是什麼?
... date S 0..1 instant 文件參照的創建時間是何時?
... author S 0..* Reference(TW Core Practitioner | TW Core PractitionerRole | TW Core Organization | Device | TW Core Patient | TW Core RelatedPerson) 誰以及/或什麼創建了文件
... authenticator 0..1 Reference(TW Core Practitioner | TW Core PractitionerRole | TW Core Organization) 誰/什麼對文件進行了認證
... custodian 0..1 Reference(TW Core Organization) 維護此文件的機構
... relatesTo 0..* BackboneElement 與其他文件的關係
.... code 1..1 code replaces | transforms | signs | appends
Binding: DocumentRelationshipType (required): 文件之間的關係類型;應填入所綁定值集中的其中一個代碼。
.... target 1..1 Reference(TW Core DocumentReference) 存在此關係的目標文件
... description 0..1 string 人可讀的描述。
... securityLabel 0..* CodeableConceptTW 文件的安全標籤(security-tags)
Binding: All Security Labels (extensible): 應填入所綁定值集中適合的代碼,確定無適合的代碼才可以使用其他值集的代碼來表示。
... content S 1..* BackboneElement 被參照的文件
.... attachment 1..1 Attachment 存取文件的位置
.... format 0..1 Coding 文件的格式/內容規則。
Binding: DocumentReferenceFormatCodeSet (preferred): 鼓勵使用所綁定值集中的代碼,但不強制一定要使用此值集,你也可使用其他值集的代碼或單純以文字表示。
... context 0..1 BackboneElement 文件的臨床背景
.... encounter 0..* Reference(TW Core Encounter | EpisodeOfCare) 文件內容的臨床背景
.... event 0..* CodeableConceptTW 正在記錄的主要臨床行為
Binding: v3 Code System ActCode (example): 可參考所綁定值集,但此值集只是針對這個欄位的一個可能值的範例,不預期也不鼓勵使用者一定要使用此值集的代碼。
.... period 0..1 Period 被記錄的服務時間
.... facilityType 0..1 CodeableConcept 病人接受治療的機構類型
Binding: FacilityTypeCodeValueSet (example): 可參考所綁定值集,但此值集只是針對這個欄位的一個可能值的範例,不預期也不鼓勵使用者一定要使用此值集的代碼。
.... practiceSetting 0..1 CodeableConceptTW 內容創建的額外細節(例如:臨床專業)
Binding: PracticeSettingCodeValueSet (example): 可參考所綁定值集,但此值集只是針對這個欄位的一個可能值的範例,不預期也不鼓勵使用者一定要使用此值集的代碼。
.... sourcePatientInfo 0..1 Reference(TW Core Patient) 來源的病人人口統計資料
.... related 0..* Reference(Resource) 相關的識別碼或resources

doco Documentation for this format

Terminology Bindings (Differential)

Path Status Usage ValueSet Version Source
DocumentReference.language Base preferred Common Languages 📦4.0.1 FHIR Std.
DocumentReference.status Base required DocumentReferenceStatus 📍4.0.1 FHIR Std.
DocumentReference.docStatus Base required CompositionStatus 📍4.0.1 FHIR Std.
DocumentReference.type Base extensible LOINC Code Document Type值集 📦2.77 This IG
DocumentReference.category Base extensible LOINC Document Class值集 📦2.77 This IG
DocumentReference.relatesTo.​code Base required DocumentRelationshipType 📍4.0.1 FHIR Std.
DocumentReference.securityLabel Base extensible SecurityLabels 📦4.0.1 FHIR Std.
DocumentReference.content.​format Base preferred DocumentReference Format Code Set 📦4.0.1 FHIR Std.
DocumentReference.context.​event Base example v3 Code System ActCode 📦3.0.0 THO v7.0
DocumentReference.context.​facilityType Base example Facility Type Code Value Set 📦4.0.1 FHIR Std.
DocumentReference.context.​practiceSetting Base example Practice Setting Code Value Set 📦4.0.1 FHIR Std.
NameFlagsCard.TypeDescription & Constraints    Filter: Filtersdoco
.. DocumentReference 0..* DocumentReference 文件的參照
... id Σ 0..1 id 不重複的ID用以識別儲存在特定FHIR Server中的DocumentReference紀錄,通常又稱為邏輯性ID。
... meta Σ 0..1 Meta 此DocumentReference Resource的metadata
... implicitRules ?!Σ 0..1 uri 創建此內容所依據的一組規則
... text 0..1 Narrative DocumentReference 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
... masterIdentifier SΣ 0..1 Identifier 主版本的識別碼
... identifier Σ 0..* Identifier 文件的其他的識別碼
... status ?!SΣ 1..1 code current | superseded | entered-in-error
Binding: DocumentReferenceStatus (required): 文件參照的狀態;應填入所綁定值集中的其中一個代碼。
... docStatus Σ 0..1 code preliminary | final | amended | entered-in-error
Binding: CompositionStatus (required): 基礎文件的狀態;應填入所綁定值集中的其中一個代碼。
... type SΣ 0..1 CodeableConceptTW 文件的類型(如果可能,使用 LOINC 代碼)
Binding: LOINC Code Document Type值集 (extensible): 應填入所綁定值集中適合的代碼,確定無適合的代碼才可以使用其他值集的代碼來表示。
... category SΣ 0..* CodeableConceptTW 文件的類別
Binding: LOINC Document Class值集 (extensible): 應填入所綁定值集中適合的代碼,確定無適合的代碼才可以使用其他值集的代碼來表示。
... subject SΣ 1..1 Reference(TW Core Patient | TW Core Practitioner | Group | Device) 文件描述的對象是誰/是什麼?
... date SΣ 0..1 instant 文件參照的創建時間是何時?
... author SΣ 0..* Reference(TW Core Practitioner | TW Core PractitionerRole | TW Core Organization | Device | TW Core Patient | TW Core RelatedPerson) 誰以及/或什麼創建了文件
... authenticator 0..1 Reference(TW Core Practitioner | TW Core PractitionerRole | TW Core Organization) 誰/什麼對文件進行了認證
... custodian 0..1 Reference(TW Core Organization) 維護此文件的機構
... relatesTo Σ 0..* BackboneElement 與其他文件的關係
.... id 0..1 string Unique id for inter-element referencing
.... extension 0..* Extension Additional content defined by implementations
.... modifierExtension ?!Σ 0..* Extension Extensions that cannot be ignored even if unrecognized
.... code Σ 1..1 code replaces | transforms | signs | appends
Binding: DocumentRelationshipType (required): 文件之間的關係類型;應填入所綁定值集中的其中一個代碼。
.... target Σ 1..1 Reference(TW Core DocumentReference) 存在此關係的目標文件
... description Σ 0..1 string 人可讀的描述。
... securityLabel Σ 0..* CodeableConceptTW 文件的安全標籤(security-tags)
Binding: All Security Labels (extensible): 應填入所綁定值集中適合的代碼,確定無適合的代碼才可以使用其他值集的代碼來表示。
... content SΣ 1..* BackboneElement 被參照的文件
.... id 0..1 string Unique id for inter-element referencing
.... extension 0..* Extension Additional content defined by implementations
.... modifierExtension ?!Σ 0..* Extension Extensions that cannot be ignored even if unrecognized
.... attachment Σ 1..1 Attachment 存取文件的位置
.... format Σ 0..1 Coding 文件的格式/內容規則。
Binding: DocumentReferenceFormatCodeSet (preferred): 鼓勵使用所綁定值集中的代碼,但不強制一定要使用此值集,你也可使用其他值集的代碼或單純以文字表示。
... context Σ 0..1 BackboneElement 文件的臨床背景
.... id 0..1 string Unique id for inter-element referencing
.... extension 0..* Extension Additional content defined by implementations
.... modifierExtension ?!Σ 0..* Extension Extensions that cannot be ignored even if unrecognized
.... encounter 0..* Reference(TW Core Encounter | EpisodeOfCare) 文件內容的臨床背景
.... event 0..* CodeableConceptTW 正在記錄的主要臨床行為
Binding: v3 Code System ActCode (example): 可參考所綁定值集,但此值集只是針對這個欄位的一個可能值的範例,不預期也不鼓勵使用者一定要使用此值集的代碼。
.... period Σ 0..1 Period 被記錄的服務時間
.... facilityType 0..1 CodeableConcept 病人接受治療的機構類型
Binding: FacilityTypeCodeValueSet (example): 可參考所綁定值集,但此值集只是針對這個欄位的一個可能值的範例,不預期也不鼓勵使用者一定要使用此值集的代碼。
.... practiceSetting 0..1 CodeableConceptTW 內容創建的額外細節(例如:臨床專業)
Binding: PracticeSettingCodeValueSet (example): 可參考所綁定值集,但此值集只是針對這個欄位的一個可能值的範例,不預期也不鼓勵使用者一定要使用此值集的代碼。
.... sourcePatientInfo 0..1 Reference(TW Core Patient) 來源的病人人口統計資料
.... related 0..* Reference(Resource) 相關的識別碼或resources

doco Documentation for this format

Terminology Bindings

Path Status Usage ValueSet Version Source
DocumentReference.language Base preferred Common Languages 📦4.0.1 FHIR Std.
DocumentReference.status Base required DocumentReferenceStatus 📍4.0.1 FHIR Std.
DocumentReference.docStatus Base required CompositionStatus 📍4.0.1 FHIR Std.
DocumentReference.type Base extensible LOINC Code Document Type值集 📦2.77 This IG
DocumentReference.category Base extensible LOINC Document Class值集 📦2.77 This IG
DocumentReference.relatesTo.​code Base required DocumentRelationshipType 📍4.0.1 FHIR Std.
DocumentReference.securityLabel Base extensible SecurityLabels 📦4.0.1 FHIR Std.
DocumentReference.content.​format Base preferred DocumentReference Format Code Set 📦4.0.1 FHIR Std.
DocumentReference.context.​event Base example v3 Code System ActCode 📦3.0.0 THO v7.0
DocumentReference.context.​facilityType Base example Facility Type Code Value Set 📦4.0.1 FHIR Std.
DocumentReference.context.​practiceSetting Base example Practice Setting Code Value Set 📦4.0.1 FHIR Std.

Constraints

Id Grade Path(s) Description Expression
dom-2 error DocumentReference If the resource is contained in another resource, it SHALL NOT contain nested Resources contained.contained.empty()
dom-3 error DocumentReference 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 DocumentReference 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 DocumentReference If a resource is contained in another resource, it SHALL NOT have a security label contained.meta.security.empty()
dom-6 best practice DocumentReference 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()

Key Elements View

NameFlagsCard.TypeDescription & Constraints    Filter: Filtersdoco
.. DocumentReference 0..* DocumentReference 文件的參照
... id Σ 0..1 id 不重複的ID用以識別儲存在特定FHIR Server中的DocumentReference紀錄,通常又稱為邏輯性ID。
... meta Σ 0..1 Meta 此DocumentReference Resource的metadata
... implicitRules ?!Σ 0..1 uri 創建此內容所依據的一組規則
... text 0..1 Narrative DocumentReference Resource之內容摘要以供人閱讀
This profile does not constrain the narrative in regard to content, language, or traceability to data elements
... modifierExtension ?! 0..* Extension Extensions that cannot be ignored
... masterIdentifier SΣ 0..1 Identifier 主版本的識別碼
... identifier Σ 0..* Identifier 文件的其他的識別碼
... status ?!SΣ 1..1 code current | superseded | entered-in-error
Binding: DocumentReferenceStatus (required): 文件參照的狀態;應填入所綁定值集中的其中一個代碼。
... docStatus Σ 0..1 code preliminary | final | amended | entered-in-error
Binding: CompositionStatus (required): 基礎文件的狀態;應填入所綁定值集中的其中一個代碼。
... type SΣ 0..1 CodeableConceptTW 文件的類型(如果可能,使用 LOINC 代碼)
Binding: LOINC Code Document Type值集 (extensible): 應填入所綁定值集中適合的代碼,確定無適合的代碼才可以使用其他值集的代碼來表示。
... category SΣ 0..* CodeableConceptTW 文件的類別
Binding: LOINC Document Class值集 (extensible): 應填入所綁定值集中適合的代碼,確定無適合的代碼才可以使用其他值集的代碼來表示。
... subject SΣ 1..1 Reference(TW Core Patient | TW Core Practitioner | Group | Device) 文件描述的對象是誰/是什麼?
... date SΣ 0..1 instant 文件參照的創建時間是何時?
... author SΣ 0..* Reference(TW Core Practitioner | TW Core PractitionerRole | TW Core Organization | Device | TW Core Patient | TW Core RelatedPerson) 誰以及/或什麼創建了文件
... authenticator 0..1 Reference(TW Core Practitioner | TW Core PractitionerRole | TW Core Organization) 誰/什麼對文件進行了認證
... custodian 0..1 Reference(TW Core Organization) 維護此文件的機構
... relatesTo Σ 0..* BackboneElement 與其他文件的關係
.... modifierExtension ?!Σ 0..* Extension Extensions that cannot be ignored even if unrecognized
.... code Σ 1..1 code replaces | transforms | signs | appends
Binding: DocumentRelationshipType (required): 文件之間的關係類型;應填入所綁定值集中的其中一個代碼。
.... target Σ 1..1 Reference(TW Core DocumentReference) 存在此關係的目標文件
... description Σ 0..1 string 人可讀的描述。
... securityLabel Σ 0..* CodeableConceptTW 文件的安全標籤(security-tags)
Binding: All Security Labels (extensible): 應填入所綁定值集中適合的代碼,確定無適合的代碼才可以使用其他值集的代碼來表示。
... content SΣ 1..* BackboneElement 被參照的文件
.... modifierExtension ?!Σ 0..* Extension Extensions that cannot be ignored even if unrecognized
.... attachment Σ 1..1 Attachment 存取文件的位置
.... format Σ 0..1 Coding 文件的格式/內容規則。
Binding: DocumentReferenceFormatCodeSet (preferred): 鼓勵使用所綁定值集中的代碼,但不強制一定要使用此值集,你也可使用其他值集的代碼或單純以文字表示。
... context Σ 0..1 BackboneElement 文件的臨床背景
.... modifierExtension ?!Σ 0..* Extension Extensions that cannot be ignored even if unrecognized
.... encounter 0..* Reference(TW Core Encounter | EpisodeOfCare) 文件內容的臨床背景
.... event 0..* CodeableConceptTW 正在記錄的主要臨床行為
Binding: v3 Code System ActCode (example): 可參考所綁定值集,但此值集只是針對這個欄位的一個可能值的範例,不預期也不鼓勵使用者一定要使用此值集的代碼。
.... period Σ 0..1 Period 被記錄的服務時間
.... facilityType 0..1 CodeableConcept 病人接受治療的機構類型
Binding: FacilityTypeCodeValueSet (example): 可參考所綁定值集,但此值集只是針對這個欄位的一個可能值的範例,不預期也不鼓勵使用者一定要使用此值集的代碼。
.... practiceSetting 0..1 CodeableConceptTW 內容創建的額外細節(例如:臨床專業)
Binding: PracticeSettingCodeValueSet (example): 可參考所綁定值集,但此值集只是針對這個欄位的一個可能值的範例,不預期也不鼓勵使用者一定要使用此值集的代碼。
.... sourcePatientInfo 0..1 Reference(TW Core Patient) 來源的病人人口統計資料
.... related 0..* Reference(Resource) 相關的識別碼或resources

doco Documentation for this format

Terminology Bindings

Path Status Usage ValueSet Version Source
DocumentReference.language Base preferred Common Languages 📦4.0.1 FHIR Std.
DocumentReference.status Base required DocumentReferenceStatus 📍4.0.1 FHIR Std.
DocumentReference.docStatus Base required CompositionStatus 📍4.0.1 FHIR Std.
DocumentReference.type Base extensible LOINC Code Document Type值集 📦2.77 This IG
DocumentReference.category Base extensible LOINC Document Class值集 📦2.77 This IG
DocumentReference.relatesTo.​code Base required DocumentRelationshipType 📍4.0.1 FHIR Std.
DocumentReference.securityLabel Base extensible SecurityLabels 📦4.0.1 FHIR Std.
DocumentReference.content.​format Base preferred DocumentReference Format Code Set 📦4.0.1 FHIR Std.
DocumentReference.context.​event Base example v3 Code System ActCode 📦3.0.0 THO v7.0
DocumentReference.context.​facilityType Base example Facility Type Code Value Set 📦4.0.1 FHIR Std.
DocumentReference.context.​practiceSetting Base example Practice Setting Code Value Set 📦4.0.1 FHIR Std.

Constraints

Id Grade Path(s) Description Expression
dom-2 error DocumentReference If the resource is contained in another resource, it SHALL NOT contain nested Resources contained.contained.empty()
dom-3 error DocumentReference 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 DocumentReference 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 DocumentReference If a resource is contained in another resource, it SHALL NOT have a security label contained.meta.security.empty()
dom-6 best practice DocumentReference 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 DocumentReference

NameFlagsCard.TypeDescription & Constraints    Filter: Filtersdoco
.. DocumentReference 0..* DocumentReference 文件的參照
... id 0..1 id 不重複的ID用以識別儲存在特定FHIR Server中的DocumentReference紀錄,通常又稱為邏輯性ID。
... meta 0..1 Meta 此DocumentReference Resource的metadata
... implicitRules 0..1 uri 創建此內容所依據的一組規則
... text 0..1 Narrative DocumentReference Resource之內容摘要以供人閱讀
... masterIdentifier S 0..1 Identifier 主版本的識別碼
... identifier 0..* Identifier 文件的其他的識別碼
... status S 1..1 code current | superseded | entered-in-error
Binding: DocumentReferenceStatus (required): 文件參照的狀態;應填入所綁定值集中的其中一個代碼。
... docStatus 0..1 code preliminary | final | amended | entered-in-error
Binding: CompositionStatus (required): 基礎文件的狀態;應填入所綁定值集中的其中一個代碼。
... type S 0..1 CodeableConceptTW 文件的類型(如果可能,使用 LOINC 代碼)
Binding: LOINC Code Document Type值集 (extensible): 應填入所綁定值集中適合的代碼,確定無適合的代碼才可以使用其他值集的代碼來表示。
... category S 0..* CodeableConceptTW 文件的類別
Binding: LOINC Document Class值集 (extensible): 應填入所綁定值集中適合的代碼,確定無適合的代碼才可以使用其他值集的代碼來表示。
... subject S 1..1 Reference(TW Core Patient | TW Core Practitioner | Group | Device) 文件描述的對象是誰/是什麼?
... date S 0..1 instant 文件參照的創建時間是何時?
... author S 0..* Reference(TW Core Practitioner | TW Core PractitionerRole | TW Core Organization | Device | TW Core Patient | TW Core RelatedPerson) 誰以及/或什麼創建了文件
... authenticator 0..1 Reference(TW Core Practitioner | TW Core PractitionerRole | TW Core Organization) 誰/什麼對文件進行了認證
... custodian 0..1 Reference(TW Core Organization) 維護此文件的機構
... relatesTo 0..* BackboneElement 與其他文件的關係
.... code 1..1 code replaces | transforms | signs | appends
Binding: DocumentRelationshipType (required): 文件之間的關係類型;應填入所綁定值集中的其中一個代碼。
.... target 1..1 Reference(TW Core DocumentReference) 存在此關係的目標文件
... description 0..1 string 人可讀的描述。
... securityLabel 0..* CodeableConceptTW 文件的安全標籤(security-tags)
Binding: All Security Labels (extensible): 應填入所綁定值集中適合的代碼,確定無適合的代碼才可以使用其他值集的代碼來表示。
... content S 1..* BackboneElement 被參照的文件
.... attachment 1..1 Attachment 存取文件的位置
.... format 0..1 Coding 文件的格式/內容規則。
Binding: DocumentReferenceFormatCodeSet (preferred): 鼓勵使用所綁定值集中的代碼,但不強制一定要使用此值集,你也可使用其他值集的代碼或單純以文字表示。
... context 0..1 BackboneElement 文件的臨床背景
.... encounter 0..* Reference(TW Core Encounter | EpisodeOfCare) 文件內容的臨床背景
.... event 0..* CodeableConceptTW 正在記錄的主要臨床行為
Binding: v3 Code System ActCode (example): 可參考所綁定值集,但此值集只是針對這個欄位的一個可能值的範例,不預期也不鼓勵使用者一定要使用此值集的代碼。
.... period 0..1 Period 被記錄的服務時間
.... facilityType 0..1 CodeableConcept 病人接受治療的機構類型
Binding: FacilityTypeCodeValueSet (example): 可參考所綁定值集,但此值集只是針對這個欄位的一個可能值的範例,不預期也不鼓勵使用者一定要使用此值集的代碼。
.... practiceSetting 0..1 CodeableConceptTW 內容創建的額外細節(例如:臨床專業)
Binding: PracticeSettingCodeValueSet (example): 可參考所綁定值集,但此值集只是針對這個欄位的一個可能值的範例,不預期也不鼓勵使用者一定要使用此值集的代碼。
.... sourcePatientInfo 0..1 Reference(TW Core Patient) 來源的病人人口統計資料
.... related 0..* Reference(Resource) 相關的識別碼或resources

doco Documentation for this format

Terminology Bindings (Differential)

Path Status Usage ValueSet Version Source
DocumentReference.language Base preferred Common Languages 📦4.0.1 FHIR Std.
DocumentReference.status Base required DocumentReferenceStatus 📍4.0.1 FHIR Std.
DocumentReference.docStatus Base required CompositionStatus 📍4.0.1 FHIR Std.
DocumentReference.type Base extensible LOINC Code Document Type值集 📦2.77 This IG
DocumentReference.category Base extensible LOINC Document Class值集 📦2.77 This IG
DocumentReference.relatesTo.​code Base required DocumentRelationshipType 📍4.0.1 FHIR Std.
DocumentReference.securityLabel Base extensible SecurityLabels 📦4.0.1 FHIR Std.
DocumentReference.content.​format Base preferred DocumentReference Format Code Set 📦4.0.1 FHIR Std.
DocumentReference.context.​event Base example v3 Code System ActCode 📦3.0.0 THO v7.0
DocumentReference.context.​facilityType Base example Facility Type Code Value Set 📦4.0.1 FHIR Std.
DocumentReference.context.​practiceSetting Base example Practice Setting Code Value Set 📦4.0.1 FHIR Std.

Snapshot View

NameFlagsCard.TypeDescription & Constraints    Filter: Filtersdoco
.. DocumentReference 0..* DocumentReference 文件的參照
... id Σ 0..1 id 不重複的ID用以識別儲存在特定FHIR Server中的DocumentReference紀錄,通常又稱為邏輯性ID。
... meta Σ 0..1 Meta 此DocumentReference Resource的metadata
... implicitRules ?!Σ 0..1 uri 創建此內容所依據的一組規則
... text 0..1 Narrative DocumentReference 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
... masterIdentifier SΣ 0..1 Identifier 主版本的識別碼
... identifier Σ 0..* Identifier 文件的其他的識別碼
... status ?!SΣ 1..1 code current | superseded | entered-in-error
Binding: DocumentReferenceStatus (required): 文件參照的狀態;應填入所綁定值集中的其中一個代碼。
... docStatus Σ 0..1 code preliminary | final | amended | entered-in-error
Binding: CompositionStatus (required): 基礎文件的狀態;應填入所綁定值集中的其中一個代碼。
... type SΣ 0..1 CodeableConceptTW 文件的類型(如果可能,使用 LOINC 代碼)
Binding: LOINC Code Document Type值集 (extensible): 應填入所綁定值集中適合的代碼,確定無適合的代碼才可以使用其他值集的代碼來表示。
... category SΣ 0..* CodeableConceptTW 文件的類別
Binding: LOINC Document Class值集 (extensible): 應填入所綁定值集中適合的代碼,確定無適合的代碼才可以使用其他值集的代碼來表示。
... subject SΣ 1..1 Reference(TW Core Patient | TW Core Practitioner | Group | Device) 文件描述的對象是誰/是什麼?
... date SΣ 0..1 instant 文件參照的創建時間是何時?
... author SΣ 0..* Reference(TW Core Practitioner | TW Core PractitionerRole | TW Core Organization | Device | TW Core Patient | TW Core RelatedPerson) 誰以及/或什麼創建了文件
... authenticator 0..1 Reference(TW Core Practitioner | TW Core PractitionerRole | TW Core Organization) 誰/什麼對文件進行了認證
... custodian 0..1 Reference(TW Core Organization) 維護此文件的機構
... relatesTo Σ 0..* BackboneElement 與其他文件的關係
.... id 0..1 string Unique id for inter-element referencing
.... extension 0..* Extension Additional content defined by implementations
.... modifierExtension ?!Σ 0..* Extension Extensions that cannot be ignored even if unrecognized
.... code Σ 1..1 code replaces | transforms | signs | appends
Binding: DocumentRelationshipType (required): 文件之間的關係類型;應填入所綁定值集中的其中一個代碼。
.... target Σ 1..1 Reference(TW Core DocumentReference) 存在此關係的目標文件
... description Σ 0..1 string 人可讀的描述。
... securityLabel Σ 0..* CodeableConceptTW 文件的安全標籤(security-tags)
Binding: All Security Labels (extensible): 應填入所綁定值集中適合的代碼,確定無適合的代碼才可以使用其他值集的代碼來表示。
... content SΣ 1..* BackboneElement 被參照的文件
.... id 0..1 string Unique id for inter-element referencing
.... extension 0..* Extension Additional content defined by implementations
.... modifierExtension ?!Σ 0..* Extension Extensions that cannot be ignored even if unrecognized
.... attachment Σ 1..1 Attachment 存取文件的位置
.... format Σ 0..1 Coding 文件的格式/內容規則。
Binding: DocumentReferenceFormatCodeSet (preferred): 鼓勵使用所綁定值集中的代碼,但不強制一定要使用此值集,你也可使用其他值集的代碼或單純以文字表示。
... context Σ 0..1 BackboneElement 文件的臨床背景
.... id 0..1 string Unique id for inter-element referencing
.... extension 0..* Extension Additional content defined by implementations
.... modifierExtension ?!Σ 0..* Extension Extensions that cannot be ignored even if unrecognized
.... encounter 0..* Reference(TW Core Encounter | EpisodeOfCare) 文件內容的臨床背景
.... event 0..* CodeableConceptTW 正在記錄的主要臨床行為
Binding: v3 Code System ActCode (example): 可參考所綁定值集,但此值集只是針對這個欄位的一個可能值的範例,不預期也不鼓勵使用者一定要使用此值集的代碼。
.... period Σ 0..1 Period 被記錄的服務時間
.... facilityType 0..1 CodeableConcept 病人接受治療的機構類型
Binding: FacilityTypeCodeValueSet (example): 可參考所綁定值集,但此值集只是針對這個欄位的一個可能值的範例,不預期也不鼓勵使用者一定要使用此值集的代碼。
.... practiceSetting 0..1 CodeableConceptTW 內容創建的額外細節(例如:臨床專業)
Binding: PracticeSettingCodeValueSet (example): 可參考所綁定值集,但此值集只是針對這個欄位的一個可能值的範例,不預期也不鼓勵使用者一定要使用此值集的代碼。
.... sourcePatientInfo 0..1 Reference(TW Core Patient) 來源的病人人口統計資料
.... related 0..* Reference(Resource) 相關的識別碼或resources

doco Documentation for this format

Terminology Bindings

Path Status Usage ValueSet Version Source
DocumentReference.language Base preferred Common Languages 📦4.0.1 FHIR Std.
DocumentReference.status Base required DocumentReferenceStatus 📍4.0.1 FHIR Std.
DocumentReference.docStatus Base required CompositionStatus 📍4.0.1 FHIR Std.
DocumentReference.type Base extensible LOINC Code Document Type值集 📦2.77 This IG
DocumentReference.category Base extensible LOINC Document Class值集 📦2.77 This IG
DocumentReference.relatesTo.​code Base required DocumentRelationshipType 📍4.0.1 FHIR Std.
DocumentReference.securityLabel Base extensible SecurityLabels 📦4.0.1 FHIR Std.
DocumentReference.content.​format Base preferred DocumentReference Format Code Set 📦4.0.1 FHIR Std.
DocumentReference.context.​event Base example v3 Code System ActCode 📦3.0.0 THO v7.0
DocumentReference.context.​facilityType Base example Facility Type Code Value Set 📦4.0.1 FHIR Std.
DocumentReference.context.​practiceSetting Base example Practice Setting Code Value Set 📦4.0.1 FHIR Std.

Constraints

Id Grade Path(s) Description Expression
dom-2 error DocumentReference If the resource is contained in another resource, it SHALL NOT contain nested Resources contained.contained.empty()
dom-3 error DocumentReference 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 DocumentReference 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 DocumentReference If a resource is contained in another resource, it SHALL NOT have a security label contained.meta.security.empty()
dom-6 best practice DocumentReference 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()

 

Other representations of profile: CSV, Excel, Schematron

Notes:

以下概述了此Profile所需的RESTful FHIR互動功能。有關TW Core IG支援的RESTful互動功能的完整清單,請參閱TW Core Server能力聲明

建議應該支援以下查詢參數:

  1. 建議應該(SHOULD) 支援透過查詢參數 _id 查詢所有DocumentReference:
    (如何透過token查詢)
    GET [base]/DocumentReference?_id=[id]
    GET [base]/DocumentReference/[id]

    例子:
    (1) GET [base]/DocumentReference?_id=documentReference-example

    (2) GET [base]/DocumentReference/documentReference-example

  2. 建議應該(SHOULD) 支援透過查詢參數 status 查詢所有DocumentReference:
    (如何透過token查詢)
    GET [base]/DocumentReference?status=[code]

    例子:
    (1) GET [base]/DocumentReference?status=completed

  3. 建議應該(SHOULD) 支援透過查詢參數 subject 查詢所有DocumentReference:
    (如何透過reference查詢)
    GET [base]/DocumentReference?subject={Type/}[id]

    例子:
    (1) GET [base]/DocumentReference?subject=Patient/pat-example

實作注意事項

  • 臨床文件架構描述 (Composition description)中有討論如何使用.docStatus代碼。這是關於文件目前狀態(如草稿、最終版等)的一種標記。
  • Resources 之間保持著一種單向的關係,這種關係是向後指的 (backwards):比如,一個取代另一份文件的文件會指回它所取代的那個文件。我們可以利用從 Resources 建立的索引追溯這種反向的關係。如果要取得文件的完整資訊,需考慮到一份文件可能會被其他文件取代或添加,所以當用戶端存取文件時,應該先確認及瞭解這些關係,再透過查詢參數來取得所需的相應文件。
    • 舉個例子,假設有一份關於病人的健康報告(稱為文件A),後來有了一個更新版的健康報告(稱為文件B)來取代它。在這種情況下,文件B會有一個指向文件 A 的參照,表明 B 是 A 的更新版。如果有人查看文件A,系統可以通過這種單向關係指示,該使用者可能想要查看最新的文件B來獲得最準確的資訊。

產生一份文件參照

用戶端可以要求伺服器從一份已有的文件中創建一個DocumentReference。伺服器會檢視這份文件,然後創建一個匹配的DocumentReference Rresource,或者如果之前已經創建過,就直接回傳那個已創建的DocumentReference。對於以下類型的文件,伺服器可能可以創建或回傳DocumentReference:

類型(Type) 意見(Comments)
FHIR 文件 uri(網址)直接指向一份現有的文件。
CDA 文件 uri是一個指向Binary端點的網址,這個端點返回CDA文件或一些CDA套件,伺服器知道如何處理這些文件(例如:一個IHE .zip檔案)。
其他 伺服器也可以被要求為其他類型的文件創建 DocumentReference。例如:PDF文件。只有當服務器已經有了這份文件的DocumentReference,或者對該文件有特殊的了解時,才能提供DocumentReference。

伺服器可能會回傳一個包含單一DocumentReference的查詢結果,或者一個錯誤訊息。如果URI指向的是另一個伺服器,是否去查詢那個文件或回傳錯誤,則由伺服器自己決定。

啟動這個過程是透過在/DocumentReference端點使用_query=generate進行的已命名查詢,像這樣:

GET [service-url]/DocumentReference/?_query=generate&uri=:url&...

這裡的「uri」參數是指向上述某種文件類型的一個網址。還可以提供其他的參數:

名稱(Name) 意義(Meaning)
persist 表示一旦文件被創建,是否需要在伺服器的文件端點(Document)儲存這份文件。值可以是true(是)或false(否),預設值則取決於伺服器。