<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="shr-entity-Substance" />
  <text>
    <status value="generated" />
    <div xmlns="http://www.w3.org/1999/xhtml">
      <p>
        <b>SHR Substance Profile</b>
      </p>
      <p>Any matter of defined composition that has discrete existence, whose origin may be biological, mineral or chemical.</p>
      <p>
        <b>SHR Mapping Summary</b>
      </p>
      <p>
        <pre>shr.entity.Substance maps to Substance:
  Type maps to code
  Ingredient maps to ingredient
  Ingredient.IngredientAmount maps to ingredient.quantity
  Ingredient.CodeableConcept maps to ingredient.substance[x]
  Ingredient.Substance maps to ingredient.substance[x]
</pre>
      </p>
    </div>
  </text>
  <url value="http://standardhealthrecord.org/fhir/StructureDefinition/shr-entity-Substance" />
  <identifier>
    <system value="http://standardhealthrecord.org" />
    <value value="shr.entity.Substance" />
  </identifier>
  <version value="0.0.1" />
  <name value="SHR Substance Profile" />
  <status value="draft" />
  <date value="2017-12-20" />
  <publisher value="The MITRE Corporation: Standard Health Record Collaborative" />
  <contact>
    <telecom>
      <system value="url" />
      <value value="http://standardhealthrecord.org" />
    </telecom>
  </contact>
  <description value="Any matter of defined composition that has discrete existence, whose origin may be biological, mineral or chemical." />
  <fhirVersion value="3.0.1" />
  <mapping>
    <identity value="rim" />
    <uri value="http://hl7.org/v3" />
    <name value="RIM Mapping" />
  </mapping>
  <mapping>
    <identity value="orim" />
    <uri value="http://hl7.org/orim" />
    <name value="Ontological RIM Mapping" />
  </mapping>
  <mapping>
    <identity value="w5" />
    <uri value="http://hl7.org/fhir/w5" />
    <name value="W5 Mapping" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="Substance" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Substance" />
  <derivation value="constraint" />
  <differential>
    <element id="Substance:shr-entity-Substance">
      <path value="Substance" />
      <short value="SHR Substance Profile" />
      <definition value="Any matter of defined composition that has discrete existence, whose origin may be biological, mineral or chemical." />
    </element>
    <element id="Substance:shr-entity-Substance.extension:relatedencounter">
      <path value="Substance.extension" />
      <sliceName value="relatedencounter" />
      <definition value="If content was generated during a patient encounter, related encounter is the encounter where the information was gained." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://standardhealthrecord.org/fhir/StructureDefinition/shr-base-RelatedEncounter-extension" />
      </type>
    </element>
    <element id="Substance:shr-entity-Substance.extension:author">
      <path value="Substance.extension" />
      <sliceName value="author" />
      <definition value="The person or organization who created the entry and is responsible for (and may certify) the content." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://standardhealthrecord.org/fhir/StructureDefinition/shr-base-Author-extension" />
      </type>
    </element>
    <element id="Substance:shr-entity-Substance.extension:informant">
      <path value="Substance.extension" />
      <sliceName value="informant" />
      <definition value="The person or entity that provided the information in the entry, as distinct from who created the entry, e.g. the subject (patient), medical professional, family member, device or software program." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://standardhealthrecord.org/fhir/StructureDefinition/shr-base-Informant-extension" />
      </type>
    </element>
    <element id="Substance:shr-entity-Substance.extension:category">
      <path value="Substance.extension" />
      <sliceName value="category" />
      <definition value="A class or division of people or things having particular shared characteristics" />
      <min value="0" />
      <max value="*" />
      <type>
        <code value="Extension" />
        <profile value="http://standardhealthrecord.org/fhir/StructureDefinition/shr-core-Category-extension" />
      </type>
    </element>
    <element id="Substance:shr-entity-Substance.extension:category.valueCodeableConcept">
      <path value="Substance.extension.valueCodeableConcept" />
      <binding>
        <strength value="extensible" />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/substance-category" />
        </valueSetReference>
      </binding>
    </element>
    <element id="Substance:shr-entity-Substance.extension:activeflagasacodeableconcept">
      <path value="Substance.extension" />
      <sliceName value="activeflagasacodeableconcept" />
      <definition value="If the ActiveFlag is false, it indicates the record or item is no longer to be used and should generally be hidden for the user in the UI." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://standardhealthrecord.org/fhir/StructureDefinition/shr-entity-ActiveFlagAsaCodeableConcept-extension" />
      </type>
    </element>
    <element id="Substance:shr-entity-Substance.extension:activeflagasacodeableconcept.valueCodeableConcept">
      <path value="Substance.extension.valueCodeableConcept" />
      <binding>
        <strength value="required" />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/substance-status" />
        </valueSetReference>
      </binding>
    </element>
    <element id="Substance:shr-entity-Substance.extension:details">
      <path value="Substance.extension" />
      <sliceName value="details" />
      <definition value="An text note containing additional details, explanation, description, comment, or summarization. Details can discuss, support, explain changes to, or dispute information." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://standardhealthrecord.org/fhir/StructureDefinition/shr-core-Details-extension" />
      </type>
    </element>
    <element id="Substance:shr-entity-Substance.code">
      <path value="Substance.code" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="SubstanceCode" />
        </extension>
        <strength value="preferred" />
        <description value="Substance codes" />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/substance-code" />
        </valueSetReference>
      </binding>
    </element>
    <element id="Substance:shr-entity-Substance.ingredient">
      <path value="Substance.ingredient" />
    </element>
    <element id="Substance:shr-entity-Substance.ingredient.quantity">
      <path value="Substance.ingredient.quantity" />
      <type>
        <code value="Ratio" />
        <profile value="http://standardhealthrecord.org/fhir/StructureDefinition/shr-core-Ratio" />
      </type>
    </element>
    <element id="Substance:shr-entity-Substance.ingredient.substance[x]">
      <path value="Substance.ingredient.substance[x]" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <type>
        <code value="Reference" />
        <targetProfile value="http://standardhealthrecord.org/fhir/StructureDefinition/shr-entity-Substance" />
      </type>
    </element>
  </differential>
</StructureDefinition>