2.7.0 - STU 3 (2nd ballot)

This page is part of the Structured Data Capture FHIR IG (v2.7.0: STU 3 Ballot 2) based on FHIR R4. The current version which supercedes this version is 3.0.0. For a full list of available versions, see the Directory of published versions

StructureDefinition: Questionnaire

The official URL for this profile is:

http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire

Scope and Usage

This profile sets base expectations for use of the Questionnaire resource in all use-cases supported by this implementation guide. It forms foundation for most other Questionaire profiles within this guide and represents information that is going to be necessary regardless of how the Questionnaire is being used. It identifies which core elements and extensions must be supported and highlights other elements that, while not required, may be relevant to the Questionnaire use-cases.

Formal Views of Profile Content

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

This structure is derived from Questionnaire

Summary

Mandatory: 5 elements
Must-Support: 18 elements

Structures

This structure refers to these other structures:

Extensions

This structure refers to these extensions:

NameFlagsCard.TypeDescription & Constraintsdoco
.. Questionnaire I0..*A structured set of questions
... 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: CommonLanguages (preferred)
Max Binding: AllLanguages
... text 0..1NarrativeText summary of the resource, for human interpretation
... contained 0..*ResourceContained, inline Resources
... extension 0..*ExtensionExtension
Slice: Unordered, Open by value:url
... designNote I0..1markdownDesign comments
URL: http://hl7.org/fhir/StructureDefinition/designNote
... sdc-questionnaire-preferredTerminologyServer I0..*uriPreferred terminology server
URL: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-preferredTerminologyServer
... modifierExtension ?!0..*ExtensionExtensions that cannot be ignored
... url SΣ1..1uriCanonical identifier for this questionnaire, represented as a URI (globally unique)
... identifier Σ0..*IdentifierAdditional identifier for the questionnaire
... version SΣ0..1stringBusiness version of the questionnaire
... name ΣI0..1stringName for this questionnaire (computer friendly)
... title Σ0..1stringName for this questionnaire (human friendly)
... derivedFrom 0..*canonical(Questionnaire)Instantiates protocol or definition
... status ?!SΣ1..1codedraft | active | retired | unknown
Binding: PublicationStatus (required)
... experimental Σ0..1booleanFor testing purposes, not real usage
... subjectType SΣ1..1codeResource that can be subject of QuestionnaireResponse
Binding: ResourceType (required)
... date Σ0..1dateTimeDate 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 questionnaire
... useContext Σ0..*UsageContextThe context that the content is intended to support
... jurisdiction Σ0..*CodeableConceptIntended jurisdiction for questionnaire (if applicable)
Binding: Jurisdiction ValueSet (extensible)
... purpose 0..1markdownWhy this questionnaire is defined
... copyright 0..1markdownUse and/or publishing restrictions
... approvalDate 0..1dateWhen the questionnaire was approved by publisher
... lastReviewDate 0..1dateWhen the questionnaire was last reviewed
... effectivePeriod Σ0..1PeriodWhen the questionnaire is expected to be used
... code Σ0..*CodingConcept that represents the overall questionnaire
Binding: QuestionnaireQuestionCodes (example)
... item SI1..*BackboneElementQuestions and sections within the Questionnaire
.... id 0..1stringUnique id for inter-element referencing
.... extension 0..*ExtensionExtension
Slice: Unordered, Open by value:url
.... designNote I0..1markdownDesign comments
URL: http://hl7.org/fhir/StructureDefinition/designNote
.... sdc-questionnaire-preferredTerminologyServer I0..*uriPreferred terminology server
URL: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-preferredTerminologyServer
.... modifierExtension ?!Σ0..*ExtensionExtensions that cannot be ignored even if unrecognized
.... linkId S1..1stringUnique id for item in questionnaire
.... definition 0..1uriElementDefinition - details for the item
.... code I0..*CodingCorresponding concept for this item in a terminology
Binding: QuestionnaireQuestionCodes (example)
.... prefix S0..1stringE.g. "1(a)", "2.5.3"
.... text S0..1stringPrimary text for the item
.... type S1..1codegroup | display | boolean | decimal | integer | date | dateTime +
Binding: QuestionnaireItemType (required)
.... enableWhen ?!I0..*BackboneElementOnly allow data when
que-7: If the operator is 'exists', the value must be a boolean
..... id 0..1stringUnique id for inter-element referencing
..... extension 0..*ExtensionAdditional content defined by implementations
..... modifierExtension ?!Σ0..*ExtensionExtensions that cannot be ignored even if unrecognized
..... question 1..1stringQuestion that determines whether item is enabled
..... operator 1..1codeexists | = | != | > | < | >= | <=
Binding: QuestionnaireItemOperator (required)
..... answer[x] I1..1boolean, decimal, integer, date, dateTime, time, string, Coding, Quantity, Reference(Resource)Value for question comparison based on operator
Binding: QuestionnaireAnswerCodes (example)
.... enableBehavior I0..1codeall | any
Binding: EnableWhenBehavior (required)
.... required SI0..1booleanWhether the item must be included in data results
.... repeats SI0..1booleanWhether the item may repeat
.... readOnly SI0..1booleanDon't allow human editing
.... maxLength SI0..1integerNo more than this many characters
.... answerValueSet SI0..1canonical(SDCValueSet)Valueset containing permitted answers
.... answerOption SI0..*BackboneElementPermitted answer
..... id 0..1stringUnique id for inter-element referencing
..... extension 0..*ExtensionAdditional content defined by implementations
..... modifierExtension ?!Σ0..*ExtensionExtensions that cannot be ignored even if unrecognized
..... value[x] 1..1integer, date, time, string, Coding, Reference(Resource)Answer value
Binding: QuestionnaireAnswerCodes (example)
..... initialSelected 0..1booleanWhether option is selected by default
.... initial SI0..*BackboneElementInitial value(s) when item is first rendered
..... id 0..1stringUnique id for inter-element referencing
..... extension 0..*ExtensionAdditional content defined by implementations
..... modifierExtension ?!Σ0..*ExtensionExtensions that cannot be ignored even if unrecognized
..... value[x] S1..1boolean, decimal, integer, date, dateTime, time, string, uri, Attachment, Coding, Quantity, Reference(Resource)Actual value for initializing the question
Binding: QuestionnaireAnswerCodes (example)
.... item SI0..*Unknown reference to #Questionnaire.item
Nested questionnaire items

