Structured Data Capture
3.0.0 - STU 3 International flag

Structured Data Capture, published by HL7 International - FHIR Infrastructure Work Group. This is not an authorized publication; it is the continuous build for version 3.0.0). This version is based on the current content of https://github.com/HL7/sdc/ and changes regularly. See the Directory of published versions

Examples

Page standards status: Informative

Below are some examples that demonstrate how the elements and extensions in this implementation guide are intended to be used in a Questionnaire. Note: The rendering of the questions in the "Sample Question" tab are not functional (i.e. no validations after entry, perform actual computations, etc). They only provide a visual presentation of the questions and do not mimic how they will work in an actual questionnaire.




Text Appearance

Using rendering-style

To display a question text in green. (Example Questionnaire)

Enter your First Name

Using rendering-xhtml

To allow different styles to different portions of a question text. (Example Questionnaire)

Please answer Yes or No to each of the following questions:

Using displayCategory

To indicate what kind of display item it is so that systems can apply differential formatting based on the purpose of the display element. (Example Questionnaire)

ALL QUESTIONS CONTAINED IN THIS QUESTIONNAIRE ARE OPTIONAL AND WILL BE KEPT STRICTLY CONFIDENTIAL.

Using hidden

To hide an item to a user. This example has a question for Form ID that is not displayed. (Example Questionnaire)

Event ID

Control Appearance

Using itemControl

To display a text box where a user can type in their answer freely. (Example Questionnaire)

If you have any other medical problems or serious injuries, please describe them here:

Using choiceOrientation

To display choices horizontally. (Example Questionnaire)

Gender: Female   Male   Other   Unknown 

Using sliderStepValue

To indicate the increment of a slider itemControl. (Example Questionnaire)

Rate your doctor: 0100%

Using width

To set the width of a column in a table. (Example Questionnaire)

Medical History

Diabetes Other Information
Type 1 Hypertension
Type 2 Smoker

Using collapsible

To display child items in collapsible form. (Example Questionnaire)

Relationship to patient
Name
Gender Female   Male   Other   Unknown

Additional Display Content

Using supportLink

To add a a support link to a question that will provide more information to the user. (Example Questionnaire)

Have you traveled outside the country within the last 14 days?
Yes
No

Using choiceColumn

To display choices with multiple columns. (Example Questionnaire)

Select Platelet:

Using optionPrefix

To add prefixes on answer options. (Example Questionnaire)

Gender:
(a) Female  
(b) Male  
(c) Other  
(d) Unknown 

Using valueset-label

To add prefixes on a value set. (Example Questionnaire)

Enter timing of harm assessment:
 A. Within 24 hours 
 B. After 24 hours but before 3 days 
 C. Three days or later 
 D. Unknown 

Using entryFormat

To add instructions for the user to guide their input. (Example Questionnaire)

Birth Date

Using rendering-styleSensitive

To indicate that the style extensions on a resource is essential. (Example Questionnaire)

IMPORTANT: Please complete questionnaire.

Using optionalDisplay

To set an item for optional display. (Example Questionnaire)

Enter your Middle Name

Using shortText

To display a shorter text for an item. (Example Questionnaire)

Annual family income

Value constraints

Using maxLength

To restrict an answer to only have 50 characters. (Example Questionnaire)

Enter your First Name

Using minLength

To restrict an answer to have at least 2 characters. (Example Questionnaire)

Enter your Last Name

Using regex

To restrict an answer to be in this format: A1A 1A1 (Example Questionnaire)

Postal Code (A1A 1A1)

Using minValue, maxValue, and maxDecimalPlaces

To restrict an answer to range from 1 to 100, up to 2 decimal places (Example Questionnaire)

Enter your weight in kg

Using minQuantity and maxQuantity

To restrict the answer to range from 10 to 100 kilograms. (Example Questionnaire)

Body Weight

Using mimeType and maxSize

To only allow a JPG or PDF attachment, up to 1,048,576 bytes. (Example Questionnaire)

Attach Proof of Citizenship

Choice Restriction

Using answerOption

To restrict choices from a fixed list. (Example Questionnaire)

(I/We) worried whether (my/our) food would run out before (I/we) got money to buy more.

Using answerOption and rendering-xhtml

To display answer options as images using the rendering-xhtml extension.
Example shows two ways to use <img> tags to display images: (1) with embedded data and (2) using contained Binary resources. (Example Questionnaire)

How are you feeling today?
Sad Image OK Image Happy Image

Using answerValueSet

To restrict choices from a value set. (Example Questionnaire)

Activity Level

Using answerValueSet with expressions

To restrict choices to distinct value sets based on context.

NOTE: This example makes assumptions about the correlation between declared gender and health conditions that are not necessarily safe/clinically appropriate, so treat this as a technical example, not as an appropriate mechanism for data capture.

Applicable health conditions :

Using answerOptionToggleExpression

To restrict control which choices are enabled based on context. (Example Questionnaire)

NOTE: This example makes assumptions about the correlation between declared gender and health conditions that are not necessarily safe/clinically appropriate, so treat this as a technical example, not as an appropriate mechanism for data capture.

Applicable health conditions :

Using required

To require an answer. (Example Questionnaire)

Email*

Using readOnly

