Skip to content

Provenance Profile

Canonicalhttps://fhir.apps.health/StructureDefinition/nexus-emr-core-provenance
Statusdraft · 1.33.0
BaseProvenance (constraint)
SourceFSH · JSON

Attribution for AI-mediated writes, cross-boundary writes and record-lifecycle events such as linking an arriving result to a chart or entering a resource into the record: what was produced, when, by which agent (human or non-human), from what inputs, and -- for generated text -- which verbatim source passage each statement rests on. Used standalone against a produced resource, and contained in an AI-suggestion review Task against the suggestion contained alongside it.

Invariants

Every rule in force on a conforming instance. This profile rows are stated here; inherited rows come from the base resource and are listed so that a constraint named on an element is findable. Invariant keys elsewhere on this page link into this table.

Key Source Severity On Rule
nexus-prov-link-automation-agent this profile error Provenance A Provenance whose link method is automatic or confirmed SHALL name the matching service as an agent that is a Device (agent.who.type = Device, or a literal Device/ reference). The reverse is not required: a manual link may still name a matcher that ran and was overridden.
activity.extension.where(url = 'https://fhir.apps.health/StructureDefinition/nexus-link-method').where(value.ofType(Coding).code = 'automatic' or value.ofType(Coding).code = 'confirmed').exists() implies agent.where(who.type = 'Device' or who.reference.startsWith('Device/')).exists()
nexus-prov-link-confirmed-person this profile error Provenance A Provenance whose link method is confirmed SHALL name, besides the matching service, the person who accepted the proposed target (an agent that is not a Device).
activity.extension.where(url = 'https://fhir.apps.health/StructureDefinition/nexus-link-method').where(value.ofType(Coding).code = 'confirmed').exists() implies agent.count() > agent.where(who.type = 'Device' or who.reference.startsWith('Device/')).count()
nexus-prov-link-method this profile error Provenance A Provenance whose activity is the ISO 21089 link or unlink event SHALL carry exactly one https://fhir.apps.health/StructureDefinition/nexus-link-method extension on activity saying how the link was made (automatic, confirmed or manual). The method is recorded, never inferred from which agents are present.
activity.coding.where(system = 'http://terminology.hl7.org/CodeSystem/iso-21089-lifecycle' and (code = 'link' or code = 'unlink')).exists() implies activity.extension.where(url = 'https://fhir.apps.health/StructureDefinition/nexus-link-method').count() = 1
nexus-prov-link-method-event this profile error Provenance A Provenance whose activity carries the nexus-link-method extension SHALL carry exactly one ISO 21089 record-lifecycle coding in activity, and it SHALL be link or unlink.
activity.extension.where(url = 'https://fhir.apps.health/StructureDefinition/nexus-link-method').exists() implies (activity.coding.where(system = 'http://terminology.hl7.org/CodeSystem/iso-21089-lifecycle').count() = 1 and activity.coding.where(system = 'http://terminology.hl7.org/CodeSystem/iso-21089-lifecycle' and (code = 'link' or code = 'unlink')).exists())
provenance-ai-action-names-agent this profile warning Provenance A Provenance that carries attributed facts SHOULD name the non-human agent that generated them (agent.who typed or referenced as Device), in addition to any supervising human -- otherwise the trail cannot distinguish generated content from human-authored content
extension.where(url = 'https://fhir.apps.health/StructureDefinition/nexus-attributed-fact').exists() implies agent.where(who.type = 'Device' or who.reference.startsWith('Device/')).exists()
provenance-target-required this profile error Provenance Provenance.target must name at least one resource -- a provenance with no target is unattributable
target.exists()
dom-2 inherited error Provenance If the resource is contained in another resource, it SHALL NOT contain nested Resources
contained.contained.empty()
dom-3 inherited error Provenance 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
dom-4 inherited error Provenance 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 inherited error Provenance If a resource is contained in another resource, it SHALL NOT have a security label
contained.meta.security.empty()
dom-6 inherited warning Provenance A resource should have narrative for robust management
text.div.exists()
ele-1 inherited error Provenance.meta All FHIR elements must have a @value or children
hasValue() or (children().count() > id.count())
ext-1 inherited error Provenance.meta.extension Must have either extensions or value[x], not both
extension.exists() != value.exists()