Structured Data Capture
2.8.0 - CI Build

Structured Data Capture, published by HL7 International - FHIR Infrastructure Work Group. This is not an authorized publication; it is the continuous build for version 2.8.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

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.

Enter your First Name

Using rendering-xhtml

To allow different styles to different portion of a question text.

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.

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.

Event ID

Control Appearance

Using itemControl

To display a text box where a user can type in their answer freely.

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

Using choiceOrientation

To display choices horizontally.

Gender: Female   Male   Other   Unknown 

Using sliderStepValue

To indicate the increment of a slider itemControl.

Rate your doctor: 0100%

Using width

To set the width of a column in a table.

Medical History

Diabetes Other Information
Type 1 Hypertension
Type 2 Smoker

Using collapsible

To display child items in collapsible form

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.

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

Using choiceColumn

To display choices with multiple columns.

Select Platelet:

Using optionPrefix

To add prefixes on answer options.

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

Using valueset-label

To add prefixes on a value set.

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.

Birth Date

Using rendering-styleSensitive

To indicate that the style extensions on a resource is essential.

IMPORTANT: Please complete questionnaire.

Using optionalDisplay

To set an item for optional display.

Enter your Middle Name

Value constraints

Using maxLength

To restrict an answer to only have 50 characters.

Enter your First Name

Using minLength

To restrict an answer to have at least 2 characters.

Enter your Last Name

Using regex

To restrict an answer to be in this format: A1A 1A1

Postal Code (A1A 1A1)

Using minValue, maxValue, and maxDecimalPlaces

To restrict an answer to range from 1 to 100, up to 2 decimal places

Enter your weight in kg

Using minQuantity and maxQuantity

To restrict the answer to range from 10 to 100 kilograms.

Body Weight

Using mimeType and maxSize

To only allow a JPG or PDF attachment, up to 1Mb.

Attach Proof of Citizenship

Choice Restriction

Using answerOption

To restrict choices from a fixed list.

Choose your Province

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.

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

Using answerValueSet

To restrict choices from a value set.

Activity Level

Using required

To require an answer.

Email*

Using readOnly

To only display a populated answer and make it non-editable.

Current Date:

Using repeats

To allow multiple answers, no limit.

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

Using minOccurs

Must have at least to 2 answers.

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.

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.

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

Restrict unit choices using unit options.

Dosage

Using unitValueSet

Restrict unit choices from a value set.

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.

Deadline for submission (7 days from now)

Using launchContext

To set resources that provide context for form processing logic.

Last Name: Hamilton
First Name: William
Gender: male

Using calculatedExpression and variable

Example with a calculated expression.
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.

Enter weight in kg

Enter email address

Other Controls

Using initial

Example of options with initial value.

Marital Status

Using enableWhen, enableBehavior, and enableWhenExpression

Example of enabling behaviors.
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.
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 signature required.

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.

[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.

[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.

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.

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

Has the patient discussed 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.

Home Address
Address:
City:
Province:
Postal Code: