eHealth Infrastructure (v2020.8)

StructureDefinition: ehealth-definedquestion

Introduction

The ehealth-definedquestion profile of StructureDefinition represents the concept of a DefinedQuestion. A DefinedQuestion is a standalone representation of a question and possibly its answer options that can be used in one or more Questionnaire resources. Although a Questionnaire can be constructed without being based on any DefinedQuestion, it is expected that a catalogue of DefinedQuestion will emerge over time and the particular DefinedQuestion will be reused in multiple Questionnaire.

The DefinedQuestion concept is based on ideas described in https://www.hl7.org/fhir/stu3/questionnaire.html#2.38.5.4. Whether a DefinedQuestion is referenced in a Questionnaire or not, it is the Questionnaire’s own definition which takes precedence.

Scope and Usage

In the eHealth Infrastructure, a reference to a DefinedQuestion by url in a Questionnaire question is used to enable robust extraction in automated processing rule(s) of answer(s) to that question from corresponding QuestionnaireResponse. An answer in a QuestionnaireResponse is already unambiguously related to a question in a Questionnaire through the question’s linkId. If the same question is used in another Questionnaire it will likely end up with a different linkId in that Questionnaire. By referencing a DefinedQuestion by its url in Questionnaire.item.definition, the same question can be referenced unambiguously in multiple Questionnaire.

Multiple DefinedQuestion with identical url can coexist as long as they have differing business versions in version. This way, different versions of the same question can have different answer options.

When using a DefinedQuestion in a Questionnaire, the Questionnaire.item.definition element must contain the url followed by a pipe and the business version thereby referencing a versioned DefinedQuestion.

An automated processing rule captured in a Library resource can, when extracting answer(s) to the question in a QuestionnaireResponse, choose to search for either the versioned reference or the version-less reference to a DefinedQuestion. The latter can be obtained by disregarding the pipe and business version in the rule logic.

The actual details of the DefinedQuestion’s question and possible answers are described in the ElementDefinition found in either snapshot.element or differential.element.

Formal Views of Profile Content

The official URL for this profile is:

http://ehealth.sundhed.dk/fhir/StructureDefinition/ehealth-definedquestion

This profile builds on StructureDefinition.

This profile was published on Thu Jan 07 13:26:31 UTC 2021 as a draft by null.

Description of Profiles, Differentials, Snapshots, and how the XML and JSON presentations work.

This structure is derived from StructureDefinition

Summary

This structure is derived from StructureDefinition

This structure is derived from StructureDefinition

NameFlagsCard.TypeDescription & Constraintsdoco
.. StructureDefinition I0..*StructureDefinitionStructural Definition
... id Σ0..1idLogical id of this artifact
... meta Σ0..1MetaMetadata about the resource
... implicitRules ?!Σ0..1uriA set of rules under which this content was created
... language 0..1codeLanguage of the resource content
Binding: Common Languages (extensible)
Max Binding: All Languages: A human language.

... text 0..1NarrativeText summary of the resource, for human interpretation
... contained 0..*ResourceContained, inline Resources
... extension 0..*ExtensionAdditional Content defined by implementations
... modifierExtension ?!0..*ExtensionExtensions that cannot be ignored
... url Σ1..1uriLogical URI to reference this structure definition (globally unique)
... identifier Σ0..*IdentifierAdditional identifier for the structure definition
... version Σ0..1stringBusiness version of the structure definition
... name Σ1..1stringName for this structure definition (computer friendly)
... title Σ0..1stringName for this structure definition (human friendly)
... status ?!Σ1..1codedraft | active | retired | unknown
Binding: PublicationStatus (required): The lifecycle status of a Value Set or Concept Map.

... experimental ?!Σ0..1booleanFor testing purposes, not real usage
... date Σ0..1dateTimeDate this was last changed
... publisher Σ0..1stringName of the publisher (organization or individual)
... contact Σ0..*ContactDetailContact details for the publisher
... description 0..1markdownNatural language description of the structure definition
... useContext Σ0..*UsageContextContext the content is intended to support
... jurisdiction Σ0..*CodeableConceptIntended jurisdiction for structure definition (if applicable)
Binding: Jurisdiction ValueSet (extensible): Countries and regions within which this artifact is targeted for use


