<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="HVOPlatsLogical" />
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-type-characteristics">
    <valueCode value="can-be-target" />
  </extension>
  <url value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOPlatsLogical" />
  <name value="HVOPlatsLogical" />
  <title value="Plats" />
  <status value="draft" />
  <description value="Klassen plats håller information om avgränsad geografisk plats (punkt) eller geografiskt område (yta) med välbestämt läge. Här avses plats ur ett geografiskt eller fysiskt perspektiv, inte ur ett organisations- eller verksamhetsperspektiv." />
  <fhirVersion value="5.0.0" />
  <mapping>
    <identity value="PlatsToHVOLocation" />
    <uri value="HVOLocation" />
  </mapping>
  <kind value="logical" />
  <abstract value="false" />
  <type value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOPlatsLogical" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Base" />
  <derivation value="specialization" />
  <snapshot>
    <element id="HVOPlatsLogical">
      <path value="HVOPlatsLogical" />
      <short value="Plats" />
      <definition value="Klassen plats håller information om avgränsad geografisk plats (punkt) eller geografiskt område (yta) med välbestämt läge. Här avses plats ur ett geografiskt eller fysiskt perspektiv, inte ur ett organisations- eller verksamhetsperspektiv." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="HVOPlatsLogical" />
        <min value="0" />
        <max value="*" />
      </base>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="HVOPlatsLogical.id">
      <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="HVOPlatsLogical.id" />
      <short value="id" />
      <definition value="Angivelse av identifierare för plats." />
      <comment value="The rules of the identifier.type  determine if a check digit is part of the ID value or sent separately, such as through the checkDigit extension." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="HVOPlatsLogical.id" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Identifier" />
      </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="ident-1" />
        <severity value="warning" />
        <human value="Identifier with no value has limited utility.  If communicating that an identifier value has been suppressed or missing, the value element SHOULD be present with an extension indicating the missing semantic - e.g. data-absent-reason" />
        <expression value="value.exists()" />
        <source value="http://hl7.org/fhir/StructureDefinition/Identifier" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="v2" />
        <map value="CX / EI (occasionally, more often EI maps to a resource id or a URL)" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="II - The Identifier class is a little looser than the v3 type II because it allows URIs as well as registered OIDs or GUIDs.  Also maps to Role[classCode=IDENT]" />
      </mapping>
      <mapping>
        <identity value="servd" />
        <map value="Identifier" />
      </mapping>
      <mapping>
        <identity value="PlatsToHVOLocation" />
        <map value="HVOLocation.identifier" />
      </mapping>
    </element>
    <element id="HVOPlatsLogical.namn">
      <path value="HVOPlatsLogical.namn" />
      <short value="namn" />
      <definition value="Angivelse av platsens namn." />
      <comment value="Note that FHIR strings SHALL NOT exceed 1,048,576 (1024*1024) characters in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="HVOPlatsLogical.namn" />
        <min value="0" />
        <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="PlatsToHVOLocation" />
        <map value="HVOLocation.name" />
      </mapping>
    </element>
    <element id="HVOPlatsLogical.beskrivning">
      <path value="HVOPlatsLogical.beskrivning" />
      <short value="beskrivning" />
      <definition value="Textuell beskrivning av en viss plats. Används som komplement till attributen namn och platstyp i de fall en ytterligare textuell beskrivning krävs." />
      <comment value="Note that FHIR strings SHALL NOT exceed 1,048,576 (1024*1024) characters in size" />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="HVOPlatsLogical.beskrivning" />
        <min value="0" />
        <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="PlatsToHVOLocation" />
        <map value="HVOLocation.description" />
      </mapping>
    </element>
    <element id="HVOPlatsLogical.status">
      <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="HVOPlatsLogical.status" />
      <short value="status" />
      <definition value="Angivelse av kod för platsens status, för att dokumentera om en plats är aktiv eller inaktiv. Betydelsen av aktiv/inaktiv kan vara beroende av vilket typ av platsangivelse som avses. En position kan exempelvis inte bli inaktiv, men en belägenhetsadress kan upphöra existera om den fastighet som pekas ut rivs. Ett geografiskt område angivet enligt ett visst kodverk skulle kunna markeras som inaktivt, exempelvis den geografiska kommungränsen i det fall en kommun delas eller går samman med en annan kommun." />
      <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="HVOPlatsLogical.status" />
        <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="PlatsToHVOLocation" />
        <map value="HVOLocation.status" />
      </mapping>
    </element>
    <element id="HVOPlatsLogical.funktion">
      <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="HVOPlatsLogical.funktion" />
      <short value="funktion" />
      <definition value="Angivelse av kod för funktion som plats fyller." />
      <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="*" />
      <base>
        <path value="HVOPlatsLogical.funktion" />
        <min value="0" />
        <max value="*" />
      </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="PlatsToHVOLocation" />
        <map value="HVOLocation.type" />
      </mapping>
    </element>
    <element id="HVOPlatsLogical.adressrad">
      <path value="HVOPlatsLogical.adressrad" />
      <short value="adress.rad" />
      <definition value="Angivelse av en belägenhetsadress. &#xD;&#xA;Anges enligt Svensk standard · SS 637003:2025.&#xD;&#xA;Exempel: &#xD;&#xA;Sibeliusgången 17 &#xD;&#xA;Akalla&#xD;&#xA;Stockholm" />
      <comment value="Note that FHIR strings SHALL NOT exceed 1,048,576 (1024*1024) characters in size" />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="HVOPlatsLogical.adressrad" />
        <min value="0" />
        <max value="*" />
      </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="PlatsToHVOLocation" />
        <map value="HVOLocation.address.line" />
      </mapping>
    </element>
    <element id="HVOPlatsLogical.kommunkod">
      <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="HVOPlatsLogical.kommunkod" />
      <short value="kommunkod" />
      <definition value="Angivelse av fyrställig kod för kommun enligt Statistiska centralbyrån (SCB). &#xD;&#xA;Exempel: 2584 (Kiruna kommun)" />
      <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="HVOPlatsLogical.kommunkod" />
        <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="PlatsToHVOLocation" />
        <map value="HVOLocation.identifier[municipality]" />
      </mapping>
    </element>
    <element id="HVOPlatsLogical.lanskod">
      <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="HVOPlatsLogical.lanskod" />
      <short value="länskod" />
      <definition value="Angivelse av tvåställig kod för län enligt Statistiska Centralbyrån (SCB). &#xD;&#xA;Exempel: 25 (Norrbottens län)" />
      <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="HVOPlatsLogical.lanskod" />
        <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="PlatsToHVOLocation" />
        <map value="HVOLocation.identifier[county]" />
      </mapping>
    </element>
    <element id="HVOPlatsLogical.typ">
      <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="HVOPlatsLogical.typ" />
      <short value="typ" />
      <definition value="Angivelse av kod för typ av plats i en fysisk bemärkelse. Exempel är byggnad, rum och väg. Detta värde anges endast i de fall då typ av platsangivelse inte framgår av övriga attribut." />
      <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="HVOPlatsLogical.typ" />
        <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="PlatsToHVOLocation" />
        <map value="HVOLocation.form" />
      </mapping>
    </element>
    <element id="HVOPlatsLogical.giltigFrom">
      <path value="HVOPlatsLogical.giltigFrom" />
      <short value="giltigFrom" />
      <definition value="Angivelse av den tidpunkt från och med vilken platsen är registrerad med angiven status." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="HVOPlatsLogical.giltigFrom" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="time" />
      </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="PlatsToHVOLocation" />
        <map value="HVOLocation.extension[period].valuePeriod.start" />
      </mapping>
    </element>
    <element id="HVOPlatsLogical.giltigTom">
      <path value="HVOPlatsLogical.giltigTom" />
      <short value="giltigTom" />
      <definition value="Angivelse av den tidpunkt då platsens angivna status upphör att gälla. Ska ej anges om denna tidpunkt är okänd." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="HVOPlatsLogical.giltigTom" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="time" />
      </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="PlatsToHVOLocation" />
        <map value="HVOLocation.extension[period].valuePeriod.end" />
      </mapping>
    </element>
    <element id="HVOPlatsLogical.harPosition">
      <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="HVOPlatsLogical.harPosition" />
      <short value="har position" />
      <definition value="har position" />
      <comment value="References SHALL be a reference to an actual FHIR resource, and SHALL be resolvable (allowing for access control, temporary unavailability, etc.). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="HVOPlatsLogical.harPosition" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOPositionLogical" />
      </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="ref-1" />
        <severity value="error" />
        <human value="SHALL have a contained resource if a local reference is provided" />
        <expression value="reference.exists()  implies (reference.startsWith('#').not() or (reference.substring(1).trace('url') in %rootResource.contained.id.trace('ids')) or (reference='#' and %rootResource!=%resource))" />
        <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
      </constraint>
      <constraint>
        <key value="ref-2" />
        <severity value="error" />
        <human value="At least one of reference, identifier and display SHALL be present (unless an extension is provided)." />
        <expression value="reference.exists() or identifier.exists() or display.exists() or extension.exists()" />
        <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
      </mapping>
      <mapping>
        <identity value="PlatsToHVOLocation" />
        <map value="HVOLocation.position" />
      </mapping>
    </element>
    <element id="HVOPlatsLogical.avgransasGeografisktAv">
      <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="HVOPlatsLogical.avgransasGeografisktAv" />
      <short value="avgränsas geografiskt av" />
      <definition value="avgränsas geografiskt av" />
      <comment value="References SHALL be a reference to an actual FHIR resource, and SHALL be resolvable (allowing for access control, temporary unavailability, etc.). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="HVOPlatsLogical.avgransasGeografisktAv" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOPositionLogical" />
      </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="ref-1" />
        <severity value="error" />
        <human value="SHALL have a contained resource if a local reference is provided" />
        <expression value="reference.exists()  implies (reference.startsWith('#').not() or (reference.substring(1).trace('url') in %rootResource.contained.id.trace('ids')) or (reference='#' and %rootResource!=%resource))" />
        <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
      </constraint>
      <constraint>
        <key value="ref-2" />
        <severity value="error" />
        <human value="At least one of reference, identifier and display SHALL be present (unless an extension is provided)." />
        <expression value="reference.exists() or identifier.exists() or display.exists() or extension.exists()" />
        <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
      </mapping>
    </element>
    <element id="HVOPlatsLogical.delAv">
      <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="HVOPlatsLogical.delAv" />
      <short value="delAv" />
      <definition value="delAv" />
      <comment value="References SHALL be a reference to an actual FHIR resource, and SHALL be resolvable (allowing for access control, temporary unavailability, etc.). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="HVOPlatsLogical.delAv" />
        <min value="0" />
        <max value="1" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOPlatsLogical" />
      </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="ref-1" />
        <severity value="error" />
        <human value="SHALL have a contained resource if a local reference is provided" />
        <expression value="reference.exists()  implies (reference.startsWith('#').not() or (reference.substring(1).trace('url') in %rootResource.contained.id.trace('ids')) or (reference='#' and %rootResource!=%resource))" />
        <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
      </constraint>
      <constraint>
        <key value="ref-2" />
        <severity value="error" />
        <human value="At least one of reference, identifier and display SHALL be present (unless an extension is provided)." />
        <expression value="reference.exists() or identifier.exists() or display.exists() or extension.exists()" />
        <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
      </mapping>
      <mapping>
        <identity value="PlatsToHVOLocation" />
        <map value="HVOLocation.partOf(HVOLocation)" />
      </mapping>
    </element>
  </snapshot>
  <differential>
    <element id="HVOPlatsLogical">
      <path value="HVOPlatsLogical" />
      <short value="Plats" />
      <definition value="Klassen plats håller information om avgränsad geografisk plats (punkt) eller geografiskt område (yta) med välbestämt läge. Här avses plats ur ett geografiskt eller fysiskt perspektiv, inte ur ett organisations- eller verksamhetsperspektiv." />
    </element>
    <element id="HVOPlatsLogical.id">
      <path value="HVOPlatsLogical.id" />
      <short value="id" />
      <definition value="Angivelse av identifierare för plats." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Identifier" />
      </type>
      <mapping>
        <identity value="PlatsToHVOLocation" />
        <map value="HVOLocation.identifier" />
      </mapping>
    </element>
    <element id="HVOPlatsLogical.namn">
      <path value="HVOPlatsLogical.namn" />
      <short value="namn" />
      <definition value="Angivelse av platsens namn." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="string" />
      </type>
      <mapping>
        <identity value="PlatsToHVOLocation" />
        <map value="HVOLocation.name" />
      </mapping>
    </element>
    <element id="HVOPlatsLogical.beskrivning">
      <path value="HVOPlatsLogical.beskrivning" />
      <short value="beskrivning" />
      <definition value="Textuell beskrivning av en viss plats. Används som komplement till attributen namn och platstyp i de fall en ytterligare textuell beskrivning krävs." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="string" />
      </type>
      <mapping>
        <identity value="PlatsToHVOLocation" />
        <map value="HVOLocation.description" />
      </mapping>
    </element>
    <element id="HVOPlatsLogical.status">
      <path value="HVOPlatsLogical.status" />
      <short value="status" />
      <definition value="Angivelse av kod för platsens status, för att dokumentera om en plats är aktiv eller inaktiv. Betydelsen av aktiv/inaktiv kan vara beroende av vilket typ av platsangivelse som avses. En position kan exempelvis inte bli inaktiv, men en belägenhetsadress kan upphöra existera om den fastighet som pekas ut rivs. Ett geografiskt område angivet enligt ett visst kodverk skulle kunna markeras som inaktivt, exempelvis den geografiska kommungränsen i det fall en kommun delas eller går samman med en annan kommun." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Coding" />
      </type>
      <mapping>
        <identity value="PlatsToHVOLocation" />
        <map value="HVOLocation.status" />
      </mapping>
    </element>
    <element id="HVOPlatsLogical.funktion">
      <path value="HVOPlatsLogical.funktion" />
      <short value="funktion" />
      <definition value="Angivelse av kod för funktion som plats fyller." />
      <min value="0" />
      <max value="*" />
      <type>
        <code value="Coding" />
      </type>
      <mapping>
        <identity value="PlatsToHVOLocation" />
        <map value="HVOLocation.type" />
      </mapping>
    </element>
    <element id="HVOPlatsLogical.adressrad">
      <path value="HVOPlatsLogical.adressrad" />
      <short value="adress.rad" />
      <definition value="Angivelse av en belägenhetsadress. &#xD;&#xA;Anges enligt Svensk standard · SS 637003:2025.&#xD;&#xA;Exempel: &#xD;&#xA;Sibeliusgången 17 &#xD;&#xA;Akalla&#xD;&#xA;Stockholm" />
      <min value="0" />
      <max value="*" />
      <type>
        <code value="string" />
      </type>
      <mapping>
        <identity value="PlatsToHVOLocation" />
        <map value="HVOLocation.address.line" />
      </mapping>
    </element>
    <element id="HVOPlatsLogical.kommunkod">
      <path value="HVOPlatsLogical.kommunkod" />
      <short value="kommunkod" />
      <definition value="Angivelse av fyrställig kod för kommun enligt Statistiska centralbyrån (SCB). &#xD;&#xA;Exempel: 2584 (Kiruna kommun)" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Coding" />
      </type>
      <mapping>
        <identity value="PlatsToHVOLocation" />
        <map value="HVOLocation.identifier[municipality]" />
      </mapping>
    </element>
    <element id="HVOPlatsLogical.lanskod">
      <path value="HVOPlatsLogical.lanskod" />
      <short value="länskod" />
      <definition value="Angivelse av tvåställig kod för län enligt Statistiska Centralbyrån (SCB). &#xD;&#xA;Exempel: 25 (Norrbottens län)" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Coding" />
      </type>
      <mapping>
        <identity value="PlatsToHVOLocation" />
        <map value="HVOLocation.identifier[county]" />
      </mapping>
    </element>
    <element id="HVOPlatsLogical.typ">
      <path value="HVOPlatsLogical.typ" />
      <short value="typ" />
      <definition value="Angivelse av kod för typ av plats i en fysisk bemärkelse. Exempel är byggnad, rum och väg. Detta värde anges endast i de fall då typ av platsangivelse inte framgår av övriga attribut." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Coding" />
      </type>
      <mapping>
        <identity value="PlatsToHVOLocation" />
        <map value="HVOLocation.form" />
      </mapping>
    </element>
    <element id="HVOPlatsLogical.giltigFrom">
      <path value="HVOPlatsLogical.giltigFrom" />
      <short value="giltigFrom" />
      <definition value="Angivelse av den tidpunkt från och med vilken platsen är registrerad med angiven status." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="time" />
      </type>
      <mapping>
        <identity value="PlatsToHVOLocation" />
        <map value="HVOLocation.extension[period].valuePeriod.start" />
      </mapping>
    </element>
    <element id="HVOPlatsLogical.giltigTom">
      <path value="HVOPlatsLogical.giltigTom" />
      <short value="giltigTom" />
      <definition value="Angivelse av den tidpunkt då platsens angivna status upphör att gälla. Ska ej anges om denna tidpunkt är okänd." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="time" />
      </type>
      <mapping>
        <identity value="PlatsToHVOLocation" />
        <map value="HVOLocation.extension[period].valuePeriod.end" />
      </mapping>
    </element>
    <element id="HVOPlatsLogical.harPosition">
      <path value="HVOPlatsLogical.harPosition" />
      <short value="har position" />
      <definition value="har position" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOPositionLogical" />
      </type>
      <mapping>
        <identity value="PlatsToHVOLocation" />
        <map value="HVOLocation.position" />
      </mapping>
    </element>
    <element id="HVOPlatsLogical.avgransasGeografisktAv">
      <path value="HVOPlatsLogical.avgransasGeografisktAv" />
      <short value="avgränsas geografiskt av" />
      <definition value="avgränsas geografiskt av" />
      <min value="0" />
      <max value="*" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOPositionLogical" />
      </type>
    </element>
    <element id="HVOPlatsLogical.delAv">
      <path value="HVOPlatsLogical.delAv" />
      <short value="delAv" />
      <definition value="delAv" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOPlatsLogical" />
      </type>
      <mapping>
        <identity value="PlatsToHVOLocation" />
        <map value="HVOLocation.partOf(HVOLocation)" />
      </mapping>
    </element>
  </differential>
</StructureDefinition>