<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="TulipBulb" />
  <url value="https://fake-acme.org/fhir/TulipCare/models/StructureDefinition/TulipBulb" />
  <version value="0.1.0" />
  <name value="TulipBulbLm" />
  <title value="Tulip Bulb" />
  <status value="draft" />
  <fhirVersion value="4.0.1" />
  <kind value="logical" />
  <abstract value="false" />
  <type value="https://fake-acme.org/fhir/TulipCare/models/StructureDefinition/TulipBulb" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Base" />
  <derivation value="specialization" />
  <differential>
    <element id="TulipBulb">
      <path value="TulipBulb" />
      <short value="Tulip bulb or bulb batch inventory record" />
      <definition value="Represents an individual bulb or a counted batch of bulbs in the farmer's physical inventory, linked to a TulipVariety and tracking provenance, quantity, location, and lifecycle status." />
      <min value="0" />
      <max value="*" />
    </element>
    <element id="TulipBulb.bulbId">
      <path value="TulipBulb.bulbId" />
      <short value="Unique identifier for this bulb or bulb batch" />
      <definition value="Farmer-assigned or generated unique identifier for this bulb or bulb batch. System: https://fake-acme.org/fhir/TulipCare/bulb-id." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="string" />
      </type>
    </element>
    <element id="TulipBulb.varietyReference">
      <path value="TulipBulb.varietyReference" />
      <short value="Reference to the associated TulipVariety" />
      <definition value="Reference to the TulipVariety record to which this bulb batch belongs. Must resolve to an existing TulipVariety record." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="https://fake-acme.org/fhir/TulipCare/models/StructureDefinition/TulipVariety" />
      </type>
    </element>
    <element id="TulipBulb.quantity">
      <path value="TulipBulb.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" />
      <type>
        <code value="integer" />
      </type>
    </element>
    <element id="TulipBulb.supplier">
      <path value="TulipBulb.supplier" />
      <short value="Name or identifier of the bulb supplier" />
      <definition value="Free-text name or identifier of the bulb supplier or vendor for v1." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="string" />
      </type>
    </element>
    <element id="TulipBulb.acquisitionDate">
      <path value="TulipBulb.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="date" />
      </type>
    </element>
    <element id="TulipBulb.plantingLocation">
      <path value="TulipBulb.plantingLocation" />
      <short value="Field or bed identifier where bulbs are/will be planted" />
      <definition value="Simple string identifier for the field or bed location (e.g., Field A – Bed 3). Structured location model is out of scope for v1." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="string" />
      </type>
    </element>
    <element id="TulipBulb.plantingDate">
      <path value="TulipBulb.plantingDate" />
      <short value="Date the bulbs were planted in the ground" />
      <definition value="Date on which the bulbs were planted. Must not precede acquisitionDate." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="date" />
      </type>
    </element>
    <element id="TulipBulb.status">
      <path value="TulipBulb.status" />
      <short value="Current lifecycle status of the bulb batch" />
      <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="code" />
      </type>
      <binding>
        <strength value="required" />
        <valueSet value="https://fake-acme.org/fhir/TulipCare/models/ValueSet/BulbStatus-lm" />
      </binding>
    </element>
    <element id="TulipBulb.notes">
      <path value="TulipBulb.notes" />
      <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" />
      <type>
        <code value="string" />
      </type>
    </element>
    <element id="TulipBulb.recordedDate">
      <path value="TulipBulb.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="date" />
      </type>
    </element>
    <element id="TulipBulb.lastUpdated">
      <path value="TulipBulb.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" />
      <max value="1" />
      <type>
        <code value="dateTime" />
      </type>
    </element>
  </differential>
</StructureDefinition>