<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="http://interopsante.org/fhir/StructureDefinition/FrSimpleQuantityUcum" />
  <version value="1.0.0" />
  <name value="FrSimpleQuantityUcum" />
  <title value="SimpleQuantity with UCUM quantity unit" />
  <status value="draft" />
  <date value="2021-10-18" />
  <publisher value="InterOp'Santé - FRANCE" />
  <contact>
    <telecom>
      <system value="email" />
      <value value="fhir@interopsante.org" />
    </telecom>
  </contact>
  <description value="simple quantity datatype requiring a UCUM unit" />
  <purpose value="force UCUM unit code usage" />
  <copyright value="Phast 2019" />
  <fhirVersion value="4.0.1" />
  <kind value="complex-type" />
  <abstract value="false" />
  <type value="Quantity" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Quantity" />
  <derivation value="constraint" />
  <differential>
    <element id="Quantity">
      <path value="Quantity" />
      <short value="A fixed quantity (no comparator) with UCUM unit" />
      <definition value="The comparator is not used on a SimpleQuantity. The unit SHALL be a UCUM code." />
      <comment value="The context of use may frequently define what kind of quantity this is and therefore what kind of units can be used. The context of use explicitely excludes the use of the simpleQuantity &quot;comparator&quot; element." />
      <constraint>
        <key value="sqty-1" />
        <severity value="warning" />
        <human value="The comparator is not used on a SimpleQuantity" />
        <expression value="comparator.empty()" />
        <xpath value="not(exists(f:comparator))" />
        <source value="Quantity" />
      </constraint>
    </element>
    <element id="Quantity.comparator">
      <path value="Quantity.comparator" />
      <definition value="Not allowed to be used in this context" />
      <max value="0" />
    </element>
    <element id="Quantity.system">
      <path value="Quantity.system" />
      <definition value="UCUM requiered for the identification of the system that provides the coded form of the unit." />
      <requirements value="UCUM requiered." />
      <min value="1" />
      <fixedUri value="http://unitsofmeasure.org" />
      <mustSupport value="true" />
    </element>
    <element id="Quantity.code">
      <path value="Quantity.code" />
      <comment value="UCUM code required." />
      <min value="1" />
    </element>
  </differential>
</StructureDefinition>