<Questionnaire xmlns="http://hl7.org/fhir">
  <url value="http://ontariohealth.ca/fhir/Questionnaire/ca-on-mha-gambling-questionnaire-template" />
  <version value="1.0.0" />
  <title value="MHA Gambling Questionnaire Template" />
  <status value="active" />
  <description value="Sample questionnaire using all questions from the Catalyst Problem Gambling Required Data Form" />
  <purpose value="To serve as a model to build required MHA Gambling questionnaires." />
  <item>
    <linkId value="Q1" />
    <text value="Reason for Seeking Help With Gambling Behaviour" />
    <type value="choice" />
    <required value="true" />
    <answerValueSet value="http://ontariohealth.ca/fhir/ValueSet/gambling-help-seeking-reason" />
  </item>
  <item>
    <linkId value="Q2" />
    <text value="Number of Months Life Negatively Affected by Gambling Behaviour" />
    <type value="integer" />
    <enableWhen>
      <question value="Q1" />
      <operator value="=" />
      <answerCoding>
        <system value="http://ontariohealth.ca/fhir/CodeSystem/gambling-help-seeking-reason" />
        <code value="1" />
      </answerCoding>
    </enableWhen>
    <enableWhen>
      <question value="Q1" />
      <operator value="=" />
      <answerCoding>
        <system value="http://ontariohealth.ca/fhir/CodeSystem/gambling-help-seeking-reason" />
        <code value="2" />
      </answerCoding>
    </enableWhen>
    <enableBehavior value="any" />
  </item>
  <item>
    <linkId value="Q3" />
    <text value="Length of Time Since Last Gambling Activity (Days)" />
    <type value="integer" />
    <enableWhen>
      <question value="Q1" />
      <operator value="=" />
      <answerCoding>
        <system value="http://ontariohealth.ca/fhir/CodeSystem/gambling-help-seeking-reason" />
        <code value="1" />
      </answerCoding>
    </enableWhen>
    <enableWhen>
      <question value="Q1" />
      <operator value="=" />
      <answerCoding>
        <system value="http://ontariohealth.ca/fhir/CodeSystem/gambling-help-seeking-reason" />
        <code value="2" />
      </answerCoding>
    </enableWhen>
    <enableBehavior value="any" />
  </item>
  <item>
    <linkId value="Q4" />
    <text value="Sequence of Gambling Problem Identification" />
    <type value="choice" />
    <enableWhen>
      <question value="Q1" />
      <operator value="=" />
      <answerCoding>
        <system value="http://ontariohealth.ca/fhir/CodeSystem/gambling-help-seeking-reason" />
        <code value="1" />
      </answerCoding>
    </enableWhen>
    <enableWhen>
      <question value="Q1" />
      <operator value="=" />
      <answerCoding>
        <system value="http://ontariohealth.ca/fhir/CodeSystem/gambling-help-seeking-reason" />
        <code value="2" />
      </answerCoding>
    </enableWhen>
    <enableBehavior value="any" />
    <answerValueSet value="http://ontariohealth.ca/fhir/ValueSet/sequence-of-gambling-problem" />
  </item>
  <item>
    <linkId value="Q5" />
    <text value="Primary Gambling Activity in the last 12 months" />
    <type value="choice" />
    <enableWhen>
      <question value="Q1" />
      <operator value="=" />
      <answerCoding>
        <system value="http://ontariohealth.ca/fhir/CodeSystem/gambling-help-seeking-reason" />
        <code value="1" />
      </answerCoding>
    </enableWhen>
    <enableWhen>
      <question value="Q1" />
      <operator value="=" />
      <answerCoding>
        <system value="http://ontariohealth.ca/fhir/CodeSystem/gambling-help-seeking-reason" />
        <code value="2" />
      </answerCoding>
    </enableWhen>
    <enableBehavior value="any" />
    <answerValueSet value="http://ontariohealth.ca/fhir/ValueSet/gambling-activities-in-last-year" />
    <item>
      <linkId value="Q5-a" />
      <text value="Primary Gambling Activity Frequency in last 12 months" />
      <type value="choice" />
      <enableWhen>
        <question value="Q5" />
        <operator value="exists" />
        <answerBoolean value="true" />
      </enableWhen>
      <required value="true" />
      <answerValueSet value="http://ontariohealth.ca/fhir/ValueSet/gambling-frequency" />
    </item>
    <item>
      <linkId value="Q5-b" />
      <text value="Primary Gambling Location in last 12 months" />
      <type value="choice" />
      <enableWhen>
        <question value="Q5-a" />
        <operator value="exists" />
        <answerBoolean value="true" />
      </enableWhen>
      <required value="true" />
      <answerValueSet value="http://ontariohealth.ca/fhir/ValueSet/gambling-location" />
    </item>
    <item>
      <linkId value="Q5-c" />
      <text value="Primary Gambling Location Frequency in last 12 months" />
      <type value="choice" />
      <enableWhen>
        <question value="Q5-b" />
        <operator value="exists" />
        <answerBoolean value="true" />
      </enableWhen>
      <required value="true" />
      <answerValueSet value="http://ontariohealth.ca/fhir/ValueSet/gambling-frequency" />
    </item>
  </item>
  <item>
    <linkId value="Q6" />
    <text value="Additional Gambling Activity in the last 12 months" />
    <type value="choice" />
    <repeats value="true" />
    <answerValueSet value="http://ontariohealth.ca/fhir/ValueSet/gambling-activities-in-last-year" />
    <item>
      <linkId value="Q6-a" />
      <text value="Additional Gambling Activity Frequency in last 12 months" />
      <type value="choice" />
      <enableWhen>
        <question value="Q6" />
        <operator value="exists" />
        <answerBoolean value="true" />
      </enableWhen>
      <answerValueSet value="http://ontariohealth.ca/fhir/ValueSet/gambling-frequency" />
    </item>
    <item>
      <linkId value="Q6-b" />
      <text value="Additional Gambling Location in last 12 months" />
      <type value="choice" />
      <answerValueSet value="http://ontariohealth.ca/fhir/ValueSet/gambling-location" />
    </item>
    <item>
      <linkId value="Q6-c" />
      <text value="Additional Gambling Location Frequency in last 12 months" />
      <type value="choice" />
      <enableWhen>
        <question value="Q6-b" />
        <operator value="exists" />
        <answerBoolean value="true" />
      </enableWhen>
      <answerValueSet value="http://ontariohealth.ca/fhir/ValueSet/gambling-frequency" />
    </item>
  </item>
  <item>
    <linkId value="Q7" />
    <text value="Percentage of Time Spent Gambling by Jurisdiction" />
    <type value="group" />
    <item>
      <linkId value="Q7-a" />
      <text value="Percentage of Time Spent Gambling in Ontario" />
      <type value="integer" />
    </item>
    <item>
      <linkId value="Q7-b" />
      <text value="Percentage of Time Spent Gambling in another province" />
      <type value="integer" />
    </item>
    <item>
      <linkId value="Q7-c" />
      <text value="Percentage of Time Spent Gambling Outside of Canada" />
      <type value="integer" />
    </item>
  </item>
</Questionnaire>