FHIR CI-Build

This is the Continuous Integration Build of FHIR (will be incorrect/inconsistent at times).
See the Directory of published versions icon

2.5 Resource Questionnaire - Content

FHIR Infrastructure icon Work GroupMaturity Level: 5 Trial UseSecurity Category: Business Compartments: No defined compartments

A structured set of questions intended to guide the collection of answers from end-users. Questionnaires provide detailed control over order, presentation, phraseology and grouping to allow coherent, consistent data collection.

A Questionnaire is an organized collection of questions intended to solicit information from patients, providers or other individuals involved in the healthcare domain. They may be simple flat lists of questions or can be hierarchically organized in groups and sub-groups, each containing questions. The Questionnaire defines the questions to be asked, how they are ordered and grouped, any intervening instructional text and what the constraints are on the allowed answers. The results of a Questionnaire can be communicated using the QuestionnaireResponse resource.

Questionnaires cover the need to communicate data originating from forms used in medical history examinations, research questionnaires and sometimes full clinical specialty records. In many systems this data is collected using user-defined screens and forms. Questionnaires define specifics about data capture - exactly what questions were asked, in what order, what choices for answers were, etc. Each of these questions is part of the Questionnaire, and as such the Questionnaire is a separately identifiable Resource, whereas the individual questions are not. (Questionnaire questions can be linked to shared data elements using the Questionnaire.item.definition element.)

In addition to its use as a means for capturing data, Questionnaires can also be useful as a mechanism of defining a standardized 'presentation' of data that might already exist. For example, a peri-natal form or diabetes management form. In this use, the benefit is to expose a large volume of data in a predictable way that can be defined outside the user-interface design of the relevant system. The form might allow data to be edited or might be read-only. In some cases, the QuestionnaireResponse might not be intended to be persisted.

Examples of Questionnaires include:

  • Past medical history (PMH)
  • Family diseases
  • Social history
  • Research questionnaires/Clinical research forms (CRFs)
  • Quality and evaluation forms
  • Patient intake form (e.g. clipboard)
  • Forms to support insurance claims

This resource is limited in scope to support the characteristics of simple questionnaires. However, common extensions have been defined to allow more sophisticated behavior. This includes:

  • Questionnaire core extensions which defines the additional descriptive characteristics for questionnaires and their groups and questions
  • Element extensions which can describe additional constraints on allowed answers for questionnaires such as string length and date and numeric ranges

Additional implementation guides, in particular the Structured Data Capture Questionnaire IG provide guidance, extensions and operations that support additional capabilities and allow the definition of more sophisticated questionnaires and their corresponding responses.

Questionnaires are intrinsically bound to QuestionnaireResponses in that a Questionnaire defines the questions and rules for answering them that are used in completing the QuestionnaireResponse. The main difference between them is that Questionnaires define 'permitted' answers and are subject and time-independent, while QuestionnaireResponses define a specific user's answers to a Questionnaire at a particular time-point and are focused on a specific subject. As well, the QuestionnaireResponse doesn't convey any of the rules or 'potential' answers the way Questionnaire does. It only conveys the answers selected by the user.

Questionnaires differ from Lists because Lists group existing resources, while Questionnaires group arbitrary questions. Questionnaires are distinct from Observations and DiagnosticReports in that both of these resources are intended to capture only certain types of information (lab, imaging, vitals, etc.) and should not be used to capture the full breadth of healthcare information (allergies, medications, care plans, etc.), while Questionnaires are able to capture any information at all. More importantly, Observation and DiagnosticReport focus on capturing the discrete information in a standardized form so that the information can be used consistently regardless of where or how it is captured. Questionnaire focuses on information capture. The same information can be captured using a wide variety of questionnaires with differently phrased questions organized in different manners. As such, the Questionnaire resource provides a means to standardize the information gathering process (how information is captured), but not how data is interoperably compared, analyzed or computed upon (typically managed using Observation, DiagnosticReport as well as other resources).

Questionnaires are similar to ObservationDefinitions in that both are about defining structures for capturing certain information and setting constraints on what allowed answers are. They can also define hierarchical constructs containing multiple layers of 'arbitrary' nested data elements. However, ObservationDefinitions are instantiated by Observations and are intended to be limited to only those data elements typically captured as Observations, while Questionnaires can describe any element at all and are instantiated by QuestionnaireResponses. Questionnaires also have significantly more power to identify rules around what data can be captured and when, as well as allowed answers. While both support nesting, ObservationDefinition nesting is focused on panels and is limited to a single level within the resource, while Questionnaire can define nesting of arbitrary depth for any purpose.

Questionnaires are similar to Compositions in that both organize collections of items and can have a hierarchical structure. They're also intended to help guide 'human' presentation of data. However, Compositions organize resources, while Questionnaires organize specific elements. Also, a Questionnaire represents data 'to be gathered' and is subject-independent, while Compositions represent collections of data that are complete and are about a particular subject. It is possible for StructureDefinitions or GraphDefinitions to act as 'templates' for FHIR documents that guide what data is collected for a particular purpose (e.g. a referral), but this differs from the gathering process that a Questionnaire provides where there are specific questions that must be asked and answered and rules that guide which questions are enabled in which circumstances.

Questionnaire supports data-collection workflow to a limited extent, in that - once triggered - a Questionnaire can guide a user through a data collection process that ensures appropriate information is collected based on answers to particular questions. However, Questionnaire doesn't provide support for capturing sets of information at different times or highly interactive data capture. Broader workflow is typically managed using PlanDefinition and Task or using other mechanisms such as CDSHooks.

Questionnaires are similar to the notion of "logical models" supported by the StructureDefinition resource. Both support the representation of a collection of data points with labels, data types and hierarchy. It will be common to find the two of them mapped together. The primary difference is that Questionnaire is focused on user-facing data collection. It describes specific questions and includes information such as what number/label should be displayed beside each question, conditions in which questions should be displayed (or not), what instructions should be provided to the user, etc. StructureDefinition, on the other hand, merely defines a data structure with no guidance on display or rules around capture mechanism, only what data should exist in the end. As well, logical models are not intended to capture data directly. Rather, they provide a basis for mapping between data capture structures.

Questionnaires are excellent tools for data capture. They allow tight control over what data is gathered and ensure information is gathered consistently across multiple users. However, data gathered using different questionnaires - or even different versions of the same questionnaire - is often not comparable. It is also not very searchable or easily integrated with discrete data sources. Because of this, the general recommendation in FHIR is to use questionnaires for raw data capture but then to convert the resulting QuestionnaireResponse instances into other FHIR resources - Observations, MedicationStatements, FamilyMemberHistories, etc. This allows the data gathered to then be easily combined with other data into FHIR documents and messages and exposed over FHIR REST interfaces.

Groups and questions that make up a Questionnaire can use the definition element to refer to data elements in external code systems and StructureDefinitions. In this way, it's possible to leverage standard definitions of questions and their associated data types and answer sets across questionnaires. This also allows extraction of the data from a questionnaire response into other data structures (e.g. populating a ServiceRequest or CarePlan from information in a completed questionnaire response. It can also support other sorts of post-processing of the data contained in a questionnaire response. However, use of the definition element is not required and Questionnaires may be quite loosely defined. The section Questionnaire versus Resources below discusses the issues of collecting data in such loosely defined Questionnaires versus collecting data as well-defined separate Resources.

Structure

NameFlagsCard.TypeDescription & Constraintsdoco
.. Questionnaire TUDomainResourceA structured set of questions
+ Warning: Name should be usable as an identifier for the module by machine processing applications such as code generation
+ Rule: The link ids for groups and questions must be unique within the questionnaire

Elements defined in Ancestors: id, meta, implicitRules, language, text, contained, extension, modifierExtension
Interfaces Implemented: MetadataResource
... url ΣC0..1uriCanonical identifier for this questionnaire, represented as an absolute URI (globally unique)
+ Warning: URL should not contain | or # - these characters make processing canonical references problematic
... identifier Σ0..*IdentifierBusiness identifier for questionnaire

... version Σ0..1stringBusiness version of the questionnaire
.... versionAlgorithmStringstring
.... versionAlgorithmCodingCoding
... name ΣC0..1stringName for this questionnaire (computer friendly)
... title ΣT0..1stringName for this questionnaire (human friendly)
... derivedFrom Σ0..*canonical(Questionnaire)Based on Questionnaire

... status ?!ΣC1..1codedraft | active | retired | unknown
Binding: PublicationStatus (Required)
... experimental Σ0..1booleanFor testing purposes, not real usage
... subjectType Σ0..*codeResource that can be subject of QuestionnaireResponse
Binding: Resource Types (Required)

... date Σ0..1dateTimeDate last changed
... publisher ΣT0..1stringName of the publisher/steward (organization or individual)
... contact Σ0..*ContactDetailContact details for the publisher

... description ΣT0..1markdownNatural language description of the questionnaire
... useContext ΣTU0..*UsageContextThe context that the content is intended to support

... jurisdiction ΣXD0..*CodeableConceptIntended jurisdiction for questionnaire (if applicable)
Binding: Jurisdiction ValueSet (Extensible)

... purpose T0..1markdownWhy this questionnaire is defined
... copyright T0..1markdownUse and/or publishing restrictions
... copyrightLabel T0..1stringCopyright holder and year(s)
... approvalDate 0..1dateWhen the questionnaire was approved by publisher
... lastReviewDate 0..1dateWhen the questionnaire was last reviewed by the publisher
... effectivePeriod Σ0..1PeriodWhen the questionnaire is expected to be used
... code Σ0..*CodingConcept that represents the overall questionnaire
Binding: Questionnaire Question Codes (Example)

... item C0..*BackboneElementQuestions and sections within the Questionnaire
+ Rule: Group items must have nested items when Questionanire is complete
+ Warning: Groups should have items
+ Rule: Display items cannot have child items
+ Rule: Display items cannot have a "code" asserted
+ Rule: A question cannot have both answerOption and answerValueSet
+ Rule: Only coding, decimal, integer, date, dateTime, time, string or quantity items can have answerOption or answerValueSet
+ Rule: Required and repeat aren't permitted for display items
+ Rule: Initial values can't be specified for groups or display items
+ Rule: Read-only can't be specified for "display" items
+ Rule: Maximum length can only be declared for simple question types
+ Rule: If one or more answerOption is present, initial cannot be present. Use answerOption.initialSelected instead
+ Rule: If there are more than one enableWhen, enableBehavior must be specified
+ Rule: Can only have multiple initial values for repeating items
+ Warning: Can only have answerConstraint if answerOption or answerValueSet are present. (This is a warning because extensions may serve the same purpose)

.... linkId C1..1stringUnique id for item in questionnaire
+ Warning: Link ids should be 255 characters or less
.... definition 0..1uriElementDefinition - details for the item
.... code C0..*CodingCorresponding concept for this item in a terminology
Binding: Questionnaire Question Codes (Example)

.... prefix 0..1stringE.g. "1(a)", "2.5.3"
.... text T0..1stringPrimary text for the item
.... type C1..1codegroup | display | boolean | decimal | integer | date | dateTime +
Binding: Questionnaire Item Type (Required)
.... enableWhen ?!C0..*BackboneElementOnly allow data when
+ Rule: If the operator is 'exists', the value must be a boolean

..... question 1..1stringThe linkId of question that determines whether item is enabled/disabled
..... operator C1..1codeexists | = | != | > | < | >= | <=
Binding: Questionnaire Item Operator (Required)
..... answer[x] TC1..1Value for question comparison based on operator
Binding: Questionnaire Answer Codes (Example)
...... answerBooleanboolean
...... answerDecimaldecimal
...... answerIntegerinteger
...... answerDatedate
...... answerDateTimedateTime
...... answerTimetime
...... answerStringstring
...... answerCodingCoding
...... answerQuantityQuantity
...... answerReferenceReference(Any)
.... enableBehavior C0..1codeall | any
Binding: Enable When Behavior (Required)
.... disabledDisplay 0..1codehidden | protected
Binding: Questionnaire Item Disabled Display (Required)
.... required C0..1booleanWhether the item must be included in data results
.... repeats C0..1booleanWhether the item may repeat
.... readOnly C0..1booleanDon't allow human editing
.... maxLength C0..1integerNo more than these many characters
.... answerConstraint C0..1codeoptionsOnly | optionsOrType | optionsOrString
Binding: Questionnaire answer constraints value set (Required)
.... answerValueSet C0..1canonical(ValueSet)ValueSet containing permitted answers
.... answerOption C0..*BackboneElementPermitted answer

..... value[x] T1..1Answer value
Binding: Questionnaire Answer Codes (Example)
...... valueIntegerinteger
...... valueDatedate
...... valueTimetime
...... valueStringstring
...... valueCodingCoding
...... valueReferenceReference(Any)
..... initialSelected 0..1booleanWhether option is selected by default
.... initial C0..*BackboneElementInitial value(s) when item is first rendered

..... value[x] T1..1Actual value for initializing the question
Binding: Questionnaire Answer Codes (Example)
...... valueBooleanboolean
...... valueDecimaldecimal
...... valueIntegerinteger
...... valueDatedate
...... valueDateTimedateTime
...... valueTimetime
...... valueStringstring
...... valueUriuri
...... valueAttachmentAttachment
...... valueCodingCoding
...... valueQuantityQuantity
...... valueReferenceReference(Any)
.... item 0..*see itemNested questionnaire items


doco Documentation for this format icon

See the Extensions for this resource

UML Diagram (Legend)

Questionnaire (DomainResource) +MetadataResourceAn absolute URI that is used to identify this questionnaire when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which an authoritative instance of this questionnaire is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the questionnaire is stored on different serversurl : uri [0..1]A formal identifier that is used to identify this questionnaire when it is represented in other formats, or referenced in a specification, model, design or an instanceidentifier : Identifier [0..*]The identifier that is used to identify this version of the questionnaire when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the questionnaire author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequenceversion : string [0..1]Indicates the mechanism used to compare versions to determine which is more currentversionAlgorithm[x] : DataType [0..1] « string|Coding; null (Strength=Extensible) VersionAlgorithm+ »A natural language name identifying the questionnaire. This name should be usable as an identifier for the module by machine processing applications such as code generationname : string [0..1] « This element has or is affected by some invariantsC »A short, descriptive, user-friendly title for the questionnairetitle : string [0..1]The URL of a Questionnaire that this Questionnaire is based onderivedFrom : canonical [0..*] « Questionnaire »The current state of this questionnaire (this element modifies the meaning of other elements)status : code [1..1] « null (Strength=Required)PublicationStatus! » « This element has or is affected by some invariantsC »A Boolean value to indicate that this questionnaire is authored for testing purposes (or education/evaluation/marketing) and is not intended for genuine usageexperimental : boolean [0..1]The types of subjects that can be the subject of responses created for the questionnairesubjectType : code [0..*] « null (Strength=Required)ResourceType! »The date (and optionally time) when the questionnaire was last significantly changed. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the questionnaire changesdate : dateTime [0..1]The name of the organization or individual responsible for the release and ongoing maintenance of the questionnairepublisher : string [0..1]Contact details to assist a user in finding and communicating with the publishercontact : ContactDetail [0..*]A free text natural language description of the questionnaire from a consumer's perspectivedescription : markdown [0..1]The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate questionnairesuseContext : UsageContext [0..*]A legal or geographic region in which the questionnaire is intended to be usedjurisdiction : CodeableConcept [0..*] « null (Strength=Extensible)JurisdictionValueSet+ »Explanation of why this questionnaire is needed and why it has been designed as it haspurpose : markdown [0..1]A copyright statement relating to the questionnaire and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the questionnairecopyright : markdown [0..1]A short string (<50 characters), suitable for inclusion in a page footer that identifies the copyright holder, effective period, and optionally whether rights are resctricted. (e.g. 'All rights reserved', 'Some rights reserved')copyrightLabel : string [0..1]The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usageapprovalDate : date [0..1]The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval datelastReviewDate : date [0..1]The period during which the questionnaire content was or is planned to be in active useeffectivePeriod : Period [0..1]An identifier for this collection of questions in a particular terminology such as LOINCcode : Coding [0..*] « null (Strength=Example)QuestionnaireQuestionCodes?? »ItemAn identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resourcelinkId : string [1..1] « This element has or is affected by some invariantsC »This element is a URI that refers to an [ElementDefinition](elementdefinition.html) or to an [ObservationDefinition](observationdefinition.html) that provides information about this item, including information that might otherwise be included in the instance of the Questionnaire resource. A detailed description of the construction of the URI is shown in [Comments](questionnaire.html#definition), belowdefinition : uri [0..1]A terminology code that corresponds to this group or question (e.g. a code from LOINC, which defines many questions and answers)code : Coding [0..*] « null (Strength=Example)QuestionnaireQuestionCodes?? » « This element has or is affected by some invariantsC »A short label for a particular group, question or set of display text within the questionnaire used for reference by the individual completing the questionnaireprefix : string [0..1]The name of a section, the text of a question or text content for a display itemtext : string [0..1]The type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, Coding, etc.)type : code [1..1] « null (Strength=Required)QuestionnaireItemType! » « This element has or is affected by some invariantsC »Controls how multiple enableWhen values are interpreted - whether all or any must be trueenableBehavior : code [0..1] « null (Strength=Required)EnableWhenBehavior! » « This element has or is affected by some invariantsC »Indicates if and how items that are disabled (because enableWhen evaluates to 'false') should be displayeddisabledDisplay : code [0..1] « null (Strength=Required)QuestionnaireItemDisabledDisp...! »An indication, if true, that the item must be present in a "completed" QuestionnaireResponse. If false, the item may be skipped when answering the questionnairerequired : boolean [0..1] « This element has or is affected by some invariantsC »An indication, if true, that a QuestionnaireResponse for this item may include multiple answers associated with a single instance of this item (for question-type items) or multiple repetitions of the item (for group-type items)repeats : boolean [0..1] « This element has or is affected by some invariantsC »An indication, when true, that the value cannot be changed by a human respondent to the QuestionnairereadOnly : boolean [0..1] « This element has or is affected by some invariantsC »The maximum number of characters that are permitted in the answer to be considered a "valid" QuestionnaireResponsemaxLength : integer [0..1] « This element has or is affected by some invariantsC »For items that have a defined set of allowed answers (via answerOption or answerValueSet), indicates whether values *other* than those specified can be selectedanswerConstraint : code [0..1] « null (Strength=Required)QuestionnaireAnswerConstraint! » « This element has or is affected by some invariantsC »A reference to a value set containing a list of values representing permitted answers for a questionanswerValueSet : canonical [0..1] « ValueSet » « This element has or is affected by some invariantsC »EnableWhenThe linkId for the question whose answer (or lack of answer) governs whether this item is enabledquestion : string [1..1]Specifies the criteria by which the question is enabledoperator : code [1..1] « null (Strength=Required)QuestionnaireItemOperator! » « This element has or is affected by some invariantsC »A value that the referenced question is tested using the specified operator in order for the item to be enabled. If there are multiple answers, a match on any of the answers suffices. If different behavior is desired (all must match, at least 2 must match, etc.), consider using the enableWhenExpression extensionanswer[x] : DataType [1..1] « boolean|decimal|integer|date|dateTime| time|string|Coding|Quantity|Reference(Any); null (Strength=Example) QuestionnaireAnswerCodes?? » « This element has or is affected by some invariantsC »AnswerOptionA potential answer that's allowed as the answer to this questionvalue[x] : DataType [1..1] « integer|date|time|string|Coding| Reference(Any); null (Strength=Example)QuestionnaireAnswerCodes?? »Indicates whether the answer value is selected when the list of possible answers is initially showninitialSelected : boolean [0..1]InitialThe actual value to for an initial answervalue[x] : DataType [1..1] « boolean|decimal|integer|date|dateTime| time|string|uri|Attachment|Coding|Quantity|Reference(Any); null (Strength=Example) QuestionnaireAnswerCodes?? »A constraint indicating that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true (this element modifies the meaning of other elements)enableWhen[0..*]One of the permitted answers for the questionanswerOption[0..*]One or more values that should be pre-populated in the answer when initially rendering the questionnaire for user inputinitial[0..*]Text, questions and other groups to be nested beneath a question or groupitem[0..*]A particular question, question grouping or display text that is part of the questionnaireitem[0..*]

XML Template

<Questionnaire xmlns="http://hl7.org/fhir"> doco
 <!-- from Resource: id, meta, implicitRules, and language -->
 <!-- from DomainResource: text, contained, extension, and modifierExtension -->
 <url value="[uri]"/><!-- 0..1 Canonical identifier for this questionnaire, represented as an absolute URI (globally unique) -->
 <identifier><!-- 0..* Identifier Business identifier for questionnaire --></identifier>
 <version value="[string]"/><!-- 0..1 Business version of the questionnaire -->
 <versionAlgorithm[x]><!-- 0..1 string|Coding How to compare versions --></versionAlgorithm[x]>
 <name value="[string]"/><!-- I 0..1 Name for this questionnaire (computer friendly) -->
 <title value="[string]"/><!-- 0..1 Name for this questionnaire (human friendly) -->
 <derivedFrom><!-- 0..* canonical(Questionnaire) Based on Questionnaire --></derivedFrom>
 <status value="[code]"/><!-- I 1..1 draft | active | retired | unknown -->
 <experimental value="[boolean]"/><!-- 0..1 For testing purposes, not real usage -->
 <subjectType value="[code]"/><!-- 0..* Resource that can be subject of QuestionnaireResponse -->
 <date value="[dateTime]"/><!-- 0..1 Date last changed -->
 <publisher value="[string]"/><!-- 0..1 Name of the publisher/steward (organization or individual) -->
 <contact><!-- 0..* ContactDetail Contact details for the publisher --></contact>
 <description value="[markdown]"/><!-- 0..1 Natural language description of the questionnaire -->
 <useContext><!-- 0..* UsageContext The context that the content is intended to support --></useContext>
 <jurisdiction><!-- 0..* CodeableConcept Intended jurisdiction for questionnaire (if applicable) --></jurisdiction>
 <purpose value="[markdown]"/><!-- 0..1 Why this questionnaire is defined -->
 <copyright value="[markdown]"/><!-- 0..1 Use and/or publishing restrictions -->
 <copyrightLabel value="[string]"/><!-- 0..1 Copyright holder and year(s) -->
 <approvalDate value="[date]"/><!-- 0..1 When the questionnaire was approved by publisher -->
 <lastReviewDate value="[date]"/><!-- 0..1 When the questionnaire was last reviewed by the publisher -->
 <effectivePeriod><!-- 0..1 Period When the questionnaire is expected to be used --></effectivePeriod>
 <code><!-- 0..* Coding Concept that represents the overall questionnaire --></code>
 <item>  <!-- 0..* Questions and sections within the Questionnaire -->
  <linkId value="[string]"/><!-- I 1..1 Unique id for item in questionnaire -->
  <definition value="[uri]"/><!-- 0..1 ElementDefinition - details for the item -->
  <code><!-- I 0..* Coding Corresponding concept for this item in a terminology --></code>
  <prefix value="[string]"/><!-- 0..1 E.g. "1(a)", "2.5.3" -->
  <text value="[string]"/><!-- 0..1 Primary text for the item -->
  <type value="[code]"/><!-- I 1..1 group | display | boolean | decimal | integer | date | dateTime + -->
  <enableWhen>  <!-- I 0..* Only allow data when -->
   <question value="[string]"/><!-- 1..1 The linkId of question that determines whether item is enabled/disabled -->
   <operator value="[code]"/><!-- I 1..1 exists | = | != | > | < | >= | <= -->
   <answer[x]><!-- I 1..1 boolean|decimal|integer|date|dateTime|time|string|Coding|
     Quantity|Reference(Any) Value for question comparison based on operator --></answer[x]>
  </enableWhen>
  <enableBehavior value="[code]"/><!-- I 0..1 all | any -->
  <disabledDisplay value="[code]"/><!-- 0..1 hidden | protected -->
  <required value="[boolean]"/><!-- I 0..1 Whether the item must be included in data results -->
  <repeats value="[boolean]"/><!-- I 0..1 Whether the item may repeat -->
  <readOnly value="[boolean]"/><!-- I 0..1 Don't allow human editing -->
  <maxLength value="[integer]"/><!-- I 0..1 No more than these many characters -->
  <answerConstraint value="[code]"/><!-- I 0..1 optionsOnly | optionsOrType | optionsOrString -->
  <answerValueSet><!-- I 0..1 canonical(ValueSet) ValueSet containing permitted answers --></answerValueSet>
  <answerOption>  <!-- I 0..* Permitted answer -->
   <value[x]><!-- 1..1 integer|date|time|string|Coding|Reference(Any) Answer value --></value[x]>
   <initialSelected value="[boolean]"/><!-- 0..1 Whether option is selected by default -->
  </answerOption>
  <initial>  <!-- I 0..* Initial value(s) when item is first rendered -->
   <value[x]><!-- 1..1 boolean|decimal|integer|date|dateTime|time|string|uri|
     Attachment|Coding|Quantity|Reference(Any) Actual value for initializing the question --></value[x]>
  </initial>
  <item><!-- 0..* Content as for Questionnaire.item Nested questionnaire items --></item>
 </item>
