<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="HVOVillkorLogical" />
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-type-characteristics">
    <valueCode value="can-be-target" />
  </extension>
  <url value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOVillkorLogical" />
  <name value="HVOVillkorLogical" />
  <title value="Villkor" />
  <status value="draft" />
  <description value="Klassen villkor håller information om övriga villkor som ställs för att ta del av en viss tjänst." />
  <fhirVersion value="5.0.0" />
  <mapping>
    <identity value="VillkorToHVOeligbilityValue" />
    <uri value="HVOeligbilityValue" />
  </mapping>
  <kind value="logical" />
  <abstract value="false" />
  <type value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOVillkorLogical" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Base" />
  <derivation value="specialization" />
  <snapshot>
    <element id="HVOVillkorLogical">
      <path value="HVOVillkorLogical" />
      <short value="Villkor" />
      <definition value="Klassen villkor håller information om övriga villkor som ställs för att ta del av en viss tjänst." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="HVOVillkorLogical" />
        <min value="0" />
        <max value="*" />
      </base>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="HVOVillkorLogical.kod">
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
        <valueCode value="normative" />
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version">
        <valueCode value="4.0.0" />
      </extension>
      <path value="HVOVillkorLogical.kod" />
      <short value="kod" />
      <definition value="Angivelse av kod för villkor som behöver uppfyllas för att vara behörig att ta del av tjänsten." />
      <comment value="Codes may be defined very casually in enumerations or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="HVOVillkorLogical.kod" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="Coding" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <constraint>
        <key value="cod-1" />
        <severity value="warning" />
        <human value="A Coding SHOULD NOT have a display unless a code is also present.  Computation on Coding.display alone is generally unsafe.  Consider using CodeableConcept.text" />
        <expression value="code.exists().not() implies display.exists().not()" />
        <source value="http://hl7.org/fhir/StructureDefinition/Coding" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CE/CNE/CWE subset one of the sets of component 1-3 or 4-6" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CV" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding rdfs:subClassOf dt:CDCoding" />
      </mapping>
      <mapping>
        <identity value="VillkorToHVOeligbilityValue" />
        <map value="HVOEligbilityGroup.characteristic.code" />
      </mapping>
    </element>
    <element id="HVOVillkorLogical.beskrivning">
      <path value="HVOVillkorLogical.beskrivning" />
      <short value="beskrivning" />
      <definition value="Textuell beskrivning av villkoret." />
      <comment value="Note that FHIR strings SHALL NOT exceed 1,048,576 (1024*1024) characters in size" />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="HVOVillkorLogical.beskrivning" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="string" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="VillkorToHVOeligbilityValue" />
        <map value="(HVOService)eligibility.comment" />
      </mapping>
    </element>
    <element id="HVOVillkorLogical.vardemin">
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
        <valueCode value="normative" />
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version">
        <valueCode value="4.0.0" />
      </extension>
      <path value="HVOVillkorLogical.vardemin" />
      <short value="värde.min" />
      <definition value="Angivelse av minsta värde för det villkor som specificeras i attributet kod." />
      <comment value="The context of use may frequently define what kind of quantity this is and therefore what kind of units can be used. The context of use may also restrict the values for the comparator." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="HVOVillkorLogical.vardemin" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Quantity" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <constraint>
        <key value="qty-3" />
        <severity value="error" />
        <human value="If a code for the unit is present, the system SHALL also be present" />
        <expression value="code.empty() or system.exists()" />
        <source value="http://hl7.org/fhir/StructureDefinition/Quantity" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="SN (see also Range) or CQ" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="PQ, IVL&lt;PQ&gt;, MO, CO, depending on the values" />
      </mapping>
      <mapping>
        <identity value="VillkorToHVOeligbilityValue" />
        <map value="HVOEligibilityGroup.characteristic.valueRange.low" />
      </mapping>
    </element>
    <element id="HVOVillkorLogical.vardemax">
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
        <valueCode value="normative" />
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version">
        <valueCode value="4.0.0" />
      </extension>
      <path value="HVOVillkorLogical.vardemax" />
      <short value="värde.max" />
      <definition value="Angivelse av maximalt värde för det villkor som specificeras i attributet kod." />
      <comment value="The context of use may frequently define what kind of quantity this is and therefore what kind of units can be used. The context of use may also restrict the values for the comparator." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="HVOVillkorLogical.vardemax" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Quantity" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <constraint>
        <key value="qty-3" />
        <severity value="error" />
        <human value="If a code for the unit is present, the system SHALL also be present" />
        <expression value="code.empty() or system.exists()" />
        <source value="http://hl7.org/fhir/StructureDefinition/Quantity" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="SN (see also Range) or CQ" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="PQ, IVL&lt;PQ&gt;, MO, CO, depending on the values" />
      </mapping>
      <mapping>
        <identity value="VillkorToHVOeligbilityValue" />
        <map value="HVOEligibilityGroup.characteristic.valueRange.high" />
      </mapping>
    </element>
    <element id="HVOVillkorLogical.vardekod">
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
        <valueCode value="normative" />
      </extension>
      <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version">
        <valueCode value="4.0.0" />
      </extension>
      <path value="HVOVillkorLogical.vardekod" />
      <short value="värde.kod" />
      <definition value="Angivelse av kod för det villkor som ska uppfyllas." />
      <comment value="Codes may be defined very casually in enumerations or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="HVOVillkorLogical.vardekod" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Coding" />
      </type>
      <constraint>
        <key value="ele-1" />
        <severity value="error" />
        <human value="All FHIR elements must have a @value or children" />
        <expression value="hasValue() or (children().count() &gt; id.count())" />
        <source value="http://hl7.org/fhir/StructureDefinition/Element" />
      </constraint>
      <constraint>
        <key value="cod-1" />
        <severity value="warning" />
        <human value="A Coding SHOULD NOT have a display unless a code is also present.  Computation on Coding.display alone is generally unsafe.  Consider using CodeableConcept.text" />
        <expression value="code.exists().not() implies display.exists().not()" />
        <source value="http://hl7.org/fhir/StructureDefinition/Coding" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CE/CNE/CWE subset one of the sets of component 1-3 or 4-6" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="CV" />
      </mapping>
      <mapping>
        <identity value="orim" />
        <map value="fhir:Coding rdfs:subClassOf dt:CDCoding" />
      </mapping>
      <mapping>
        <identity value="VillkorToHVOeligbilityValue" />
        <map value="HVOEligibilityGroup.characteristic.valueCodeableConcept" />
      </mapping>
    </element>
  </snapshot>
  <differential>
    <element id="HVOVillkorLogical">
      <path value="HVOVillkorLogical" />
      <short value="Villkor" />
      <definition value="Klassen villkor håller information om övriga villkor som ställs för att ta del av en viss tjänst." />
    </element>
    <element id="HVOVillkorLogical.kod">
      <path value="HVOVillkorLogical.kod" />
      <short value="kod" />
      <definition value="Angivelse av kod för villkor som behöver uppfyllas för att vara behörig att ta del av tjänsten." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Coding" />
      </type>
      <mapping>
        <identity value="VillkorToHVOeligbilityValue" />
        <map value="HVOEligbilityGroup.characteristic.code" />
      </mapping>
    </element>
    <element id="HVOVillkorLogical.beskrivning">
      <path value="HVOVillkorLogical.beskrivning" />
      <short value="beskrivning" />
      <definition value="Textuell beskrivning av villkoret." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="string" />
      </type>
      <mapping>
        <identity value="VillkorToHVOeligbilityValue" />
        <map value="(HVOService)eligibility.comment" />
      </mapping>
    </element>
    <element id="HVOVillkorLogical.vardemin">
      <path value="HVOVillkorLogical.vardemin" />
      <short value="värde.min" />
      <definition value="Angivelse av minsta värde för det villkor som specificeras i attributet kod." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Quantity" />
      </type>
      <mapping>
        <identity value="VillkorToHVOeligbilityValue" />
        <map value="HVOEligibilityGroup.characteristic.valueRange.low" />
      </mapping>
    </element>
    <element id="HVOVillkorLogical.vardemax">
      <path value="HVOVillkorLogical.vardemax" />
      <short value="värde.max" />
      <definition value="Angivelse av maximalt värde för det villkor som specificeras i attributet kod." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Quantity" />
      </type>
      <mapping>
        <identity value="VillkorToHVOeligbilityValue" />
        <map value="HVOEligibilityGroup.characteristic.valueRange.high" />
      </mapping>
    </element>
    <element id="HVOVillkorLogical.vardekod">
      <path value="HVOVillkorLogical.vardekod" />
      <short value="värde.kod" />
      <definition value="Angivelse av kod för det villkor som ska uppfyllas." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Coding" />
      </type>
      <mapping>
        <identity value="VillkorToHVOeligbilityValue" />
        <map value="HVOEligibilityGroup.characteristic.valueCodeableConcept" />
      </mapping>
    </element>
  </differential>
</StructureDefinition>