<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="nfdi4health-ex-mds-study-comparison-group-backport-r5" />
  <url value="https://www.nfdi4health.de/fhir/metadataschema/StructureDefinition/nfdi4health-ex-mds-study-comparison-group-backport-r5" />
  <version value="0.9" />
  <name value="NFDI4Health_EX_MDS_Study_Comparison_Group_Backport_R5" />
  <title value="NFDI4Health EX MDS Study Comparison Group Backport R5" />
  <status value="draft" />
  <publisher value="NFDI4Health" />
  <contact>
    <telecom>
      <system value="url" />
      <value value="https://www.nfdi4health.de" />
    </telecom>
  </contact>
  <description value="Extension providing information about the arm(s)/group(s)/cohort(s) and intervention(s)/exposure(s) in a resource. Based on ResearchStudy.comparisonGroup (R5)" />
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="rim" />
    <uri value="http://hl7.org/v3" />
    <name value="RIM Mapping" />
  </mapping>
  <mapping>
    <identity value="NFDI4Health" />
    <name value="NFDI4Health to FHIR Mapping" />
  </mapping>
  <kind value="complex-type" />
  <abstract value="false" />
  <context>
    <type value="element" />
    <expression value="ResearchStudy" />
  </context>
  <type value="Extension" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Extension" />
  <derivation value="constraint" />
  <differential>
    <element id="Extension">
      <path value="Extension" />
      <short value="Arms or groups/cohorts of the [RESOURCE]" />
      <definition value="Group of items providing information about arms or groups/cohorts of a [RESOURCE]." />
      <comment value="[Backport Extension from R5: ResearchStudy.comparisonGroup; Please note that some of the elements are not relevant for NFDI4Health. Also the DataType of 'Description' has been modified to string.]" />
      <mapping>
        <identity value="NFDI4Health" />
        <map value="Design.groups" />
      </mapping>
    </element>
    <element id="Extension.extension">
      <path value="Extension.extension" />
      <min value="1" />
    </element>
    <element id="Extension.extension:linkId">
      <path value="Extension.extension" />
      <sliceName value="linkId" />
      <min value="0" />
      <max value="1" />
    </element>
    <element id="Extension.extension:linkId.extension">
      <path value="Extension.extension.extension" />
      <max value="0" />
    </element>
    <element id="Extension.extension:linkId.url">
      <path value="Extension.extension.url" />
      <fixedUri value="linkId" />
    </element>
    <element id="Extension.extension:linkId.value[x]">
      <path value="Extension.extension.value[x]" />
      <type>
        <code value="id" />
      </type>
    </element>
    <element id="Extension.extension:name">
      <path value="Extension.extension" />
      <sliceName value="name" />
      <min value="1" />
      <max value="1" />
      <mapping>
        <identity value="NFDI4Health" />
        <map value="Design.groups.name" />
      </mapping>
      <mapping>
        <identity value="NFDI4Health" />
        <map value="Design.arms" />
      </mapping>
    </element>
    <element id="Extension.extension:name.extension">
      <path value="Extension.extension.extension" />
      <max value="0" />
    </element>
    <element id="Extension.extension:name.url">
      <path value="Extension.extension.url" />
      <fixedUri value="name" />
    </element>
    <element id="Extension.extension:name.value[x]">
      <path value="Extension.extension.value[x]" />
      <short value="Name of the group | Name of the arm" />
      <definition value="Short name used to identify the group. | Short name used to identify the arm." />
      <comment value="'Group' means a predefined group (cohort) of participants to be studied. | 0..*, if Resource.classification.type == ('Study' OR 'Substudy') AND Design.primaryDesign == 'Interventional'; otherwise 0..0" />
      <type>
        <code value="string" />
      </type>
    </element>
    <element id="Extension.extension:type">
      <path value="Extension.extension" />
      <sliceName value="type" />
      <min value="0" />
      <max value="1" />
      <mapping>
        <identity value="NFDI4Health" />
        <map value="Design.arms.type" />
      </mapping>
    </element>
    <element id="Extension.extension:type.extension">
      <path value="Extension.extension.extension" />
      <max value="0" />
    </element>
    <element id="Extension.extension:type.url">
      <path value="Extension.extension.url" />
      <fixedUri value="type" />
    </element>
    <element id="Extension.extension:type.value[x]">
      <path value="Extension.extension.value[x]" />
      <short value="Role of the arm" />
      <definition value="Role of the given arm in the [RESOURCE]." />
      <type>
        <code value="CodeableConcept" />
      </type>
      <binding>
        <strength value="required" />
        <valueSet value="https://www.nfdi4health.de/fhir/metadataschema/ValueSet/nfdi4health-vs-mds-study-arm-group-type-nci" />
      </binding>
    </element>
    <element id="Extension.extension:description">
      <path value="Extension.extension" />
      <sliceName value="description" />
      <min value="0" />
      <max value="1" />
      <mapping>
        <identity value="NFDI4Health" />
        <map value="Design.groups.description" />
      </mapping>
      <mapping>
        <identity value="NFDI4Health" />
        <map value="Design.arms.description" />
      </mapping>
    </element>
    <element id="Extension.extension:description.extension">
      <path value="Extension.extension.extension" />
      <max value="0" />
    </element>
    <element id="Extension.extension:description.url">
      <path value="Extension.extension.url" />
      <fixedUri value="description" />
    </element>
    <element id="Extension.extension:description.value[x]">
      <path value="Extension.extension.value[x]" />
      <short value="Additional information about the group | Additional information about the arm" />
      <definition value="Additional descriptive information about the given group. | Additional descriptive information about the given arm." />
      <comment value="Explanation of the nature of the [RESOURCE] group (for example, participants with and without a condition, participants with and without an exposure, etc.)." />
      <type>
        <code value="string" />
      </type>
    </element>
    <element id="Extension.extension:intendedExposure">
      <path value="Extension.extension" />
      <sliceName value="intendedExposure" />
      <short value="For Design.interventions: Interventions of the [RESOURCE] | For Design.exposures: Exposures of the [RESOURCE]" />
      <definition value="For Design.interventions: Group of items providing information about the interventions of the [RESOURCE]. | For Design.exposures: Group of items providing information about the exposures of the [RESOURCE]." />
      <comment value="Additional information: For Design.interventions: Specification of the intervention(s) associated with each arm. | For Design.exposures: Specification of the exposure(s) associated with each group." />
      <min value="0" />
      <max value="*" />
      <mapping>
        <identity value="NFDI4Health" />
        <map value="Design.interventions" />
      </mapping>
      <mapping>
        <identity value="NFDI4Health" />
        <map value="Design.exposures" />
      </mapping>
    </element>
    <element id="Extension.extension:intendedExposure.extension">
      <path value="Extension.extension.extension" />
      <max value="0" />
    </element>
    <element id="Extension.extension:intendedExposure.url">
      <path value="Extension.extension.url" />
      <fixedUri value="intendedExposure" />
    </element>
    <element id="Extension.extension:intendedExposure.value[x]">
      <path value="Extension.extension.value[x]" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://www.nfdi4health.de/fhir/metadataschema/StructureDefinition/nfdi4health-pr-mds-evidence-variable-intervention" />
        <targetProfile value="https://www.nfdi4health.de/fhir/metadataschema/StructureDefinition/nfdi4health-pr-mds-evidence-variable-exposure" />
      </type>
    </element>
    <element id="Extension.extension:observedGroup">
      <path value="Extension.extension" />
      <sliceName value="observedGroup" />
      <min value="0" />
      <max value="1" />
      <mapping>
        <identity value="NFDI4Health" />
        <map value="Design.groups.label" />
      </mapping>
    </element>
    <element id="Extension.extension:observedGroup.extension">
      <path value="Extension.extension.extension" />
      <max value="0" />
    </element>
    <element id="Extension.extension:observedGroup.url">
      <path value="Extension.extension.url" />
      <fixedUri value="observedGroup" />
    </element>
    <element id="Extension.extension:observedGroup.value[x]">
      <path value="Extension.extension.value[x]" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Group" />
      </type>
    </element>
    <element id="Extension.url">
      <path value="Extension.url" />
      <fixedUri value="https://www.nfdi4health.de/fhir/metadataschema/StructureDefinition/nfdi4health-ex-mds-study-comparison-group-backport-r5" />
    </element>
    <element id="Extension.value[x]">
      <path value="Extension.value[x]" />
      <max value="0" />
    </element>
  </differential>
</StructureDefinition>