</Questionnaire>

JSON Template

{doco
  "resourceType" : "Questionnaire",
  // from Resource: id, meta, implicitRules, and language
  // from DomainResource: text, contained, extension, and modifierExtension
  "url" : "<uri>", // Canonical identifier for this questionnaire, represented as an absolute URI (globally unique)
  "identifier" : [{ Identifier }], // Business identifier for questionnaire
  "version" : "<string>", // Business version of the questionnaire
  // versionAlgorithm[x]: How to compare versions. One of these 2:
  "versionAlgorithmString" : "<string>",
  "versionAlgorithmCoding" : { Coding },
  "name" : "<string>", // I Name for this questionnaire (computer friendly)
  "title" : "<string>", // Name for this questionnaire (human friendly)
  "derivedFrom" : ["<canonical(Questionnaire)>"], // Based on Questionnaire
  "status" : "<code>", // I R!  draft | active | retired | unknown
  "experimental" : <boolean>, // For testing purposes, not real usage
  "subjectType" : ["<code>"], // Resource that can be subject of QuestionnaireResponse
  "date" : "<dateTime>", // Date last changed
  "publisher" : "<string>", // Name of the publisher/steward (organization or individual)
  "contact" : [{ ContactDetail }], // Contact details for the publisher
  "description" : "<markdown>", // Natural language description of the questionnaire
  "useContext" : [{ UsageContext }], // The context that the content is intended to support
  "jurisdiction" : [{ CodeableConcept }], // Intended jurisdiction for questionnaire (if applicable)
  "purpose" : "<markdown>", // Why this questionnaire is defined
  "copyright" : "<markdown>", // Use and/or publishing restrictions
  "copyrightLabel" : "<string>", // Copyright holder and year(s)
  "approvalDate" : "<date>", // When the questionnaire was approved by publisher
  "lastReviewDate" : "<date>", // When the questionnaire was last reviewed by the publisher
  "effectivePeriod" : { Period }, // When the questionnaire is expected to be used
  "code" : [{ Coding }], // Concept that represents the overall questionnaire
  "item" : [{ // Questions and sections within the Questionnaire
    "linkId" : "<string>", // I R!  Unique id for item in questionnaire
    "definition" : "<uri>", // ElementDefinition - details for the item
    "code" : [{ Coding }], // I Corresponding concept for this item in a terminology
    "prefix" : "<string>", // E.g. "1(a)", "2.5.3"
    "text" : "<string>", // Primary text for the item
    "type" : "<code>", // I R!  group | display | boolean | decimal | integer | date | dateTime +
    "enableWhen" : [{ // I Only allow data when
      "question" : "<string>", // R!  The linkId of question that determines whether item is enabled/disabled
      "operator" : "<code>", // I R!  exists | = | != | > | < | >= | <=
      // answer[x]: Value for question comparison based on operator. One of these 10:
      "answerBoolean" : <boolean>,
      "answerDecimal" : <decimal>,
      "answerInteger" : <integer>,
      "answerDate" : "<date>",
      "answerDateTime" : "<dateTime>",
      "answerTime" : "<time>",
      "answerString" : "<string>",
      "answerCoding" : { Coding },
      "answerQuantity" : { Quantity },
      "answerReference" : { Reference(Any) }
    }],
    "enableBehavior" : "<code>", // I all | any
    "disabledDisplay" : "<code>", // hidden | protected
    "required" : <boolean>, // I Whether the item must be included in data results
    "repeats" : <boolean>, // I Whether the item may repeat
    "readOnly" : <boolean>, // I Don't allow human editing
    "maxLength" : <integer>, // I No more than these many characters
    "answerConstraint" : "<code>", // I optionsOnly | optionsOrType | optionsOrString
    "answerValueSet" : "<canonical(ValueSet)>", // I ValueSet containing permitted answers
    "answerOption" : [{ // I Permitted answer
      // value[x]: Answer value. One of these 6:
      "valueInteger" : <integer>,
      "valueDate" : "<date>",
      "valueTime" : "<time>",
      "valueString" : "<string>",
      "valueCoding" : { Coding },
      "valueReference" : { Reference(Any) },
      "initialSelected" : <boolean> // Whether option is selected by default
    }],
    "initial" : [{ // I Initial value(s) when item is first rendered
      // value[x]: Actual value for initializing the question. One of these 12:
      "valueBoolean" : <boolean>,
      "valueDecimal" : <decimal>,
      "valueInteger" : <integer>,
      "valueDate" : "<date>",
      "valueDateTime" : "<dateTime>",
      "valueTime" : "<time>",
      "valueString" : "<string>",
      "valueUri" : "<uri>",
      "valueAttachment" : { Attachment },
      "valueCoding" : { Coding },
      "valueQuantity" : { Quantity },
      "valueReference" : { Reference(Any) }
    }],
    "item" : [{ Content as for Questionnaire.item }] // Nested questionnaire items
  }]
}

Turtle Template

@prefix fhir: <http://hl7.org/fhir/> .doco


[ a fhir:Questionnaire;
  fhir:nodeRole fhir:treeRoot; # if this is the parser root

  # from Resource: .id, .meta, .implicitRules, and .language
  # from DomainResource: .text, .contained, .extension, and .modifierExtension
  fhir:url [ uri ] ; # 0..1 Canonical identifier for this questionnaire, represented as an absolute URI (globally unique)
  fhir:identifier  ( [ Identifier ] ... ) ; # 0..* Business identifier for questionnaire
  fhir:version [ string ] ; # 0..1 Business version of the questionnaire
  # versionAlgorithm[x] : 0..1 How to compare versions. One of these 2
    fhir:versionAlgorithm [  a fhir:string ; string ]
    fhir:versionAlgorithm [  a fhir:Coding ; Coding ]
  fhir:name [ string ] ; # 0..1 I Name for this questionnaire (computer friendly)
  fhir:title [ string ] ; # 0..1 Name for this questionnaire (human friendly)
  fhir:derivedFrom  ( [ canonical(Questionnaire) ] ... ) ; # 0..* Based on Questionnaire
  fhir:status [ code ] ; # 1..1 I draft | active | retired | unknown
  fhir:experimental [ boolean ] ; # 0..1 For testing purposes, not real usage
  fhir:subjectType  ( [ code ] ... ) ; # 0..* Resource that can be subject of QuestionnaireResponse
  fhir:date [ dateTime ] ; # 0..1 Date last changed
  fhir:publisher [ string ] ; # 0..1 Name of the publisher/steward (organization or individual)
  fhir:contact  ( [ ContactDetail ] ... ) ; # 0..* Contact details for the publisher
  fhir:description [ markdown ] ; # 0..1 Natural language description of the questionnaire
  fhir:useContext  ( [ UsageContext ] ... ) ; # 0..* The context that the content is intended to support
  fhir:jurisdiction  ( [ CodeableConcept ] ... ) ; # 0..* Intended jurisdiction for questionnaire (if applicable)
  fhir:purpose [ markdown ] ; # 0..1 Why this questionnaire is defined
  fhir:copyright [ markdown ] ; # 0..1 Use and/or publishing restrictions
  fhir:copyrightLabel [ string ] ; # 0..1 Copyright holder and year(s)
  fhir:approvalDate [ date ] ; # 0..1 When the questionnaire was approved by publisher
  fhir:lastReviewDate [ date ] ; # 0..1 When the questionnaire was last reviewed by the publisher
  fhir:effectivePeriod [ Period ] ; # 0..1 When the questionnaire is expected to be used
  fhir:code  ( [ Coding ] ... ) ; # 0..* Concept that represents the overall questionnaire
  fhir:item ( [ # 0..* Questions and sections within the Questionnaire
    fhir:linkId [ string ] ; # 1..1 I Unique id for item in questionnaire
    fhir:definition [ uri ] ; # 0..1 ElementDefinition - details for the item
    fhir:code  ( [ Coding ] ... ) ; # 0..* I Corresponding concept for this item in a terminology
    fhir:prefix [ string ] ; # 0..1 E.g. "1(a)", "2.5.3"
    fhir:text [ string ] ; # 0..1 Primary text for the item
    fhir:type [ code ] ; # 1..1 I group | display | boolean | decimal | integer | date | dateTime +
    fhir:enableWhen ( [ # 0..* I Only allow data when
      fhir:question [ string ] ; # 1..1 The linkId of question that determines whether item is enabled/disabled
      fhir:operator [ code ] ; # 1..1 I exists | = | != | > | < | >= | <=
      # answer[x] : 1..1 I Value for question comparison based on operator. One of these 10
        fhir:answer [  a fhir:boolean ; boolean ]
        fhir:answer [  a fhir:decimal ; decimal ]
        fhir:answer [  a fhir:integer ; integer ]
        fhir:answer [  a fhir:date ; date ]
        fhir:answer [  a fhir:dateTime ; dateTime ]
        fhir:answer [  a fhir:time ; time ]
        fhir:answer [  a fhir:string ; string ]
        fhir:answer [  a fhir:Coding ; Coding ]
        fhir:answer [  a fhir:Quantity ; Quantity ]
        fhir:answer [  a fhir:Reference ; Reference(Any) ]
    ] ... ) ;
    fhir:enableBehavior [ code ] ; # 0..1 I all | any
    fhir:disabledDisplay [ code ] ; # 0..1 hidden | protected
    fhir:required [ boolean ] ; # 0..1 I Whether the item must be included in data results
    fhir:repeats [ boolean ] ; # 0..1 I Whether the item may repeat
    fhir:readOnly [ boolean ] ; # 0..1 I Don't allow human editing
    fhir:maxLength [ integer ] ; # 0..1 I No more than these many characters
    fhir:answerConstraint [ code ] ; # 0..1 I optionsOnly | optionsOrType | optionsOrString
    fhir:answerValueSet [ canonical(ValueSet) ] ; # 0..1 I ValueSet containing permitted answers
    fhir:answerOption ( [ # 0..* I Permitted answer
      # value[x] : 1..1 Answer value. One of these 6
        fhir:value [  a fhir:integer ; integer ]
        fhir:value [  a fhir:date ; date ]
        fhir:value [  a fhir:time ; time ]
        fhir:value [  a fhir:string ; string ]
        fhir:value [  a fhir:Coding ; Coding ]
        fhir:value [  a fhir:Reference ; Reference(Any) ]
      fhir:initialSelected [ boolean ] ; # 0..1 Whether option is selected by default
    ] ... ) ;
    fhir:initial ( [ # 0..* I Initial value(s) when item is first rendered
      # value[x] : 1..1 Actual value for initializing the question. One of these 12
        fhir:value [  a fhir:boolean ; boolean ]
        fhir:value [  a fhir:decimal ; decimal ]
        fhir:value [  a fhir:integer ; integer ]
        fhir:value [  a fhir:date ; date ]
        fhir:value [  a fhir:dateTime ; dateTime ]
        fhir:value [  a fhir:time ; time ]
        fhir:value [  a fhir:string ; string ]
        fhir:value [  a fhir:uri ; uri ]
        fhir:value [  a fhir:Attachment ; Attachment ]
        fhir:value [  a fhir:Coding ; Coding ]
        fhir:value [  a fhir:Quantity ; Quantity ]
        fhir:value [  a fhir:Reference ; Reference(Any) ]
    ] ... ) ;
    fhir:item  ( [ See Questionnaire.item ] ... ) ; # 0..* Nested questionnaire items
  ] ... ) ;
]