... purpose 0..1markdownWhy this structure definition is defined
... copyright 0..1markdownUse and/or publishing restrictions
... keyword Σ0..*CodingAssist with indexing and finding
Binding: Structure Definition Codes (example): Codes for the meaning of the defined structure (SNOMED CT and LOINC codes, as an example).


... fhirVersion Σ0..1idFHIR Version this StructureDefinition targets
... mapping I0..*BackboneElementExternal specification that the content is mapped to
sdf-2: Must have at least a name or a uri (or both)
.... id 0..1stringxml:id (or equivalent in JSON)
.... extension 0..*ExtensionAdditional Content defined by implementations
.... modifierExtension ?!Σ0..*ExtensionExtensions that cannot be ignored
.... identity 1..1idInternal id when this mapping is used
.... uri I0..1uriIdentifies what this mapping refers to
.... name I0..1stringNames what this mapping refers to
.... comment 0..1stringVersions, Issues, Scope limitations etc.
... kind Σ1..1codeprimitive-type | complex-type | resource | logical
Binding: StructureDefinitionKind (required): Defines the type of structure that a definition is describing.

... abstract Σ1..1booleanWhether the structure is abstract
... contextType ΣI0..1coderesource | datatype | extension
Binding: ExtensionContext (required): How an extension context is interpreted.

... context ΣI0..*stringWhere the extension can be used in instances
... contextInvariant ΣI0..*stringFHIRPath invariants - when the extension can be used
... type ΣI1..1codeType defined or constrained by this structure
Binding: FHIRDefinedType (extensible): Either a resource or a data type, including logical model types

... baseDefinition ΣI0..1uriDefinition that this type is constrained/specialized from
... derivation Σ0..1codespecialization | constraint - How relates to base definition
Binding: TypeDerivationRule (required): How a type relates to its baseDefinition.

... snapshot I0..1BackboneElementSnapshot view of the structure
sdf-15: The first element in a snapshot has no type
sdf-8: In any snapshot, all the elements must be in the specified type
sdf-3: Each element definition in a snapshot must have a formal definition and cardinalities
.... id 0..1stringxml:id (or equivalent in JSON)
.... extension 0..*ExtensionAdditional Content defined by implementations
.... modifierExtension ?!Σ0..*ExtensionExtensions that cannot be ignored
.... element I1..*ElementDefinitionDefinition of elements in the resource (if no StructureDefinition)
... differential I0..1BackboneElementDifferential view of the structure
sdf-15a: If the first element in a differential has no "." in the path, it has no type
sdf-20: No slicing on the root element
sdf-8a: In any differential, all the elements must be in the specified type
.... id 0..1stringxml:id (or equivalent in JSON)
.... extension 0..*ExtensionAdditional Content defined by implementations
.... modifierExtension ?!Σ0..*ExtensionExtensions that cannot be ignored
.... element 1..*ElementDefinitionDefinition of elements in the resource (if no StructureDefinition)

doco Documentation for this format

This structure is derived from StructureDefinition

Summary

Differential View

This structure is derived from StructureDefinition

Snapshot View

NameFlagsCard.TypeDescription & Constraintsdoco
.. StructureDefinition I0..*StructureDefinitionStructural Definition
... id Σ0..1idLogical id of this artifact
... meta Σ0..1MetaMetadata about the resource
... implicitRules ?!Σ0..1uriA set of rules under which this content was created
... language 0..1codeLanguage of the resource content
Binding: Common Languages (extensible)
Max Binding: All Languages: A human language.

... text 0..1NarrativeText summary of the resource, for human interpretation
... contained 0..*ResourceContained, inline Resources
... extension 0..*ExtensionAdditional Content defined by implementations
... modifierExtension ?!0..*ExtensionExtensions that cannot be ignored
... url Σ1..1uriLogical URI to reference this structure definition (globally unique)
... identifier Σ0..*IdentifierAdditional identifier for the structure definition
... version Σ0..1stringBusiness version of the structure definition
... name Σ1..1stringName for this structure definition (computer friendly)
... title Σ0..1stringName for this structure definition (human friendly)
... status ?!Σ1..1codedraft | active | retired | unknown
Binding: PublicationStatus (required): The lifecycle status of a Value Set or Concept Map.

