{
  "resourceType": "StructureDefinition",
  "constrainedType": "Extension",
  "base": "http://hl7.org/fhir/StructureDefinition/Extension",
  "id": "spark359",
  "meta": {
    "versionId": "spark359",
    "lastUpdated": "2015-10-02T12:25:09.998+00:00"
  },
  "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-enableWhen",
  "name": "Only allow data when:",
  "status": "draft",
  "date": "2013-07-04",
  "publisher": "HL7",
  "contact": [
    {
      "telecom": [
        {
          "system": "other",
          "value": "http://www.hl7.org"
        }
      ]
    }
  ],
  "description": "If present, indicates that the group or question containing the extension should only be enabled (allow an answer to be present and, in most circumstances, even be visible to the user) when the specified condition is true.",
  "fhirVersion": "1.0.1",
  "kind": "datatype",
  "abstract": false,
  "contextType": "resource",
  "context": [
    "Questionnaire.group",
    "Questionnaire.group.group",
    "Questionnaire.group.question"
  ],
  "snapshot": {
    "element": [
      {
        "comments": "If multiple repetitions of this extension are present, the question or group should be displayed when the condition for *any* of the repetitions is true.  I.e. Treat \"enableWhen\"s as being joined by an \"or\" clause.",
        "id": "Extension",
        "path": "Extension",
        "short": "Only allow data when:",
        "definition": "If present, indicates that the group or question containing the extension should only be enabled (allow an answer to be present and, in most circumstances, even be visible to the user) when the specified condition is true.",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "Extension"
          }
        ]
      }
    ]
  },
  "differential": {
    "element": [
      {
        "comments": "If multiple repetitions of this extension are present, the question or group should be displayed when the condition for *any* of the repetitions is true.  I.e. Treat \"enableWhen\"s as being joined by an \"or\" clause.",
        "path": "Extension",
        "short": "Only allow data when:",
        "definition": "If present, indicates that the group or question containing the extension should only be enabled (allow an answer to be present and, in most circumstances, even be visible to the user) when the specified condition is true.",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "Extension"
          }
        ]
      },
      {
        "name": "question",
        "comments": "If multiple question occurrences are present for the same question (same linkId), then this refers to the nearest question occurrence reachable by tracing first the \"ancestor\" axis and then the \"preceding\" axis and then the \"following\" axis.",
        "path": "Extension.extension",
        "short": "Question that must be answered",
        "definition": "The linkId for the question whose answer (or lack of answer) governs whether the question is enabled.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension"
          }
        ]
      },
      {
        "name": "extension",
        "path": "Extension.extension.extension",
        "max": "0"
      },
      {
        "path": "Extension.extension.url",
        "type": [
          {
            "code": "uri"
          }
        ],
        "fixedUri": "question"
      },
      {
        "path": "Extension.extension.value[x]",
        "min": 1,
        "type": [
          {
            "code": "string"
          }
        ]
      },
      {
        "name": "answered",
        "comments": "If answered=false and answer values are also provided, then they are treated as \"or\".  I.e. \"Enable if the question is unanswered or the answer is one of the specified values\".  If answered=true and answers are present, one of the specified answers must be met. (So there's little reason to specify answered=true if answers are present.).",
        "path": "Extension.extension",
        "short": "when answered or not",
        "definition": "If present, allows the assertion to control whether the item is enabled when the question is answered or is unanswered.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension"
          }
        ]
      },
      {
        "name": "extension",
        "path": "Extension.extension.extension",
        "max": "0"
      },
      {
        "path": "Extension.extension.url",
        "type": [
          {
            "code": "uri"
          }
        ],
        "fixedUri": "answered"
      },
      {
        "path": "Extension.extension.value[x]",
        "min": 1,
        "type": [
          {
            "code": "boolean"
          }
        ]
      },
      {
        "name": "answer",
        "path": "Extension.extension",
        "short": "Value question must have",
        "definition": "If present, then the specified question must match the specified answer for all components present in the enableWhen.answer.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension"
          }
        ]
      },
      {
        "name": "extension",
        "path": "Extension.extension.extension",
        "max": "0"
      },
      {
        "path": "Extension.extension.url",
        "type": [
          {
            "code": "uri"
          }
        ],
        "fixedUri": "answer"
      },
      {
        "path": "Extension.extension.value[x]",
        "min": 1,
        "type": [
          {
            "code": "boolean"
          },
          {
            "code": "integer"
          },
          {
            "code": "decimal"
          },
          {
            "code": "base64Binary"
          },
          {
            "code": "instant"
          },
          {
            "code": "string"
          },
          {
            "code": "uri"
          },
          {
            "code": "date"
          },
          {
            "code": "dateTime"
          },
          {
            "code": "time"
          },
          {
            "code": "code"
          },
          {
            "code": "oid"
          },
          {
            "code": "id"
          },
          {
            "code": "unsignedInt"
          },
          {
            "code": "positiveInt"
          },
          {
            "code": "markdown"
          },
          {
            "code": "Annotation"
          },
          {
            "code": "Attachment"
          },
          {
            "code": "Identifier"
          },
          {
            "code": "CodeableConcept"
          },
          {
            "code": "Coding"
          },
          {
            "code": "Quantity"
          },
          {
            "code": "Range"
          },
          {
            "code": "Period"
          },
          {
            "code": "Ratio"
          },
          {
            "code": "SampledData"
          },
          {
            "code": "Signature"
          },
          {
            "code": "HumanName"
          },
          {
            "code": "Address"
          },
          {
            "code": "ContactPoint"
          },
          {
            "code": "Timing"
          },
          {
            "code": "Reference"
          },
          {
            "code": "Meta"
          }
        ]
      },
      {
        "path": "Extension.url",
        "type": [
          {
            "code": "uri"
          }
        ],
        "fixedUri": "http://hl7.org/fhir/StructureDefinition/questionnaire-enableWhen"
      },
      {
        "path": "Extension.value[x]",
        "min": 0,
        "max": "0"
      }
    ]
  }
}