Page Status: updated 2023-02-28

Provenance

Page index

Introduction

The Provenance resource, shown in the profile NLLProvenance, contains additional information describing why a resource was created or changed, who performed and/or advised the change and when the change occurred.

When doing an HTTP POST or PUT (insert / update) of a resource, a Provenance resource must be provided in the HTTP header as a custom header parameter, X-Provenance, see HTTP Header and Authorization. The target of the Provenance is the resource(s) defined in the HTTP body. The provided provenance addresses why and who. The National Medication List adds when to the provenance.

See the HL7 FHIR documentation Provenance HTTP header for more details about the Provenance resource.

Regarding information about how the "must support"-property is used in the Swedish National MedicationList, please refer to the page Resources

Overview

idS Σ0..1string
metaΣ0..1Meta
implicitRulesΣ ?!0..1uri
language0..1codeBinding
text0..1Narrative
contained0..*Resource
extensionI0..*Extension
modifierExtension?! I0..*Extension
targetS Σ1..*Reference(NLLMedicationRequest | NLLMedicationDispense | NLLMultiDoseDispConsent | NLLMultiDoseDispensingBasis | NLLDispensePaperPrescription | NLLDataLock | NLLAccessConsent)
occurredDateTimedateTime
recordedS Σ1..1instant
policy0..*uri
location0..1Reference(Location)
id0..1string
extensionI0..*Extension
id0..1string
extensionI0..*Extension
systemS Σ0..1uri
versionS Σ0..1string
codeS Σ1..1code
displayΣ0..1string
userSelectedΣ0..1boolean
textS Σ0..1string
id0..1string
extensionI0..*Extension
id0..1string
extensionI0..*Extension
systemS Σ0..1uri
versionS Σ0..1string
codeS Σ1..1code
displayΣ0..1string
userSelectedΣ0..1boolean
textΣ0..1string
id0..1string
extensionI0..*Extension
modifierExtensionΣ ?! I0..*Extension
typeS Σ1..1CodeableConceptBinding
role0..*CodeableConcept
whoS Σ1..1Reference(NLLPractitioner | NLLPatient)
onBehalfOf0..1Reference(Practitioner | PractitionerRole | RelatedPerson | Patient | Device | Organization)
id0..1string
extensionI0..*Extension
modifierExtensionΣ ?! I0..*Extension
roleΣ1..1codeBinding
whatΣ1..1Reference(Resource)
agent0..*see (agent)
signature0..*Signature
Provenance
DefinitionNLLProvenance describes a change that has been made on a resource affecting a patient medications list, e.g. a MedicationRequest, MedicationDispense or resource related to multi dose dispensing (sv: dosunderlag, dossamtycke) or a change affecting a data lock (sv spärr). The change describes What - in the form of which resource is the target in combination with a reason and activity. It describes by Who - in the form of agent and it describes When it occurred. A Provenance resource is created fron the X-Provenance header wich is mandatory in a number of scenarios.
Cardinality0...*
AliasHistory, Event, Activity
Comments

Some parties may be duplicated between the target resource and its provenance. For instance, the prescriber is usually (but not always) the author of the prescription resource. This resource is defined with close consideration for W3C Provenance.

Invariants
  • dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources
    contained.contained.empty()
  • dom-3: 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: 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: If a resource is contained in another resource, it SHALL NOT have a security label
    contained.meta.security.empty()
  • dom-6: A resource should have narrative for robust management
    text.`div`.exists()
Mappings
  • rim: Entity. Role, or Act
  • workflow: Event
  • rim: ControlAct[isNormalAct() and subsumes(CACT, classCode) and moodCode=EVN]
  • w3c.prov: Activity
  • EHM: Händelse
Provenance.id
DefinitionThe logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.
Cardinality0...1
Typestring
Must SupportTrue
SummaryTrue
Comments

The only time that a resource does not have an id is when it is being submitted to the server using a create operation.

Mappings
  • EHM: Händelse-id
Provenance.meta
DefinitionThe 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.
Cardinality0...1
TypeMeta
SummaryTrue
Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Provenance.implicitRules
DefinitionA 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.
Cardinality0...1
Typeuri
ModifierTrue
SummaryTrue
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.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Provenance.language
DefinitionThe base language in which the resource is written.
Cardinality0...1
Typecode
Binding

A human language.

CommonLanguages (preferred)
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).

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Provenance.text
DefinitionA human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.
Cardinality0...1
TypeNarrative
Aliasnarrative, html, xhtml, display
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.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Mappings
  • rim: Act.text?
Provenance.contained
DefinitionThese 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.
Cardinality0...*
TypeResource
Aliasinline resources, anonymous resources, contained resources
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.

Mappings
  • rim: N/A
Provenance.extension
DefinitionMay 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.
Cardinality0...*
TypeExtension
Aliasextensions, user content
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.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
  • ext-1: Must have either extensions or value[x], not both
    extension.exists() != value.exists()
Mappings
  • rim: N/A
Provenance.modifierExtension
DefinitionMay 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).
Cardinality0...*
TypeExtension
ModifierTrue
Aliasextensions, user content
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.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
  • ext-1: Must have either extensions or value[x], not both
    extension.exists() != value.exists()
Mappings
  • rim: N/A
Provenance.target
DefinitionThe Reference(s) that were generated or updated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity. The Reference is set by the Swedish eHealth Agency to the resource in the body of the request containing the X-Provenance header, and in some cases the target may also point to additional affected resources .
Cardinality1...*
TypeReference(NLLMedicationRequest | NLLMedicationDispense | NLLMultiDoseDispConsent | NLLMultiDoseDispensingBasis | NLLDispensePaperPrescription | NLLDataLock | NLLAccessConsent)
Must SupportTrue
SummaryTrue
Comments

