Content Source Extension¶
| Canonical | ../StructureDefinition/nexus-content-source |
|---|---|
| Status | draft · 1.26.0 |
| Base | Extension (constraint) |
| Context | DocumentReference.content (element) |
| Source | FSH · JSON |
Origin metadata for the file behind one DocumentReference.content entry: the channel or system
the file was delivered through.
FSH
The authored source of truth: extensions/ContentSourceExtension.fsh (edit on GitHub). One FSH file may define several related artifacts.
// ContentSourceExtension.fsh
// Where the FILE behind one `DocumentReference.content` entry came from.
//
// WHY IT IS ON `content` AND NOT ON THE RESOURCE. A DocumentReference may carry the same document
// in several renditions -- a PDF and a plain-text extraction of it, say -- and only one of them is
// the file that actually arrived. The others are produced locally from it. A fact about the file's
// origin is therefore a fact about ONE rendition, and putting it on the resource root would assert
// it of every rendition including the ones this estate generated itself. So it rides the content
// entry holding the delivered file, and the derived renditions carry nothing.
//
// WHAT IT IS FOR. Documents reach a chart through several channels, and the channel is not
// recoverable from anything else on the resource: `custodian` names the organization that holds
// the document, `author` names who wrote it, and neither says how it got here. A consumer that
// needs to treat delivered documents differently from locally-authored ones -- reconciliation,
// duplicate detection against a feed, or simply telling a user where a file came from -- has no
// other element to read.
//
// THE SOURCE IS AN OPAQUE TOKEN, NOT A BOUND CODE. It names the delivery channel or system as the
// receiving pipeline knows it (`HRM`, Ontario Health's Health Report Manager, is the case this
// shape was drawn from). No value set is declared, deliberately: the set of channels is a
// deployment fact rather than a modelling one, and a required or extensible binding published here
// would make a conformant deployment nonconformant the day it adds a feed. A consumer should match
// the values its own deployment produces and pass through the ones it does not recognise.
//
// ────────────────────────────────────────────────────────────────────────────────────────────────
// WHY THIS IS NOT CALLED `nexus-emr-file-metadata`, WHICH IS THE NAME THE SHAPE SUGGESTS.
//
// That canonical is spent. Up to 1.10.0 it named a different extension -- on the
// `DocumentReference` ROOT, carrying display and embedded-section hints (`originalFileName`,
// `fileCategory`, `displayHint`, `processingInstructions`, `embeddedSections`) -- and it was
// withdrawn in 1.11.0 with the rest of the experimental clinical-document surface.
//
// A withdrawn canonical is not a free name. This guide's rule is that a published canonical URL is
// permanent: it identifies one definition for as long as anything anywhere remembers it, and that
// obligation does not lapse when the definition is withdrawn. Re-pointing it at a different context
// with a disjoint set of sub-extensions would mean one URL had named two unrelated things, and a
// reader holding pre-1.11.0 data would have no way to know which it had. So this extension takes a
// fresh canonical, and the old one stays dead.
//
// WHAT A READER SHOULD DO with an instance carrying the withdrawn sub-extensions: it is pre-1.11.0
// data, it conforms to nothing this guide currently publishes, and it is not this extension. Carry
// it forward as opaque or drop it. WHAT A WRITER SHOULD DO: write only `source`, on the content
// entry holding the delivered file.
// ────────────────────────────────────────────────────────────────────────────────────────────────
Extension: NexusContentSource
Id: nexus-content-source
Title: "Content Source Extension"
Description: """
Origin metadata for the file behind one `DocumentReference.content` entry: the channel or system
the file was delivered through.
**On the content entry, not on the resource.** A DocumentReference may hold several renditions of
one document and only one of them is the file that arrived; the others are produced locally. The
extension rides the delivered rendition, so derived renditions carry nothing.
**`source` is an opaque token**, naming the delivery channel as the receiving pipeline knows it.
`HRM` -- Ontario Health's Health Report Manager -- is the channel this shape was drawn from and the
value carried in this guide's example. No value set is bound: the set of channels is a deployment
fact, and a binding published here would make a deployment nonconformant the day it adds a feed.
Match the values your deployment produces and pass through the rest.
⚠ **FIRST PASS -- do not treat this as a contract.** The extension is published under a canonical
minted for it, so nothing predates it: there is no earlier address for this shape and no legacy
instance to reconcile against. A store holds instances of it from the point a delivery pipeline
starts stamping them, and no sooner. Write only `source`, on the content entry holding the
delivered file.
"""
* ^url = "../StructureDefinition/nexus-content-source"
* ^status = #draft
* ^date = "2026-09-04"
* ^publisher = "WELLSTAR Technologies Corp."
* ^contact.name = "Nexus EMR FHIR Implementation Guide"
* ^contact.telecom.system = #url
* ^contact.telecom.value = ".."
* ^jurisdiction = urn:iso:std:iso:3166#CA "Canada"
* ^context[0].type = #element
* ^context[0].expression = "DocumentReference.content"
* . ^short = "Origin of the file behind this rendition (delivered renditions only)"
* value[x] 0..0
* url 1..1
* extension contains
source 1..1 MS
* extension[source].value[x] only string
* extension[source] ^short = "The channel or system the file was delivered through"
* extension[source] ^definition = "An opaque token naming the delivery channel or system that produced this file, as the receiving pipeline knows it -- for example `HRM`, Ontario Health's Health Report Manager. Not bound to a value set: the set of channels a deployment receives from is a deployment fact. It names HOW the file arrived, which is not recoverable from `custodian` (who holds the document) or `author` (who wrote it)."