doco Documentation for this format

This structure is derived from Questionnaire

Summary

Mandatory: 5 elements
Must-Support: 18 elements

Structures

This structure refers to these other structures:

Extensions

This structure refers to these extensions:

Snapshot View

NameFlagsCard.TypeDescription & Constraintsdoco
.. Questionnaire I0..*A structured set of questions
... 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: CommonLanguages (preferred)
Max Binding: AllLanguages
... text 0..1NarrativeText summary of the resource, for human interpretation
... contained 0..*ResourceContained, inline Resources
... extension 0..*ExtensionExtension
Slice: Unordered, Open by value:url
... designNote I0..1markdownDesign comments
URL: http://hl7.org/fhir/StructureDefinition/designNote
... sdc-questionnaire-preferredTerminologyServer I0..*uriPreferred terminology server
URL: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-preferredTerminologyServer
... modifierExtension ?!0..*ExtensionExtensions that cannot be ignored
... url SΣ1..1uriCanonical identifier for this questionnaire, represented as a URI (globally unique)
... identifier Σ0..*IdentifierAdditional identifier for the questionnaire
... version SΣ0..1stringBusiness version of the questionnaire
... name ΣI0..1stringName for this questionnaire (computer friendly)
... title Σ0..1stringName for this questionnaire (human friendly)
... derivedFrom 0..*canonical(Questionnaire)Instantiates protocol or definition
... status ?!SΣ1..1codedraft | active | retired | unknown
Binding: PublicationStatus (required)
... experimental Σ0..1booleanFor testing purposes, not real usage
... subjectType SΣ1..1codeResource that can be subject of QuestionnaireResponse
Binding: ResourceType (required)
... date Σ0..1dateTimeDate 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 questionnaire
... useContext Σ0..*UsageContextThe context that the content is intended to support
... jurisdiction Σ0..*CodeableConceptIntended jurisdiction for questionnaire (if applicable)
Binding: Jurisdiction ValueSet (extensible)
... purpose 0..1markdownWhy this questionnaire is defined
... copyright 0..1markdownUse and/or publishing restrictions
... approvalDate 0..1dateWhen the questionnaire was approved by publisher
... lastReviewDate 0..1dateWhen the questionnaire was last reviewed
... effectivePeriod Σ0..1PeriodWhen the questionnaire is expected to be used
... code Σ0..*CodingConcept that represents the overall questionnaire
Binding: QuestionnaireQuestionCodes (example)
... item SI1..*BackboneElementQuestions and sections within the Questionnaire
.... id 0..1stringUnique id for inter-element referencing
.... extension 0..*ExtensionExtension
Slice: Unordered, Open by value:url
.... designNote I0..1markdownDesign comments
URL: http://hl7.org/fhir/StructureDefinition/designNote
.... sdc-questionnaire-preferredTerminologyServer I0..*uriPreferred terminology server
URL: http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-preferredTerminologyServer
.... modifierExtension ?!Σ0..*ExtensionExtensions that cannot be ignored even if unrecognized
.... linkId S1..1stringUnique id for item in questionnaire
.... definition 0..1uriElementDefinition - details for the item
.... code I0..*CodingCorresponding concept for this item in a terminology
Binding: QuestionnaireQuestionCodes (example)
.... prefix S0..1stringE.g. "1(a)", "2.5.3"
.... text S0..1stringPrimary text for the item
.... type S1..1codegroup | display | boolean | decimal | integer | date | dateTime +
Binding: QuestionnaireItemType (required)
.... enableWhen ?!I0..*BackboneElementOnly allow data when
que-7: If the operator is 'exists', the value must be a boolean
..... id 0..1stringUnique id for inter-element referencing
..... extension 0..*ExtensionAdditional content defined by implementations
..... modifierExtension ?!Σ0..*ExtensionExtensions that cannot be ignored even if unrecognized
..... question 1..1stringQuestion that determines whether item is enabled
..... operator 1..1codeexists | = | != | > | < | >= | <=
Binding: QuestionnaireItemOperator (required)
..... answer[x] I1..1boolean, decimal, integer, date, dateTime, time, string, Coding, Quantity, Reference(Resource)Value for question comparison based on operator
Binding: QuestionnaireAnswerCodes (example)
.... enableBehavior I0..1codeall | any
Binding: EnableWhenBehavior (required)
.... required SI0..1booleanWhether the item must be included in data results
.... repeats SI0..1booleanWhether the item may repeat
.... readOnly SI0..1booleanDon't allow human editing
.... maxLength SI0..1integerNo more than this many characters
.... answerValueSet SI0..1canonical(SDCValueSet)Valueset containing permitted answers
.... answerOption SI0..*BackboneElementPermitted answer
..... id 0..1stringUnique id for inter-element referencing
..... extension 0..*ExtensionAdditional content defined by implementations
..... modifierExtension ?!Σ0..*ExtensionExtensions that cannot be ignored even if unrecognized
..... value[x] 1..1integer, date, time, string, Coding, Reference(Resource)Answer value
Binding: QuestionnaireAnswerCodes (example)
..... initialSelected 0..1booleanWhether option is selected by default
.... initial SI0..*BackboneElementInitial value(s) when item is first rendered
..... id 0..1stringUnique id for inter-element referencing
..... extension 0..*ExtensionAdditional content defined by implementations
..... modifierExtension ?!Σ0..*ExtensionExtensions that cannot be ignored even if unrecognized
..... value[x] S1..1boolean, decimal, integer, date, dateTime, time, string, uri, Attachment, Coding, Quantity, Reference(Resource)Actual value for initializing the question
Binding: QuestionnaireAnswerCodes (example)
.... item SI0..*Unknown reference to #Questionnaire.item
Nested questionnaire items