Target references are usually version specific, but might not be, if a version has not been assigned or if the provenance information is part of the set of resources being maintained (i.e. a document). When using the RESTful API, the identity of the resource might not be known (especially not the version specific one); the client may either submit the resource first, and then the provenance, or it may submit both using a single transaction. See the notes on transaction for further discussion.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Mappings
  • w5: FiveWs.what[x]
  • rim: ./outboundRelationship[isNormalActRelationship() and typeCode=SUBJ]/target OR ./participation[isNormalParticipation() and typeCode=SBJ]/role OR ./participation[isNormalParticipation() and typeCode=SBJ]/role[isNormalRole()]/player
  • fhirauditevent: AuditEvent.entity.reference
  • w3c.prov: Entity Created/Updated
  • EHM: Resursreferenser
  • EHM: Referens till spärr
Provenance.occurred[x]
DefinitionThe period during which the activity occurred.
Cardinality0...1
TypedateTime
Comments

This value is set by the system to reflect the date and time when the request was received

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Mappings
  • workflow: Event.occurred[x]
  • w5: FiveWs.done[x]
  • rim: ./effectiveTime[type=IVL_TS]
  • w3c.prov: Activity.startTime & Activity.endTime
  • EHM: Tidpunkt
Provenance.recorded
DefinitionThe instant of time at which the activity was recorded by the Swedish eHealth Agency.
Cardinality1...1
Typeinstant
Must SupportTrue
SummaryTrue
Comments

This can be a little different from the time stamp on the resource if there is a delay between recording the event and updating the provenance and target resource.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Mappings
  • w5: FiveWs.recorded
  • rim: unique(./participation[isNormalParticipation() and typeCode=AUT]/time[type=TS])
  • fhirauditevent: AuditEvent.recorded
  • w3c.prov: Activity.when
  • EHM: Händelsetidpunkt
Provenance.policy
DefinitionPolicy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.
Cardinality0...*
Typeuri
Comments

