<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="HVOEligibilityGroup" />
  <url value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOEligibilityGroup" />
  <version value="0.1.0" />
  <name value="HVOEligibilityGroup" />
  <title value="HVOEligibilityGroup" />
  <status value="draft" />
  <description value="HVOEligibilityGroup profile for HVO" />
  <fhirVersion value="5.0.0" />
  <mapping>
    <identity value="HVOEligibilityGroupToHVOMalgruppLogical" />
    <uri value="HVOMalgruppLogical" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="Group" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Group" />
  <derivation value="constraint" />
  <differential>
    <element id="Group.type">
      <path value="Group.type" />
      <fixedCode value="person" />
      <mustSupport value="true" />
    </element>
    <element id="Group.membership">
      <path value="Group.membership" />
      <fixedCode value="definitional" />
      <mustSupport value="true" />
    </element>
    <element id="Group.characteristic">
      <path value="Group.characteristic" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Group.characteristic.code">
      <path value="Group.characteristic.code" />
      <short value="A code representing the type of characteristic a person should have to be eligible for the service. Examples include age, gender, etc. Use valueRange for numerical values, eg age, and valueCodeableConcept for coded values, eg gender." />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="http://electronichealth.se/fhir/hvo/ValueSet/hvo-eligibility-characteristic" />
      </binding>
      <mapping>
        <identity value="HVOEligibilityGroupToHVOMalgruppLogical" />
        <map value="kod" />
      </mapping>
    </element>
    <element id="Group.characteristic.code.coding">
      <path value="Group.characteristic.code.coding" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Group.characteristic.code.coding.system">
      <path value="Group.characteristic.code.coding.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Group.characteristic.code.coding.code">
      <path value="Group.characteristic.code.coding.code" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Group.characteristic.value[x]">
      <path value="Group.characteristic.value[x]" />
      <slicing>
        <discriminator>
          <type value="type" />
          <path value="$this" />
        </discriminator>
        <ordered value="false" />
        <rules value="open" />
      </slicing>
      <mustSupport value="true" />
    </element>
    <element id="Group.characteristic.value[x]:valueRange">
      <path value="Group.characteristic.value[x]" />
      <sliceName value="valueRange" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Range" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Group.characteristic.value[x]:valueRange.low">
      <path value="Group.characteristic.value[x].low" />
      <short value="The minimum value of the characteristic which makes a person eligible for a service. For example, if the characteristic is age, the minimum value might be 17 if only adults are eligible for the service." />
      <mustSupport value="true" />
      <mapping>
        <identity value="HVOEligibilityGroupToHVOMalgruppLogical" />
        <map value="vardemin" />
      </mapping>
    </element>
    <element id="Group.characteristic.value[x]:valueRange.low.value">
      <path value="Group.characteristic.value[x].low.value" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Group.characteristic.value[x]:valueRange.high">
      <path value="Group.characteristic.value[x].high" />
      <short value="The maximum value of the characteristic which makes a person eligible for a service. For example, if the characteristic is age, the maximum value might be 17 if only children are eligible fo the service." />
      <mustSupport value="true" />
      <mapping>
        <identity value="HVOEligibilityGroupToHVOMalgruppLogical" />
        <map value="vardemax" />
      </mapping>
    </element>
    <element id="Group.characteristic.value[x]:valueRange.high.value">
      <path value="Group.characteristic.value[x].high.value" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Group.characteristic.value[x]:valueCodeableConcept">
      <path value="Group.characteristic.value[x]" />
      <sliceName value="valueCodeableConcept" />
      <short value="The coded value of the characteristic which makes a person eligible for a service. For example, if the characteristic is to have a certain diagnosis, the value might be 'diabetes type 2'." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="CodeableConcept" />
      </type>
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="http://electronichealth.se/fhir/hvo/ValueSet/hvo-eligibility-characteristic-value" />
      </binding>
      <mapping>
        <identity value="HVOEligibilityGroupToHVOMalgruppLogical" />
        <map value="vardekod" />
      </mapping>
    </element>
    <element id="Group.characteristic.value[x]:valueCodeableConcept.coding">
      <path value="Group.characteristic.value[x].coding" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Group.characteristic.value[x]:valueCodeableConcept.coding.system">
      <path value="Group.characteristic.value[x].coding.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Group.characteristic.value[x]:valueCodeableConcept.coding.code">
      <path value="Group.characteristic.value[x].coding.code" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Group.characteristic.exclude">
      <path value="Group.characteristic.exclude" />
      <fixedBoolean value="false" />
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>