doco Documentation for this format

 

Other representations of profile: Schematron

Terminology Bindings

PathConformanceValueSet
Questionnaire.statusrequiredPublicationStatus
Questionnaire.subjectTyperequiredResourceType
Questionnaire.item.typerequiredQuestionnaireItemType
Questionnaire.item.initial.value[x]exampleQuestionnaireAnswerCodes

Constraints

IdPathDetailsRequirements
dom-2QuestionnaireIf the resource is contained in another resource, it SHALL NOT contain nested Resources
: contained.contained.empty()
dom-4QuestionnaireIf 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-3QuestionnaireIf 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-6QuestionnaireA resource should have narrative for robust management
: text.div.exists()
dom-5QuestionnaireIf a resource is contained in another resource, it SHALL NOT have a security label
: contained.meta.security.empty()
que-2QuestionnaireThe link ids for groups and questions must be unique within the questionnaire
: descendants().linkId.isDistinct()
que-0QuestionnaireName should be usable as an identifier for the module by machine processing applications such as code generation
: name.matches('[A-Z]([A-Za-z0-9_]){0,254}')
ele-1Questionnaire.extensionAll FHIR elements must have a @value or children
: hasValue() or (children().count() > id.count())
ext-1Questionnaire.extensionMust have either extensions or value[x], not both
: extension.exists() != value.exists()
ele-1Questionnaire.extensionAll FHIR elements must have a @value or children
: hasValue() or (children().count() > id.count())
ext-1Questionnaire.extensionMust have either extensions or value[x], not both
: extension.exists() != value.exists()
ele-1Questionnaire.extensionAll FHIR elements must have a @value or children
: hasValue() or (children().count() > id.count())
ext-1Questionnaire.extensionMust have either extensions or value[x], not both
: extension.exists() != value.exists()
ele-1Questionnaire.itemAll FHIR elements must have a @value or children
: hasValue() or (children().count() > id.count())
que-9Questionnaire.itemRead-only can't be specified for "display" items
: type!='display' or readOnly.empty()
que-8Questionnaire.itemInitial values can't be specified for groups or display items
: (type!='group' and type!='display') or initial.empty()
que-6Questionnaire.itemRequired and repeat aren't permitted for display items
: type!='display' or (required.empty() and repeats.empty())
que-5Questionnaire.itemOnly 'choice' and 'open-choice' items can have answerValueSet
: (type ='choice' or type = 'open-choice' or type = 'decimal' or type = 'integer' or type = 'date' or type = 'dateTime' or type = 'time' or type = 'string' or type = 'quantity') or (answerValueSet.empty() and answerOption.empty())
que-4Questionnaire.itemA question cannot have both answerOption and answerValueSet
: answerOption.empty() or answerValueSet.empty()
que-3Questionnaire.itemDisplay items cannot have a "code" asserted
: type!='display' or code.empty()
que-10Questionnaire.itemMaximum length can only be declared for simple question types
: (type in ('boolean' | 'decimal' | 'integer' | 'string' | 'text' | 'url' | 'open-choice')) or maxLength.empty()
que-1Questionnaire.itemGroup items must have nested items, display items cannot have nested items
: (type='group' implies item.empty().not()) and (type.trace('type')='display' implies item.trace('item').empty())
que-13Questionnaire.itemCan only have multiple initial values for repeating items
: repeats=true or initial.count() <= 1
que-11Questionnaire.itemIf one or more answerOption is present, initial[x] must be missing
: answerOption.empty() or initial.empty()
que-12Questionnaire.itemIf there are more than one enableWhen, enableBehavior must be specified
: enableWhen.count() > 2 implies enableBehavior.exists()
ele-1Questionnaire.item.extensionAll FHIR elements must have a @value or children
: hasValue() or (children().count() > id.count())
ext-1Questionnaire.item.extensionMust have either extensions or value[x], not both
: extension.exists() != value.exists()
ele-1Questionnaire.item.extensionAll FHIR elements must have a @value or children
: hasValue() or (children().count() > id.count())
ext-1Questionnaire.item.extensionMust have either extensions or value[x], not both
: extension.exists() != value.exists()
ele-1Questionnaire.item.extensionAll FHIR elements must have a @value or children
: hasValue() or (children().count() > id.count())
ext-1Questionnaire.item.extensionMust have either extensions or value[x], not both
: extension.exists() != value.exists()
ele-1Questionnaire.item.enableWhenAll FHIR elements must have a @value or children
: hasValue() or (children().count() > id.count())
que-7Questionnaire.item.enableWhenIf the operator is 'exists', the value must be a boolean
: operator = 'exists' implies (answer is Boolean)
ele-1Questionnaire.item.answerOptionAll FHIR elements must have a @value or children
: hasValue() or (children().count() > id.count())
ele-1Questionnaire.item.initialAll FHIR elements must have a @value or children
: hasValue() or (children().count() > id.count())

Language and translations

In some environments, it may be necessary for a questionnaire to support multiple languages. The rendering tool would select the appropriate language based on a configuration setting, or perhaps would display all available languages and the user would read the one they are familiar with. Systems MAY choose to provide support for identifying language and translations. If they do, they MAY do so using the generic language and translation extensions FHIR defines based on the ISO21090 data type specification:

  • iso21090-st-language allows the language of a particular (or any other data type) to be identified
  • iso21090-st-translation allows additional repetitions in alternate languages to be communicated. (The language for each translation would be communicated using the above #language extension)

These extensions can be used on absolutely any string element on Questionnaire, ValueSet, or any other resource. The base string should be the primary language of the questionnaire. It is what will be rendered by systems that do not support the translation extension or by systems whose language preference is other than one of the languages provided.

The ISO 19763 specification permits declaring language on questionnaire titles, descriptions, display names for codes and many other strings. It also supports capturing multiple variants of these strings with distinct languages. These capabilities can be mirrored using the above extensions.

An alternative is to define an extension to the Questionnaire providing a pointer to an externally maintained set of extensions. This approach allows the translations to be maintained independently of the resource which has both positive and negative impacts, particularly with respect to resource signature.

Open Issue: Should this profile define such an extension and/or a resource for managing such translations?