--- type: "doc" title: "FHIR Documents" source: "source/documents.html" --- \[%settitle FHIR Documents%\] \[%file newheader%\] \[%file newnavbar%\] # FHIR Documents | Responsible Owner: [\[%wgt fhir%\]]([%wg fhir%]) Work Group | [Standards Status](versions#std-process):[Normative](versions#std-process) | | --- | --- | FHIR resources can be used to build documents that represent a composition: a coherent set of information that is a statement of healthcare information, including clinical observations and services. A document is a set of resources with a fixed presentation that is authored and/or attested by humans, organizations and devices. A FHIR document instance is a [Bundle](bundle) of type `document` that starts with a [Composition](composition) and contains specific frozen versions of other resources. Changes to a document Bundle may risk invalidating the attestation present within the document. Implementations SHOULD have policies around when documents can be 'updated' (new version of the same instance) vs. when a distinct document needs to be created, as well as what types of change are permitted, in order to retain attestation validity. These rules might vary based on the type of document (e.g., legal documents, clinical documents, etc.). Documents built in this fashion may be exchanged between systems and persisted in document storage and management systems, including systems such as [IHE XDS](https://wiki.ihe.net/index.php/Cross-Enterprise_Document_Sharing). Applications that declare support for FHIR documents with [CapabilityStatement.document](capabilitystatement-definitions#CapabilityStatement.document) are asserting conformance to the rules defined on this page. FHIR documents may serve clinical purposes (focused on patient healthcare information) and non-clinical purposes (e.g., practice guidelines, patient handouts, etc.). HL7 has plans to develop profiles in the future giving additional guidance on appropriate representation of clinical documents in general, specific types of clinical documents (e.g., Consolidated CDA), and other non-clinical documents (Death Certificate, Medication Registration Information). FHIR documents are not intended to capture unbounded data sets such as all data stored in an EHR. Rather, consider the [Bulk Data](http://hl7.org/fhir/uv/bulkdata/) specification for use cases requiring access to such data sets. Note that FHIR defines both this document format (a document bundle containing a Composition resource and potentially other resources) and a [DocumentReference resource](documentreference). FHIR documents are used for documents that are authored and assembled in FHIR, while the DocumentReference resource is for general references to documents (which may include FHIR documents as well as PDFs, CDAs, etc.). - [Example discharge summary](document-example-dischargesummary): [XML](document-example-dischargesummary.xml) or [JSON](document-example-dischargesummary.json) ## Document Structure All documents have the same structure: a [Bundle](bundle) of resources of [type](bundle-definitions#Bundle.type) "document" that has a [Composition](composition) resource as the first resource in the bundle, followed by a series of other resources, referenced from the `Composition` resource, that provide the supporting details for the document. The bundle gathers all the content of the document into a single XML or JSON document which may be signed and managed as required. The resources may include both human readable and computer processable portions. In addition, the bundle may include [CSS stylesheets](http://www.w3.org/Style/CSS/Overview.en.html), [Provenance](provenance) statements including signatures. The composition resource is the foundation of the clinical document, it: - provides identity and its purpose, and sets the context of the document - carries key information such as the subject and author, and who attests to the document - divides the document up into a series of sections, each with their own narrative Resources referenced by the Composition as listed below SHALL be included in the bundle when the document is assembled: <%res-ref-list Composition%> When these resources reference other resources, the referenced resources SHOULD also be included in the bundle. Omitting referenced resources could compromise the integrity and wholeness of the document, especially when considering that documents have legal retention periods that may be longer than the life of the FHIR server where the reference(s) point to. In rare cases the referenced resources in Composition can also be contained resources within Composition provided that the resource(s) in question meets the restrictions for the use of contained resources (see [Contained Resources](references#contained) for more information). The document bundle SHALL include only: 1. The composition set: the single Composition resource, and the resources it links to 2. The supporting information: Any resources that are part of the graph of resources that reference or are referenced from the composition set, either directly or indirectly (e.g., recursively in a chain). Such references SHALL use [Reference.reference](references#Reference), [canonical](references#canonical) or a [URI](datatypes#uri) See [Graph-connected Bundles](bundle#graphs) for further details. 3. Supporting Collateral: A Binary resource containing a stylesheet (as described below) There are two key identifiers in the document: - The document identifier (mandatory) found in _Bundle.identifier_. It is globally unique for this instance of the document, and is never re-used, including for other documents derived from the same composition - The Composition identifier (optional) in _Composition.identifier_. It is the same for all documents that are derived from this composition The document has several dates in it: - The document date (mandatory) found in _Bundle.timestamp_. It identifies when the document bundle was assembled from the underlying resources - The Composition date (mandatory) found in _Composition.date_. It is when the author wrote the document logically - The Attestation dates (optional). These are found in _Composition.attester.time_ and is when the document was witnessed by the attesters. This would usually be at the same time as the composition date or afterwards - The Composition last modified time (optional). This is found in _Composition.meta.lastUpdated_ for the composition and is the last date of change of the composition. This must be >= the composition date If there is a need to have a digital signature on a Document Bundle, this may be accomplished using the rules laid out in the [digital signatures](signatures) page. Note that the document may be represented in either XML or JSON and interconverted between these or have its character encoding changed, all the while remaining the same document. Any additional documents derived from the same Composition SHALL have a different Bundle.identifier. ### Document Presentation When the document is presented for human consumption, applications SHOULD present the collated narrative portions in order: 1. The [subject resource](composition-definitions#Composition.subject) Narrative 2. The [Composition](composition) resource Narrative 3. The [section.text](composition-definitions#Composition.section.text) Narratives If the document is presented in a different order from that given above, it might not represent the original attested content. Implementation Guides may restrict document narrative and display behavior further. The presentation of the document is called the 'attested content' of the document. The text of resources outside Composition and the subject resource are not considered attested content (e.g., a [Condition](condition) resource). Specifically, the `Composition.attester` attests to the presented form of the document. The Composition resource narrative should summarize the important parts of the document header that are required to establish clinical context for the document (other than the subject, which is displayed in its own right). To actually build the combined narrative, simply append all the narrative