Nexus EMR profile for an ATTACHED DOCUMENT -- a clinical document that exists as a file:
scanned paper, incoming faxes, external consult letters received as PDF, signed consent forms,
patient-uploaded files. FHIR holds the metadata and clinical context; the bytes live in
document storage and are reached through content.attachment.url.
An attached document (scan, PDF, fax, Word) with its metadata and clinical context
Definition
DocumentReference is the metadata wrapper for a document that exists as a FILE -- scanned paper,
an incoming fax, an external consult letter received as PDF, a signed consent form. It provides
indexing, discovery, and clinical context; the bytes themselves live in document storage and are
reached through content.attachment.url.
For notes AUTHORED in this EMR, use NexusEmrCoreComposition instead -- narrative belongs in
FHIR as XHTML, not as an encoded attachment. See the boundary rule at the top of this file.
The resource captures:
- Document identification and categorization
- Clinical context and temporal relevance
- Authorship and authentication details
- A pointer to the document content (and, on the way in, the content itself)
- Relationships to other documents
Comments
Usually, this is used for documents other than those defined by FHIR.
The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.
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.
Comments
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.
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.
Comments
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.
Comments
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 interaction.
Identifies EMR instance & pipeline version the resource came from
Definition
A URI that identifies the EMR pipeline and version from which this resource originated. This tells you which EMR instance (recommend using the instance identifier), and the version of the pipeline code/transformations.
Comments
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.
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. These tags connect specific resources to the overall security policy and infrastructure.
Comments
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.
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.
Comments
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.
A set of rules under which this content was created
Definition
A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.
Comments
Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc.
Cardinality
0..1
Type
uri
Modifier
yes — 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
The base language in which the resource is written.
Comments
Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).
A human-readable narrative that contains a summary of the document reference. This narrative should provide key information about the document for human interpretation, including document type, date, and key clinical context.
Comments
Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a "text blob" or where text is additionally entered raw or narrated and encoded information is added later.
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.
Comments
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.
Comments
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.
Review acknowledgement, one per reviewer (absent = unreviewed)
Definition
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.
Comments
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.
Free-text reason the document is superseded or entered in error (absent when current)
Definition
Why the document is no longer current: what replaced a superseded document, or what made an
entered-in-error one wrong. Written when the status changes and removed when the document is
made current again, so a stale reason never sits on an active document. Because the resource is
updated in place, each stored version keeps the reason that applied to it -- the store's version
history is the audit of who changed the status, when, from what to what, and why. Optional: a
status change with no reason is a complete record.
Comments
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.
Fillable fields a chart value pre-fills -- form templates only
Definition
Which fillable fields of this template's file a chart value pre-fills when a form is started
from it: one rule per field, naming the field as the file names it and the chart value (from
CodeSystem/nexus-form-chart-value) that fills it. Present only on a form template. Absent, or
naming no field the file carries, the form opens blank; present, every pre-filled value stays
editable.
Comments
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.
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).
Requirements
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.
Comments
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.
Cardinality
0..*
Type
Extension
Modifier
yes — Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them
Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document.
Requirements
The structure and format of this Id shall be consistent with the specification corresponding to the formatCode attribute. (e.g. for a DICOM standard document a 64-character numeric UID, for an HL7 CDA format a serialization of the CDA Document Id extension and root in the form "oid^extension", where OID is a 64 digits max, and the Id is a 16 UTF-8 char max. If the OID is coded without the extension then the '^' character shall not be included.).
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.
Comments
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.
A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.
Requirements
Allows users to make use of identifiers when the identifier system is not known.
Comments
This element deals only with general categories of identifiers. It SHOULD not be used for codes that correspond 1..1 with the Identifier.system. Some identifiers may fall into multiple categories due to common usage. Where the system is known, a type is unnecessary because the type is always part of the system definition. However systems often need to handle identifiers where the system is not known. There is not a 1:1 relationship between type and system, since many different systems have the same type.
Establishes the namespace for the value - that is, a URL that describes a set values that are unique.
Requirements
There are many sets of identifiers. To perform matching of two identifiers, we need to know what set we're dealing with. The system identifies a particular set of unique identifiers.
The portion of the identifier typically relevant to the user and which is unique within the context of the system.
Comments
If the value is a full URI, then the system SHALL be urn:ietf:rfc:3986. The value's primary purpose is computational mapping. As a result, it may be normalized for comparison purposes (e.g. removing non-significant whitespace, dashes, etc.) A value formatted for human display can be conveyed using the Rendered Value extension. Identifier.value is to be treated as case sensitive unless knowledge of the Identifier.system allows the processer to be confident that non-case-sensitive processing is safe.
The Identifier.assigner may omit the .reference element and only contain a .display element reflecting the name or other textual information about the assigning organization.
The status of this document reference. Allowed values:
- current: The document is active and current
- superseded: The document has been replaced by a newer version
- entered-in-error: The document was created in error and should not be used (deleted)
When a document is updated, the previous version can be marked as 'superseded' and a new DocumentReference
created with status 'current'. This approach:
- Maintains immutable document history
- Provides clear version tracking
- Enables audit trails
- Supports document lifecycle management
Comments
This is the status of the DocumentReference object, which might be independent from the docStatus element.
This element is labeled as a modifier because the status contains the codes that mark the document or reference as not currently valid.
Cardinality
1..1
Type
code
Must Support
yes
Modifier
yes — 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
Specifies the precise type of clinical document referenced (e.g., specific LOINC code for document type).
While this field is supported for backward compatibility with systems expecting it, Nexus EMR strongly
recommends using 'category' instead because:
- Category supports multiple classifications per document
- Category allows both clinical and administrative taxonomies
- Type is limited to a single classification
If used, prefer LOINC codes for interoperability.
Where this code was mapped from a source system's own vocabulary, carry the raw coding alongside the mapped one, flagged userSelected = true. See Carrying the raw code.
Comments
Key metadata element describing the document that describes he exact type of document. Helps humans to assess whether the document is of interest when viewing a list of documents.
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.
Comments
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.
A reference to a code defined by a terminology system.
Requirements
Allows for alternative encodings within a code system, and translations to other code systems.
Comments
Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information. Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true.
Allows for alternative encodings within a code system, and translations to other code systems.
Comments
Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information. Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true.
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.
Comments
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.
The identification of the code system that defines the meaning of the symbol in the code.
Requirements
Need to be unambiguous about the source of the definition of the symbol.
Comments
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.
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.
Comments
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.
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).
Indicates that this coding was chosen by a user directly - e.g. off a pick list of available items (codes or displays).
Requirements
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.
Comments
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.
A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.
Requirements
The codes from the terminologies do not always capture the correct meaning with all the nuances of the human using them, or sometimes there is no appropriate code at all. In these cases, the text is used to capture the full meaning of the source.
Comments
Very often the text is the same as a displayName of one of the codings.
High-level categorization of the document. This is the PREFERRED method for document classification in Nexus EMR.
Multiple categories can be assigned to provide different perspectives on the document's purpose and content.
Common categories include:
- Received correspondence (consult letters, discharge summaries from other institutions)
- Scanned paper and incoming faxes
- Diagnostic documents (lab or imaging reports delivered as files rather than as DiagnosticReport)
- Legal and administrative documents (consent forms, advance directives, insurance forms)
- Patient-supplied documents
Note what is NOT here since the 2026-08-06 narrowing: progress notes and consultation notes
AUTHORED in this EMR are NexusEmrCoreComposition, not DocumentReference. A consult note
received as a PDF is still a DocumentReference -- the distinction is the form the content
arrives in, not the clinical genre.
Use standard terminologies (LOINC, SNOMED CT) for maximum interoperability.
Comments
Key metadata element describing the the category or classification of the document. This is a broader perspective that groups similar documents based on how they would be used. This is a primary key used in searching.
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.
Comments
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.
A reference to a code defined by a terminology system.
Requirements
Allows for alternative encodings within a code system, and translations to other code systems.
Comments
Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information. Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true.
A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.
Requirements
The codes from the terminologies do not always capture the correct meaning with all the nuances of the human using them, or sometimes there is no appropriate code at all. In these cases, the text is used to capture the full meaning of the source.
Comments
Very often the text is the same as a displayName of one of the codings.
The patient that this document pertains to. Required for every document EXCEPT a form template,
which is the tenant-wide blank of a form type and is about no patient; the
nexus-documentreference-subject-unless-template invariant states that rule in evaluable form.
When present it must reference a valid NexusEmrCorePatient resource, and the reference should use
the patient's identifier for reliable cross-system identification.
While the FHIR standard allows documents about other subjects (Device, Practitioner, Group), Nexus EMR currently
only supports patient-centric documents to align with Canadian healthcare requirements.
When DocumentReference was created (not document date)
Definition
When this DocumentReference resource was created in the system. This is NOT necessarily when the document itself
was created or when the documented service occurred.
Timing relationships:
- date: When DocumentReference was created (this field)
- content.attachment.creation: When document was created
- context.period: When clinical service occurred
Example: A discharge summary for April 10-15 admission might be:
- Service period: 2025-04-10 to 2025-04-15
- Document created: 2025-04-15T14:00:00
- DocumentReference created: 2025-04-16T09:00:00 (next day upload)
This field is primarily for technical/audit purposes.
Comments
Referencing/indexing time is used for tracking, organizing versions and searching.
Identifies who was responsible for writing the document content. Can include multiple authors for collaborative
documents. Note the distinction:
- Author: Who wrote/created the content
- Authenticator: Who legally verified/signed the document
- Custodian: Organization maintaining the document
- in EMRs, you probably want to be using 'authenticator' rather than 'author' here.
- eg: 'author' may be a medical student, 'authenticator' could be the doc signing off.
- 'authenticator' is the person who is medically responsible for the content of this document.
Authors can only be EMR users in this context, referenced as a Practitioner (the primary
provider identity in this IG) or as a PractitionerRole where the clinic/role binding is
part of the assertion.
Order matters - list primary author first.
Comments
Not necessarily who did the actual data entry (i.e. typist) or who was the source (informant).
The practitioner who has legally authenticated or verified this document, taking responsibility for its content.
This represents medical/legal responsibility rather than authorship. The authenticator:
- Must have appropriate authority/credentials
- Takes responsibility for document accuracy
- May or may not be the document author
- Should be a single practitioner (not multiple)
Typically the attending physician, consultant, or supervising practitioner.
References a Practitioner -- the primary provider identity in this IG. A
PractitionerRole reference is also permitted, for the cases where the clinic/role binding
is part of what is being asserted (e.g. authentication performed in a specific role at a
specific organization, which Practitioner cannot express since it has no organization).
Comments
Represents a participant within the author institution who has legally authenticated or attested the document. Legal authentication implies that a document has been signed manually or electronically by the legal Authenticator.
The organization that is responsible for maintaining the authoritative source of this document and controlling
access to it. This is a REQUIRED field that identifies:
- Who has stewardship of the document
- Where to direct queries about the document
- Who is responsible for retention policies
- Who manages access permissions
Typically the organization that created the document or currently manages the patient's care.
Must reference a valid NexusEmrCoreOrganization resource.
Comments
Identifies the logical organization (software system, vendor, or department) to go to find the current version, where to report issues, etc. This is different from the physical location (URL, disk drive, or server) of the document, which is the technical location of the document, which host may be delegated to the management of some other organization.
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.
Comments
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.
Extensions that cannot be ignored even if unrecognized
Definition
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).
Requirements
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.
Comments
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.
Cardinality
0..*
Type
Extension
Modifier
yes — Modifier extensions are expected to modify the meaning or interpretation of the element that contains them
A human-readable description of the document's content and purpose. While optional, this field is strongly
recommended as it:
- Provides quick context without opening the document
- Improves searchability and discoverability
- Helps users identify relevant documents quickly
- Supports accessibility requirements
Should be concise but informative (typically 1-2 sentences).
Examples:
- "Complete blood count showing mild anemia, hemoglobin 10.2"
- "Cardiology consultation for chest pain, recommending stress test"
- "Discharge summary following 5-day admission for pneumonia"
Requirements
Helps humans to assess whether the document is of interest.
Comments
What the document is about, a terse summary of the document.
A set of Security-Tag codes specifying the level of privacy/security of the Document. Note that DocumentReference.meta.security contains the security labels of the "reference" to the document, while DocumentReference.securityLabel contains a snapshot of the security labels on the document the reference refers to.
Requirements
Use of the Health Care Privacy/Security Classification (HCS) system of security-tag use is recommended.
Comments
The confidentiality codes can carry multiple vocabulary items. HL7 has developed an understanding of security and privacy tags that might be desirable in a Document Sharing environment, called HL7 Healthcare Privacy and Security Classification System (HCS). The following specification is recommended but not mandated, as the vocabulary bindings are an administrative domain responsibility. The use of this method is up to the policy domain such as the XDS Affinity Domain or other Trust Domain where all parties including sender and recipients are trusted to appropriately tag and enforce.
In the HL7 Healthcare Privacy and Security Classification (HCS) there are code systems specific to Confidentiality, Sensitivity, Integrity, and Handling Caveats. Some values would come from a local vocabulary as they are related to workflow roles and special projects.
Document attachment(s) -- submitted inline, stored as files, read back by URL
Definition
The document content and its metadata. Each content element is one attachment. Multiple
attachments per DocumentReference are supported (a referral letter plus supporting results),
but most cases are a single document.
THE ROUND TRIP -- what a writer sends is not what a reader gets back.
WRITING. Submit the document inline: contentType plus base64 in attachment.data, with no
url. On create or update the gateway stores the bytes, then rewrites the attachment before
persisting it: url is set to the stored-document address, size and hash (SHA-1) are
computed and filled in, and data is cleared. Writers SHOULD NOT compute size, hash, or
url themselves.
READING. Expect url and no data. Fetch the bytes from the URL (see content.attachment.url
for the auth contract). Consumers MUST NOT assume data is populated.
SENDING BOTH IS A TRAP. The conversion is guarded on url being absent. An attachment carrying
BOTH data and a url bypasses storage entirely and the base64 is persisted inline in the FHIR
resource, where it will be echoed on every subsequent read. Send one or the other: data to
upload new content, url only to reference something already stored.
STABLE URLS ACROSS UPDATES. Updating a DocumentReference reuses the existing stored-document
identity, so the URL does not churn when metadata changes. (Note this is DocumentReference-only
behaviour; DiagnosticReport.presentedForm runs through the same middleware but without the
existing-document lookup, so its attachments get a fresh URL on each update.)
At least one of data or url MUST be present per attachment (invariant
attachment-has-data-or-url) -- which, given the above, means "inline on the way in, URL on the
way out."
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.
Comments
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.
Extensions that cannot be ignored even if unrecognized
Definition
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).
Requirements
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.
Comments
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.
Cardinality
0..*
Type
Extension
Modifier
yes — Modifier extensions are expected to modify the meaning or interpretation of the element that contains them
The document: MIME type, content (inline on write / URL on read), and file metadata
Definition
The attachment carrying the document. Required.
Provides MIME type identification, the content itself (inline base64 on write, a stored-file URL
on read -- see content for the round trip), a human-readable title, size, hash, and language.
size and hash are populated by the gateway during storage; writers need not supply them.
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.
Comments
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.
MIME type identifying the document format. This is REQUIRED to ensure proper handling and display of the document.
Common values:
- 'application/pdf' - PDF documents (most common)
- 'text/plain' - Plain text documents
- 'text/html' - HTML formatted documents
- 'text/rtf' - Rich text format
- 'image/jpeg' - JPEG images (scanned documents)
- 'image/png' - PNG images
- 'application/msword' - Microsoft Word
- 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' - Word DOCX
The MIME type must accurately reflect the actual content format.
Requirements
Processors of the data need to be able to know how to interpret the data.
BCP-47 language tag indicating the human language of the document content. Important for:
- Multilingual healthcare settings
- Accessibility requirements
- Content filtering/searching
- Translation workflows
Common values:
- 'en-CA' - Canadian English
- 'fr-CA' - Canadian French
- 'en' - English (generic)
- 'fr' - French (generic)
- 'es' - Spanish
Example: A discharge summary in French would have language = 'fr-CA'
Requirements
Users need to be able to choose between the languages in a set of attachments.
Base64 document content -- the UPLOAD channel; normally absent on read
Definition
The document content as base64-encoded binary. This is the upload channel: populate it (with no
url) to submit a new document.
NORMALLY ABSENT ON READ. The gateway clears data once the bytes are stored, so a reader gets
url instead. Consumers MUST NOT assume this element is populated, and MUST NOT treat its
absence as an empty document.
Do not send data and url together -- see content. That combination skips storage and
persists the base64 inline permanently.
Implementation notes:
- Line breaks in the base64 string should be avoided; standard alphabet (A-Z, a-z, 0-9, +, /).
- Large documents: no explicit size threshold is enforced by the gateway, and the whole body is
buffered in memory during conversion. Very large inline submissions are a practical risk
(request-body limits and memory), not a specified one -- prefer keeping documents modest and
raise it with the platform team rather than assuming a limit exists.
Example encoding (JavaScript):
Absolute URL to the stored document -- the READ channel; set by the gateway
Definition
Where the document bytes can be fetched. This is the read channel, and for gateway-ingested
documents it is written BY the gateway during storage -- clients uploading new content should
leave it empty and send data.
SHAPE. An absolute URL served by the platform's File Storage Service:
https://{host}/fss/api/v1/file/{documentId}
This is NOT a FHIR Binary reference (this platform implements no Binary endpoint), and NOT
a pre-signed or SAS blob URL. It is a normal API endpoint.
FETCHING IT. The URL is not self-authorizing. Retrieval requires the caller's own credentials:
a bearer token carrying the file-read permission, and the request resolves within the caller's
tenant -- a document belonging to another tenant is not found, regardless of the identifier. A
client that treats this like a public or signed download link will get a 401, not a document.
Reads are audited.
STABILITY. The URL is permanent for the life of the document -- no expiry, no rotation -- and
survives updates to the DocumentReference (the gateway reuses the stored-document identity).
It may therefore be cached and stored.
SUPPLYING A URL YOURSELF. Permitted, for referencing content already held by the platform, but
validated: the host must be trusted, and an untrusted host is rejected with a 400 and an
OperationOutcome directing you to upload via data instead. Do not point this element at
arbitrary external systems -- content that lives outside the platform should be ingested, not
linked.
Requirements
The data needs to be transmitted by reference.
Comments
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 calculated hash of the data using SHA-1. Represented using base64.
Requirements
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).
Comments
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 for mechanism to protect a resource with a digital signature.
Human-readable title for the document. While optional, this field is strongly recommended for user experience.
The title should be:
- Descriptive and meaningful
- Suitable for display in document lists
- Include relevant context (e.g., date, type)
- 50-100 characters typically
Examples:
- "Discharge Summary - April 15, 2025"
- "CBC Results - Hemoglobin 10.2"
- "Cardiology Referral - Dr. Smith"
- "Chest X-Ray Report - Normal"
Requirements
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/time when the document was originally created (not when the DocumentReference was created).
Useful for:
- Distinguishing between multiple versions
- Understanding document timeline
- Sorting documents chronologically
- Audit trail purposes
Format: FHIR dateTime (e.g., "2025-04-20T10:00:00-06:00")
Requirements
This is often tracked as an integrity issue for use of the attachment.
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.
Comments
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.
Extensions that cannot be ignored even if unrecognized
Definition
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).
Requirements
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.
Comments
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.
Cardinality
0..*
Type
Extension
Modifier
yes — Modifier extensions are expected to modify the meaning or interpretation of the element that contains them
This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the type Code, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act.
Comments
An event can further specialize the act inherent in the type, such as where it is simply "Procedure Report" and the procedure was a "colonoscopy". If one or more event codes are included, they shall not conflict with the values inherent in the class or type elements as such a conflict would create an ambiguous situation.
Time period of documented service. Only 'start' expected
Definition
The time period over which the service described by the document was provided. This represents the clinical
relevance timeframe, not when the document was created. Critical for understanding temporal context.
Examples:
- Discharge summary: Admission to discharge dates
- Consultation note: Consultation appointment time
- Progress note: Specific day of care
- Procedure report: Surgery start to end time
If only a point in time is relevant, use 'start' only.
For ongoing care, 'end' may be absent.
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.
Comments
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.
The end of the period. If the end of the period is missing, it means no end was known or planned at the time the instance was created. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time.
Comments
The high value includes any matching date/time. i.e. 2012-02-03T10:00:00 is in a period that has an end value of 2012-02-03.
Additional details about where the content was created (e.g. clinical specialty)
Definition
This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty.
Requirements
This is an important piece of metadata that providers often rely upon to quickly sort and/or filter out to find specific content.
Comments
This element should be based on a coarse classification system for the class of specialty practice. Recommend the use of the classification system for Practice Setting, such as that described by the Subject Matter Domain in LOINC.
What this document was assembled from or sent with -- the packet, and its host
Definition
Other resources this document is related to. For a rendered outbound artifact this is the BACK
POINTER: the attachment packet whose members it renders, and the host that packet travelled with
(a letter's Composition, a referral's ServiceRequest).
The FORWARD link is on the host and is the one to navigate: a letter names its packet in one
Composition.section.entry, a referral in ServiceRequest.supportingInfo. This element exists so
a reader that starts from the document can get back, not so the relationship can be discovered by
search -- related is not a declared search parameter on this server.
Comments
May be identifiers or resources that caused the DocumentReference or referenced Document to be created.