{
  "resourceType": "StructureDefinition",
  "id": "cqif-questionnaire",
  "text": {
    "status": "generated",
    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">to do</div>"
  },
  "url": "http://hl7.org/fhir/StructureDefinition/cqif-questionnaire",
  "name": "CQIF-Questionnaire",
  "status": "draft",
  "experimental": false,
  "date": "2015-05-30",
  "publisher": "Health Level Seven, Inc. - CDS WG",
  "contact": [
    {
      "telecom": [
        {
          "system": "url",
          "value": "http://hl7.org/special/committees/dss"
        }
      ]
    }
  ],
  "description": "A questionnaire with the ability to specify behavior associated with questions or groups of questions",
  "fhirVersion": "3.0.1",
  "mapping": [
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/w5",
      "name": "W5 Mapping"
    },
    {
      "identity": "objimpl",
      "uri": "http://hl7.org/fhir/object-implementation",
      "name": "Object Implementation Information"
    },
    {
      "identity": "v2",
      "uri": "http://hl7.org/v2",
      "name": "HL7 v2 Mapping"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Questionnaire",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Questionnaire",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Questionnaire",
        "path": "Questionnaire",
        "short": "A questionnaire with the ability to specify behavior associated with questions or groups of questions",
        "definition": "A CQIF questionnaire is a questionnaire with the added ability to describe behavior associated with questions. For example, whether or not to display a particular question or group of questions, or automatically calculating the value of an answer based on the answers to previous questions.",
        "min": 0,
        "max": "*"
      },
      {
        "id": "Questionnaire.extension:library",
        "path": "Questionnaire.extension",
        "sliceName": "library",
        "short": "A library containing logic referenced by the questionnaire",
        "definition": "A CQL or ELM library containing any logic referenced by the questionnaire.",
        "alias": [
          "library"
        ],
        "type": [
          {
            "code": "Extension",
            "profile": "http://hl7.org/fhir/StructureDefinition/cqif-library"
          }
        ]
      },
      {
        "id": "Questionnaire.item",
        "path": "Questionnaire.item"
      },
      {
        "id": "Questionnaire.item.extension:condition",
        "path": "Questionnaire.item.extension",
        "sliceName": "condition",
        "short": "A condition that determines whether or not the group is applicable",
        "definition": "The name of an expression that determines whether the group on which it appears is applicable. The expression is evaluated within the current context. If the result of evaluating the expression is true, the group is applicable. The expression has access to the current value of answered questions by the linkId of the question.",
        "comment": "Note that per Lloyd this extension may not be necessary, it may be able to specified structurally using the elements already available within Questionnaire.",
        "alias": [
          "condition"
        ],
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": "http://hl7.org/fhir/StructureDefinition/cqif-condition"
          }
        ]
      },
      {
        "id": "Questionnaire.item.extension:initialvalue",
        "path": "Questionnaire.item.extension",
        "sliceName": "initialValue",
        "short": "An expression that provides the initial value for the answer to the question",
        "definition": "The name of an expression that determines the initial value for the answer to the question. This expression is evaluated once as part of displaying the form, and does not have access to the answers to other questions.",
        "alias": [
          "initialValue"
        ],
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": "http://hl7.org/fhir/StructureDefinition/cqif-initialValue"
          }
        ]
      },
      {
        "id": "Questionnaire.item.extension:calculatedvalue",
        "path": "Questionnaire.item.extension",
        "sliceName": "calculatedValue",
        "short": "An expression that provides a calculated value for the answer to the question",
        "definition": "The name of an expression that determines a calculated value for the answer to the question. The expression is evaluated as necessary and has access to the answers to other questions by the linkId of the question.",
        "alias": [
          "calculatedValue"
        ],
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": "http://hl7.org/fhir/StructureDefinition/cqif-calculatedValue"
          }
        ]
      },
      {
        "id": "Questionnaire.item.option",
        "path": "Questionnaire.item.option"
      },
      {
        "id": "Questionnaire.item.option.extension:optioncode",
        "path": "Questionnaire.item.option.extension",
        "sliceName": "optionCode",
        "short": "Meaning of the response option",
        "definition": "A CodeableConcept that assigns meaning to the response object on which it appears.",
        "requirements": "Need to be able to determine the semantics of each potential response in order to interpret the meaning when processing the questionnaire response.  For example, the response option \"Severe migraines within the past year\" to the question \"Select all that apply\" needs detailed coding (such as via CodeableConcept) at the option level, as well as a way to represent that an affirmation/negative response should result in (perhaps) an Observation in the QuestionnaireResponse tied to a clinical model (such as CIMI). This is key to support sophisticated CDS based on the semantics of the QuestionnaireResponse -- not just the codes.",
        "alias": [
          "optionCode"
        ],
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "Extension",
            "profile": "http://hl7.org/fhir/StructureDefinition/cqif-optionCode"
          }
        ]
      }
    ]
  }
}