... experimental ?!Σ0..1booleanFor testing purposes, not real usage
... date Σ0..1dateTimeDate this was last changed
... publisher Σ0..1stringName of the publisher (organization or individual)
... contact Σ0..*ContactDetailContact details for the publisher
... description 0..1markdownNatural language description of the structure definition
... useContext Σ0..*UsageContextContext the content is intended to support
... jurisdiction Σ0..*CodeableConceptIntended jurisdiction for structure definition (if applicable)
Binding: Jurisdiction ValueSet (extensible): Countries and regions within which this artifact is targeted for use


... purpose 0..1markdownWhy this structure definition is defined
... copyright 0..1markdownUse and/or publishing restrictions
... keyword Σ0..*CodingAssist with indexing and finding
Binding: Structure Definition Codes (example): Codes for the meaning of the defined structure (SNOMED CT and LOINC codes, as an example).


... fhirVersion Σ0..1idFHIR Version this StructureDefinition targets
... mapping I0..*BackboneElementExternal specification that the content is mapped to
sdf-2: Must have at least a name or a uri (or both)
.... id 0..1stringxml:id (or equivalent in JSON)
.... extension 0..*ExtensionAdditional Content defined by implementations
.... modifierExtension ?!Σ0..*ExtensionExtensions that cannot be ignored
.... identity 1..1idInternal id when this mapping is used
.... uri I0..1uriIdentifies what this mapping refers to
.... name I0..1stringNames what this mapping refers to
.... comment 0..1stringVersions, Issues, Scope limitations etc.
... kind Σ1..1codeprimitive-type | complex-type | resource | logical
Binding: StructureDefinitionKind (required): Defines the type of structure that a definition is describing.

... abstract Σ1..1booleanWhether the structure is abstract
... contextType ΣI0..1coderesource | datatype | extension
Binding: ExtensionContext (required): How an extension context is interpreted.

... context ΣI0..*stringWhere the extension can be used in instances
... contextInvariant ΣI0..*stringFHIRPath invariants - when the extension can be used
... type ΣI1..1codeType defined or constrained by this structure
Binding: FHIRDefinedType (extensible): Either a resource or a data type, including logical model types

... baseDefinition ΣI0..1uriDefinition that this type is constrained/specialized from
... derivation Σ0..1codespecialization | constraint - How relates to base definition
Binding: TypeDerivationRule (required): How a type relates to its baseDefinition.

... snapshot I0..1BackboneElementSnapshot view of the structure
sdf-15: The first element in a snapshot has no type
sdf-8: In any snapshot, all the elements must be in the specified type
sdf-3: Each element definition in a snapshot must have a formal definition and cardinalities
.... id 0..1stringxml:id (or equivalent in JSON)
.... extension 0..*ExtensionAdditional Content defined by implementations
.... modifierExtension ?!Σ0..*ExtensionExtensions that cannot be ignored
.... element I1..*ElementDefinitionDefinition of elements in the resource (if no StructureDefinition)
... differential I0..1BackboneElementDifferential view of the structure
sdf-15a: If the first element in a differential has no "." in the path, it has no type
sdf-20: No slicing on the root element
sdf-8a: In any differential, all the elements must be in the specified type
.... id 0..1stringxml:id (or equivalent in JSON)
.... extension 0..*ExtensionAdditional Content defined by implementations
.... modifierExtension ?!Σ0..*ExtensionExtensions that cannot be ignored
.... element 1..*ElementDefinitionDefinition of elements in the resource (if no StructureDefinition)

doco Documentation for this format

 

Terminology Bindings

PathConformanceValueSet
StructureDefinition.languageextensibleCommon Languages
Max Binding: All Languages
StructureDefinition.statusrequiredPublicationStatus
StructureDefinition.jurisdictionextensibleJurisdiction ValueSet
StructureDefinition.keywordexampleStructure Definition Codes
StructureDefinition.kindrequiredStructureDefinitionKind
StructureDefinition.contextTyperequiredExtensionContext
StructureDefinition.typeextensibleFHIRDefinedType
StructureDefinition.derivationrequiredTypeDerivationRule

Constraints