Changes from both R4 and R4B

Questionnaire
Questionnaire.versionAlgorithm[x]
  • Added Element
Questionnaire.subjectType
  • Remove codes CatalogEntry, DeviceUseStatement, DocumentManifest, DomainResource, EffectEvidenceSynthesis, Media, MedicinalProduct, MedicinalProductAuthorization, MedicinalProductContraindication, MedicinalProductIndication, MedicinalProductIngredient, MedicinalProductInteraction, MedicinalProductManufactured, MedicinalProductPackaged, MedicinalProductPharmaceutical, MedicinalProductUndesirableEffect, RequestGroup, ResearchDefinition, ResearchElementDefinition, Resource, RiskEvidenceSynthesis, SubstanceSpecification
  • Add codes ActorDefinition, AdministrableProductDefinition, ArtifactAssessment, BiologicallyDerivedProductDispense, Citation, ClinicalUseDefinition, ConditionDefinition, DeviceAssociation, DeviceDispense, DeviceUsage, EncounterHistory, EvidenceReport, FormularyItem, GenomicStudy, ImagingSelection, Ingredient, InsuranceProduct, InventoryItem, InventoryReport, ManufacturedItemDefinition, MedicinalProductDefinition, NutritionIntake, NutritionProduct, PackagedProductDefinition, Permission, RegulatedAuthorization, RequestOrchestration, Requirements, SubscriptionStatus, SubscriptionTopic, SubstanceDefinition, TestPlan, Transport
Questionnaire.copyrightLabel
  • Added Element
Questionnaire.item.type
  • Remove codes choice, open-choice
  • Add codes question, coding
Questionnaire.item.disabledDisplay
  • Added Element
Questionnaire.item.answerConstraint
  • Added Element

See the Full Difference for further information

This analysis is available for R4 as XML or JSON and for R4B as XML or JSON.

See R4 <--> R5 Conversion Maps (status = See Conversions Summary.)

Structure

NameFlagsCard.TypeDescription & Constraintsdoco
.. Questionnaire TUDomainResourceA structured set of questions
+ Warning: Name should be usable as an identifier for the module by machine processing applications such as code generation
+ Rule: The link ids for groups and questions must be unique within the questionnaire

Elements defined in Ancestors: id, meta, implicitRules, language, text, contained, extension, modifierExtension
Interfaces Implemented: MetadataResource
... url ΣC0..1uriCanonical identifier for this questionnaire, represented as an absolute URI (globally unique)
+ Warning: URL should not contain | or # - these characters make processing canonical references problematic
... identifier Σ0..*IdentifierBusiness identifier for questionnaire

... version Σ0..1stringBusiness version of the questionnaire
.... versionAlgorithmStringstring
.... versionAlgorithmCodingCoding
... name ΣC0..1stringName for this questionnaire (computer friendly)
... title ΣT0..1stringName for this questionnaire (human friendly)
... derivedFrom Σ0..*canonical(Questionnaire)Based on Questionnaire

... status ?!ΣC1..1codedraft | active | retired | unknown
Binding: PublicationStatus (Required)
... experimental Σ0..1booleanFor testing purposes, not real usage
... subjectType Σ0..*codeResource that can be subject of QuestionnaireResponse
Binding: Resource Types (Required)

... date Σ0..1dateTimeDate last changed
... publisher ΣT0..1stringName of the publisher/steward (organization or individual)
... contact Σ0..*ContactDetailContact details for the publisher

... description ΣT0..1markdownNatural language description of the questionnaire
... useContext ΣTU0..*UsageContextThe context that the content is intended to support

... jurisdiction ΣXD0..*CodeableConceptIntended jurisdiction for questionnaire (if applicable)
Binding: Jurisdiction ValueSet (Extensible)

... purpose T0..1markdownWhy this questionnaire is defined
... copyright T0..1markdownUse and/or publishing restrictions
... copyrightLabel T0..1stringCopyright holder and year(s)
... approvalDate 0..1dateWhen the questionnaire was approved by publisher
... lastReviewDate 0..1dateWhen the questionnaire was last reviewed by the publisher
... effectivePeriod Σ0..1PeriodWhen the questionnaire is expected to be used
... code Σ0..*CodingConcept that represents the overall questionnaire
Binding: Questionnaire Question Codes (Example)

... item C0..*BackboneElementQuestions and sections within the Questionnaire
+ Rule: Group items must have nested items when Questionanire is complete
+ Warning: Groups should have items
+ Rule: Display items cannot have child items
+ Rule: Display items cannot have a "code" asserted
+ Rule: A question cannot have both answerOption and answerValueSet
+ Rule: Only coding, decimal, integer, date, dateTime, time, string or quantity items can have answerOption or answerValueSet
+ Rule: Required and repeat aren't permitted for display items
+ Rule: Initial values can't be specified for groups or display items
+ Rule: Read-only can't be specified for "display" items
+ Rule: Maximum length can only be declared for simple question types
+ Rule: If one or more answerOption is present, initial cannot be present. Use answerOption.initialSelected instead
+ Rule: If there are more than one enableWhen, enableBehavior must be specified
+ Rule: Can only have multiple initial values for repeating items
+ Warning: Can only have answerConstraint if answerOption or answerValueSet are present. (This is a warning because extensions may serve the same purpose)

.... linkId C1..1stringUnique id for item in questionnaire
+ Warning: Link ids should be 255 characters or less
.... definition 0..1uriElementDefinition - details for the item
.... code C0..*CodingCorresponding concept for this item in a terminology
Binding: Questionnaire Question Codes (Example)

.... prefix 0..1stringE.g. "1(a)", "2.5.3"
.... text T0..1stringPrimary text for the item
.... type C1..1codegroup | display | boolean | decimal | integer | date | dateTime +
Binding: Questionnaire Item Type (Required)
.... enableWhen ?!C0..*BackboneElementOnly allow data when
+ Rule: If the operator is 'exists', the value must be a boolean

..... question 1..1stringThe linkId of question that determines whether item is enabled/disabled
..... operator C1..1codeexists | = | != | > | < | >= | <=
Binding: Questionnaire Item Operator (Required)
..... answer[x] TC1..1Value for question comparison based on operator
Binding: Questionnaire Answer Codes (Example)
...... answerBooleanboolean
...... answerDecimaldecimal
...... answerIntegerinteger
...... answerDatedate
...... answerDateTimedateTime
...... answerTimetime
...... answerStringstring
...... answerCodingCoding
...... answerQuantityQuantity
...... answerReferenceReference(Any)
.... enableBehavior C0..1codeall | any
Binding: Enable When Behavior (Required)
.... disabledDisplay 0..1codehidden | protected
Binding: Questionnaire Item Disabled Display (Required)
.... required C0..1booleanWhether the item must be included in data results
.... repeats C0..1booleanWhether the item may repeat
.... readOnly C0..1booleanDon't allow human editing
.... maxLength C0..1integerNo more than these many characters
.... answerConstraint C0..1codeoptionsOnly | optionsOrType | optionsOrString
Binding: Questionnaire answer constraints value set (Required)
.... answerValueSet C0..1canonical(ValueSet)ValueSet containing permitted answers
.... answerOption C0..*BackboneElementPermitted answer

..... value[x] T1..1Answer value
Binding: Questionnaire Answer Codes (Example)
...... valueIntegerinteger
...... valueDatedate
...... valueTimetime
...... valueStringstring
...... valueCodingCoding
...... valueReferenceReference(Any)
..... initialSelected 0..1booleanWhether option is selected by default
.... initial C0..*BackboneElementInitial value(s) when item is first rendered

..... value[x] T1..1Actual value for initializing the question
Binding: Questionnaire Answer Codes (Example)
...... valueBooleanboolean
...... valueDecimaldecimal
...... valueIntegerinteger
...... valueDatedate
...... valueDateTimedateTime
...... valueTimetime
...... valueStringstring
...... valueUriuri
...... valueAttachmentAttachment
...... valueCodingCoding
...... valueQuantityQuantity
...... valueReferenceReference(Any)
.... item 0..*see itemNested questionnaire items


doco Documentation for this format icon

See the Extensions for this resource

UML Diagram (Legend)

Questionnaire (DomainResource) +MetadataResourceAn absolute URI that is used to identify this questionnaire when it is referenced in a specification, model, design or an instance; also called its canonical identifier. This SHOULD be globally unique and SHOULD be a literal address at which an authoritative instance of this questionnaire is (or will be) published. This URL can be the target of a canonical reference. It SHALL remain the same when the questionnaire is stored on different serversurl : uri [0..1]A formal identifier that is used to identify this questionnaire when it is represented in other formats, or referenced in a specification, model, design or an instanceidentifier : Identifier [0..*]The identifier that is used to identify this version of the questionnaire when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the questionnaire author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequenceversion : string [0..1]Indicates the mechanism used to compare versions to determine which is more currentversionAlgorithm[x] : DataType [0..1] « string|Coding; null (Strength=Extensible) VersionAlgorithm+ »A natural language name identifying the questionnaire. This name should be usable as an identifier for the module by machine processing applications such as code generationname : string [0..1] « This element has or is affected by some invariantsC »A short, descriptive, user-friendly title for the questionnairetitle : string [0..1]The URL of a Questionnaire that this Questionnaire is based onderivedFrom : canonical [0..*] « Questionnaire »The current state of this questionnaire (this element modifies the meaning of other elements)status : code [1..1] « null (Strength=Required)PublicationStatus! » « This element has or is affected by some invariantsC »A Boolean value to indicate that this questionnaire is authored for testing purposes (or education/evaluation/marketing) and is not intended for genuine usageexperimental : boolean [0..1]The types of subjects that can be the subject of responses created for the questionnairesubjectType : code [0..*] « null (Strength=Required)ResourceType! »The date (and optionally time) when the questionnaire was last significantly changed. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the questionnaire changesdate : dateTime [0..1]The name of the organization or individual responsible for the release and ongoing maintenance of the questionnairepublisher : string [0..1]Contact details to assist a user in finding and communicating with the publishercontact : ContactDetail [0..*]A free text natural language description of the questionnaire from a consumer's perspectivedescription : markdown [0..1]The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate questionnairesuseContext : UsageContext [0..*]A legal or geographic region in which the questionnaire is intended to be usedjurisdiction : CodeableConcept [0..*] « null (Strength=Extensible)JurisdictionValueSet+ »Explanation of why this questionnaire is needed and why it has been designed as it haspurpose : markdown [0..1]A copyright statement relating to the questionnaire and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the questionnairecopyright : markdown [0..1]A short string (<50 characters), suitable for inclusion in a page footer that identifies the copyright holder, effective period, and optionally whether rights are resctricted. (e.g. 'All rights reserved', 'Some rights reserved')copyrightLabel : string [0..1]The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usageapprovalDate : date [0..1]The date on which the resource content was last reviewed. Review happens periodically after approval but does not change the original approval datelastReviewDate : date [0..1]The period during which the questionnaire content was or is planned to be in active useeffectivePeriod : Period [0..1]An identifier for this collection of questions in a particular terminology such as LOINCcode : Coding [0..*] « null (Strength=Example)QuestionnaireQuestionCodes?? »ItemAn identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resourcelinkId : string [1..1] « This element has or is affected by some invariantsC »This element is a URI that refers to an [ElementDefinition](elementdefinition.html) or to an [ObservationDefinition](observationdefinition.html) that provides information about this item, including information that might otherwise be included in the instance of the Questionnaire resource. A detailed description of the construction of the URI is shown in [Comments](questionnaire.html#definition), belowdefinition : uri [0..1]A terminology code that corresponds to this group or question (e.g. a code from LOINC, which defines many questions and answers)code : Coding [0..*] « null (Strength=Example)QuestionnaireQuestionCodes?? » « This element has or is affected by some invariantsC »A short label for a particular group, question or set of display text within the questionnaire used for reference by the individual completing the questionnaireprefix : string [0..1]The name of a section, the text of a question or text content for a display itemtext : string [0..1]The type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, Coding, etc.)type : code [1..1] « null (Strength=Required)QuestionnaireItemType! » « This element has or is affected by some invariantsC »Controls how multiple enableWhen values are interpreted - whether all or any must be trueenableBehavior : code [0..1] « null (Strength=Required)EnableWhenBehavior! » « This element has or is affected by some invariantsC »Indicates if and how items that are disabled (because enableWhen evaluates to 'false') should be displayeddisabledDisplay : code [0..1] « null (Strength=Required)QuestionnaireItemDisabledDisp...! »An indication, if true, that the item must be present in a "completed" QuestionnaireResponse. If false, the item may be skipped when answering the questionnairerequired : boolean [0..1] « This element has or is affected by some invariantsC »An indication, if true, that a QuestionnaireResponse for this item may include multiple answers associated with a single instance of this item (for question-type items) or multiple repetitions of the item (for group-type items)repeats : boolean [0..1] « This element has or is affected by some invariantsC »An indication, when true, that the value cannot be changed by a human respondent to the QuestionnairereadOnly : boolean [0..1] « This element has or is affected by some invariantsC »The maximum number of characters that are permitted in the answer to be considered a "valid" QuestionnaireResponsemaxLength : integer [0..1] « This element has or is affected by some invariantsC »For items that have a defined set of allowed answers (via answerOption or answerValueSet), indicates whether values *other* than those specified can be selectedanswerConstraint : code [0..1] « null (Strength=Required)QuestionnaireAnswerConstraint! » « This element has or is affected by some invariantsC »A reference to a value set containing a list of values representing permitted answers for a questionanswerValueSet : canonical [0..1] « ValueSet » « This element has or is affected by some invariantsC »EnableWhenThe linkId for the question whose answer (or lack of answer) governs whether this item is enabledquestion : string [1..1]Specifies the criteria by which the question is enabledoperator : code [1..1] « null (Strength=Required)QuestionnaireItemOperator! » « This element has or is affected by some invariantsC »A value that the referenced question is tested using the specified operator in order for the item to be enabled. If there are multiple answers, a match on any of the answers suffices. If different behavior is desired (all must match, at least 2 must match, etc.), consider using the enableWhenExpression extensionanswer[x] : DataType [1..1] « boolean|decimal|integer|date|dateTime| time|string|Coding|Quantity|Reference(Any); null (Strength=Example) QuestionnaireAnswerCodes?? » « This element has or is affected by some invariantsC »AnswerOptionA potential answer that's allowed as the answer to this questionvalue[x] : DataType [1..1] « integer|date|time|string|Coding| Reference(Any); null (Strength=Example)QuestionnaireAnswerCodes?? »Indicates whether the answer value is selected when the list of possible answers is initially showninitialSelected : boolean [0..1]InitialThe actual value to for an initial answervalue[x] : DataType [1..1] « boolean|decimal|integer|date|dateTime| time|string|uri|Attachment|Coding|Quantity|Reference(Any); null (Strength=Example) QuestionnaireAnswerCodes?? »A constraint indicating that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true (this element modifies the meaning of other elements)enableWhen[0..*]One of the permitted answers for the questionanswerOption[0..*]One or more values that should be pre-populated in the answer when initially rendering the questionnaire for user inputinitial[0..*]Text, questions and other groups to be nested beneath a question or groupitem[0..*]A particular question, question grouping or display text that is part of the questionnaireitem[0..*]

XML Template

<Questionnaire xmlns="http://hl7.org/fhir"> doco
 <!-- from Resource: id, meta, implicitRules, and language -->
 <!-- from DomainResource: text, contained, extension, and modifierExtension -->
 <url value="[uri]"/><!-- 0..1 Canonical identifier for this questionnaire, represented as an absolute URI (globally unique) -->
 <identifier><!-- 0..* Identifier Business identifier for questionnaire --></identifier>
 <version value="[string]"/><!-- 0..1 Business version of the questionnaire -->
 <versionAlgorithm[x]><!-- 0..1 string|Coding How to compare versions --></versionAlgorithm[x]>
 <name value="[string]"/><!-- I 0..1 Name for this questionnaire (computer friendly) -->
 <title value="[string]"/><!-- 0..1 Name for this questionnaire (human friendly) -->
 <derivedFrom><!-- 0..* canonical(Questionnaire) Based on Questionnaire --></derivedFrom>
 <status value="[code]"/><!-- I 1..1 draft | active | retired | unknown -->
 <experimental value="[boolean]"/><!-- 0..1 For testing purposes, not real usage -->
 <subjectType value="[code]"/><!-- 0..* Resource that can be subject of QuestionnaireResponse -->
 <date value="[dateTime]"/><!-- 0..1 Date last changed -->
 <publisher value="[string]"/><!-- 0..1 Name of the publisher/steward (organization or individual) -->
 <contact><!-- 0..* ContactDetail Contact details for the publisher --></contact>
 <description value="[markdown]"/><!-- 0..1 Natural language description of the questionnaire -->
 <useContext><!-- 0..* UsageContext The context that the content is intended to support --></useContext>
 <jurisdiction><!-- 0..* CodeableConcept Intended jurisdiction for questionnaire (if applicable) --></jurisdiction>
 <purpose value="[markdown]"/><!-- 0..1 Why this questionnaire is defined -->
 <copyright value="[markdown]"/><!-- 0..1 Use and/or publishing restrictions -->
 <copyrightLabel value="[string]"/><!-- 0..1 Copyright holder and year(s) -->
 <approvalDate value="[date]"/><!-- 0..1 When the questionnaire was approved by publisher -->
 <lastReviewDate value="[date]"/><!-- 0..1 When the questionnaire was last reviewed by the publisher -->
 <effectivePeriod><!-- 0..1 Period When the questionnaire is expected to be used --></effectivePeriod>
 <code><!-- 0..* Coding Concept that represents the overall questionnaire --></code>
 <item>  <!-- 0..* Questions and sections within the Questionnaire -->
  <linkId value="[string]"/><!-- I 1..1 Unique id for item in questionnaire -->
  <definition value="[uri]"/><!-- 0..1 ElementDefinition - details for the item -->
  <code><!-- I 0..* Coding Corresponding concept for this item in a terminology --></code>
  <prefix value="[string]"/><!-- 0..1 E.g. "1(a)", "2.5.3" -->
  <text value="[string]"/><!-- 0..1 Primary text for the item -->
  <type value="[code]"/><!-- I 1..1 group | display | boolean | decimal | integer | date | dateTime + -->
  <enableWhen>  <!-- I 0..* Only allow data when -->
   <question value="[string]"/><!-- 1..1 The linkId of question that determines whether item is enabled/disabled -->
   <operator value="[code]"/><!-- I 1..1 exists | = | != | > | < | >= | <= -->
   <answer[x]><!-- I 1..1 boolean|decimal|integer|date|dateTime|time|string|Coding|
     Quantity|Reference(Any) Value for question comparison based on operator --></answer[x]>
  </enableWhen>
  <enableBehavior value="[code]"/><!-- I 0..1 all | any -->
  <disabledDisplay value="[code]"/><!-- 0..1 hidden | protected -->
  <required value="[boolean]"/><!-- I 0..1 Whether the item must be included in data results -->
  <repeats value="[boolean]"/><!-- I 0..1 Whether the item may repeat -->
  <readOnly value="[boolean]"/><!-- I 0..1 Don't allow human editing -->
  <maxLength value="[integer]"/><!-- I 0..1 No more than these many characters -->
  <answerConstraint value="[code]"/><!-- I 0..1 optionsOnly | optionsOrType | optionsOrString -->
  <answerValueSet><!-- I 0..1 canonical(ValueSet) ValueSet containing permitted answers --></answerValueSet>
  <answerOption>  <!-- I 0..* Permitted answer -->
   <value[x]><!-- 1..1 integer|date|time|string|Coding|Reference(Any) Answer value --></value[x]>
   <initialSelected value="[boolean]"/><!-- 0..1 Whether option is selected by default -->
  </answerOption>
  <initial>  <!-- I 0..* Initial value(s) when item is first rendered -->
   <value[x]><!-- 1..1 boolean|decimal|integer|date|dateTime|time|string|uri|
     Attachment|Coding|Quantity|Reference(Any) Actual value for initializing the question --></value[x]>
  </initial>
  <item><!-- 0..* Content as for Questionnaire.item Nested questionnaire items --></item>
 </item>
</Questionnaire>

JSON Template

