<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="TulipVariety" />
  <url value="https://fake-acme.org/fhir/TulipCare/StructureDefinition/TulipVariety" />
  <version value="0.1.0" />
  <name value="TulipVariety" />
  <title value="Tulip Variety" />
  <status value="draft" />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Substance" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Substance" />
  <derivation value="constraint" />
  <differential>
    <element id="Substance.extension">
      <path value="Substance.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Substance.extension:bloomSeason">
      <path value="Substance.extension" />
      <sliceName value="bloomSeason" />
      <short value="Seasonal bloom period" />
      <definition value="The season in which this variety blooms, derived from KAVB bloom time chart." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://fake-acme.org/fhir/TulipCare/StructureDefinition/ext-bloomSeason" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Substance.extension:heightRangeMin">
      <path value="Substance.extension" />
      <sliceName value="heightRangeMin" />
      <short value="Minimum expected plant height in inches" />
      <definition value="Minimum expected plant height in inches." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://fake-acme.org/fhir/TulipCare/StructureDefinition/ext-heightRangeMin" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Substance.extension:heightRangeMax">
      <path value="Substance.extension" />
      <sliceName value="heightRangeMax" />
      <short value="Maximum expected plant height in inches" />
      <definition value="Maximum expected plant height in inches." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://fake-acme.org/fhir/TulipCare/StructureDefinition/ext-heightRangeMax" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Substance.extension:flowerColour">
      <path value="Substance.extension" />
      <sliceName value="flowerColour" />
      <short value="Descriptive colour of the bloom" />
      <definition value="Descriptive or coded colour of the bloom. Free text for v1." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://fake-acme.org/fhir/TulipCare/StructureDefinition/ext-flowerColour" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Substance.extension:varietyRecordedDate">
      <path value="Substance.extension" />
      <sliceName value="varietyRecordedDate" />
      <short value="Date the variety was added to the catalogue" />
      <definition value="Server-populated date on which this variety record was created in the catalogue." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://fake-acme.org/fhir/TulipCare/StructureDefinition/ext-varietyRecordedDate" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Substance.identifier">
      <path value="Substance.identifier" />
      <short value="Unique system identifier for this variety record" />
      <definition value="Server-assigned unique identifier for the variety record." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Substance.code">
      <path value="Substance.code" />
      <short value="Variety name coded identity" />
      <definition value="The common name of the cultivar or species encoded as the substance code. Text carries the varietyName." />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Substance.code.coding">
      <path value="Substance.code.coding" />
      <short value="Horticultural classification group (tulipClass)" />
      <definition value="Horticultural classification group based on KAVB classification (13 recognised groups)." />
      <min value="1" />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="https://fake-acme.org/fhir/TulipCare/models/ValueSet/TulipClass-lm" />
      </binding>
    </element>
    <element id="Substance.code.text">
      <path value="Substance.code.text" />
      <short value="Cultivar or species common name (varietyName)" />
      <definition value="Common name of the cultivar or species. Must be unique within the catalogue." />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Substance.description">
      <path value="Substance.description" />
      <short value="Free-text remarks about the variety" />
      <definition value="Optional free-text remarks or observations about this variety." />
      <min value="0" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>