IdPathDetailsRequirements
dom-2StructureDefinitionIf the resource is contained in another resource, it SHALL NOT contain nested Resources
: contained.contained.empty()
dom-1StructureDefinitionIf the resource is contained in another resource, it SHALL NOT contain any narrative
: contained.text.empty()
dom-4StructureDefinitionIf 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-3StructureDefinitionIf the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource
: contained.where(('#'+id in %resource.descendants().reference).not()).empty()
sdf-9StructureDefinitionIn any snapshot or differential, no label, code or requirements on the an element without a "." in the path (e.g. the first element)
: children().element.where(path.contains('.').not()).label.empty() and children().element.where(path.contains('.').not()).code.empty() and children().element.where(path.contains('.').not()).requirements.empty()
Because these 3 fields seem to be have overlapping meaning with the ones in the root of StructureDefinition
sdf-19StructureDefinitionCustom types can only be used in logical models
: kind = 'logical' or (differential.element.type.code.all(hasValue() implies matches('^[a-zA-Z0-9]+$')) and snapshot.element.type.code.all(hasValue() implies matches('^[a-zA-Z0-9]+$')))
custom types only in logical models
sdf-16StructureDefinitionAll element definitions must have unique ids (snapshot)
: snapshot.element.id.trace('ids').isDistinct()
element ids need to be unique
sdf-18StructureDefinitionContext Invariants can only be used for extensions
: contextInvariant.exists() implies type = 'Extension'
contextInvariant
sdf-17StructureDefinitionAll element definitions must have unique ids (diff)
: differential.element.id.trace('ids').isDistinct()
element ids need to be unique
sdf-11StructureDefinitionIf there's a type, its content must match the path name in the first element of a snapshot
: snapshot.empty() or snapshot.element.first().path = type
Ensure that the type is not inconsistent with the other information in the structure
sdf-14StructureDefinitionAll element definitions must have an id
: snapshot.element.all(id.exists()) and differential.element.all(id.exists())
elements have id
sdf-1StructureDefinitionElement paths must be unique unless the structure is a constraint
: derivation = 'constraint' or snapshot.element.select(path).isDistinct()
sdf-7StructureDefinitionIf the structure describes a base Resource or Type, the URL has to start with "http://hl7.org/fhir/StructureDefinition/" and the tail must match the id
: (derivation = 'constraint') or (kind = 'logical') or (url = 'http://hl7.org/fhir/StructureDefinition/'+id)
sdf-6StructureDefinitionA structure must have either a differential, or a snapshot (or both)
: snapshot.exists() or differential.exists()
sdf-5StructureDefinitionIf the structure defines an extension then the structure must have context information
: type != 'Extension' or derivation = 'specialization' or (context.exists() and contextType.exists())
sdf-4StructureDefinitionIf the structure is not abstract, then there SHALL be a baseDefinition
: abstract = true or baseDefinition.exists()
Ensure that the base types are abstract
ele-1StructureDefinition.mappingAll FHIR elements must have a @value or children
: hasValue() | (children().count() > id.count())
sdf-2StructureDefinition.mappingMust have at least a name or a uri (or both)
: name.exists() or uri.exists()
ele-1StructureDefinition.snapshotAll FHIR elements must have a @value or children
: hasValue() | (children().count() > id.count())
sdf-15StructureDefinition.snapshotThe first element in a snapshot has no type
: kind!='logical' implies snapshot.element.first().type.empty()
No Type on the root element (snapshot)
sdf-8StructureDefinition.snapshotIn any snapshot, all the elements must be in the specified type
: (%resource.kind = 'logical' or element.first().path = %resource.type) and element.tail().all(path.startsWith(%resource.snapshot.element.first().path&'.'))
sdf-3StructureDefinition.snapshotEach element definition in a snapshot must have a formal definition and cardinalities
: element.all(definition and min and max)
ele-1StructureDefinition.differentialAll FHIR elements must have a @value or children
: hasValue() | (children().count() > id.count())
sdf-15aStructureDefinition.differentialIf the first element in a differential has no "." in the path, it has no type
: element.first().path.contains('.').not() implies element.first().type.empty()
No Type on the root element (differential)
sdf-20StructureDefinition.differentialNo slicing on the root element
: element.where(path.contains('.').not()).slicing.empty()
no slicing on root
sdf-8aStructureDefinition.differentialIn any differential, all the elements must be in the specified type
: element.first().path.startsWith(%resource.type) and element.tail().all(path.startsWith(%resource.type&'.'))
.