FHIR © HL7.org  |  Server Home  |  XIG Home  |  XIG Stats  |  Server Source  |  FHIR  

FHIR IG Statistics: Questionnaire/questionnaire-sdc-profile-example-form-behavior

Packagehl7.fhir.uv.sdc
Resource TypeQuestionnaire
Idquestionnaire-sdc-profile-example-form-behavior
FHIR VersionR4
Sourcehttp://hl7.org/fhir/uv/sdc/https://build.fhir.org/ig/HL7/sdc/Questionnaire-questionnaire-sdc-profile-example-form-behavior.html
URLhttp://build.fhir.org/ig/HL7/sdc/questionnaire-sdc-profile-example-form-behavior
Version4.0.0-ballot
Statusactive
Date2025-07-14T18:38:59+00:00
NameSDCAdvancedRenderingExample
Realmuv
Authorityhl7

Resources that use this resource

No resources found


Resources that this resource uses

No resources found


Narrative

Note: links and images are rebased to the (stated) source

Generated Narrative: Questionnaire questionnaire-sdc-profile-example-form-behavior

Structure
LinkIDTextCardinalityTypeFlagsDescription & Constraintsdoco
.. SDCAdvancedRenderingExampleQuestionnairehttp://build.fhir.org/ig/HL7/sdc/questionnaire-sdc-profile-example-form-behavior#4.0.0-ballot
... 1Value constraints0..1group
.... 1.1First Name0..1stringMax Length: 50
.... 1.2Last Name0..1string
.... 1.3Postal Code (A1A 1A1)0..1string
.... 1.4Enter your weight in kg0..1decimal
.... 1.5Body Weight0..1quantity
.... 1.6Attach Proof of Citizenship0..1attachment
... 2Value constraints0..1group
.... 2.1(I/We) worried whether (my/our) food would run out before (I/we) got money to buy more.0..1choiceOptions: 4 options
.... 2.3Activity Level0..1choiceValue Set: http://loinc.org/vs/LL4882-8
.... 2.5Applicable health conditions0..*choiceValue Set: Questionnaire Form Behavior Conditions
.... 2.6Email*1..1string
.... 2.7Current Date:0..1dateiconicon
.... 2.7.1null0..1display
.... 2.8Heart History (check all that applies)0..*open-choiceOptions: 5 options
.... 2.9Heart History (check at least 2):1..*choiceOptions: 5 options
.... 2.10Heart History (check no more than 3):1..*choiceOptions: 5 options
.... 2.11What treatments do you now have for heart disease? (select all that applies)0..*choiceOptions: 6 options
.... 2.12Dosage0..1quantity
.... 2.13Specify age:0..1quantity
.... 2.14Select your preferred practitioner:0..1reference
... 3Calculation0..1group
.... 3.1Deadline for submission (7 days from now)0..1dateiconicon
.... 3.2null0..1group
..... 3.2.1Last Name:0..1stringiconicon
..... 3.2.2First Name:0..1stringiconicon
..... 3.2.3Gender:0..1stringiconicon
.... 3.3Calculated Expression0..1group
..... 3.3.1Weight (kg)0..1decimal
..... 3.3.2Body Height (inches)0..1decimal
..... 3.3.3Your Body Mass Index (BMI)0..1decimaliconicon
.... 3.4CQF-related Example0..1group
..... 3.4.1Enter weight in kg0..1decimal
..... 3.4.2Enter email address0..1string
.... 3.5null0..1display
... 4Other Controls0..1group
.... 4.1Marital Status0..1choiceValue Set: MaritalStatus
Initial Value: Coding = MaritalStatus#D "Divorced"
.... 4.2null0..1group
..... 4.2.1Choose Gender0..1choiceValue Set: AdministrativeGender
..... 4.2.2Are you pregnant? (enableWhen = gender is Female, disableDisplay=protected)0..1choiceEnable When: 4.2.1 =
Value Set: Yes/No/Don't Know
..... 4.2.3Are you diabetic? (enableWhen = gender is Female, disableDisplay=hidden)0..1choiceEnable When: 4.2.1 =
Value Set: Yes/No/Don't Know
..... 4.2.4Have you been diagnosed with Gestational Diabetes? (enableBehavior = only when pregnant and diabetic, disableDisplay=protected)0..1choiceEnable When:
Value Set: Yes/No/Don't Know
..... 4.2.5Enter your birthdate (MM/DD/YYYY)0..1dateValue Set: AdministrativeGender
..... 4.2.6Have you had mammogram before?(enableWhenExpression = only when gender is female and age > 40, disableDisplay=protected)0..1choiceValue Set: Yes/No/Don't Know
.... 4.4Signature of Patient1..1attachment
.... 4.5All the practitioners below can speak the patient's language. Choose all preferred practioners:0..*reference
.... 4.6null0..1group
..... 4.6.1Home Address0..1display
..... 4.6.2Address0..1stringDefinition: Patient.address.line
..... 4.6.3City0..1stringDefinition: Patient.address.city
..... 4.6.4Province0..1choiceDefinition: Patient.address.state
Options: 10 options
..... 4.6.5Postal Code0..1stringDefinition: Patient.address.postalCode