To only display a populated answer and make it non-editable. (Example Questionnaire)

Current Date:

Using repeats, openLabel

To allow multiple answers, no limit and to specify label for alternate answer choices. (Example Questionnaire)

Heart History (check all that applies):
Heart attack
Heart surgery
Cardiac catheterization
Coronary angioplasty (PTCA)
Cardiac pacemaker
Other event (specify):

Using minOccurs

Must have at least to 2 answers. (Example Questionnaire)

Heart History (check at least 2):
Heart attack
Heart surgery
Cardiac catheterization
Coronary angioplasty (PTCA)
Cardiac pacemaker

Using maxOccurs

Can only have up to 3 answers. (Example Questionnaire)

Heart History (check no more than 3):
Heart attack
Heart surgery
Cardiac catheterization
Coronary angioplasty (PTCA)
Cardiac pacemaker

Using optionExclusive

To restrict other answers from being selected when an exclusive answer (like "None of the above") has been selected. (Example Questionnaire)

What treatments do you now have for heart disease? (select all that applies)
No treatment
Aspirin
Other medicines, tablets, or pills
Diet
Exercise
None of the above

Using unitOption, unitOpen and unitSupplementalSystem

Restrict unit choices using unit options with control over how strict and other options. (Example Questionnaire)

Dosage

Using unitValueSet

Restrict unit choices from a value set. (Example Questionnaire)

Specify age:

Using answerExpression, referenceResource, referenceProfile and lookupQuestionnaire

Restrict an answer to a specific resource or profile.

Select your preferred practitioner:

Calculation

Using initialExpression

Example with an initial expression. (Example Questionnaire)

Deadline for submission (7 days from now)

Using launchContext

To set resources that provide context for form processing logic. (Example Questionnaire)

Last Name: Hamilton
First Name: William
Gender: male

Using calculatedExpression and variable

Example with a calculated expression. (Example Questionnaire)
Note: The questions below are not functional. The BMI will not calculated and displayed after input.

Weight (kg)
Body Height (inches)
Your Body Mass Index (BMI) is

Using cqf-calculatedValue, cqf-library and cqf-expression

Example question with a cqf-calculatedValue for minimum and maximum weight allowed and a question using a cqf-expression to determine if a question is required based on Patient data. (Example Questionnaire)

Enter weight in kg

Enter email address

Using text and cqf-Expression

Text example with cqf-expression. (Example Questionnaire)

Your last immunization was on 2021-01-05.

Other Controls

Using initial

Example of options with initial value. (Example Questionnaire)

Marital Status

Using enableWhen, enableBehavior, and enableWhenExpression

Example of enabling behaviors. (Example Questionnaire)
Note: The questions below are not functional. Display does not show actual enabling behaviors.

Choose Gender

Are you pregnant? (enableWhen gender = Female)
Yes No Don't know

Are you diabetic? (enableWhen gender = Female)
Yes No Don't know

Have you been diagnosed with Gestational Diabetes? (enableBehavior = only when pregnant and diabetic)
Yes No Don't know

Enter your birthdate (MM/DD/YYYY)


Have you had mammogram before?(enableWhenExpression = only when gender is female and age > 40)
Yes No Don't know

Using ordinalValue and constraint

Example involving ordinal value and contraints. (Example Questionnaire)
Note: The questions below are not functional. The total score will not be calculated and displayed after input.

You should answer at least three questions.

Over the last 2 weeks, how often have you been bothered by any of the following problems?

1. Little interest or pleasure in doing things
Not at all (0) Several Days (1) More than half the days (2) Nearly every day (3)

2. Feeling down, depressed, or hopeless
Not at all (0) Several Days (1) More than half the days (2) Nearly every day (3)

3. Trouble falling or staying asleep, or sleeping too much
Not at all (0) Several Days (1) More than half the days (2) Nearly every day (3)

4. Feeling tired or having little energy
Not at all (0) Several Days (1) More than half the days (2) Nearly every day (3)

Total Score: 0

Using signatureRequired and usageMode

Example of a questionnaire requiring a signature. (Example Questionnaire)

Signature of Patient: [only show signature pad when capturing data]

Using endpoint

To set an endpoint URL for the Form Receiver when the Questionnaire is completed. (Example Questionnaire)

[Not applicable to a question item - this extension is part of a base Questionnaire's metadata]

Using entryMode

To display questions one at a time. (Example Questionnaire)

[Not applicable to a question item - this extension is part of a base Questionnaire's metadata]

Using candidateExpression

To provide a list of candidate answers for the question item. (Example Questionnaire)

All the practitioners below can speak your language. Choose all preferred practioners:

Last Name First Name Gender
Smith John Male
Moseley Henry Male
Upton Isaac Male
Williams Amy Female

Using contextExpression

To indicate the resources to make available for display to the user to aid in answering the question. (Example Questionnaire)

Instruction: Click on "Review Previous Visits" button to view all the visits of this patient in the past year.

Has the patient been admitted for this issue on any visits in the past year?
Yes 
No 
Don't know 

Using itemPopulationContext and itemExtractionContext

To specify the resources to populate and extract a questionnaire. (Example Questionnaire)

Home Address
Address:
City:
Province:
Postal Code: