<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="sfm-MedicationBundle" />
  <url value="http://ehelse.no/fhir/StructureDefinition/sfm-MedicationBundle" />
  <version value="1.0" />
  <name value="SfmMedicationBundle" />
  <title value="sfm-MedicationBundle" />
  <status value="active" />
  <date value="2021-05-01" />
  <description value="Profile on Bundle for use as container for medications and prescription data in SFM API Basis" />
  <purpose value="The purpose of this profile on Bundle is to contain the structure of the service-calls provided by the SFM API Basis" />
  <fhirVersion value="4.0.0" />
  <mapping>
    <identity value="v2" />
    <uri value="http://hl7.org/v2" />
    <name value="HL7 v2 Mapping" />
  </mapping>
  <mapping>
    <identity value="rim" />
    <uri value="http://hl7.org/v3" />
    <name value="RIM Mapping" />
  </mapping>
  <mapping>
    <identity value="cda" />
    <uri value="http://hl7.org/v3/cda" />
    <name value="CDA (R2)" />
  </mapping>
  <mapping>
    <identity value="w5" />
    <uri value="http://hl7.org/fhir/fivews" />
    <name value="FiveWs Pattern Mapping" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="Bundle" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Bundle" />
  <derivation value="constraint" />
  <differential>
    <element id="Bundle">
      <path value="Bundle" />
      <short value="Contains a collection of Medication resources" />
      <definition value="A container for a collection of Medication and prescription resources for the SFM API Basis." />
    </element>
    <element id="Bundle.type">
      <path value="Bundle.type" />
      <short value="document" />
      <definition value="This bundle is a document intedet to contain the strucured data read from or written to SFM API Basis. Closely connected to SfmMedicationComposition" />
      <comment value="Norwegian profile on Bundle to serve service oriented transactions for e-resept on FHIR" />
      <fixedCode value="document" />
    </element>
    <element id="Bundle.total">
      <path value="Bundle.total" />
      <max value="0" />
    </element>
    <element id="Bundle.link">
      <path value="Bundle.link" />
      <max value="0" />
    </element>
    <element id="Bundle.entry">
      <path value="Bundle.entry" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="resource.meta.profile" />
        </discriminator>
        <description value="First entry will always be the SfmMedicationComposition. All other entries will be resources referred from this" />
        <rules value="open" />
      </slicing>
    </element>
    <element id="Bundle.entry:SfmMedicationComposition">
      <path value="Bundle.entry" />
      <sliceName value="SfmMedicationComposition" />
      <short value="First entry is a SfmMedicationComposition" />
      <definition value="First entry in Bundle of type &quot;document&quot; is always a Composition" />
      <comment value="This Composition entry serves as a directory for the document Bundle" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Bundle.entry:SfmMedicationComposition.resource">
      <path value="Bundle.entry.resource" />
      <type>
        <code value="Resource" />
        <profile value="http://ehelse.no/fhir/StructureDefinition/sfm-MedicationComposition" />
      </type>
    </element>
  </differential>
</StructureDefinition>