For example: Where an OAuth token authorizes, the unique identifier from the OAuth token is placed into the policy element Where a policy engine (e.g. XACML) holds policy logic, the unique policy identifier is placed into the policy element.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Mappings
  • rim: ./inboundRelationship[isNormalActRelationship() and typeCode="SUBJ"]/source[isNormalAct and subsumes(POLICY, classCode) and moodCode=EVN]/text[typeCode='ED'/tel
  • fhirauditevent: AuditEvent.agent.policy
Provenance.location
DefinitionWhere the activity occurred, if relevant.
Cardinality0...1
TypeReference(Location)
Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Mappings
  • workflow: Event.location
  • w5: FiveWs.where[x]
  • rim: unique(./participation[isNormalParticipation() and typeCode=LOC]/role[isNormalRole() and subsumes(SDLOC, classCode)]/player[isNormalEntity and classCode="LOC" and determinerCode="INST"]
  • fhirauditevent: AuditEvent.agent.location
  • w3c.prov: Activity.location
Provenance.reason
DefinitionThe reason for the change.
For prescriptions, codes can be used to describe either a reason for change or a reason for cancellation. For other scenarios regarding prescriptions, only the text element is allowed (in combination with the code OTH). For all scenarios regarding medication dispense, only the text element is allowed. For all scenarios regarding Consents (NLLMultiDoseDispConsent (sv Dossamtycke), NLLAccessConsent (sv. Åtkomstsamtycke)), NLLMultiDoseDispensingBasis (sv Dosunderlag) and NLLDataLock (sv Spärr) no reason is allowed.
Cardinality0...1
TypeCodeableConcept
Binding

The reason the activity took place.

http://electronichealth.se/fhir/ValueSet/nll-reason-for-provenance (extensible)
Must SupportTrue
Comments

_

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Mappings
  • workflow: Event.reasonCode
  • w5: FiveWs.why[x]
  • rim: unique(./reasonCode)
  • fhirauditevent: AuditEvent.purposeOfEvent
  • w3c.prov: Activity.Activity
  • EHM: Händelseorsak
Provenance.reason.id
DefinitionUnique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
Cardinality0...1
Typestring
Mappings
  • rim: n/a
Provenance.reason.extension
DefinitionMay 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.
Cardinality0...*
TypeExtension
Aliasextensions, user content
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.

SlicingUnordered, Open, by url(Value)
Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
  • ext-1: Must have either extensions or value[x], not both
    extension.exists() != value.exists()
Mappings
  • rim: n/a
Provenance.reason.coding
DefinitionA reference to a code defined by a terminology system.
Cardinality0...1
TypeCoding
Must SupportTrue
SummaryTrue
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.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Mappings
  • v2: C*E.1-8, C*E.10-22
  • rim: union(., ./translation)
  • orim: fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding
Provenance.reason.coding.id
DefinitionUnique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
Cardinality0...1
Typestring
Mappings
  • rim: n/a
Provenance.reason.coding.extension
DefinitionMay 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.
Cardinality0...*
TypeExtension
Aliasextensions, user content
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.

SlicingUnordered, Open, by url(Value)
Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
  • ext-1: Must have either extensions or value[x], not both
    extension.exists() != value.exists()
Mappings
  • rim: n/a
Provenance.reason.coding.system
DefinitionThe identification of the code system that defines the meaning of the symbol in the code.
Cardinality0...1
Typeuri
Must SupportTrue
SummaryTrue
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.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Mappings
  • v2: C*E.3
  • rim: ./codeSystem
  • orim: fhir:Coding.system rdfs:subPropertyOf dt:CDCoding.codeSystem
Provenance.reason.coding.version
DefinitionThe 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.
Cardinality0...1
Typestring
Must SupportTrue
SummaryTrue
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.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Mappings
  • v2: C*E.7
  • rim: ./codeSystemVersion
  • orim: fhir:Coding.version rdfs:subPropertyOf dt:CDCoding.codeSystemVersion
Provenance.reason.coding.code
DefinitionA 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).
Cardinality1...1
Typecode
Must SupportTrue
SummaryTrue
Requirements

Need to refer to a particular code in the system.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Mappings
  • v2: C*E.1
  • rim: ./code
  • orim: fhir:Coding.code rdfs:subPropertyOf dt:CDCoding.code
Provenance.reason.coding.display
DefinitionA representation of the meaning of the code in the system, following the rules of the system.
Cardinality0...1
Typestring
SummaryTrue
Requirements

Need to be able to carry a human-readable meaning of the code for readers that do not know the system.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Mappings
  • v2: C*E.2 - but note this is not well followed
  • rim: CV.displayName
  • orim: fhir:Coding.display rdfs:subPropertyOf dt:CDCoding.displayName
Provenance.reason.coding.userSelected
DefinitionIndicates that this coding was chosen by a user directly - e.g. off a pick list of available items (codes or displays).
Cardinality0...1
Typeboolean
SummaryTrue
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.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Mappings
  • v2: Sometimes implied by being first
  • rim: CD.codingRationale
  • orim: fhir:Coding.userSelected fhir:mapsTo dt:CDCoding.codingRationale. fhir:Coding.userSelected fhir:hasMap fhir:Coding.userSelected.map. fhir:Coding.userSelected.map a fhir:Map; fhir:target dt:CDCoding.codingRationale. fhir:Coding.userSelected\#true a [ fhir:source "true"; fhir:target dt:CDCoding.codingRationale\#O ]
Provenance.reason.text
DefinitionPlain text representation of the reason that the activity was taking place. Mandatory when the code "OTH" (other) is used. Can be used for all scenarios regarding prescriptions and dispenses that does not require a code.
Cardinality0...1
Typestring
Must SupportTrue
SummaryTrue
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

Maximum string length: 256 For reasons related to dispensens for paper prescriptions the maximum string length is: 50

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Mappings
  • v2: C*E.9. But note many systems use C*E.2 for this
  • rim: ./originalText[mediaType/code="text/plain"]/data
  • orim: fhir:CodeableConcept.text rdfs:subPropertyOf dt:CD.originalText
  • EHM: Beskrivning händelseorsak
Provenance.activity
DefinitionThis type describes the activity that occurred. This could both be a medication list activity type concerning a MedicationRequest for example, or a data lock activity type.
Cardinality1...1
TypeCodeableConcept
Binding

The activity that took place.

provenance-activity-types (required)
Must SupportTrue
Comments

_

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Mappings
  • workflow: Event.code
  • w5: FiveWs.why[x]
  • rim: Act.code
  • w3c.prov: Activity.Activity
  • EHM: Händelsetyp
Provenance.activity.id
DefinitionUnique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
Cardinality0...1
Typestring
Mappings
  • rim: n/a
Provenance.activity.extension
DefinitionMay 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.
Cardinality0...*
TypeExtension
Aliasextensions, user content
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.

SlicingUnordered, Open, by url(Value)
Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
  • ext-1: Must have either extensions or value[x], not both
    extension.exists() != value.exists()
Mappings
  • rim: n/a
Provenance.activity.coding
DefinitionA reference to a code defined by a terminology system.
Cardinality1...1
TypeCoding
Must SupportTrue
SummaryTrue
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.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Mappings
  • v2: C*E.1-8, C*E.10-22
  • rim: union(., ./translation)
  • orim: fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding
Provenance.activity.coding.id
DefinitionUnique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
Cardinality0...1
Typestring
Mappings
  • rim: n/a
Provenance.activity.coding.extension
DefinitionMay 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.
Cardinality0...*
TypeExtension
Aliasextensions, user content
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.

SlicingUnordered, Open, by url(Value)
Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
  • ext-1: Must have either extensions or value[x], not both
    extension.exists() != value.exists()
Mappings
  • rim: n/a
Provenance.activity.coding.system
DefinitionThe identification of the code system that defines the meaning of the symbol in the code.
Cardinality0...1
Typeuri
Must SupportTrue
SummaryTrue
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.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Mappings
  • v2: C*E.3
  • rim: ./codeSystem
  • orim: fhir:Coding.system rdfs:subPropertyOf dt:CDCoding.codeSystem
Provenance.activity.coding.version
DefinitionThe 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.
Cardinality0...1
Typestring
Must SupportTrue
SummaryTrue
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.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Mappings
  • v2: C*E.7
  • rim: ./codeSystemVersion
  • orim: fhir:Coding.version rdfs:subPropertyOf dt:CDCoding.codeSystemVersion
Provenance.activity.coding.code
DefinitionA 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).
Cardinality1...1
Typecode
Must SupportTrue
SummaryTrue
Requirements

Need to refer to a particular code in the system.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Mappings
  • v2: C*E.1
  • rim: ./code
  • orim: fhir:Coding.code rdfs:subPropertyOf dt:CDCoding.code
Provenance.activity.coding.display
DefinitionA representation of the meaning of the code in the system, following the rules of the system.
Cardinality0...1
Typestring
SummaryTrue
Requirements

Need to be able to carry a human-readable meaning of the code for readers that do not know the system.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Mappings
  • v2: C*E.2 - but note this is not well followed
  • rim: CV.displayName
  • orim: fhir:Coding.display rdfs:subPropertyOf dt:CDCoding.displayName
