Example Questionnaire resource (GAD7)
This page contains the JSON for a Questionnaire resource of a GAD7, generated from the advanced questionnaires feature. This is the format you will receive the Questionnaire in when you retrieve it from the Questionnaire endpoint. This page is intended as a guide for how to read a Questionnaire resource retrieved from the PKB FHIR Questionnaire endpoint and to define various fields within the questionnaire.
JSON
{
"resourceType": "Questionnaire",
"id": "2becaa96-8d4c-4ea4-84b8-6b41edba854a",
"meta": {
"extension": [
{
"url": "ex:createdAt",
"valueInstant": "2024-10-16T06:09:53.182990Z"
}
],
"versionId": "15727",
"lastUpdated": "2024-11-21T11:04:10.609008Z",
"profile": [
"urn:fhir:extension:SDCQuestionnaire"
]
},
"url": "http://fhir.patientsknowbest.com/questionnaire/gad7",
"version": "1.0",
"title": "GAD-7",
"status": "active",
"description": "GAD-7. This form represents an anxiety measure based on seven items which are scored from zero to three.",
"code": [
{
"system": "http://snomed.info/sct",
"code": "704501007",
"display": "Generalized Anxiety Disorder 7 item scale (assessment scale)"
}
],
"item": [
{
"linkId": "48DwCGiy",
"text": "Is this questionnaire being completed by you? ",
"type": "choice",
"answerOption": [
{
"valueCoding": {
"code": "yes",
"display": "Yes"
}
},
{
"valueCoding": {
"code": "no",
"display": "No"
}
}
]
},
{
"linkId": "a63vQFeQ",
"text": "Who is supporting you to complete this questionnaire (name and relationship)?",
"type": "text"
},
{
"linkId": "HZWpenZY",
"text": "Over the last two weeks, how often have you been bothered by the following problems?",
"type": "display"
},
{
"extension": [
{
"url": "http://aidbox.io/questionnaire-showOrdinalValue",
"valueBoolean": true
}
],
"linkId": "69725-0",
"code": [
{
"system": "http://loinc.org",
"code": "69725-0"
}
],
"text": "Feeling nervous, anxious, or on edge",
"type": "choice",
"answerOption": [
{
"valueCoding": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 0
}
],
"system": "http://loinc.org",
"code": "LA6568-5",
"display": "Not at all"
}
},
{
"valueCoding": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 1
}
],
"system": "http://loinc.org",
"code": "LA6569-3",
"display": "Several days"
}
},
{
"valueCoding": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 2
}
],
"system": "http://loinc.org",
"code": "LA6570-1",
"display": "More than half the days"
}
},
{
"valueCoding": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 3
}
],
"system": "http://loinc.org",
"code": "LA6571-9",
"display": "Nearly every day"
}
}
]
},
{
"extension": [
{
"url": "http://aidbox.io/questionnaire-showOrdinalValue",
"valueBoolean": true
}
],
"linkId": "68509-9",
"code": [
{
"system": "http://loinc.org",
"code": "68509-9"
}
],
"text": "Not being able to stop or control worrying",
"type": "choice",
"answerOption": [
{
"valueCoding": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 0
}
],
"system": "http://loinc.org",
"code": "LA6568-5",
"display": "Not at all"
}
},
{
"valueCoding": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 1
}
],
"system": "http://loinc.org",
"code": "LA6569-3",
"display": "Several days"
}
},
{
"valueCoding": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 2
}
],
"system": "http://loinc.org",
"code": "LA6570-1",
"display": "More than half the days"
}
},
{
"valueCoding": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 3
}
],
"system": "http://loinc.org",
"code": "LA6571-9",
"display": "Nearly every day"
}
}
]
},
{
"extension": [
{
"url": "http://aidbox.io/questionnaire-showOrdinalValue",
"valueBoolean": true
}
],
"linkId": "69733-4",
"code": [
{
"system": "http://loinc.org",
"code": "69733-4"
}
],
"text": "Worrying too much about different things",
"type": "choice",
"answerOption": [
{
"valueCoding": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 0
}
],
"system": "http://loinc.org",
"code": "LA6568-5",
"display": "Not at all"
}
},
{
"valueCoding": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 1
}
],
"system": "http://loinc.org",
"code": "LA6569-3",
"display": "Several days"
}
},
{
"valueCoding": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 2
}
],
"system": "http://loinc.org",
"code": "LA6570-1",
"display": "More than half the days"
}
},
{
"valueCoding": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 3
}
],
"system": "http://loinc.org",
"code": "LA6571-9",
"display": "Nearly every day"
}
}
]
},
{
"extension": [
{
"url": "http://aidbox.io/questionnaire-showOrdinalValue",
"valueBoolean": true
}
],
"linkId": "69734-2",
"code": [
{
"system": "http://loinc.org",
"code": "69734-2"
}
],
"text": "Trouble relaxing",
"type": "choice",
"answerOption": [
{
"valueCoding": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 0
}
],
"system": "http://loinc.org",
"code": "LA6568-5",
"display": "Not at all"
}
},
{
"valueCoding": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 1
}
],
"system": "http://loinc.org",
"code": "LA6569-3",
"display": "Several days"
}
},
{
"valueCoding": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 2
}
],
"system": "http://loinc.org",
"code": "LA6570-1",
"display": "More than half the days"
}
},
{
"valueCoding": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 3
}
],
"system": "http://loinc.org",
"code": "LA6571-9",
"display": "Nearly every day"
}
}
]
},
{
"extension": [
{
"url": "http://aidbox.io/questionnaire-showOrdinalValue",
"valueBoolean": true
}
],
"linkId": "69735-9",
"code": [
{
"system": "http://loinc.org",
"code": "69735-9"
}
],
"text": "Being so restless that it is hard to sit still",
"type": "choice",
"answerOption": [
{
"valueCoding": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 0
}
],
"system": "http://loinc.org",
"code": "LA6568-5",
"display": "Not at all"
}
},
{
"valueCoding": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 1
}
],
"system": "http://loinc.org",
"code": "LA6569-3",
"display": "Several days"
}
},
{
"valueCoding": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 2
}
],
"system": "http://loinc.org",
"code": "LA6570-1",
"display": "More than half the days"
}
},
{
"valueCoding": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 3
}
],
"system": "http://loinc.org",
"code": "LA6571-9",
"display": "Nearly every day"
}
}
]
},
{
"extension": [
{
"url": "http://aidbox.io/questionnaire-showOrdinalValue",
"valueBoolean": true
}
],
"linkId": "69689-8",
"code": [
{
"system": "http://loinc.org",
"code": "69689-8"
}
],
"text": "Becoming easily annoyed or irritable",
"type": "choice",
"answerOption": [
{
"valueCoding": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 0
}
],
"system": "http://loinc.org",
"code": "LA6568-5",
"display": "Not at all"
}
},
{
"valueCoding": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 1
}
],
"system": "http://loinc.org",
"code": "LA6569-3",
"display": "Several days"
}
},
{
"valueCoding": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 2
}
],
"system": "http://loinc.org",
"code": "LA6570-1",
"display": "More than half the days"
}
},
{
"valueCoding": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 3
}
],
"system": "http://loinc.org",
"code": "LA6571-9",
"display": "Nearly every day"
}
}
]
},
{
"extension": [
{
"url": "http://aidbox.io/questionnaire-showOrdinalValue",
"valueBoolean": true
}
],
"linkId": "69736-7",
"code": [
{
"system": "http://loinc.org",
"code": "69736-7"
}
],
"text": "Feeling afraid, as if something awful might happen",
"type": "choice",
"answerOption": [
{
"valueCoding": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 0
}
],
"system": "http://loinc.org",
"code": "LA6568-5",
"display": "Not at all"
}
},
{
"valueCoding": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 1
}
],
"system": "http://loinc.org",
"code": "LA6569-3",
"display": "Several days"
}
},
{
"valueCoding": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 2
}
],
"system": "http://loinc.org",
"code": "LA6570-1",
"display": "More than half the days"
}
},
{
"valueCoding": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
"valueDecimal": 3
}
],
"system": "http://loinc.org",
"code": "LA6571-9",
"display": "Nearly every day"
}
}
]
},
{
"extension": [
{
"url": "urn:fhir:extension:sdc-questionnaire-ruleDescription",
"valueMarkdown": "A + B + C + D + E + F + G\n\nWhere:\n* A = Feeling nervous, anxious, or on edge\n* B = Not being able to stop or control worrying\n* C = Worrying too much about different things\n* D = Trouble relaxing\n* E = Being so restless that it is hard to sit still\n* F = Becoming easily annoyed or irritable\n* G = Feeling afraid, as if something awful might happen"
},
{
"url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression",
"valueExpression": {
"language": "text/fhirpath",
"expression": " %resource.repeat(item).where(linkId='69725-0' or linkId='68509-9' or linkId='69733-4' or linkId='69734-2' or linkId='69735-9' or linkId = '69689-8' or linkId='69736-7').answer.valueCoding.ordinal().sum()"
}
},
{
"url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-observationExtract",
"valueBoolean": true
}
],
"linkId": "/70274-6",
"code": [
{
"system": "http://snomed.info/sct",
"code": "445455005",
"display": "GAD (generalised anxiety disorder) 7 item score"
}
],
"text": "GAD-7 Anxiety Severity Score",
"type": "decimal",
"readOnly": true
}
]
}
Questionnaire field definitions
The above Questionnaire resource is in JSON format and adheres to the FHIR R4 standard. The FHIR Questionnaire resource spec can be found here. Key information it contains includes:
Item | Description | Notes |
---|---|---|
id | The questionnaire’s logical ID | This is used to send the questionnaire using the $send-questionnaire-request operation |
meta | Meta information about when the Questionnaire resource was created and last updated |
|
url | Canonical URL representing the questionnaire | Follows format http://fhir.patientsknowbest.com/questionnaire/…” This links the Questionnaire and QuestionnaireResponse via the questionnaire field on the QuestionnaireResponse |
version | Business version of the questionnaire | This is a manually assigned version number will change when changes are made to the questionnaire. |
title | The title/name of the questionnaire |
|
status | Whether the questionnaire is active, in draft, or retired. |
|
description | A textual description of the Questionnaire resource |
|
code | The clinical code representing the questionnaire | Generally under the ‘Assessment scales (273249006)’ parent SNOMED code. Contains code, system and display. |
item.linkId | ID representing a question | Links the question on the Questionnaire and QuestionnaireResponse resources |
item.text | Question text |
|
item.type | Type of question (e.g. text, multiple choice, etc.) | Types of question listed here. |
item.code | The clinical code representing the question | Contains code, system and display |
item.readOnly | A boolean value determining whether the question is read only | Read only questions are used for fields that should only be viewed by the patient, not edited. For example, calculated scores. |
item.answerOption | For multiple choice questions, the answer options |
|
item.answerOption.valueCoding.code | The clinical code associated with the answer option |
|
item.answerOption.valueCoding.system | The code system that answer option’s clinical code belongs to |
|
item.answerOption.valueCoding.display | The display name of the answer option’s clinical code |
|
ordinalValue extension | An ordinal value associated with each answer option | Used to calculate scores in questionnaires |
showOrdinalValue extension | A boolean value determining whether the ‘score’ associated with each answer is displayed in the UI | Set to false if a clinical team does not want a user to know that a score is being calculated. |