{doco
  "resourceType" : "Questionnaire",
  // from Resource: id, meta, implicitRules, and language
  // from DomainResource: text, contained, extension, and modifierExtension
  "url" : "<uri>", // Canonical identifier for this questionnaire, represented as an absolute URI (globally unique)
  "identifier" : [{ Identifier }], // Business identifier for questionnaire
  "version" : "<string>", // Business version of the questionnaire
  // versionAlgorithm[x]: How to compare versions. One of these 2:
  "versionAlgorithmString" : "<string>",
  "versionAlgorithmCoding" : { Coding },
  "name" : "<string>", // I Name for this questionnaire (computer friendly)
  "title" : "<string>", // Name for this questionnaire (human friendly)
  "derivedFrom" : ["<canonical(Questionnaire)>"], // Based on Questionnaire
  "status" : "<code>", // I R!  draft | active | retired | unknown
  "experimental" : <boolean>, // For testing purposes, not real usage
  "subjectType" : ["<code>"], // Resource that can be subject of QuestionnaireResponse
  "date" : "<dateTime>", // Date last changed
  "publisher" : "<string>", // Name of the publisher/steward (organization or individual)
  "contact" : [{ ContactDetail }], // Contact details for the publisher
  "description" : "<markdown>", // Natural language description of the questionnaire
  "useContext" : [{ UsageContext }], // The context that the content is intended to support
  "jurisdiction" : [{ CodeableConcept }], // Intended jurisdiction for questionnaire (if applicable)
  "purpose" : "<markdown>", // Why this questionnaire is defined
  "copyright" : "<markdown>", // Use and/or publishing restrictions
  "copyrightLabel" : "<string>", // Copyright holder and year(s)
  "approvalDate" : "<date>", // When the questionnaire was approved by publisher
  "lastReviewDate" : "<date>", // When the questionnaire was last reviewed by the publisher
  "effectivePeriod" : { Period }, // When the questionnaire is expected to be used
  "code" : [{ Coding }], // Concept that represents the overall questionnaire
  "item" : [{ // Questions and sections within the Questionnaire
    "linkId" : "<string>", // I R!  Unique id for item in questionnaire
    "definition" : "<uri>", // ElementDefinition - details for the item
    "code" : [{ Coding }], // I Corresponding concept for this item in a terminology
    "prefix" : "<string>", // E.g. "1(a)", "2.5.3"
    "text" : "<string>", // Primary text for the item
    "type" : "<code>", // I R!  group | display | boolean | decimal | integer | date | dateTime +
    "enableWhen" : [{ // I Only allow data when
      "question" : "<string>", // R!  The linkId of question that determines whether item is enabled/disabled
      "operator" : "<code>", // I R!  exists | = | != | > | < | >= | <=
      // answer[x]: Value for question comparison based on operator. One of these 10:
      "answerBoolean" : <boolean>,
      "answerDecimal" : <decimal>,
      "answerInteger" : <integer>,
      "answerDate" : "<date>",
      "answerDateTime" : "<dateTime>",
      "answerTime" : "<time>",
      "answerString" : "<string>",
      "answerCoding" : { Coding },
      "answerQuantity" : { Quantity },
      "answerReference" : { Reference(Any) }
    }],
    "enableBehavior" : "<code>", // I all | any
    "disabledDisplay" : "<code>", // hidden | protected
    "required" : <boolean>, // I Whether the item must be included in data results
    "repeats" : <boolean>, // I Whether the item may repeat
    "readOnly" : <boolean>, // I Don't allow human editing
    "maxLength" : <integer>, // I No more than these many characters
    "answerConstraint" : "<code>", // I optionsOnly | optionsOrType | optionsOrString
    "answerValueSet" : "<canonical(ValueSet)>", // I ValueSet containing permitted answers
    "answerOption" : [{ // I Permitted answer
      // value[x]: Answer value. One of these 6:
      "valueInteger" : <integer>,
      "valueDate" : "<date>",
      "valueTime" : "<time>",
      "valueString" : "<string>",
      "valueCoding" : { Coding },
      "valueReference" : { Reference(Any) },
      "initialSelected" : <boolean> // Whether option is selected by default
    }],
    "initial" : [{ // I Initial value(s) when item is first rendered
      // value[x]: Actual value for initializing the question. One of these 12:
      "valueBoolean" : <boolean>,
      "valueDecimal" : <decimal>,
      "valueInteger" : <integer>,
      "valueDate" : "<date>",
      "valueDateTime" : "<dateTime>",
      "valueTime" : "<time>",
      "valueString" : "<string>",
      "valueUri" : "<uri>",
      "valueAttachment" : { Attachment },
      "valueCoding" : { Coding },
      "valueQuantity" : { Quantity },
      "valueReference" : { Reference(Any) }
    }],
    "item" : [{ Content as for Questionnaire.item }] // Nested questionnaire items
  }]
}

Turtle Template

@prefix fhir: <http://hl7.org/fhir/> .doco


[ a fhir:Questionnaire;
  fhir:nodeRole fhir:treeRoot; # if this is the parser root

  # from Resource: .id, .meta, .implicitRules, and .language
  # from DomainResource: .text, .contained, .extension, and .modifierExtension
  fhir:url [ uri ] ; # 0..1 Canonical identifier for this questionnaire, represented as an absolute URI (globally unique)
  fhir:identifier  ( [ Identifier ] ... ) ; # 0..* Business identifier for questionnaire
  fhir:version [ string ] ; # 0..1 Business version of the questionnaire
  # versionAlgorithm[x] : 0..1 How to compare versions. One of these 2
    fhir:versionAlgorithm [  a fhir:string ; string ]
    fhir:versionAlgorithm [  a fhir:Coding ; Coding ]
  fhir:name [ string ] ; # 0..1 I Name for this questionnaire (computer friendly)
  fhir:title [ string ] ; # 0..1 Name for this questionnaire (human friendly)
  fhir:derivedFrom  ( [ canonical(Questionnaire) ] ... ) ; # 0..* Based on Questionnaire
  fhir:status [ code ] ; # 1..1 I draft | active | retired | unknown
  fhir:experimental [ boolean ] ; # 0..1 For testing purposes, not real usage
  fhir:subjectType  ( [ code ] ... ) ; # 0..* Resource that can be subject of QuestionnaireResponse
  fhir:date [ dateTime ] ; # 0..1 Date last changed
  fhir:publisher [ string ] ; # 0..1 Name of the publisher/steward (organization or individual)
  fhir:contact  ( [ ContactDetail ] ... ) ; # 0..* Contact details for the publisher
  fhir:description [ markdown ] ; # 0..1 Natural language description of the questionnaire
  fhir:useContext  ( [ UsageContext ] ... ) ; # 0..* The context that the content is intended to support
  fhir:jurisdiction  ( [ CodeableConcept ] ... ) ; # 0..* Intended jurisdiction for questionnaire (if applicable)
  fhir:purpose [ markdown ] ; # 0..1 Why this questionnaire is defined
  fhir:copyright [ markdown ] ; # 0..1 Use and/or publishing restrictions
  fhir:copyrightLabel [ string ] ; # 0..1 Copyright holder and year(s)
  fhir:approvalDate [ date ] ; # 0..1 When the questionnaire was approved by publisher
  fhir:lastReviewDate [ date ] ; # 0..1 When the questionnaire was last reviewed by the publisher
  fhir:effectivePeriod [ Period ] ; # 0..1 When the questionnaire is expected to be used
  fhir:code  ( [ Coding ] ... ) ; # 0..* Concept that represents the overall questionnaire
  fhir:item ( [ # 0..* Questions and sections within the Questionnaire
    fhir:linkId [ string ] ; # 1..1 I Unique id for item in questionnaire
    fhir:definition [ uri ] ; # 0..1 ElementDefinition - details for the item
    fhir:code  ( [ Coding ] ... ) ; # 0..* I Corresponding concept for this item in a terminology
    fhir:prefix [ string ] ; # 0..1 E.g. "1(a)", "2.5.3"
    fhir:text [ string ] ; # 0..1 Primary text for the item
    fhir:type [ code ] ; # 1..1 I group | display | boolean | decimal | integer | date | dateTime +
    fhir:enableWhen ( [ # 0..* I Only allow data when
      fhir:question [ string ] ; # 1..1 The linkId of question that determines whether item is enabled/disabled
      fhir:operator [ code ] ; # 1..1 I exists | = | != | > | < | >= | <=
      # answer[x] : 1..1 I Value for question comparison based on operator. One of these 10
        fhir:answer [  a fhir:boolean ; boolean ]
        fhir:answer [  a fhir:decimal ; decimal ]
        fhir:answer [  a fhir:integer ; integer ]
        fhir:answer [  a fhir:date ; date ]
        fhir:answer [  a fhir:dateTime ; dateTime ]
        fhir:answer [  a fhir:time ; time ]
        fhir:answer [  a fhir:string ; string ]
        fhir:answer [  a fhir:Coding ; Coding ]
        fhir:answer [  a fhir:Quantity ; Quantity ]
        fhir:answer [  a fhir:Reference ; Reference(Any) ]
    ] ... ) ;
    fhir:enableBehavior [ code ] ; # 0..1 I all | any
    fhir:disabledDisplay [ code ] ; # 0..1 hidden | protected
    fhir:required [ boolean ] ; # 0..1 I Whether the item must be included in data results
    fhir:repeats [ boolean ] ; # 0..1 I Whether the item may repeat
    fhir:readOnly [ boolean ] ; # 0..1 I Don't allow human editing
    fhir:maxLength [ integer ] ; # 0..1 I No more than these many characters
    fhir:answerConstraint [ code ] ; # 0..1 I optionsOnly | optionsOrType | optionsOrString
    fhir:answerValueSet [ canonical(ValueSet) ] ; # 0..1 I ValueSet containing permitted answers
    fhir:answerOption ( [ # 0..* I Permitted answer
      # value[x] : 1..1 Answer value. One of these 6
        fhir:value [  a fhir:integer ; integer ]
        fhir:value [  a fhir:date ; date ]
        fhir:value [  a fhir:time ; time ]
        fhir:value [  a fhir:string ; string ]
        fhir:value [  a fhir:Coding ; Coding ]
        fhir:value [  a fhir:Reference ; Reference(Any) ]
      fhir:initialSelected [ boolean ] ; # 0..1 Whether option is selected by default
    ] ... ) ;
    fhir:initial ( [ # 0..* I Initial value(s) when item is first rendered
      # value[x] : 1..1 Actual value for initializing the question. One of these 12
        fhir:value [  a fhir:boolean ; boolean ]
        fhir:value [  a fhir:decimal ; decimal ]
        fhir:value [  a fhir:integer ; integer ]
        fhir:value [  a fhir:date ; date ]
        fhir:value [  a fhir:dateTime ; dateTime ]
        fhir:value [  a fhir:time ; time ]
        fhir:value [  a fhir:string ; string ]
        fhir:value [  a fhir:uri ; uri ]
        fhir:value [  a fhir:Attachment ; Attachment ]
        fhir:value [  a fhir:Coding ; Coding ]
        fhir:value [  a fhir:Quantity ; Quantity ]
        fhir:value [  a fhir:Reference ; Reference(Any) ]
    ] ... ) ;
    fhir:item  ( [ See Questionnaire.item ] ... ) ; # 0..* Nested questionnaire items
  ] ... ) ;
]

Changes from both R4 and R4B

Questionnaire
Questionnaire.versionAlgorithm[x]
  • Added Element
Questionnaire.subjectType
  • Remove codes CatalogEntry, DeviceUseStatement, DocumentManifest, DomainResource, EffectEvidenceSynthesis, Media, MedicinalProduct, MedicinalProductAuthorization, MedicinalProductContraindication, MedicinalProductIndication, MedicinalProductIngredient, MedicinalProductInteraction, MedicinalProductManufactured, MedicinalProductPackaged, MedicinalProductPharmaceutical, MedicinalProductUndesirableEffect, RequestGroup, ResearchDefinition, ResearchElementDefinition, Resource, RiskEvidenceSynthesis, SubstanceSpecification
  • Add codes ActorDefinition, AdministrableProductDefinition, ArtifactAssessment, BiologicallyDerivedProductDispense, Citation, ClinicalUseDefinition, ConditionDefinition, DeviceAssociation, DeviceDispense, DeviceUsage, EncounterHistory, EvidenceReport, FormularyItem, GenomicStudy, ImagingSelection, Ingredient, InsuranceProduct, InventoryItem, InventoryReport, ManufacturedItemDefinition, MedicinalProductDefinition, NutritionIntake, NutritionProduct, PackagedProductDefinition, Permission, RegulatedAuthorization, RequestOrchestration, Requirements, SubscriptionStatus, SubscriptionTopic, SubstanceDefinition, TestPlan, Transport
Questionnaire.copyrightLabel
  • Added Element
Questionnaire.item.type
  • Remove codes choice, open-choice
  • Add codes question, coding
Questionnaire.item.disabledDisplay
  • Added Element
Questionnaire.item.answerConstraint
  • Added Element

See the Full Difference for further information

This analysis is available for R4 as XML or JSON and for R4B as XML or JSON.

See R4 <--> R5 Conversion Maps (status = See Conversions Summary.)

 

Additional definitions: Master Definition XML + JSON, XML Schema/Schematron + JSON Schema, ShEx (for Turtle) , the spreadsheet version & the dependency analysis

PathValueSetTypeDocumentation
Questionnaire.versionAlgorithm[x] VersionAlgorithm Extensible

Indicates the mechanism used to compare versions to determine which is more current.

Questionnaire.status PublicationStatus Required

The lifecycle status of an artifact.

Questionnaire.subjectType ResourceType Required

Concrete FHIR Resource Types

Questionnaire.jurisdiction JurisdictionValueSet Extensible

This value set defines a base set of codes for country, country subdivision and region for indicating where a resource is intended to be used.

Note: The codes for countries and country subdivisions are taken from ISO 3166 icon while the codes for "supra-national" regions are from UN Standard country or area codes for statistical use (M49) icon.