Provenance.activity.coding.userSelected
DefinitionIndicates that this coding was chosen by a user directly - e.g. off a pick list of available items (codes or displays).
Cardinality0...1
Typeboolean
SummaryTrue
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.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Mappings
  • v2: Sometimes implied by being first
  • rim: CD.codingRationale
  • orim: fhir:Coding.userSelected fhir:mapsTo dt:CDCoding.codingRationale. fhir:Coding.userSelected fhir:hasMap fhir:Coding.userSelected.map. fhir:Coding.userSelected.map a fhir:Map; fhir:target dt:CDCoding.codingRationale. fhir:Coding.userSelected\#true a [ fhir:source "true"; fhir:target dt:CDCoding.codingRationale\#O ]
Provenance.activity.text
DefinitionA 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.
Cardinality0...1
Typestring
SummaryTrue
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.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Mappings
  • v2: C*E.9. But note many systems use C*E.2 for this
  • rim: ./originalText[mediaType/code="text/plain"]/data
  • orim: fhir:CodeableConcept.text rdfs:subPropertyOf dt:CD.originalText
Provenance.agent
DefinitionAllowed actors are: enterer (sv: utförare) and author (sv: uppdragsgivare). Enterer MUST always be present, author CAN be present in case a practitioner is performing a change on behalf of someone
Cardinality1...*
TypeBackboneElement
Must SupportTrue
Requirements

_

Comments

Several agents may be associated (i.e. has some responsibility for an activity) with an activity and vice-versa.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Mappings
  • workflow: Event.performer
  • w5: FiveWs.who
  • rim: ./participation[isNormalParticipation()] OR ./outboundRelationship[isNormalActRelationship() and typeCode='DRIV']
  • fhirauditevent: AuditEvent.agent
  • w3c.prov: Agent
  • EHM: Uppdragsgivare
  • EHM: Utförare
Provenance.agent.id
DefinitionUnique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
Cardinality0...1
Typestring
Mappings
  • rim: n/a
Provenance.agent.extension
DefinitionMay 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.
Cardinality0...*
TypeExtension
Aliasextensions, user content
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.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
  • ext-1: Must have either extensions or value[x], not both
    extension.exists() != value.exists()
Mappings
  • rim: n/a
Provenance.agent.modifierExtension
DefinitionMay 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).
Cardinality0...*
TypeExtension
ModifierTrue
SummaryTrue
Aliasextensions, user content, modifiers
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.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
  • ext-1: Must have either extensions or value[x], not both
    extension.exists() != value.exists()
Mappings
  • rim: N/A
Provenance.agent.type
DefinitionThe participation the agent had with respect to the activity.
Cardinality1...1
TypeCodeableConcept
Binding

The type of participation that a provenance agent played with respect to the activity.

provenance-participant-types (extensible)
Must SupportTrue
SummaryTrue
Comments

_

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Mappings
  • workflow: Event.performer.function
  • rim: .role
  • fhirauditevent: AuditEvent.agent.type
  • w3c.prov: Agent.Attribution
Provenance.agent.role
DefinitionThe function of the agent with respect to the activity. The security role enabling the agent with respect to the activity.
Cardinality0...*
TypeCodeableConcept
Binding

The role that a provenance agent played with respect to the activity.

SecurityRoleType (example)
Comments

For example: doctor, nurse, clerk, etc.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Mappings
  • rim: .typecode
  • fhirauditevent: AuditEvent.agent.role
Provenance.agent.who
DefinitionThe individual that participated in the event. NB! Only a DataLock Provenance can contain a reference to a Patient resource.
Cardinality1...1
TypeReference(NLLPractitioner | NLLPatient)
Must SupportTrue
SummaryTrue
Comments

whoIdentity should be used when the agent is not a Resource type.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Mappings
  • workflow: Event.performer.actor
  • w5: FiveWs.actor
  • rim: .id
  • EHM: Uppdragsgivare / Utförare
Provenance.agent.onBehalfOf
DefinitionThe individual, device, or organization for whom the change was made.
Cardinality0...1
TypeReference(Practitioner | PractitionerRole | RelatedPerson | Patient | Device | Organization)
Comments

onBehalfOfIdentity should be used when the agent is not a Resource type.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Mappings
  • rim: Person, Practitioner, Organization, Device :* .role [classCode = RoleClassMutualRelationship; role.code and * .scopes[Role](classCode=IDENT) and *.plays [Role.Code]
Provenance.entity
DefinitionAn entity used in this activity.
Cardinality0...*
TypeBackboneElement
Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Mappings
  • rim: ./subjectOf
  • fhirauditevent: AuditEvent.entity
  • w3c.prov: Entity
Provenance.entity.id
DefinitionUnique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
Cardinality0...1
Typestring
Mappings
  • rim: n/a
Provenance.entity.extension
DefinitionMay 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.
Cardinality0...*
TypeExtension
Aliasextensions, user content
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.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
  • ext-1: Must have either extensions or value[x], not both
    extension.exists() != value.exists()
Mappings
  • rim: n/a
Provenance.entity.modifierExtension
DefinitionMay 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).
Cardinality0...*
TypeExtension
ModifierTrue
SummaryTrue
Aliasextensions, user content, modifiers
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.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
  • ext-1: Must have either extensions or value[x], not both
    extension.exists() != value.exists()
Mappings
  • rim: N/A
Provenance.entity.role
DefinitionHow the entity was used during the activity.
Cardinality1...1
Typecode
Binding

How an entity was used in an activity.

ProvenanceEntityRole (required)
SummaryTrue
Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Mappings
  • rim: ./typeCode
  • fhirauditevent: AuditEvent.entity.lifecycle
  • w3c.prov: Entity.role
