<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="TulipBulb" />
  <url value="https://fake-acme.org/fhir/TulipCare/StructureDefinition/TulipBulb" />
  <version value="0.1.0" />
  <name value="TulipBulb" />
  <title value="Tulip Bulb" />
  <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:acquisitionDate">
      <path value="Substance.extension" />
      <sliceName value="acquisitionDate" />
      <short value="Date the bulbs were received or acquired" />
      <definition value="Date on which the bulbs were received or acquired from the supplier." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://fake-acme.org/fhir/TulipCare/StructureDefinition/ext-acquisitionDate" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Substance.extension:plantingLocation">
      <path value="Substance.extension" />
      <sliceName value="plantingLocation" />
      <short value="Field or bed identifier where bulbs are/will be planted" />
      <definition value="Simple string identifier for the field or bed location." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://fake-acme.org/fhir/TulipCare/StructureDefinition/ext-plantingLocation" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Substance.extension:plantingDate">
      <path value="Substance.extension" />
      <sliceName value="plantingDate" />
      <short value="Date the bulbs were planted" />
      <definition value="Date on which the bulbs were planted. Must not precede acquisitionDate." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://fake-acme.org/fhir/TulipCare/StructureDefinition/ext-plantingDate" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Substance.extension:supplier">
      <path value="Substance.extension" />
      <sliceName value="supplier" />
      <short value="Name or identifier of the bulb supplier" />
      <definition value="Free-text name or identifier of the bulb supplier or vendor." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://fake-acme.org/fhir/TulipCare/StructureDefinition/ext-supplier" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Substance.extension:recordedDate">
      <path value="Substance.extension" />
      <sliceName value="recordedDate" />
      <short value="Date this bulb record was created in the system" />
      <definition value="Server-populated date on which this bulb record was first created in the system." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://fake-acme.org/fhir/TulipCare/StructureDefinition/ext-recordedDate" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Substance.extension:bulbStatus">
      <path value="Substance.extension" />
      <sliceName value="bulbStatus" />
      <short value="Lifecycle status of the bulb batch (TulipCare)" />
      <definition value="Current lifecycle status of the bulb batch. Allowed transitions: In Storage → Planted → Bloomed → Harvested or Discarded." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://fake-acme.org/fhir/TulipCare/StructureDefinition/ext-bulbStatus" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Substance.identifier">
      <path value="Substance.identifier" />
      <short value="Unique identifier for this bulb or bulb batch" />
      <definition value="Farmer-assigned or generated unique identifier. System: https://fake-acme.org/fhir/TulipCare/bulb-id." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Substance.status">
      <path value="Substance.status" />
      <short value="FHIR base status (always active for in-use bulbs)" />
      <definition value="FHIR Substance lifecycle status. Use ext-bulbStatus for detailed TulipCare lifecycle." />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Substance.code">
      <path value="Substance.code" />
      <short value="Coded identity of the variety" />
      <definition value="Coded representation of the tulip variety associated with this bulb batch. Carries varietyReference semantics." />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Substance.description">
      <path value="Substance.description" />
      <short value="Free-text remarks about this bulb batch" />
      <definition value="Optional free-text remarks or observations about this bulb batch." />
      <min value="0" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Substance.quantity">
      <path value="Substance.quantity" />
      <short value="Number of bulbs in this batch" />
      <definition value="Number of bulbs in this batch. Minimum value is 1; a value of 1 represents an individual bulb." />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Substance.meta.lastUpdated">
      <path value="Substance.meta.lastUpdated" />
      <short value="Date/time the record was last modified" />
      <definition value="Server-maintained date and time at which this bulb record was last modified." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>