Questionnaire.code QuestionnaireQuestionCodes (a valid code from LOINC icon)Example

Example list of codes for questions and groups of questions. (Not necessarily complete or appropriate.)

Questionnaire.item.code QuestionnaireQuestionCodes (a valid code from LOINC icon)Example

Example list of codes for questions and groups of questions. (Not necessarily complete or appropriate.)

Questionnaire.item.type QuestionnaireItemType Required

Distinguishes groups from questions and display text and indicates data type for questions.

Questionnaire.item.enableWhen.operator QuestionnaireItemOperator Required

The criteria by which a question is enabled.

Questionnaire.item.enableWhen.answer[x] QuestionnaireAnswerCodes (a valid code from SNOMED CT icon)Example

Example list of codes for answers to questions. (Not complete or necessarily appropriate.)

Questionnaire.item.enableBehavior EnableWhenBehavior Required

Controls how multiple enableWhen values are interpreted - whether all or any must be true.

Questionnaire.item.disabledDisplay QuestionnaireItemDisabledDisplay Required

Codes that guide the display of disabled questionnaire items

Questionnaire.item.answerConstraint QuestionnaireAnswerConstraint (a valid code from Questionnaire answer constraint codes)Required

Codes that describe the types of constraints possible on a question item that has a list of permitted answers

Questionnaire.item.answerOption.value[x] QuestionnaireAnswerCodes (a valid code from SNOMED CT icon)Example

Example list of codes for answers to questions. (Not complete or necessarily appropriate.)

Questionnaire.item.initial.value[x] QuestionnaireAnswerCodes (a valid code from SNOMED CT icon)Example

Example list of codes for answers to questions. (Not complete or necessarily appropriate.)