Provenance.entity.what
DefinitionIdentity of the Entity used. May be a logical or physical uri and maybe absolute or relative.
Cardinality1...1
TypeReference(Resource)
SummaryTrue
Comments

whatIdentity should be used for entities that are not a Resource type.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Mappings
  • rim: ./text/reference
  • fhirauditevent: AuditEvent.entity.reference
  • w3c.prov: Entity.Identity
Provenance.entity.agent
DefinitionThe entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity.
Cardinality0...*
Typesee (agent)
Comments

A usecase where one Provenance.entity.agent is used where the Entity that was used in the creation/updating of the Target, is not in the context of the same custodianship as the Target, and thus the meaning of Provenance.entity.agent is to say that the entity referenced is managed elsewhere and that this Agent provided access to it. This would be similar to where the Entity being referenced is managed outside FHIR, such as through HL7 v2, v3, or XDS. This might be where the Entity being referenced is managed in another FHIR resource server. Thus it explains the Provenance of that Entity's use in the context of this Provenance activity.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Mappings
  • rim: ./author/role
Provenance.signature
DefinitionA digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated.
Cardinality0...*
TypeSignature
Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() or (children().count() > id.count())
Mappings
  • rim: ./signatureText
<StructureDefinition xmlns="http://hl7.org/fhir">
    <url value="http://electronichealth.se/fhir/StructureDefinition/NLLProvenance" />
    <version value="2.0.0" />
    <name value="NLLProvenance" />
    <status value="active" />
    <experimental value="false" />
    <date value="2024-12-17" />
    <publisher value="Swedish eHealth Agency" />
    <description value="A profile of Provenance that is compatible with all scenarios in the Swedish National Medication List." />
    <fhirVersion value="4.0.1" />
    <mapping>
        <identity value="EHM" />
        <name value="E-h&#228;lsomyndigheten concept" />
    </mapping>
    <kind value="resource" />
    <abstract value="false" />
    <type value="Provenance" />
    <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Provenance" />
    <derivation value="constraint" />
    <differential>
        <element id="Provenance">
            <path value="Provenance" />
            <short value="When a change is made in the patient&#180;s medication list a provenance provides information about who, what, when and where from the change is made." />
            <definition value="NLLProvenance describes a change that has been made on a resource affecting a patient medications list, e.g. a MedicationRequest, MedicationDispense or resource related to multi dose dispensing (sv: dosunderlag, dossamtycke) or a change affecting a data lock (sv sp&#228;rr). The change describes What - in the form of which resource is the target in combination with a reason and activity. It describes by Who - in the form of agent and it describes When it occurred.\nA Provenance resource is created fron the X-Provenance header wich is mandatory in a number of scenarios." />
            <mapping>
                <identity value="EHM" />
                <map value="H&#228;ndelse" />
            </mapping>
        </element>
        <element id="Provenance.id">
            <path value="Provenance.id" />
            <mustSupport value="true" />
            <mapping>
                <identity value="EHM" />
                <map value="H&#228;ndelse-id" />
            </mapping>
        </element>
        <element id="Provenance.target">
            <path value="Provenance.target" />
            <definition value="The Reference(s) that were generated or updated by  the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.\nThe Reference is set by the Swedish eHealth Agency to the resource in the body of the request containing the X-Provenance header, and in some cases the target may also point to additional affected resources ." />
            <type>
                <code value="Reference" />
                <targetProfile value="http://electronichealth.se/fhir/StructureDefinition/NLLMedicationRequest" />
                <targetProfile value="http://electronichealth.se/fhir/StructureDefinition/NLLMedicationDispense" />
                <targetProfile value="http://electronichealth.se/fhir/StructureDefinition/NLLMultiDoseDispConsent" />
                <targetProfile value="http://electronichealth.se/fhir/StructureDefinition/NLLMultiDoseDispensingBasis" />
                <targetProfile value="http://electronichealth.se/fhir/StructureDefinition/NLLDispensePaperPrescription" />
                <targetProfile value="http://electronichealth.se/fhir/StructureDefinition/NLLDataLock" />
                <targetProfile value="http://electronichealth.se/fhir/StructureDefinition/NLLAccessConsent" />
                <aggregation value="referenced" />
            </type>
            <mustSupport value="true" />
            <mapping>
                <identity value="EHM" />
                <map value="Resursreferenser" />
            </mapping>
            <mapping>
                <identity value="EHM" />
                <map value="Referens till sp&#228;rr" />
            </mapping>
        </element>
        <element id="Provenance.occurred[x]">
            <path value="Provenance.occurred[x]" />
            <comment value="This value is set by the system to reflect the date and time when the request was received" />
            <type>
                <code value="dateTime" />
            </type>
            <mapping>
                <identity value="EHM" />
                <map value="Tidpunkt" />
            </mapping>
        </element>
        <element id="Provenance.recorded">
            <path value="Provenance.recorded" />
            <definition value="The instant of time at which the activity was recorded by the Swedish eHealth Agency." />
            <mustSupport value="true" />
            <mapping>
                <identity value="EHM" />
                <map value="H&#228;ndelsetidpunkt" />
            </mapping>
        </element>
        <element id="Provenance.reason">
            <path value="Provenance.reason" />
            <definition value="The reason for the change. &lt;br&gt;\nFor prescriptions, codes can be used to describe either a reason for change or a reason for cancellation.\nFor other scenarios regarding prescriptions, only the text element is allowed (in combination with the code OTH).\nFor all scenarios regarding medication dispense, only the text element is allowed.\nFor all scenarios regarding Consents (NLLMultiDoseDispConsent (sv Dossamtycke), NLLAccessConsent (sv. &#197;tkomstsamtycke)), NLLMultiDoseDispensingBasis (sv Dosunderlag) and NLLDataLock (sv Sp&#228;rr) no reason is allowed." />
            <comment value="_" />
            <max value="1" />
            <mustSupport value="true" />
            <binding>
                <strength value="extensible" />
                <valueSet value="http://electronichealth.se/fhir/ValueSet/nll-reason-for-provenance" />
            </binding>
            <mapping>
                <identity value="EHM" />
                <map value="H&#228;ndelseorsak" />
            </mapping>
        </element>
        <element id="Provenance.reason.coding">
            <path value="Provenance.reason.coding" />
            <max value="1" />
            <mustSupport value="true" />
        </element>
        <element id="Provenance.reason.coding.system">
            <path value="Provenance.reason.coding.system" />
            <mustSupport value="true" />
        </element>
        <element id="Provenance.reason.coding.version">
            <path value="Provenance.reason.coding.version" />
            <mustSupport value="true" />
        </element>
        <element id="Provenance.reason.coding.code">
            <path value="Provenance.reason.coding.code" />
            <min value="1" />
            <mustSupport value="true" />
        </element>
        <element id="Provenance.reason.text">
            <path value="Provenance.reason.text" />
            <definition value="Plain text representation of the reason that the activity was taking place. \nMandatory when the code &quot;OTH&quot; (other) is used.\nCan be used for all scenarios regarding prescriptions and dispenses that does not require a code." />
            <comment value="Maximum string length: 256\nFor reasons related to dispensens for paper prescriptions the maximum string length is: 50" />
            <mustSupport value="true" />
            <mapping>
                <identity value="EHM" />
                <map value="Beskrivning h&#228;ndelseorsak" />
            </mapping>
        </element>
        <element id="Provenance.activity">
            <path value="Provenance.activity" />
            <definition value="This type describes the activity that occurred. This could both be a medication list activity type concerning a MedicationRequest for example, or a data lock activity type." />
            <comment value="_" />
            <min value="1" />
            <mustSupport value="true" />
            <binding>
                <strength value="required" />
                <valueSet value="http://ehalsomyndigheten.se/fhir/ValueSet/provenance-activity-types" />
            </binding>
            <mapping>
                <identity value="EHM" />
                <map value="H&#228;ndelsetyp" />
            </mapping>
        </element>
        <element id="Provenance.activity.coding">
            <path value="Provenance.activity.coding" />
            <min value="1" />
            <max value="1" />
            <mustSupport value="true" />
        </element>
        <element id="Provenance.activity.coding.system">
            <path value="Provenance.activity.coding.system" />
            <mustSupport value="true" />
        </element>
        <element id="Provenance.activity.coding.version">
            <path value="Provenance.activity.coding.version" />
            <mustSupport value="true" />
        </element>
        <element id="Provenance.activity.coding.code">
            <path value="Provenance.activity.coding.code" />
            <min value="1" />
            <mustSupport value="true" />
        </element>
        <element id="Provenance.agent">
            <path value="Provenance.agent" />
            <definition value="Allowed actors are: enterer (sv: utf&#246;rare) and author (sv: uppdragsgivare). Enterer MUST always be present, author CAN be present in case a practitioner is performing a change on behalf of someone" />
            <requirements value="_" />
            <mustSupport value="true" />
            <mapping>
                <identity value="EHM" />
                <map value="Uppdragsgivare" />
            </mapping>
            <mapping>
                <identity value="EHM" />
                <map value="Utf&#246;rare" />
            </mapping>
        </element>
        <element id="Provenance.agent.type">
            <path value="Provenance.agent.type" />
            <comment value="_" />
            <min value="1" />
            <mustSupport value="true" />
            <binding>
                <strength value="extensible" />
                <valueSet value="http://electronichealth.se/fhir/ValueSet/provenance-participant-types" />
            </binding>
        </element>
        <element id="Provenance.agent.who">
            <path value="Provenance.agent.who" />
            <definition value="The individual that participated in the event. NB! Only a DataLock Provenance can contain a reference to a Patient resource." />
            <type>
                <code value="Reference" />
                <targetProfile value="http://electronichealth.se/fhir/StructureDefinition/NLLPractitioner" />
                <targetProfile value="http://electronichealth.se/fhir/StructureDefinition/NLLPatient" />
                <aggregation value="contained" />
                <aggregation value="referenced" />
            </type>
            <mustSupport value="true" />
            <mapping>
                <identity value="EHM" />
                <map value="Uppdragsgivare / Utf&#246;rare" />
                <comment value="Depending on type, this is the practitioner acting as the performer (sv: utf&#246;rare) or author (sv: uppdragsgivare)" />
            </mapping>
        </element>
    </differential>
