{
  "resourceType": "Questionnaire",
  "status": "active",
  "item": [
    {
      "linkId": "phq9",
      "text": "PHQ-9 Depression Screening",
      "type": "group",
      "item": [
        {
          "linkId": "phq9-intro",
          "text": "Over the last 2 weeks, how often have you been bothered by any of the following problems?",
          "type": "display"
        },
        {
          "linkId": "phq9-q1",
          "code": [
            {
              "system": "http://loinc.org",
              "code": "44250-9"
            }
          ],
          "text": "Little interest or pleasure in doing things",
          "type": "choice",
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",
              "valueCodeableConcept": {
                "coding": [
                  {
                    "system": "http://hl7.org/fhir/questionnaire-item-control",
                    "code": "radio-button"
                  }
                ]
              }
            }
          ],
          "required": true,
          "answerOption": [
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 0
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6568-5",
                "display": "Not at all"
              }
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 1
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6569-3",
                "display": "Several days"
              }
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 2
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6570-1",
                "display": "More than half the days"
              }
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 3
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6571-9",
                "display": "Nearly every day"
              }
            }
          ]
        },
        {
          "linkId": "phq9-q2",
          "code": [
            {
              "system": "http://loinc.org",
              "code": "44255-8"
            }
          ],
          "text": "Feeling down, depressed, or hopeless",
          "type": "choice",
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",
              "valueCodeableConcept": {
                "coding": [
                  {
                    "system": "http://hl7.org/fhir/questionnaire-item-control",
                    "code": "radio-button"
                  }
                ]
              }
            }
          ],
          "required": true,
          "answerOption": [
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 0
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6568-5",
                "display": "Not at all"
              }
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 1
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6569-3",
                "display": "Several days"
              }
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 2
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6570-1",
                "display": "More than half the days"
              }
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 3
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6571-9",
                "display": "Nearly every day"
              }
            }
          ]
        },
        {
          "linkId": "phq9-q3",
          "code": [
            {
              "system": "http://loinc.org",
              "code": "44259-0"
            }
          ],
          "text": "Trouble falling or staying asleep, or sleeping too much",
          "type": "choice",
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",
              "valueCodeableConcept": {
                "coding": [
                  {
                    "system": "http://hl7.org/fhir/questionnaire-item-control",
                    "code": "radio-button"
                  }
                ]
              }
            }
          ],
          "required": true,
          "answerOption": [
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 0
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6568-5",
                "display": "Not at all"
              }
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 1
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6569-3",
                "display": "Several days"
              }
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 2
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6570-1",
                "display": "More than half the days"
              }
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 3
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6571-9",
                "display": "Nearly every day"
              }
            }
          ]
        },
        {
          "linkId": "phq9-q4",
          "code": [
            {
              "system": "http://loinc.org",
              "code": "44254-1"
            }
          ],
          "text": "Feeling tired or having little energy",
          "type": "choice",
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",
              "valueCodeableConcept": {
                "coding": [
                  {
                    "system": "http://hl7.org/fhir/questionnaire-item-control",
                    "code": "radio-button"
                  }
                ]
              }
            }
          ],
          "required": true,
          "answerOption": [
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 0
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6568-5",
                "display": "Not at all"
              }
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 1
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6569-3",
                "display": "Several days"
              }
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 2
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6570-1",
                "display": "More than half the days"
              }
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 3
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6571-9",
                "display": "Nearly every day"
              }
            }
          ]
        },
        {
          "linkId": "phq9-q5",
          "code": [
            {
              "system": "http://loinc.org",
              "code": "44251-7"
            }
          ],
          "text": "Poor appetite or overeating",
          "type": "choice",
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",
              "valueCodeableConcept": {
                "coding": [
                  {
                    "system": "http://hl7.org/fhir/questionnaire-item-control",
                    "code": "radio-button"
                  }
                ]
              }
            }
          ],
          "required": true,
          "answerOption": [
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 0
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6568-5",
                "display": "Not at all"
              }
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 1
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6569-3",
                "display": "Several days"
              }
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 2
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6570-1",
                "display": "More than half the days"
              }
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 3
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6571-9",
                "display": "Nearly every day"
              }
            }
          ]
        },
        {
          "linkId": "phq9-q6",
          "code": [
            {
              "system": "http://loinc.org",
              "code": "44258-2"
            }
          ],
          "text": "Feeling bad about yourself — or that you are a failure or have let yourself or your family down",
          "type": "choice",
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",
              "valueCodeableConcept": {
                "coding": [
                  {
                    "system": "http://hl7.org/fhir/questionnaire-item-control",
                    "code": "radio-button"
                  }
                ]
              }
            }
          ],
          "required": true,
          "answerOption": [
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 0
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6568-5",
                "display": "Not at all"
              }
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 1
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6569-3",
                "display": "Several days"
              }
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 2
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6570-1",
                "display": "More than half the days"
              }
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 3
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6571-9",
                "display": "Nearly every day"
              }
            }
          ]
        },
        {
          "linkId": "phq9-q7",
          "code": [
            {
              "system": "http://loinc.org",
              "code": "44252-5"
            }
          ],
          "text": "Trouble concentrating on things, such as reading the newspaper or watching television",
          "type": "choice",
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",
              "valueCodeableConcept": {
                "coding": [
                  {
                    "system": "http://hl7.org/fhir/questionnaire-item-control",
                    "code": "radio-button"
                  }
                ]
              }
            }
          ],
          "required": true,
          "answerOption": [
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 0
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6568-5",
                "display": "Not at all"
              }
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 1
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6569-3",
                "display": "Several days"
              }
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 2
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6570-1",
                "display": "More than half the days"
              }
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 3
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6571-9",
                "display": "Nearly every day"
              }
            }
          ]
        },
        {
          "linkId": "phq9-q8",
          "code": [
            {
              "system": "http://loinc.org",
              "code": "44253-3"
            }
          ],
          "text": "Moving or speaking so slowly that other people could have noticed? Or the opposite — being so fidgety or restless that you have been moving around a lot more than usual",
          "type": "choice",
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",
              "valueCodeableConcept": {
                "coding": [
                  {
                    "system": "http://hl7.org/fhir/questionnaire-item-control",
                    "code": "radio-button"
                  }
                ]
              }
            }
          ],
          "required": true,
          "answerOption": [
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 0
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6568-5",
                "display": "Not at all"
              }
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 1
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6569-3",
                "display": "Several days"
              }
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 2
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6570-1",
                "display": "More than half the days"
              }
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 3
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6571-9",
                "display": "Nearly every day"
              }
            }
          ]
        },
        {
          "linkId": "phq9-q9",
          "code": [
            {
              "system": "http://loinc.org",
              "code": "44260-8"
            }
          ],
          "text": "Thoughts that you would be better off dead, or of hurting yourself in some way",
          "type": "choice",
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",
              "valueCodeableConcept": {
                "coding": [
                  {
                    "system": "http://hl7.org/fhir/questionnaire-item-control",
                    "code": "radio-button"
                  }
                ]
              }
            }
          ],
          "required": true,
          "answerOption": [
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 0
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6568-5",
                "display": "Not at all"
              }
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 1
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6569-3",
                "display": "Several days"
              }
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 2
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6570-1",
                "display": "More than half the days"
              }
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 3
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6571-9",
                "display": "Nearly every day"
              }
            }
          ]
        },
        {
          "linkId": "phq9-difficulty",
          "code": [
            {
              "system": "http://loinc.org",
              "code": "69722-7"
            }
          ],
          "text": "If you checked off any problems, how difficult have these problems made it for you to do your work, take care of things at home, or get along with other people?",
          "type": "choice",
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",
              "valueCodeableConcept": {
                "coding": [
                  {
                    "system": "http://hl7.org/fhir/questionnaire-item-control",
                    "code": "radio-button"
                  }
                ]
              }
            }
          ],
          "answerOption": [
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 0
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6572-7",
                "display": "Not difficult at all"
              }
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 1
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6573-5",
                "display": "Somewhat difficult"
              }
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 2
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6575-0",
                "display": "Very difficult"
              }
            },
            {
              "extension": [
                {
                  "url": "http://hl7.org/fhir/StructureDefinition/ordinalValue",
                  "valueDecimal": 3
                }
              ],
              "valueCoding": {
                "system": "http://loinc.org",
                "code": "LA6574-3",
                "display": "Extremely difficult"
              }
            }
          ]
        },
        {
          "linkId": "phq9-total",
          "code": [
            {
              "system": "http://loinc.org",
              "code": "44261-6"
            }
          ],
          "text": "PHQ-9 total score",
          "type": "decimal",
          "readOnly": true,
          "extension": [
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression",
              "valueExpression": {
                "language": "text/fhirpath",
                "expression": "iif(%resource.repeat(item).where(linkId in ('phq9-q1' | 'phq9-q2' | 'phq9-q3' | 'phq9-q4' | 'phq9-q5' | 'phq9-q6' | 'phq9-q7' | 'phq9-q8' | 'phq9-q9')).answer.valueCoding.extension('http://hl7.org/fhir/StructureDefinition/ordinalValue').valueDecimal.count() = 9, %resource.repeat(item).where(linkId in ('phq9-q1' | 'phq9-q2' | 'phq9-q3' | 'phq9-q4' | 'phq9-q5' | 'phq9-q6' | 'phq9-q7' | 'phq9-q8' | 'phq9-q9')).answer.valueCoding.extension('http://hl7.org/fhir/StructureDefinition/ordinalValue').valueDecimal.sum(), {})"
              }
            }
          ]
        },
        {
          "linkId": "phq9-severity",
          "text": "Depression severity",
          "type": "string",
          "readOnly": true,
          "extension": [
            {
              "url": "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression",
              "valueExpression": {
                "language": "text/fhirpath",
                "expression": "iif(%resource.repeat(item).where(linkId='phq9-total').answer.valueDecimal.exists(), iif(%resource.repeat(item).where(linkId='phq9-total').answer.valueDecimal < 5, 'Minimal depression', iif(%resource.repeat(item).where(linkId='phq9-total').answer.valueDecimal < 10, 'Mild depression', iif(%resource.repeat(item).where(linkId='phq9-total').answer.valueDecimal < 15, 'Moderate depression', iif(%resource.repeat(item).where(linkId='phq9-total').answer.valueDecimal < 20, 'Moderately severe depression', 'Severe depression')))), {})"
              }
            }
          ]
        }
      ]
    }
  ]
}