UniqueKeyLevelLocationDescriptionExpression
img cnl-0Warning (base)Name should be usable as an identifier for the module by machine processing applications such as code generationname.exists() implies name.matches('^[A-Z]([A-Za-z0-9_]){1,254}$')
img cnl-1Warning Questionnaire.urlURL should not contain | or # - these characters make processing canonical references problematicexists() implies matches('^[^|# ]+$')
img que-1aRule Questionnaire.itemGroup items must have nested items when Questionanire is complete(type='group' and %resource.status='complete') implies item.empty().not()
img que-1bWarning Questionnaire.itemGroups should have itemstype='group' implies item.empty().not()
img que-1cRule Questionnaire.itemDisplay items cannot have child itemstype='display' implies item.empty()
img que-2Rule (base)The link ids for groups and questions must be unique within the questionnairedescendants().linkId.isDistinct()
img que-3Rule Questionnaire.itemDisplay items cannot have a "code" assertedtype!='display' or code.empty()
img que-4Rule Questionnaire.itemA question cannot have both answerOption and answerValueSetanswerOption.empty() or answerValueSet.empty()
img que-5Rule Questionnaire.itemOnly coding, decimal, integer, date, dateTime, time, string or quantity items can have answerOption or answerValueSet(type='coding' 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())
img que-6Rule Questionnaire.itemRequired and repeat aren't permitted for display itemstype!='display' or (required.empty() and repeats.empty())
img que-7Rule Questionnaire.item.enableWhenIf the operator is 'exists', the value must be a booleanoperator = 'exists' implies (answer is boolean)
img que-8Rule Questionnaire.itemInitial values can't be specified for groups or display items(type!='group' and type!='display') or initial.empty()
img que-9Rule Questionnaire.itemRead-only can't be specified for "display" itemstype!='display' or readOnly.empty()
img que-10Rule Questionnaire.itemMaximum length can only be declared for simple question types(type in ('boolean' | 'decimal' | 'integer' | 'string' | 'text' | 'url')) or answerConstraint='optionOrString' or maxLength.empty()
img que-11Rule Questionnaire.itemIf one or more answerOption is present, initial cannot be present. Use answerOption.initialSelected insteadanswerOption.empty() or initial.empty()
img que-12Rule Questionnaire.itemIf there are more than one enableWhen, enableBehavior must be specifiedenableWhen.count() > 1 implies enableBehavior.exists()
img que-13Rule Questionnaire.itemCan only have multiple initial values for repeating itemsrepeats=true or initial.count() <= 1
img que-14Warning Questionnaire.itemCan only have answerConstraint if answerOption or answerValueSet are present. (This is a warning because extensions may serve the same purpose)answerConstraint.exists() implies answerOption.exists() or answerValueSet.exists()
img que-15Warning Questionnaire.item.linkIdLink ids should be 255 characters or less$this.length() <= 255

  • Questionnaires may be used to represent predefined forms or panels, referenced using items of type "group"
  • Questions may be nested. The Questionnaire resource supports nested items beneath both items of type "group" (which doesn't capture an answer of its own) as well as beneath questions
  • Groups and Questions may have linkIds allowing groups and question answers captured in a QuestionnaireResponse to be associated with their corresponding group or question.
  • Questionnaire allows for flexible naming and structuring of its contents to reflect the flexible and varying nature of forms and questionnaires. It explicitly does not try to standardize or streamline exchange of its contents outside its context of use, although exchanging partners may further constrain its structure and flexibility using profiles to define standardized, reusable forms.
  • Because of the lack of explicit support for Questionnaires in HL7 v3 icon, CDA icon Documents frequently used named sections with Observations to model Questionnaires. Such use cases should now use the Questionnaire Resource instead.
  • The order of questions within groups, groups within groups and groups within questions is relevant and must be retained for display and capture.
  • Display items allow the inclusion of instructions, background information and similar content within a questionnaire.
  • In cases where it is necessary or appropriate to capture the reason why a response is missing (that is, why a particular question was not answered), there should be an explicit child item defined for the relevant question(s) in the Questionnaire; e.g. add a child question of "Reason not specified:" with an enableWhen operator "not exists" to the parent question.

The base questionnaire resource is aimed at the capabilities of "most" healthcare systems that deal with forms and questionnaires. While the resource structure supports a reasonable degree of complexity, it doesn't provide the degree of control over rendering, question flow and data management needed by some portions of the healthcare space. Many of these more sophisticated requirements are addressed by a supplemental implementation guide called Structured Data Capture (SDC) icon. This implementation guide covers the following capabilities, plus several others:

  • Rendering grids of questions, multi-column drop-downs, multi-language questionnaires, and other 'advanced' formatting capabilities
  • Advanced dynamic questionnaires including calculated scores, enabling of questions and groups based on complex logic, drop-downs driven by answers to other questions
  • Support for populating questionnaires from existing clinical data based on the current patient, encounter, etc., including the ability to render the form as HTML or to redirect to a website to complete unanswered items
  • Support for extracting information from a completed QuestionnaireResponse to generate other FHIR resources such as Observations, MedicationStatements, etc.
  • Support for completing 'adaptive' questionnaires (see below)

Some questionnaires might not provide a full listing of questions, instead relying on a service to interactively send partially completed forms to a server which generates the next set of questions. As such, some questionnaires might be 'active' but have either no questions or an insufficient set of questions for their purpose. Further guidance on the use of such forms, can be found in the SDC implementation guide.

There is considerable overlap between the information covered by Questionnaires and other Resources (especially FamilyMemberHistory, MedicationStatement, Observation, Procedure, etc.). Questionnaire's flexible structure can easily be misused to capture any data, even data that should be captured as separate Resources. The choice between using Questionnaires or separate Resources may be dictated by the procedure of collection and recording; e.g. if the data is captured as a physician-agreed (electronic) form, it might be impossible or undesirable to distill separate resources from it and capturing the data in a Questionnaire would be most appropriate.

However, data captured only in Questionnaires can be difficult to query after-the-fact. Queries against other Resources will not return data captured only in Questionnaires and querying against Questionnaires directly might not find all desired data, depending on how the questions may have been phrased or encoded over time or by different clinicians. Moreover, interoperability of such Questionnaires is limited, as interpretation of its contents is only known to the circle of parties that were involved in its definition: encoding data from such Questionnaires using more specific resources increases the availability of the information they contain.

It is entirely possible for data to exist in both QuestionnaireResponse and in other resources. For example, data may be captured in QuestionnaireResponse as part of an intake questionnaire. That data may then be propagated into the Patient resource (demographics), FamilyMemberHistory, AllergyIntolerance, MedicationStatement and/or Observation resources to allow the data to be queried and analyzed. The original QuestionnaireResponse instance can be retained for traceability purposes. If desired, a Provenance resource can be used to identify the Questionnaire as the data source for the other resources. For example, if a questionnaire question asks "what is your weight", an Observation with the appropriate Observation.code and the specified answer as the Observation.valueQuantity can be created.

Profiling can be used to define the constraints of a set of Questionnaires - for example that a particular system only supports Questionnaires where answers have certain data types, only recognizes certain extensions, mandates the presence of certain metadata, etc. However, profiling should NOT be used to define the content of a specific Questionnaire instance. To define a Questionnaire instance, simply create an instance of Questionnaire as you would any other resource.

A Questionnaire is built out of two components, Questionnaire and item:

  • The main component is Questionnaire, which holds information about the Questionnaire, like the identifier, publisher, date authored, title, etc. The Questionnaire contains zero or more items which define the content of the questionnaire (zero items allows for the possibility of narrative-only questionnaires, though these provide little computable information).
  • Items have one of three sub-types, distinguished by the type element:
    • display items convey text to be rendered on the form that won't capture data and which won't contain nested items. This might include copyright or authorship information, instructions or other background information.
    • group items organize content of the questionnaire into sections, sub-sections, etc. Groups don't have answers associated with them directly, but generally contain child 'question' items which do.
    • question items ask a specific question to which an answer may be given. There isn't a single type for question items. Instead, the type conveys the data type of the answer for the question. If an item isn't a 'display' or a 'group', then it is a question which allows a particular type of answer to be gathered. Questions may also have nested content - groups and/or other questions. This way, one can model "panels" of questions which would only be relevant (and thus would only be displayed) depending on the answers of a parent question; e.g. a question "Did the patient receive treatment in the past six months?" would contain a nested group of questions asking for further details about the treatment. See an example from the Australian New South Wales blue book icon

Specific controls on dynamic display of groups, questions, etc. based on the answers to other questions is outside the scope of the base resource and are handled using extensions.

Group text is intended to provide a "label" for a collection of nested items. The text will often be rendered in a "heading" style. As such, it should be kept relatively short. Detailed instructions should be conveyed by a nested "display" item. It's not necessary to create groups in order to relate an instruction to a collection of questions - you can simply intermix display items and questions or groups, with the expectation that users will see the display text before encountering the following questions.

Some properties defined at the 'group' level will impact the behavior of everything within the group. For example, if a 'group' item is marked as readOnly=true, then all items within that group are automatically treated as readOnly - even if they explicitly declare readOnly=false. The same holds for enableWhen. If a group is 'disabled' based on its enableWhen settings, then all child items are automatically disabled - regardless of whether they have enableWhen declared or how those enableWhen conditions might resolve. Some extensions (e.g. the SDC 'hidden' extension) behave in the same manner. Systems MAY choose to raise errors or warnings if questionnaires have conflicting settings. E.g. if a group is marked as readOnly=true and a descendant item explicitly declares readOnly=false. This wouldn't be because the behavior is unclear, but more to draw the author's attention to the fact that their desired behavior for the child will not be realized due to the setting of the ancestor group.

Behavior of parent 'question' items (i.e. questions with child groups or questions) can also influence descendant elements, but not as strongly. If a question is readOnly, that doesn't mean that child items are also readOnly. However, if a question is disabled, all descendant items are also disabled. Similarly, a 'hidden' question, would hide child elements as well.

LinkIds are globally unique in a Questionnaire and are how items in a QuestionnaireResponse are tied to their corresponding Questionnaire item. The QuestionnaireResponse page includes a diagram showing how response items are linked to their corresponding Questionnaire items. Questions and their responses are tied together by their linkIds. LinkIds are unique across all items in a Questionnaire, but can sometimes appear multiple times within a QuestionnaireResponse. The diagram on the right shows a Questionnaire with a hierarchy of group and question items, some marked as 'repeats'=true, and others false and with similar variation in 'required'=true and false. It also shows a hypothetical QuestionnaireResponse that is valid against that questionnaire with appropriate nesting of items and answers and linkIds showing the alignment between the Questionnaire and QuestionnaireResponse items.

There are three different "identifying" elements within Questionnaire: identifier, id and linkId. Each serves very distinct purposes:

  • The identifier element is used to reference the overall questionnaire in business terms. It is the number printed across the top of the form or listed beside the form when making a choice between alternate forms.
  • The id attribute supported on each element is used for references within a resource, for example linking narrative to discrete elements. Ids are not generally displayed to end users
  • The linkId element on questions and groups establishes a link between elements in a QuestionnaireResponse and their definition inside a Questionnaire. This is the only way to link between the groups and questions in a Questionnaire and QuestionnaireResponse. These are also not displayed to end users

Questionnaires can be crafted using any questions the author can conceive and can be phrased in whatever manner is appropriate or convenient. However, standardization of questions and the constraints enforced on the accompanying answers increases the ability to compare data gathered across questionnaires. Items can be directly linked to an ElementDefinition using Questionnaire.item.definition which provides details for the item. If a definition is provided, then the following element values can be derived from the definition:

  • code (from ElementDefinition.code)
  • text (from ElementDefinition.label)
  • required (inferred from ElementDefinition.min)
  • repeats (inferred from ElementDefinition.max)
  • maxLength (from ElementDefinition.maxLength)
  • answerValueSet (from ElementDefinition.binding.valueSet)
  • initial.value[x] or fixed[x] (from ElementDefinition.defaultValue[x] - depending on whether readOnly is set)

QuestionnaireResponse.item.type corresponds to ElementDefinition.type, however item.type is mandatory in Questionnaire, so it can't be 'populated' because it must exist for the item to exist at all. However, the values specified for item.type and ElementDefinition.type do need to correspond. Complex types such as Address or anything based on BackboneElement would correspond to 'group', while simple types would normally map directly.

In addition, extensions and elements that have corresponding extensions should also propagate. Specifically:

  • Any extensions that have a context of both ElementDefinition and Questionnaire.item (e.g. maxSize) should propagate
  • Any extensions defined for Questionnaire.item that directly correspond to elements on ElementDefinition should also propagate. E.g.:
    • ElementDefinition.minValue[x] -> minValue
    • ElementDefinition.maxValue[x] -> maxValue
    • There are Questionnaire extensions defined in the SDC IG icon that correspond to min, max, type.targetProfile and constraint

Any information provided in these elements overrides the information from the definition, and some are always required to be populated so that invariants can be enforced, etc. The url refers to an ElementDefinition in StructureDefinition, and always starts with the canonical URL for the target resource. When referring to a StructureDefinition, a fragment identifier is used to specify the element definition by its id (Element.id). E.g. http://hl7.org/fhir/StructureDefinition/Observation#Observation.value[x]. In the absence of a fragment identifier, the first/root element definition in the target is the matching element definition. Examples:

Value of definitionExplanation
http://hl7.org/fhir/StructureDefinition/Observation#Observation.effectiveDateTimeA reference to the standard Observation element effectiveDateTime
http://example.org/definitions/xxxA reference to the logical model "xxx" that represents a data element
http://example.org/StructureDefinition/Oedema#Observation.category:XXXA reference to slice XXX on the Observation category element on an Oedema Scale profile
http://example.org/StructureDefinition/Oedema|2.0#Observation.category:XXXA reference to slice XXX on the Observation category element on an Oedema Scale profile, specifying version 2.0

The definitions may also be used to automatically pre-populate answers, or extract data from a corresponding pre-existing QuestionnaireResponse resource.

Note that LOINC codes implicitly icon define logical models whose elements can be considered question definitions.

NOTE: Even if a standard question definition is provided , information such as the question text, data type and value set SHOULD still be declared for the question. Systems processing the questionnaire might not have access to or support the ability to look up the question definitions from external sources. If the information is not included in-line within the questionnaire, other systems might not be able to render or use the Questionnaire. The questionnaire-definitionBased extension can be used to flag that a questionnaire requires the ability to resolve and use item.definition information to fully understand the Questionnaire. Systems that validate, render or otherwise process the questionnaire SHOULD check for this extension.

If an external definition is included along with question information such as question text, data type or value set, it is expected that the content for the question and the referenced definition would be in alignment. However, FHIR does not dictate what degree of alignment is required; e.g. Does the question text need to match exactly? Is it legitimate for a question to constrain the allowed value set of possible answers? These rules will need to be established within implementation environments.

The codes for the data type for each question are slightly different than the data types allowed in the QuestionnaireResponse resource. Where the names are the same (ignoring case), the "answer" must use the specified type. Where the names are different, the mappings are as follows:

Questionnaire AnswerFormat code QuestionnaireResponse data type
text string
url uri
coding Coding

Many questionnaires place constraints on the allowed list of values for a given question. FHIR supports this notion through the item.answerValueSet or the item.answerOption element.

The "answerOption" mechanism is simplest - all possible answers are listed in-line with the question using the item.answerOption element. Maintenance of the set of permitted question answers involves maintenance of the questionnaire itself.

The "answerValueSet" mechanism is more sophisticated. Rather than listing the possible answers directly, the item.answerValueSet element refers to a ValueSet resource. This approach adds complexity for questionnaires having a simple list of strings as choices for a question, but provides several benefits, including:

  • Questionnaires that reference codes from externally defined code systems have a means of doing so
  • Answer sets can be shared across questions (and there are many questionnaires where this capability is useful)
  • The full capability of value sets can be brought into play, including the ability to use ConceptMap to link and translate from questionnaire-specific codes to other codes, the use of multiple display names (e.g. different languages), the ability to use coded ordinals, and the ability to allow choices from larger value sets (e.g. "all SNOMED CT procedure codes")

In many cases, the set of code choices will be specific to a given questionnaire and should be maintained as part of the questionnaire. In this case, the referenced ValueSet can be included as a contained resource. All contained ValueSets are listed together and then are referenced by the individual questions as necessary. Alternatively, the item.answerValueSet element can reference the value set in a version-specific manner. This ensures that the Questionnaire will not adopt a new version of the referenced value set without revising the Questionnaire to point to that new version - putting the author of the Questionnaire in control of any changes.

Many questions have a common set of possible codes for their answer. These value sets may be useful to help, and when referenced by full URL, do not need to be provided as part of the questionnaire:

In a questionnaire response, a question of type 'boolean' can have 3 possible states - unanswered, answered true, and answered false. Users will generally need to be able to toggle through all three states. If a default value is specified and the element is mandatory, a simple control with only true and false options (e.g. traditional check-box) will suffice. However, if a three-state selection is required, the typical controls used in HTML and other rendering technologies for booleans might not be appropriate. E.g. a checkbox that can only convey 'true' or 'false' will not be able to differentiate 'unanswered' and thus is generally not appropriate. If a tri-state control is available, that would work well. Alternatively, a set of radio buttons allow choices of true, false or "no answer" could also work.

As well, when enableWhen expressions are used that reference boolean elements, designers should consider whether "non-answered" is a possible value for boolean questions and design their enableWhen logic accordingly.

In some questionnaires, it may be possible to respond to a question with multiple types of answers. For example, capturing a coded answer plus free text, capturing a coded value plus a numeric priority, etc. In FHIR, this is handled through nested questions. Each question has a single data type. However, each question can have nested child questions. These nested child questions can have text (e.g. "Please specify") or can have no text at all if the appropriate guidance is provided by the parent question or group.

Many questionnaires involve computations on questionnaire answers, e.g. tabulating scores. To help with associating numeric values to coded answers, the itemweight extension can be used to define the numeric weighting of a code defined in a value set or in the questionnaire itself.

In addition, there are extensions for defining the dynamic value of an element using expressions. For more information, see the Using Expressions and Documentation Template topics in the Clinical Reasoning module.

Once a Questionnaire is defined, there's often a need to 'assign' a Questionnaire to a particular individual to request them to complete it. This is not done using the Questionnaire resource directly. Instead, the Questionnaire is referenced as an 'input' or argument using one of FHIR's workflow patterns. The most common mechanism is by defining a stand-alone Task that references the Questionnaire and seeks completion. The SDC implementation guide defines profiles and guidance for using this mechanism.

The capabilities of the Questionnaire resource are fairly simple and try to adhere to what most systems that deal with questionnaires would be capable of. However, there are lots of systems that require more sophisticated capabilities, such as:

  • Greater control over rendering, including tables, read-only values, hidden answers, multi-column drop-downs
  • Greater control over question flow, including formula-based rules for conditional display of elements
  • Ability to pre-populate forms with data found in the client system
  • Ability to define how to convert a completed QuestionnaireResponse for a Questionnaire into a collection of Observations and/or other resources

Extensions have been defined for all of these purposes and many more. (Questionnaire has the most 'core' extensions of any resource to-date.) A list of these extensions can be found here. However, some of the extensions are complex and work together in particular ways. To support more advanced questionnaire implementation, the Structured Data Capture (SDC) icon implementation guide has been created to provide non-country-specific guidance on the use of most of these extensions and sets expectations for systems wishing to support more complex forms.

Search parameters for this resource. See also the full list of search parameters for this resource, and check the Extensions registry for search parameters on extensions related to this resource. The common parameters also apply. See Searching for more information about searching in REST, messaging, and services.

NameTypeDescriptionExpressionIn Common
combo-codetokenA code that corresponds to one of its items in the questionnaireQuestionnaire.code | Questionnaire.item.code
contexttokenA use context assigned to the questionnaire(Questionnaire.useContext.value.ofType(CodeableConcept))30 Resources
context-quantityquantityA quantity- or range-valued use context assigned to the questionnaire(Questionnaire.useContext.value.ofType(Quantity)) | (Questionnaire.useContext.value.ofType(Range))30 Resources
context-typetokenA type of use context assigned to the questionnaireQuestionnaire.useContext.code30 Resources
context-type-quantitycompositeA use context type and quantity- or range-based value assigned to the questionnaireOn Questionnaire.useContext:
  context-type: code
  context-quantity: value.ofType(Quantity) | value.ofType(Range)
30 Resources
context-type-valuecompositeA use context type and value assigned to the questionnaireOn Questionnaire.useContext:
  context-type: code
  context: value.ofType(CodeableConcept)
30 Resources
datedateThe questionnaire publication dateQuestionnaire.date30 Resources
definitionuriElementDefinition - details for the itemQuestionnaire.item.definition
descriptionstringThe description of the questionnaireQuestionnaire.description28 Resources
effectivedateThe time during which the questionnaire is intended to be in useQuestionnaire.effectivePeriod12 Resources
identifiertokenExternal identifier for the questionnaireQuestionnaire.identifier35 Resources
item-codetokenA code that corresponds to one of the items in the questionnaireQuestionnaire.item.code
jurisdictiontokenIntended jurisdiction for the questionnaireQuestionnaire.jurisdiction26 Resources
namestringComputationally friendly name of the questionnaireQuestionnaire.name27 Resources
publisherstringName of the publisher of the questionnaireQuestionnaire.publisher30 Resources
questionnaire-codetokenA code that matches one of the Questionnaire.code codingsQuestionnaire.code
statustokenThe current status of the questionnaireQuestionnaire.status36 Resources
subject-typetokenResource that can be subject of QuestionnaireResponseQuestionnaire.subjectType
titlestringThe human-friendly name of the questionnaireQuestionnaire.title27 Resources
urluriThe uri that identifies the questionnaireQuestionnaire.url35 Resources
versiontokenThe business version of the questionnaireQuestionnaire.version30 Resources