</StructureDefinition>
{
    "resourceType": "StructureDefinition",
    "url": "http://electronichealth.se/fhir/StructureDefinition/NLLProvenance",
    "version": "2.0.0",
    "name": "NLLProvenance",
    "status": "active",
    "experimental": false,
    "date": "2024-12-17",
    "publisher": "Swedish eHealth Agency",
    "description": "A profile of Provenance that is compatible with all scenarios in the Swedish National Medication List.",
    "fhirVersion": "4.0.1",
    "mapping":  [
        {
            "identity": "EHM",
            "name": "E-hälsomyndigheten concept"
        }
    ],
    "kind": "resource",
    "abstract": false,
    "type": "Provenance",
    "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Provenance",
    "derivation": "constraint",
    "differential": {
        "element":  [
            {
                "id": "Provenance",
                "path": "Provenance",
                "short": "When a change is made in the patient´s medication list a provenance provides information about who, what, when and where from the change is made.",
                "definition": "NLLProvenance describes a change that has been made on a resource affecting a patient medications list, e.g. a MedicationRequest, MedicationDispense or resource related to multi dose dispensing (sv: dosunderlag, dossamtycke) or a change affecting a data lock (sv spärr). The change describes What - in the form of which resource is the target in combination with a reason and activity. It describes by Who - in the form of agent and it describes When it occurred.\nA Provenance resource is created fron the X-Provenance header wich is mandatory in a number of scenarios.",
                "mapping":  [
                    {
                        "identity": "EHM",
                        "map": "Händelse"
                    }
                ]
            },
            {
                "id": "Provenance.id",
                "path": "Provenance.id",
                "mustSupport": true,
                "mapping":  [
                    {
                        "identity": "EHM",
                        "map": "Händelse-id"
                    }
                ]
            },
            {
                "id": "Provenance.target",
                "path": "Provenance.target",
                "definition": "The Reference(s) that were generated or updated by  the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.\nThe Reference is set by the Swedish eHealth Agency to the resource in the body of the request containing the X-Provenance header, and in some cases the target may also point to additional affected resources .",
                "type":  [
                    {
                        "code": "Reference",
                        "targetProfile":  [
                            "http://electronichealth.se/fhir/StructureDefinition/NLLMedicationRequest",
                            "http://electronichealth.se/fhir/StructureDefinition/NLLMedicationDispense",
                            "http://electronichealth.se/fhir/StructureDefinition/NLLMultiDoseDispConsent",
                            "http://electronichealth.se/fhir/StructureDefinition/NLLMultiDoseDispensingBasis",
                            "http://electronichealth.se/fhir/StructureDefinition/NLLDispensePaperPrescription",
                            "http://electronichealth.se/fhir/StructureDefinition/NLLDataLock",
                            "http://electronichealth.se/fhir/StructureDefinition/NLLAccessConsent"
                        ],
                        "aggregation":  [
                            "referenced"
                        ]
                    }
                ],
                "mustSupport": true,
                "mapping":  [
                    {
                        "identity": "EHM",
                        "map": "Resursreferenser"
                    },
                    {
                        "identity": "EHM",
                        "map": "Referens till spärr"
                    }
                ]
            },
            {
                "id": "Provenance.occurred[x]",
                "path": "Provenance.occurred[x]",
                "comment": "This value is set by the system to reflect the date and time when the request was received",
                "type":  [
                    {
                        "code": "dateTime"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "EHM",
                        "map": "Tidpunkt"
                    }
                ]
            },
            {
                "id": "Provenance.recorded",
                "path": "Provenance.recorded",
                "definition": "The instant of time at which the activity was recorded by the Swedish eHealth Agency.",
                "mustSupport": true,
                "mapping":  [
                    {
                        "identity": "EHM",
                        "map": "Händelsetidpunkt"
                    }
                ]
            },
            {
                "id": "Provenance.reason",
                "path": "Provenance.reason",
                "definition": "The reason for the change. <br>\nFor prescriptions, codes can be used to describe either a reason for change or a reason for cancellation.\nFor other scenarios regarding prescriptions, only the text element is allowed (in combination with the code OTH).\nFor all scenarios regarding medication dispense, only the text element is allowed.\nFor all scenarios regarding Consents (NLLMultiDoseDispConsent (sv Dossamtycke), NLLAccessConsent (sv. Åtkomstsamtycke)), NLLMultiDoseDispensingBasis (sv Dosunderlag) and NLLDataLock (sv Spärr) no reason is allowed.",
                "comment": "_",
                "max": "1",
                "mustSupport": true,
                "binding": {
                    "strength": "extensible",
                    "valueSet": "http://electronichealth.se/fhir/ValueSet/nll-reason-for-provenance"
                },
                "mapping":  [
                    {
                        "identity": "EHM",
                        "map": "Händelseorsak"
                    }
                ]
            },
            {
                "id": "Provenance.reason.coding",
                "path": "Provenance.reason.coding",
                "max": "1",
                "mustSupport": true
            },
            {
                "id": "Provenance.reason.coding.system",
                "path": "Provenance.reason.coding.system",
                "mustSupport": true
            },
            {
                "id": "Provenance.reason.coding.version",
                "path": "Provenance.reason.coding.version",
                "mustSupport": true
            },
            {
                "id": "Provenance.reason.coding.code",
                "path": "Provenance.reason.coding.code",
                "min": 1,
                "mustSupport": true
            },
            {
                "id": "Provenance.reason.text",
                "path": "Provenance.reason.text",
                "definition": "Plain text representation of the reason that the activity was taking place. \nMandatory when the code \"OTH\" (other) is used.\nCan be used for all scenarios regarding prescriptions and dispenses that does not require a code.",
                "comment": "Maximum string length: 256\nFor reasons related to dispensens for paper prescriptions the maximum string length is: 50",
                "mustSupport": true,
                "mapping":  [
                    {
                        "identity": "EHM",
                        "map": "Beskrivning händelseorsak"
                    }
                ]
            },
            {
                "id": "Provenance.activity",
                "path": "Provenance.activity",
                "definition": "This type describes the activity that occurred. This could both be a medication list activity type concerning a MedicationRequest for example, or a data lock activity type.",
                "comment": "_",
                "min": 1,
                "mustSupport": true,
                "binding": {
                    "strength": "required",
                    "valueSet": "http://ehalsomyndigheten.se/fhir/ValueSet/provenance-activity-types"
                },
                "mapping":  [
                    {
                        "identity": "EHM",
                        "map": "Händelsetyp"
                    }
                ]
            },
            {
                "id": "Provenance.activity.coding",
                "path": "Provenance.activity.coding",
                "min": 1,
                "max": "1",
                "mustSupport": true
            },
            {
                "id": "Provenance.activity.coding.system",
                "path": "Provenance.activity.coding.system",
                "mustSupport": true
            },
            {
                "id": "Provenance.activity.coding.version",
                "path": "Provenance.activity.coding.version",
                "mustSupport": true
            },
            {
                "id": "Provenance.activity.coding.code",
                "path": "Provenance.activity.coding.code",
                "min": 1,
                "mustSupport": true
            },
            {
                "id": "Provenance.agent",
                "path": "Provenance.agent",
                "definition": "Allowed actors are: enterer (sv: utförare) and author (sv: uppdragsgivare). Enterer MUST always be present, author CAN be present in case a practitioner is performing a change on behalf of someone",
                "requirements": "_",
                "mustSupport": true,
                "mapping":  [
                    {
                        "identity": "EHM",
                        "map": "Uppdragsgivare"
                    },
                    {
                        "identity": "EHM",
                        "map": "Utförare"
                    }
                ]
            },
            {
                "id": "Provenance.agent.type",
                "path": "Provenance.agent.type",
                "comment": "_",
                "min": 1,
                "mustSupport": true,
                "binding": {
                    "strength": "extensible",
                    "valueSet": "http://electronichealth.se/fhir/ValueSet/provenance-participant-types"
                }
            },
            {
                "id": "Provenance.agent.who",
                "path": "Provenance.agent.who",
                "definition": "The individual that participated in the event. NB! Only a DataLock Provenance can contain a reference to a Patient resource.",
                "type":  [
                    {
                        "code": "Reference",
                        "targetProfile":  [
                            "http://electronichealth.se/fhir/StructureDefinition/NLLPractitioner",
                            "http://electronichealth.se/fhir/StructureDefinition/NLLPatient"
                        ],
                        "aggregation":  [
                            "contained",
                            "referenced"
                        ]
                    }
                ],
                "mustSupport": true,
                "mapping":  [
                    {
                        "identity": "EHM",
                        "map": "Uppdragsgivare / Utförare",
                        "comment": "Depending on type, this is the practitioner acting as the performer (sv: utförare) or author (sv: uppdragsgivare)"
                    }
                ]
            }
        ]
    }
}
Provenance..
Provenance.id..
Provenance.targetReference(NLLMedicationRequest | NLLMedicationDispense | NLLMultiDoseDispConsent | NLLMultiDoseDispensingBasis | NLLDispensePaperPrescription | NLLDataLock | NLLAccessConsent)..
Provenance.occurred[x]dateTime..
Provenance.recorded..
Provenance.reason..1
Provenance.reason.coding..1
Provenance.reason.coding.system..
Provenance.reason.coding.version..
Provenance.reason.coding.code1..
Provenance.reason.text..
Provenance.activity1..
Provenance.activity.coding1..1
Provenance.activity.coding.system..
Provenance.activity.coding.version..
Provenance.activity.coding.code1..
Provenance.agent..
Provenance.agent.type1..
Provenance.agent.whoReference(NLLPractitioner | NLLPatient)..