doco Documentation for this format

Options Sets

Answer options for 2.1

  • http://loinc.org#LA28397-0 ("Often true")
  • http://loinc.org#LA6729-3 ("Sometimes true")
  • http://loinc.org#LA28398-8 ("Never true")
  • http://loinc.org#LA15775-2 ("Don't know/refused")

Answer options for 2.8

  • http://example.org/CodeSystem/procedures#U1 ("Heart attack")
  • http://example.org/CodeSystem/procedures#U2 ("Heart surgery")
  • http://example.org/CodeSystem/procedures#U3 ("Cardiac catheterization")
  • http://example.org/CodeSystem/procedures#U4 ("Coronary angioplasty (PTCA)")
  • http://example.org/CodeSystem/procedures#U5 ("Cardiac pacemaker")

Answer options for 2.9

  • http://example.org/CodeSystem/procedures#U1 ("Heart attack")
  • http://example.org/CodeSystem/procedures#U2 ("Heart surgery")
  • http://example.org/CodeSystem/procedures#U3 ("Cardiac catheterization")
  • http://example.org/CodeSystem/procedures#U4 ("Coronary angioplasty (PTCA)")
  • http://example.org/CodeSystem/procedures#U5 ("Cardiac pacemaker")

Answer options for 2.10

  • http://example.org/CodeSystem/procedures#U1 ("Heart attack")
  • http://example.org/CodeSystem/procedures#U2 ("Heart surgery")
  • http://example.org/CodeSystem/procedures#U3 ("Cardiac catheterization")
  • http://example.org/CodeSystem/procedures#U4 ("Coronary angioplasty (PTCA)")
  • http://example.org/CodeSystem/procedures#U5 ("Cardiac pacemaker")

Answer options for 2.11

  • http://example.org/CodeSystem/treatments#noTreatment ("NoTreatment")
  • http://example.org/CodeSystem/treatments#aspirin ("Aspirin")
  • http://example.org/CodeSystem/treatments#otherMeds ("Other medicines, tablets, or pills")
  • http://example.org/CodeSystem/treatments#diet ("Diet")
  • http://example.org/CodeSystem/treatments#exercise ("Exercise")
  • http://example.org/CodeSystem/treatments#none ("None of the above")

Answer options for 4.6.4

  • http://example.org/CodeSystem/provinces#Alberta ("Alberta")
  • http://example.org/CodeSystem/provinces#BritishColumbia ("British Columbia")
  • http://example.org/CodeSystem/provinces#Manitoba ("Manitoba")
  • http://example.org/CodeSystem/provinces#NewBrunswick ("New Brunswick")
  • http://example.org/CodeSystem/provinces#NewfoundlandAndLabrador ("Newfoundland and Labrador")
  • http://example.org/CodeSystem/provinces#NovaScotia ("Nova Scotia")
  • http://example.org/CodeSystem/provinces#Ontario ("Ontario")
  • http://example.org/CodeSystem/provinces#PrinceEdwardIsland ("Prince Edward Island")
  • http://example.org/CodeSystem/provinces#Quebec ("Quebec")
  • http://example.org/CodeSystem/provinces#Saskatchewan ("Saskatchewan")

Source

