Are you designing clinical forms in FHIR? The type of question you use in a Questionnaire can make or break your data quality.
Capturing structured information is a crucial aspect of all healthcare operations - whether it is to gather patient information or recording clinical history. Most healthcare providers use a large number of structured forms to ensure consistent, repeatable and high-quality data capture. Forms enable this by maintaining definitions for the information needed, the format and constraints.
In FHIR, the Questionnaire and QuestionnaireResponse resources are used to model healthcare forms. It supports a variety of question types, allowing information to be grouped, labelled and even to display or hide elements conditionally. In this article we’ll be exploring the structure of a Questionnaire resource, and specifically the question and answer types that can be used.
Understanding the Questionnaire.item element#
The FHIR Questionnaire resource is made up of two components, the Questionnaire
and item
. In this previous article, we look at the structure of Questionnaire and QuestionnaireResponse in detail. We’re interested in the item
component, and will be looking at it in more detail.

The item
is a recursive structure which has three types - display, groups and questions. They’re identified by the type
element.
Display#
This type of item contains static content that will be displayed on the screen such as instructions or labels. It cannot have child items, and also does not collect answers.
Group#
This type of item organizes the content of a Questionnaire into logical sections. It can contain nested items within it. Groups don’t collect answers but usually contain question
items within it that do.

Questions#
All other types of items are questions. These represent the questions included in the form and usually expect an answer from the user. The type
element for questions reflects the expected data format for the answer, e.g. string, date, etc. We’ll be looking at the question types in detail.
Examining question types or item.type
#
item.type
The FHIR Questionnaire resource defines a wide variety of item.type
values to denote questions. The value represents the format in which the answer should be provided. Here are the different types.
Simple input types#
There are 5 simple input types, namely string, text, boolean, integer and decimal.
string
: Used for questions with a short free-text answer, usually a few words to a short sentence, e.g. nametext
: Used for questions with a long, multi-line or multi-paragraph free-text entry answer e.g. notesboolean
: Used for questions with a yes or no answer, although they are usually configured to also allow a response to denote ‘unanswered’ e.g.integer
: Used for questions that will be answered with a whole number, e.g. number of episodesdecimal
: Used for questions with a numeric answer that will need decimal precision, e.g. temperature
Date time input types#
There are 3 types of date time inputs, namely, date, dateTime and time.
date
: Used for questions with a date answer e.g. birth datedateTime
: Used to record the full timestamp with date and time e.g. the date and time of an appointmenttime
: Used for questions that ask for only the time, e.g. check-in time
Selectable and reference based input types#
This section refers to question types that involve structured, coded or linked answers, namely, coding, quantity, reference and uri.
coding
: Used when the answer should be one of several codes that are typically drawn from a terminology set such as SNOMED CT or LOINC. It can be used withanswerOption
oranswerValueSet
which we’ll be exploring further in the next section. E.g. gender, smoking statusquantity
: Used for questions that are answered with a number and a UCUM-coded unit. There are extensions available to further define unit selection. E.g. dosage, blood pressurereference
: Allows the answer to refer to or point towards an instance of another FHIR resource, i.e. a specific Patient, Practitioner etc.uri
: Used to capture a web address or a system level Uniform Resource Identifier (URI), e.g. to link to an external document, reference an image or pdf attachment, etc.
Using answerOption and answerValueSet#
In a FHIR Questionnaire, there are two distinct mechanisms in order to define a set of acceptable answers for a question. They are answerOption and answerValueSet. Understanding when to use each option is essential to building interoperable and scalable forms.
answerOption#
This is the simplest way to define the allowed list of values, by listing all possible answer values in-line with the question. This uses the item.answerOption element. This can be used to create dropdowns, radio buttons or checkboxes in the UI. When changes have to be made to the answerOptions, it requires changes to the questionnaire itself.
{
"linkId": "smoking-status",
"text": "What is your smoking status?",
"type": "coding",
"answerOption": [
{
"valueCoding": {
"code": "never",
"display": "Never smoked"
}
},
{
"valueCoding": {
"code": "former",
"display": "Former smoker"
}
},
{
"valueCoding": {
"code": "current",
"display": "Current smoker"
}
}
]
}
answerValueSet#
When using the answerValueSet mechanism, the allowed list of options is referred from a ValueSet resource. While this increases the complexity, it provides several benefits including,
- Questionnaires can now reference externally defined code systems
- Answer sets can be shared across questions and questionnaires
- ValueSets allow the use of ConceptMap to link to terminologies, use multiple display names, support different languages etc.
{
"linkId": "smoking-status",
"text": "What is your smoking status?",
"type": "coding",
"answerValueSet": "http://hl7.org/fhir/ValueSet/smoking-status"
}
This allows changes to the ValueSet to be made independently of the questionnaire. It is also possible to refer to a specific version of the value set, allowing the author of the questionnaire to be in control of any changes.
Sample questionnaire#
Here is a sample questionnaire that uses some of the input types discussed in this article. First, here is a preview of what the form looks like when rendered.

Here is the corresponding JSON code.
{
"resourceType": "Questionnaire",
"meta": {
"profile": [
"http://hl7.org/fhir/4.0/StructureDefinition/Questionnaire"
],
"tag": [
{
"code": "lhc-qnvconv-R5-to-R4",
"display": "Converted from R5 to R4 by the LHC Questionnaire Version Converter"
}
]
},
"title": "Test Form",
"status": "draft",
"item": [
{
"type": "display",
"linkId": "808145178143",
"text": "Basic Information"
},
{
"type": "string",
"linkId": "900843292121",
"text": "Name"
},
{
"type": "integer",
"linkId": "628859034495",
"text": "Age"
},
{
"type": "string",
"linkId": "976654418969",
"text": "Gender",
"answerOption": [
{
"valueString": "Male"
},
{
"valueString": "Female"
},
{
"valueString": "Other"
}
]
},
{
"type": "boolean",
"linkId": "729611384218",
"text": "Is this your first visit?"
},
{
"type": "date",
"linkId": "774766884944",
"text": "Birthdate"
},
{
"type": "dateTime",
"linkId": "854205526824",
"text": "Appointment Date and Time"
}
]
}
This questionnaire and preview were created using the free, online tool - National Library of Medicine (NLM) Form Builder.
In summary#
The FHIR Questionnaire is a powerful tool for structured data collection, enabling consistent, standardized and interoperable data capture. They are used in multiple settings across healthcare workflows including intake forms, clinical assessments and more. At the heart of the Questionnaire resource, lies the item
element. It is a recursive element that has 3 types - group, display and questions that are used for organizing, labelling and collecting data respectively.
Questions in a FHIR Questionnaire are defined by the item.type, and the value of this element corresponds to the input type of the answer. There are various types of inputs that questions can be defined to expect. Simple inputs such as string, text, boolean, decimal and integer, date and time inputs such as date, time and dateTime, and selectable and referenced inputs such as coding, quantity, reference and uri provide a great deal of flexibility to the Questionnaire. It is also possible to define allowable answers to a question using answerOption and answerValueSet.
Understanding the FHIR Questionnaire and specifically its Questionnaire.item element is a key learning towards building and maintaining your own interoperable and standardized healthcare forms. Get a headstart on your learning with our expert FHIR webinar led by Dr. Sidharth Ramesh. Register now!