Contained resources

References to other resources are based on contained resources in the following cases.

Element Resource Case
agent.who Practitioner Allways

For more information about references and contained resources see Resources - References.

Details

Description of all elements can be found here, Element descriptions.

Mapping of FHIR element names to the National Medication List names can be found here, Element language mappings.

Super provenance and sub provenances

The profile NLLProvenance is a super type compatible with all other sub-profiles used in the National Medication List. NLLProvenance can therefore be used as a replacement of all other provenance types.

The value sets used in NLLProvenance contain all codes for all scenarios in the National Medication List, and the references support all scenarios. To describe valid elements and combinations of data for specific scenarios a number of specialized sub-profiles are available.

See the following pages for more information about how to use the Provenance resource in scenarios where it is used together with information about the supporting sub-profiles.

Practitioner

The Provenance structure must conform to the type of activity it describes and who is doing it. In some use cases a practitioner is provided in the HTTP body, e.g. an agent is defined as requester in a MedicationRequest, as well as in the Provenance in the HTTP header. It is important that the practitioner is the same in both places in many of those use cases.

Supported operations

HTTP methods

Operation Supported Comment
Search (GET, POST) yes See below for supported search options.
Insert (POST) no
Update (PUT) no
Delete (DEL) no
Operation (GET, POST) no

When interacting with this resource a set of HTTP-headers must be included in the request, see HTTP Header and Authorization.

Query operations

The following query alternatives are available for this resource.

  1. ../Provenance/[id]
  2. ../Provenance?target=[ref]{&activity-type=[code]}

Compartment searches

Supported searches on a compartment. This kind of search returns a bundle with the related resources.

  1. ../Provenance/[id]/MedicationRequest returns all related medication requests.
  2. ../MedicationRequest/[id]/Provenance returns all related provenances.
  3. ../Basic/[id]/Provenance returns all related provenances (data locks and multi dose dispenses).
  4. ../Consent/[id]/Provenance returns all related provenances.
  5. ../MedicationDispense/[id]/Provenance returns all related provenances.

Include & reverse includes

Include and revinclude are not supported by this resource.

For generic information about how to search in FHIR look here.

Search parameters

The table below shows all supported search parameters.

Parameter Description Comment
Provenance/[id] A read based on the logical ID (UUID) of a provenance
../Provenance/<uuid>
Applicable for provenances related to Basic (multidose dispenses and datalock), medication request, medication dispense (not dispense paper prescription) and consent
target Reference to the target resource. Supported targets are MedicationRequest, MedicationDispense, Consent and Basic
..?target=Basic/<uuid>
..?target=MedicationRequest/<uuid>/_history/2
activity-type Type of activity
..&activity-type=REGISTRERA_FORSKRIVNING