{
  "resourceType": "Questionnaire",
  "id": "questionnaire-sdc-profile-example-form-behavior",
  "meta": {
    "profile": [
      "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-behave"
    ]
  },
  "text": {
    "status": "extensions",
    "div": "<!-- snip (see above) -->"
  },
  "extension": [
    {
      "url": "http://hl7.org/fhir/5.0/StructureDefinition/extension-Questionnaire.versionAlgorithm[x]",
      "valueCoding": {
        "system": "http://hl7.org/fhir/version-algorithm",
        "code": "semver"
      }
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/variable",
      "valueExpression": {
        "name": "weight",
        "language": "text/fhirpath",
        "expression": "%resource.repeat(item).where(linkId='3.3.1').item.answer.value"
      }
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/variable",
      "valueExpression": {
        "name": "height",
        "language": "text/fhirpath",
        "expression": "%resource.repeat(item).where(linkId='3.3.2').item.answer.value*0.0254"
      }
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/cqf-library",
      "valueCanonical": "http://example.org/Library/MeasurementLimits"
    },
    {
      "extension": [
        {
          "url": "name",
          "valueCoding": {
            "system": "http://hl7.org/fhir/uv/sdc/CodeSystem/launchContext",
            "code": "patient",
            "display": "Patient"
          }
        },
        {
          "url": "type",
          "valueCode": "Patient"
        },
        {
          "url": "description",
          "valueString": "The patient that is to be used to pre-populate the form"
        }
      ],
      "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-launchContext"
    },
    {
      "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-endpoint",
      "valueUri": "http://example.org/QuestionnaireResponse/create"
    },
    {
      "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-entryMode",
      "valueCode": "sequential"
    },
    {
      "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-assembleDefinitionRoot",
      "valueUri": "http://example.org/StructureDefinition/myElementLibrary"
    }
  ],
  "modifierExtension": [
    {
      "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-rendering-criticalExtension",
      "valueCanonical": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-entryMode"
    },
    {
      "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-rendering-criticalExtension",
      "valueCanonical": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-answerOptionsToggleExpression"
    }
  ],
  "url": "http://build.fhir.org/ig/HL7/sdc/questionnaire-sdc-profile-example-form-behavior",
  "identifier": [
    {
      "system": "urn:ietf:rfc:3986",
      "value": "urn:oid:2.16.840.1.113883.4.642.40.17.35.9"
    }
  ],
  "version": "4.0.0-ballot",
  "name": "SDCAdvancedRenderingExample",
  "status": "active",
  "date": "2025-07-14T18:38:59+00:00",
  "publisher": "HL7 International / FHIR Infrastructure",
  "contact": [
    {
      "name": "HL7 International / FHIR Infrastructure",
      "telecom": [
        {
          "system": "url",
          "value": "http://www.hl7.org/Special/committees/fiwg"
        }
      ]
    },
    {
      "telecom": [
        {
          "system": "url",
          "value": "http://www.hl7.org/Special/committees/fiwg"
        }
      ]
    }
  ],
  "jurisdiction": [
    {
      "coding": [
        {
          "system": "http://unstats.un.org/unsd/methods/m49/m49.htm",
          "code": "001",
          "display": "World"
        }
      ]
    }
  ],
  "item": [
    {
      "linkId": "1",
      "text": "Value constraints",
      "type": "group",
      "item": [
        {
          "linkId": "1.1",
          "text": "First Name",
          "type": "string",
          "maxLength": 50
        },
        {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/minLength",
              "valueInteger": 2
            }
          ],
          "linkId": "1.2",
          "text": "Last Name",
          "type": "string"
        },
        {
          "extension": [
            {
              "extension": [
                {
                  "url": "key",
                  "valueId": "contraint-regex1"
                },
                {
                  "url": "severity",
                  "valueCode": "error"
                },
                {
                  "url": "expression",
                  "valueExpression": {
                    "language": "text/fhirpath",
                    "expression": "%resource.repeat(item).where(linkId='1.3').answer.all(value.matches('[A-Z][0-9][A-Z] [0-9][A-Z][0-9]'))"
                  }
                },
                {
                  "url": "human",
                  "valueString": "Postal code must match syntax A1A 1A1."
                }
              ],
              "url": "http://hl7.org/fhir/StructureDefinition/targetConstraint"
            }
          ],
          "linkId": "1.3",
          "text": "Postal Code (A1A 1A1)",
          "type": "string"
        },
        {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/minValue",
              "valueDecimal": 1
            },
            {
              "url": "http://hl7.org/fhir/StructureDefinition/maxValue",
              "valueDecimal": 100
            },
            {
              "url": "http://hl7.org/fhir/StructureDefinition/maxDecimalPlaces",
              "valueInteger": 2
            }
          ],
          "linkId": "1.4",
          "text": "Enter your weight in kg",
          "type": "decimal"
        },
        {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-unitValueSet",
              "valueCanonical": "http://hl7.org/fhir/ValueSet/ucum-bodyweight"
            },
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-minQuantity",
              "valueQuantity": {
                "value": 10,
                "system": "http://unitsofmeasure.org",
                "code": "kg"
              }
            },
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-maxQuantity",
              "valueQuantity": {
                "value": 100,
                "system": "http://unitsofmeasure.org",
                "code": "kg"
              }
            }
          ],
          "linkId": "1.5",
          "text": "Body Weight",
          "type": "quantity"
        },
        {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/mimeType",
              "valueCode": "image/jpeg"
            },
            {
              "url": "http://hl7.org/fhir/StructureDefinition/mimeType",
              "valueCode": "application/pdf"
            },
            {
              "url": "http://hl7.org/fhir/StructureDefinition/maxSize",
              "valueDecimal": 1048576
            }
          ],
          "linkId": "1.6",
          "text": "Attach Proof of Citizenship",
          "type": "attachment"
        }
      ]
    },
    {
      "linkId": "2",
      "text": "Value constraints",
      "type": "group",
      "item": [
        {
          "linkId": "2.1",
          "text": "(I/We) worried whether (my/our) food would run out before (I/we) got money to buy more.",
          "type": "choice",
          "answerOption": [
            {
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA28397-0",
                "display": "Often true"
              }
            },
            {
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6729-3",
                "display": "Sometimes true"
              }
            },
            {
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA28398-8",
                "display": "Never true"
              }
            },
            {
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA15775-2",
                "display": "Don't know/refused"
              }
            }
          ]
        },
        {
          "linkId": "2.3",
          "text": "Activity Level",
          "type": "choice",
          "answerValueSet": "http://loinc.org/vs/LL4882-8"
        },
        {
          "extension": [
            {
              "extension": [
                {
                  "url": "option",
                  "valueCoding": {
                    "system": "http://example.org/CodeSystem/conditions",
                    "code": "3"
                  }
                },
                {
                  "url": "expression",
                  "valueExpression": {
                    "language": "text/fhirpath",
                    "expression": "%patient.gender!='male'"
                  }
                }
              ],
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-answerOptionsToggleExpression"
            },
            {
              "extension": [
                {
                  "url": "option",
                  "valueCoding": {
                    "system": "http://example.org/CodeSystem/conditions",
                    "code": "4"
                  }
                },
                {
                  "url": "expression",
                  "valueExpression": {
                    "language": "text/fhirpath",
                    "expression": "%patient.gender!='female'"
                  }
                }
              ],
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-answerOptionsToggleExpression"
            }
          ],
          "linkId": "2.5",
          "text": "Applicable health conditions",
          "type": "choice",
          "repeats": true,
          "answerValueSet": "http://hl7.org/fhir/uv/sdc/ValueSet/formBehaviorConditions"
        },
        {
          "extension": [
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-keyboard",
              "valueCoding": {
                "system": "http://hl7.org/fhir/uv/sdc/CodeSystem/keyboardType",
                "code": "email",
                "display": "email"
              }
            }
          ],
          "linkId": "2.6",
          "text": "Email*",
          "type": "string",
          "required": true
        },
        {
          "extension": [
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
              "valueExpression": {
                "description": "current date",
                "language": "text/fhirpath",
                "expression": "today()"
              }
            }
          ],
          "linkId": "2.7",
          "text": "Current Date:",
          "type": "date",
          "readOnly": true
        },
        {
          "linkId": "2.7.1",
          "_text": {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/cqf-expression",
                "valueExpression": {
                  "description": "Substitute in current date",
                  "language": "text/fhirpath",
                  "expression": "'Please only enter data that has been validated as of ' + today()"
                }
              }
            ]
          },
          "type": "display"
        },
        {
          "extension": [
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-openLabel",
              "valueString": "Other event (specify)"
            }
          ],
          "linkId": "2.8",
          "text": "Heart History (check all that applies)",
          "type": "open-choice",
          "repeats": true,
          "answerOption": [
            {
              "valueCoding": {
                "system": "http://example.org/CodeSystem/procedures",
                "code": "U1",
                "display": "Heart attack"
              }
            },
            {
              "valueCoding": {
                "system": "http://example.org/CodeSystem/procedures",
                "code": "U2",
                "display": "Heart surgery"
              }
            },
            {
              "valueCoding": {
                "system": "http://example.org/CodeSystem/procedures",
                "code": "U3",
                "display": "Cardiac catheterization"
              }
            },
            {
              "valueCoding": {
                "system": "http://example.org/CodeSystem/procedures",
                "code": "U4",
                "display": "Coronary angioplasty (PTCA)"
              }
            },
            {
              "valueCoding": {
                "system": "http://example.org/CodeSystem/procedures",
                "code": "U5",
                "display": "Cardiac pacemaker"
              }
            }
          ]
        },
        {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-minOccurs",
              "valueInteger": 2
            }
          ],
          "linkId": "2.9",
          "text": "Heart History (check at least 2):",
          "type": "choice",
          "required": true,
          "repeats": true,
          "answerOption": [
            {
              "valueCoding": {
                "system": "http://example.org/CodeSystem/procedures",
                "code": "U1",
                "display": "Heart attack"
              }
            },
            {
              "valueCoding": {
                "system": "http://example.org/CodeSystem/procedures",
                "code": "U2",
                "display": "Heart surgery"
              }
            },
            {
              "valueCoding": {
                "system": "http://example.org/CodeSystem/procedures",
                "code": "U3",
                "display": "Cardiac catheterization"
              }
            },
            {
              "valueCoding": {
                "system": "http://example.org/CodeSystem/procedures",
                "code": "U4",
                "display": "Coronary angioplasty (PTCA)"
              }
            },
            {
              "valueCoding": {
                "system": "http://example.org/CodeSystem/procedures",
                "code": "U5",
                "display": "Cardiac pacemaker"
              }
            }
          ]
        },
        {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs",
              "valueInteger": 3
            }
          ],
          "linkId": "2.10",
          "text": "Heart History (check no more than 3):",
          "type": "choice",
          "required": true,
          "repeats": true,
          "answerOption": [
            {
              "valueCoding": {
                "system": "http://example.org/CodeSystem/procedures",
                "code": "U1",
                "display": "Heart attack"
              }
            },
            {
              "valueCoding": {
                "system": "http://example.org/CodeSystem/procedures",
                "code": "U2",
                "display": "Heart surgery"
              }
            },
            {
              "valueCoding": {
                "system": "http://example.org/CodeSystem/procedures",
                "code": "U3",
                "display": "Cardiac catheterization"
              }
            },
            {
              "valueCoding": {
                "system": "http://example.org/CodeSystem/procedures",
                "code": "U4",
                "display": "Coronary angioplasty (PTCA)"
              }
            },
            {
              "valueCoding": {
                "system": "http://example.org/CodeSystem/procedures",
                "code": "U5",
                "display": "Cardiac pacemaker"
              }
            }
          ]
        },
        {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",
              "valueCodeableConcept": {
                "coding": [
                  {
                    "system": "http://hl7.org/fhir/questionnaire-item-control",
                    "code": "check-box",
                    "display": "Check-box"
                  }
                ]
              }
            }
          ],
          "linkId": "2.11",
          "text": "What treatments do you now have for heart disease? (select all that applies)",
          "type": "choice",
          "repeats": true,
          "answerOption": [
            {
              "valueCoding": {
                "system": "http://example.org/CodeSystem/treatments",
                "code": "noTreatment",
                "display": "NoTreatment"
              }
            },
            {
              "valueCoding": {
                "system": "http://example.org/CodeSystem/treatments",
                "code": "aspirin",
                "display": "Aspirin"
              }
            },
            {
              "valueCoding": {
                "system": "http://example.org/CodeSystem/treatments",
                "code": "otherMeds",
                "display": "Other medicines, tablets, or pills"
              }
            },
            {
              "valueCoding": {
                "system": "http://example.org/CodeSystem/treatments",
                "code": "diet",
                "display": "Diet"
              }
            },
            {
              "valueCoding": {
                "system": "http://example.org/CodeSystem/treatments",
                "code": "exercise",
                "display": "Exercise"
              }
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-optionExclusive",
                  "valueBoolean": true
                }
              ],
              "valueCoding": {
                "system": "http://example.org/CodeSystem/treatments",
                "code": "none",
                "display": "None of the above"
              }
            }
          ]
        },
        {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-unitOption",
              "valueCoding": {
                "system": "http://unitsofmeasure.org",
                "code": "mL",
                "display": "mL"
              }
            },
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-unitOption",
              "valueCoding": {
                "system": "http://unitsofmeasure.org",
                "code": "L",
                "display": "L"
              }
            },
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-unitOption",
              "valueCoding": {
                "system": "http://unitsofmeasure.org",
                "code": "g",
                "display": "g"
              }
            },
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-unitOption",
              "valueCoding": {
                "system": "http://unitsofmeasure.org",
                "code": "mg",
                "display": "mg"
              }
            },
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-unitOpen",
              "valueCode": "optionsOrType"
            },
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-unitSupplementalSystem",
              "valueCanonical": "http://example.org/SomeUnitCodeSystem"
            }
          ],
          "linkId": "2.12",
          "text": "Dosage",
          "type": "quantity"
        },
        {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-unitValueSet",
              "valueCanonical": "http://hl7.org/fhir/ValueSet/age-units"
            }
          ],
          "linkId": "2.13",
          "text": "Specify age:",
          "type": "quantity"
        },
        {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource",
              "valueCode": "Practitioner"
            },
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-referenceProfile",
              "valueCanonical": "http://example.org/fhir/StructureDefinition/my-practitioner"
            },
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-lookupQuestionnaire",
              "valueCanonical": "http://example.org/Questionnaire/1234"
            },
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-answerExpression",
              "valueExpression": {
                "description": "all active practitioners",
                "language": "application/x-fhir-query",
                "expression": "Practitioner?active=true&_sort=family,given"
              }
            },
            {
              "extension": [
                {
                  "url": "path",
                  "valueString": "name.where(use='official').family + ', ' + name.where(use='official').given.first()"
                },
                {
                  "url": "forDisplay",
                  "valueBoolean": true
                }
              ],
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-choiceColumn"
            }
          ],
          "linkId": "2.14",
          "text": "Select your preferred practitioner:",
          "type": "reference"
        }
      ]
    },
    {
      "linkId": "3",
      "text": "Calculation",
      "type": "group",
      "item": [
        {
          "extension": [
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
              "valueExpression": {
                "description": "deadline for submission",
                "language": "text/fhirpath",
                "expression": "today() + 7 days"
              }
            }
          ],
          "linkId": "3.1",
          "text": "Deadline for submission (7 days from now)",
          "type": "date",
          "readOnly": true
        },
        {
          "linkId": "3.2",
          "type": "group",
          "item": [
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
                  "valueExpression": {
                    "description": "patient's last name",
                    "language": "text/fhirpath",
                    "expression": "%patient.name.where(use='official').given.first()"
                  }
                }
              ],
              "linkId": "3.2.1",
              "text": "Last Name:",
              "type": "string",
              "readOnly": true
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
                  "valueExpression": {
                    "description": "patient's first name",
                    "language": "text/fhirpath",
                    "expression": "%patient.name.where(use='official').family"
                  }
                }
              ],
              "linkId": "3.2.2",
              "text": "First Name:",
              "type": "string",
              "readOnly": true
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
                  "valueExpression": {
                    "description": "patient's gender",
                    "language": "text/fhirpath",
                    "expression": "%patient.gender"
                  }
                }
              ],
              "linkId": "3.2.3",
              "text": "Gender:",
              "type": "string",
              "readOnly": true
            }
          ]
        },
        {
          "linkId": "3.3",
          "text": "Calculated Expression",
          "type": "group",
          "item": [
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-unit",
                  "valueCoding": {
                    "system": "http://unitsofmeasure.org",
                    "code": "kg"
                  }
                }
              ],
              "linkId": "3.3.1",
              "text": "Weight (kg)",
              "type": "decimal"
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-unit",
                  "valueCoding": {
                    "system": "http://unitsofmeasure.org",
                    "code": "[in_i]"
                  }
                }
              ],
              "linkId": "3.3.2",
              "text": "Body Height (inches)",
              "type": "decimal"
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression",
                  "valueExpression": {
                    "description": "BMI Calculation",
                    "language": "text/fhirpath",
                    "expression": "(%weight/(%height.power(2))).round(1)"
                  }
                },
                {
                  "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-assembleDefinitionRoot",
                  "valueBoolean": false
                }
              ],
              "linkId": "3.3.3",
              "text": "Your Body Mass Index (BMI)",
              "type": "decimal",
              "readOnly": true
            }
          ]
        },
        {
          "linkId": "3.4",
          "text": "CQF-related Example",
          "type": "group",
          "item": [
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/minValue",
                  "valueDecimal": 1,
                  "_valueDecimal": {
                    "extension": [
                      {
                        "url": "http://hl7.org/fhir/StructureDefinition/cqf-expression",
                        "valueExpression": {
                          "language": "text/fhirpath",
                          "expression": "min_weight"
                        }
                      }
                    ]
                  }
                },
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/maxValue",
                  "valueDecimal": 100,
                  "_valueDecimal": {
                    "extension": [
                      {
                        "url": "http://hl7.org/fhir/StructureDefinition/cqf-expression",
                        "valueExpression": {
                          "language": "text/fhirpath",
                          "expression": "max_weight"
                        }
                      }
                    ]
                  }
                }
              ],
              "linkId": "3.4.1",
              "text": "Enter weight in kg",
              "type": "decimal"
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-keyboard",
                  "valueCoding": {
                    "system": "http://hl7.org/fhir/uv/sdc/CodeSystem/keyboardType",
                    "code": "email",
                    "display": "email"
                  }
                }
              ],
              "linkId": "3.4.2",
              "text": "Enter email address",
              "type": "string",
              "required": false,
              "_required": {
                "extension": [
                  {
                    "url": "http://hl7.org/fhir/StructureDefinition/cqf-expression",
                    "valueExpression": {
                      "description": "current date",
                      "language": "text/fhirpath",
                      "expression": "%patient.active"
                    }
                  }
                ]
              }
            }
          ]
        },
        {
          "linkId": "3.5",
          "_text": {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/cqf-expression",
                "valueExpression": {
                  "description": "last immunization date",
                  "language": "text/fhirpath",
                  "expression": "'Your last immunization was on '+ %Immunization.occurrenceDateTime.substring(0,10) + '.'"
                }
              }
            ]
          },
          "type": "display"
        }
      ]
    },
    {
      "linkId": "4",
      "text": "Other Controls",
      "type": "group",
      "item": [
        {
          "linkId": "4.1",
          "text": "Marital Status",
          "type": "choice",
          "answerValueSet": "http://hl7.org/fhir/ValueSet/marital-status",
          "initial": [
            {
              "valueCoding": {
                "system": "http://terminology.hl7.org/CodeSystem/v3-MaritalStatus",
                "code": "D",
                "display": "Divorced"
              }
            }
          ]
        },
        {
          "linkId": "4.2",
          "type": "group",
          "item": [
            {
              "linkId": "4.2.1",
              "text": "Choose Gender",
              "type": "choice",
              "answerValueSet": "http://hl7.org/fhir/ValueSet/administrative-gender"
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/5.0/StructureDefinition/extension-Questionnaire.item.disabledDisplay",
                  "valueCode": "protected"
                }
              ],
              "linkId": "4.2.2",
              "text": "Are you pregnant? (enableWhen = gender is Female, disableDisplay=protected)",
              "type": "choice",
              "enableWhen": [
                {
                  "question": "4.2.1",
                  "operator": "=",
                  "answerCoding": {
                    "system": "http://hl7.org/fhir/administrative-gender",
                    "code": "female"
                  }
                }
              ],
              "answerValueSet": "http://hl7.org/fhir/ValueSet/yesnodontknow"
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/5.0/StructureDefinition/extension-Questionnaire.item.disabledDisplay",
                  "valueCode": "hidden"
                }
              ],
              "linkId": "4.2.3",
              "text": "Are you diabetic? (enableWhen = gender is Female, disableDisplay=hidden)",
              "type": "choice",
              "enableWhen": [
                {
                  "question": "4.2.1",
                  "operator": "=",
                  "answerCoding": {
                    "system": "http://hl7.org/fhir/administrative-gender",
                    "code": "female"
                  }
                }
              ],
              "answerValueSet": "http://hl7.org/fhir/ValueSet/yesnodontknow"
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/5.0/StructureDefinition/extension-Questionnaire.item.disabledDisplay",
                  "valueCode": "protected"
                }
              ],
              "linkId": "4.2.4",
              "text": "Have you been diagnosed with Gestational Diabetes? (enableBehavior = only when pregnant and diabetic, disableDisplay=protected)",
              "type": "choice",
              "enableWhen": [
                {
                  "question": "4.2.2",
                  "operator": "=",
                  "answerCoding": {
                    "system": "http://terminology.hl7.org/CodeSystem/v2-0136",
                    "code": "Y"
                  }
                },
                {
                  "question": "4.2.3",
                  "operator": "=",
                  "answerCoding": {
                    "system": "http://terminology.hl7.org/CodeSystem/v2-0136",
                    "code": "Y"
                  }
                }
              ],
              "enableBehavior": "all",
              "answerValueSet": "http://hl7.org/fhir/ValueSet/yesnodontknow"
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/entryFormat",
                  "valueString": "MM/DD/YYYY"
                }
              ],
              "linkId": "4.2.5",
              "text": "Enter your birthdate (MM/DD/YYYY)",
              "type": "date",
              "answerValueSet": "http://hl7.org/fhir/ValueSet/administrative-gender"
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/5.0/StructureDefinition/extension-Questionnaire.item.disabledDisplay",
                  "valueCode": "protected"
                },
                {
                  "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression",
                  "valueExpression": {
                    "description": "if last 2 questions were answered",
                    "language": "text/fhirpath",
                    "expression": "%resource.repeat(item).where(linkId='4.2.b.1').answer.value.code ='female' and today().toString().substring(0, 4).toInteger() - %resource.repeat(item).where(linkId='4.2.b.5').answer.value.toString().substring(0, 4).toInteger() >= 40"
                  }
                }
              ],
              "linkId": "4.2.6",
              "text": "Have you had mammogram before?(enableWhenExpression = only when gender is female and age > 40, disableDisplay=protected)",
              "type": "choice",
              "answerValueSet": "http://hl7.org/fhir/ValueSet/yesnodontknow"
            }
          ]
        },
        {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-signatureRequired",
              "valueCodeableConcept": {
                "coding": [
                  {
                    "system": "urn:iso-astm:E1762-95:2013",
                    "code": "1.2.840.10065.1.12.1.8",
                    "display": "Signature Witness Signature"
                  }
                ],
                "text": "the signature of a witness to any other signature."
              }
            },
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-usageMode",
              "valueCode": "capture"
            }
          ],
          "linkId": "4.4",
          "text": "Signature of Patient",
          "type": "attachment",
          "required": true
        },
        {
          "extension": [
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-candidateExpression",
              "valueExpression": {
                "description": "active practitioners that speak at least one of the patient's language",
                "language": "application/x-fhir-query",
                "expression": "Practitioner?communication=&active=true"
              }
            },
            {
              "extension": [
                {
                  "url": "path",
                  "valueString": "name.first().family"
                },
                {
                  "url": "label",
                  "valueString": "LAST NAME"
                },
                {
                  "url": "width",
                  "valueQuantity": {
                    "value": 40,
                    "system": "http://unitsofmeasure.org",
                    "code": "%"
                  }
                },
                {
                  "url": "forDisplay",
                  "valueBoolean": true
                }
              ],
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-choiceColumn"
            },
            {
              "extension": [
                {
                  "url": "path",
                  "valueString": "name.first().given.first()"
                },
                {
                  "url": "label",
                  "valueString": "FIRST NAME"
                },
                {
                  "url": "width",
                  "valueQuantity": {
                    "value": 40,
                    "system": "http://unitsofmeasure.org",
                    "code": "%"
                  }
                },
                {
                  "url": "forDisplay",
                  "valueBoolean": true
                }
              ],
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-choiceColumn"
            },
            {
              "extension": [
                {
                  "url": "path",
                  "valueString": "gender"
                },
                {
                  "url": "label",
                  "valueString": "GENDER"
                },
                {
                  "url": "width",
                  "valueQuantity": {
                    "value": 20,
                    "system": "http://unitsofmeasure.org",
                    "code": "%"
                  }
                },
                {
                  "url": "forDisplay",
                  "valueBoolean": false
                }
              ],
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-choiceColumn"
            }
          ],
          "linkId": "4.5",
          "text": "All the practitioners below can speak the patient's language. Choose all preferred practioners:",
          "type": "reference",
          "repeats": true
        },
        {
          "extension": [
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-itemPopulationContext",
              "valueExpression": {
                "description": "Home address of the patient",
                "name": "homeAddress",
                "language": "text/fhirpath",
                "expression": "%patient.address.where(use='home').first()"
              }
            }
          ],
          "linkId": "4.6",
          "type": "group",
          "item": [
            {
              "linkId": "4.6.1",
              "text": "Home Address",
              "type": "display"
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
                  "valueExpression": {
                    "description": "Address Line 1",
                    "language": "text/fhirpath",
                    "expression": "%homeAddress.line.first()"
                  }
                }
              ],
              "linkId": "4.6.2",
              "definition": "http://hl7.org/fhir/StructureDefinition/Patient#Patient.address.line",
              "text": "Address",
              "type": "string"
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
                  "valueExpression": {
                    "description": "City",
                    "language": "text/fhirpath",
                    "expression": "%homeAddress.city"
                  }
                }
              ],
              "linkId": "4.6.3",
              "definition": "http://hl7.org/fhir/StructureDefinition/Patient#Patient.address.city",
              "text": "City",
              "type": "string"
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
                  "valueExpression": {
                    "description": "State",
                    "language": "text/fhirpath",
                    "expression": "%homeAddress.state"
                  }
                }
              ],
              "linkId": "4.6.4",
              "definition": "http://hl7.org/fhir/StructureDefinition/Patient#Patient.address.state",
              "text": "Province",
              "type": "choice",
              "answerOption": [
                {
                  "valueCoding": {
                    "system": "http://example.org/CodeSystem/provinces",
                    "code": "Alberta",
                    "display": "Alberta"
                  }
                },
                {
                  "valueCoding": {
                    "system": "http://example.org/CodeSystem/provinces",
                    "code": "BritishColumbia",
                    "display": "British Columbia"
                  }
                },
                {
                  "valueCoding": {
                    "system": "http://example.org/CodeSystem/provinces",
                    "code": "Manitoba",
                    "display": "Manitoba"
                  }
                },
                {
                  "valueCoding": {
                    "system": "http://example.org/CodeSystem/provinces",
                    "code": "NewBrunswick",
                    "display": "New Brunswick"
                  }
                },
                {
                  "valueCoding": {
                    "system": "http://example.org/CodeSystem/provinces",
                    "code": "NewfoundlandAndLabrador",
                    "display": "Newfoundland and Labrador"
                  }
                },
                {
                  "valueCoding": {
                    "system": "http://example.org/CodeSystem/provinces",
                    "code": "NovaScotia",
                    "display": "Nova Scotia"
                  }
                },
                {
                  "valueCoding": {
                    "system": "http://example.org/CodeSystem/provinces",
                    "code": "Ontario",
                    "display": "Ontario"
                  }
                },
                {
                  "valueCoding": {
                    "system": "http://example.org/CodeSystem/provinces",
                    "code": "PrinceEdwardIsland",
                    "display": "Prince Edward Island"
                  }
                },
                {
                  "valueCoding": {
                    "system": "http://example.org/CodeSystem/provinces",
                    "code": "Quebec",
                    "display": "Quebec"
                  }
                },
                {
                  "valueCoding": {
                    "system": "http://example.org/CodeSystem/provinces",
                    "code": "Saskatchewan",
                    "display": "Saskatchewan"
                  }
                }
              ]
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-initialExpression",
                  "valueExpression": {
                    "description": "Postal Code",
                    "language": "text/fhirpath",
                    "expression": "%homeAddress.postalCode"
                  }
                }
              ],
              "linkId": "4.6.5",
              "definition": "http://hl7.org/fhir/StructureDefinition/Patient#Patient.address.postalCode",
              "text": "Postal Code",
              "type": "string"
            }
          ]
        }
      ]
    }
  ]
}