<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="flag-onset" />
  <url value="http://hl7.org/fhir/StructureDefinition/flag-onset" />
  <version value="4.0" />
  <name value="flag-onset" />
  <title value="Flag Onset" />
  <status value="draft" />
  <publisher value="Orion Health" />
  <description value="This extension enhances the Flag resources to provide an onset for a Flag" />
  <purpose value="Unlike the other problem related resources, Flags do not contain an onset field. This extension enhances the Flag resource to provide the onset as either an Age, a Date or a String" />
  <fhirVersion value="4.0" />
  <kind value="complex-type" />
  <abstract value="false" />
  <type value="Extension" />
  <snapshot>
    <element id="Extension">
      <path value="Extension" />
      <max value="1" />
      <base>
        <path value="Extension" />
        <max value="1" />
      </base>
    </element>
    <element id="Extension.url">
      <path value="Extension.url" />
      <base>
        <path value="Extension.url" />
      </base>
      <fixedUri value="http://hl7.org/fhir/StructureDefinition/flag-onset" />
    </element>
    <element id="Extension.value[x]">
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
        <valueCode value="normative" />
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version">
        <valueCode value="4.0.0" />
      </extension>
      <path value="Extension.value[x]" />
      <short value="This extension enhances the Flag resources to provide an onset for a Flag" />
      <definition value="Set the onset for this Flag" />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="Extension.value[x]" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="Age" />
      </type>
      <type>
        <code value="dateTime" />
      </type>
      <type>
        <code value="string" />
      </type>
      <condition value="ele-1" />
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <xpath value="@value|f:*|h:div" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
  </snapshot>
  <differential>
    <element id="Extension">
      <path value="Extension" />
      <max value="1" />
    </element>
    <element id="Extension.url">
      <path value="Extension.url" />
      <fixedUri value="http://hl7.org/fhir/StructureDefinition/flag-onset" />
    </element>
    <element id="Extension.value[x]">
      <path value="Extension.value[x]" />
      <short value="This extension enhances the Flag resources to provide an onset for a Flag" />
      <definition value="Set the onset for this Flag" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Age" />
      </type>
      <type>
        <code value="dateTime" />
      </type>
      <type>
        <code value="string" />
      </type>
    </element>
  </differential>
</StructureDefinition>