What are Questionnaire Templates?
Questionnaire templates are FHIR Questionnaire resources that define:- Form structure (groups and fields)
- Field types and validation
- Conditional logic
- Calculated fields
- Instructions and help text
Creating a Questionnaire Template
Questionnaire Editor
Adding Groups
Groups organize related fields:Adding Items
Items are individual fields within groups:Item Types
Text Fields
| Type | Description |
|---|---|
| String | Single-line text |
| Text | Multi-line text area |
- Max length
- Required/optional
- Placeholder text
Numeric Fields
| Type | Description |
|---|---|
| Integer | Whole numbers |
| Decimal | Numbers with decimals |
| Quantity | Value with unit |
- Min/max values
- Decimal places
- Units
Date/Time Fields
| Type | Description |
|---|---|
| Date | Calendar date |
| DateTime | Date and time |
| Time | Time only |
- Date format options
- Year/month only option
Choice Fields
| Type | Description |
|---|---|
| Choice | Single selection |
| Open Choice | Choice with “other” option |
| Boolean | Yes/No |
- Answer options
- Display style (dropdown, radio)
- Default value
Special Fields
| Type | Description |
|---|---|
| Attachment | File upload |
| Display | Read-only instructions |
| Calculated | Auto-computed value |
Conditional Logic
Make items appear based on conditions:Condition Types
| Operator | Description |
|---|---|
| Equals | Value matches exactly |
| Not Equals | Value doesn’t match |
| Exists | Field has any value |
| Greater Than | Numeric comparison |
| Less Than | Numeric comparison |
Calculated Fields
Create fields that compute values automatically:Example Calculations
| Calculation | Expression Example |
|---|---|
| Sum | %context.item.where(...).answer.value.sum() |
| BMI | weight / (height * height) |
| Score | item1 + item2 + item3 |
Validation Rules
Add validation to ensure data quality:| Rule | Purpose |
|---|---|
| Required | Field must have value |
| Min/Max | Numeric range |
| Max Length | Text length limit |
| Pattern | Regex matching |
Scoring
For assessment questionnaires:- Assign point values to answer options
- Configure automatic score calculation
- Display scores inline or at summary level
Template Settings
Metadata
| Setting | Description |
|---|---|
| Name | Template display name |
| Description | What the questionnaire captures |
| Version | Version identifier |
| Status | Draft, active, or retired |
Visibility
| Setting | Options |
|---|---|
| Public | Visible to all users |
| Private | Visible to organization only |
Using in Studies
Best Practices
Logical Grouping
Logical Grouping
Group related fields together for easier data entry.
Clear Labels
Clear Labels
Use clear, unambiguous field labels.
Appropriate Validation
Appropriate Validation
Add validation to catch errors early.
Test Thoroughly
Test Thoroughly
Test templates with realistic data before use.
Related
Questionnaires
How questionnaires work in data collection.
Governance
Template management and versioning.
