<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="MedicationStatement-uv-ips" />
  <meta>
    <lastUpdated value="2018-02-21T00:47:03.873+01:00" />
  </meta>
  <url value="http://hl7.org/fhir/uv/ips/StructureDefinition/MedicationStatement-uv-ips" />
  <name value="MedicationStatementIPS" />
  <title value="Medication Statement (IPS)" />
  <status value="active" />
  <date value="2018-02-14T22:57:06.512+01:00" />
  <publisher value="HL7 International" />
  <description value="This profile represents the constraints applied to the MedicationStatement resource by the International Patient Summary (IPS) FHIR Implementation Guide, based on FHIR R4. A record of a medication statement is represented in the patient summary as an instance of a MedicationStatement resource constrained by this profile." />
  <purpose value="This profile constrains the representation of a medication statement related to the patient, in the context of the international patient summary as specified by the IPS project of HL7 International." />
  <kind value="resource" />
  <abstract value="false" />
  <type value="MedicationStatement" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/MedicationStatement" />
  <derivation value="constraint" />
  <differential>
    <element id="MedicationStatement">
      <path value="MedicationStatement" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationStatement.id">
      <path value="MedicationStatement.id" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationStatement.status">
      <path value="MedicationStatement.status" />
      <comment value="In the scope of the IPS the entered-in-error concept is not allowed." />
      <mustSupport value="true" />
    </element>
    <element id="MedicationStatement.medication[x]">
      <path value="MedicationStatement.medication[x]" />
      <!-- The slicing below is expected to be replaced in R5 by a 'medication' element of the new CodeableReference 
				data type with the appropriate constraints. -->
      <slicing>
        <discriminator>
          <type value="type" />
          <path value="$this" />
        </discriminator>
        <rules value="closed" />
      </slicing>
      <definition value="Identifies the medication being administered or the reason for absent or unknown Medication. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code. To improve global interoperability is strongly encouraged that the reference to a medication resource is used, limiting the usage of the medicationCodeableConcept only to the cases in which no other information than a simple code is available." />
      <mustSupport value="true" />
      <binding>
        <strength value="example" />
        <description value="The type of medication" />
        <valueSet value="http://hl7.org/fhir/uv/ips/ValueSet/medication-example-uv-ips" />
      </binding>
    </element>
    <element id="MedicationStatement.medication[x]:medicationReference">
      <path value="MedicationStatement.medication[x]" />
      <sliceName value="medicationReference" />
      <definition value="Identifies the medication being administered or the reason for absent or unknown Medication. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code. To improve global interoperability is strongly encouraged that the reference to a medication resource is used, limiting the usage of the medicationCodeableConcept only to the cases in which no other information than a simple code is available." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/uv/ips/StructureDefinition/Medication-uv-ips" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MedicationStatement.medication[x]:medicationCodeableConcept">
      <path value="MedicationStatement.medication[x]" />
      <sliceName value="medicationCodeableConcept" />
      <short value="Code for absent or unknown medication" />
      <definition value="Code for a negated/excluded medication statement.  This describes a categorical negated statement (e.g.,  &quot;No known allergy&quot;)." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="CodeableConcept" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips" />
      </type>
      <mustSupport value="true" />
      <!-- The extensible binding requires the specified codes for absent and unknown medications, but also allows
				any code to be used for a statement of an administered medication.  This will be replaced in R5 with
				with appropriate bindings and constraints with the new CodeableReference data type. -->
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="UnknownMedicationCode" />
        </extension>
        <strength value="extensible" />
        <description value="Representation of unknown or absent medications" />
        <valueSet value="http://hl7.org/fhir/uv/ips/ValueSet/absent-or-unknown-medications-uv-ips" />
      </binding>
    </element>
    <element id="MedicationStatement.subject">
      <path value="MedicationStatement.subject" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/uv/ips/StructureDefinition/Patient-uv-ips" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MedicationStatement.effective[x]">
      <path value="MedicationStatement.effective[x]" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationStatement.effective[x]:data-absent-reason">
      <path value="MedicationStatement.effective[x].extension" />
      <short value="effective[x] absence reason" />
      <definition value="Provides a reason why the effectiveTime is missing." />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/StructureDefinition/data-absent-reason" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="MedicationStatement.informationSource">
      <path value="MedicationStatement.informationSource" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationStatement.dosage">
      <path value="MedicationStatement.dosage" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationStatement.dosage.text">
      <path value="MedicationStatement.dosage.text" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationStatement.dosage.timing">
      <path value="MedicationStatement.dosage.timing" />
      <mustSupport value="true" />
    </element>
    <element id="MedicationStatement.dosage.route">
      <path value="MedicationStatement.dosage.route" />
      <type>
        <code value="CodeableConcept" />
        <profile value="http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips" />
      </type>
      <mustSupport value="true" />
      <binding>
        <strength value="preferred" />
        <description value="EDQM Standards Terms" />
        <valueSet value="http://hl7.org/fhir/uv/ips/ValueSet/medicine-route-of-administration" />
      </binding>
    </element>
  </differential>
</StructureDefinition>