<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="HVOTjanstLogical" />
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-type-characteristics">
    <valueCode value="can-be-target" />
  </extension>
  <url value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOTjanstLogical" />
  <name value="HVOTjanstLogical" />
  <title value="Tjänst" />
  <status value="draft" />
  <description value="Klassen tjänst håller information aktivitet som erbjuds för att tillgodose ett behov." />
  <fhirVersion value="5.0.0" />
  <mapping>
    <identity value="TjanstToHVOService" />
    <uri value="HVOService" />
  </mapping>
  <kind value="logical" />
  <abstract value="false" />
  <type value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOTjanstLogical" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Base" />
  <derivation value="specialization" />
  <snapshot>
    <element id="HVOTjanstLogical">
      <path value="HVOTjanstLogical" />
      <short value="Tjänst" />
      <definition value="Klassen tjänst håller information aktivitet som erbjuds för att tillgodose ett behov." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="HVOTjanstLogical" />
        <min value="0" />
        <max value="*" />
      </base>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="HVOTjanstLogical.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="HVOTjanstLogical.id" />
      <short value="id" />
      <definition value="Angivelse av identifierare för tjänsten." />
      <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="1" />
      <max value="1" />
      <base>
        <path value="HVOTjanstLogical.id" />
        <min value="1" />
        <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="TjanstToHVOService" />
        <map value="HVOService.identifier" />
      </mapping>
    </element>
    <element id="HVOTjanstLogical.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="HVOTjanstLogical.typ" />
      <short value="typ" />
      <definition value="Angivelse av kod för typ av tjänst." />
      <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="HVOTjanstLogical.typ" />
        <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="TjanstToHVOService" />
        <map value="HVOService.type" />
      </mapping>
    </element>
    <element id="HVOTjanstLogical.motesform">
      <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="HVOTjanstLogical.motesform" />
      <short value="mötesform" />
      <definition value="Angivelse av kod för vilken form tjänstens möten erbjuds i. Exempel är videosamtal, fysisk träff eller chatt." />
      <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="*" />
      <base>
        <path value="HVOTjanstLogical.motesform" />
        <min value="1" />
        <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="TjanstToHVOService" />
        <map value="HVOService.characteristic" />
      </mapping>
    </element>
    <element id="HVOTjanstLogical.beskrivning">
      <path value="HVOTjanstLogical.beskrivning" />
      <short value="beskrivning" />
      <definition value="Textuell beskrivning av tjänst. Används som komplement för attributet typ i de fall en 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="HVOTjanstLogical.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="TjanstToHVOService" />
        <map value="HVOService.comment" />
      </mapping>
    </element>
    <element id="HVOTjanstLogical.giltigFrom">
      <path value="HVOTjanstLogical.giltigFrom" />
      <short value="giltigFrom" />
      <definition value="Angivelse av den tidpunkt från och med vilken tjänsten erbjuds." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="HVOTjanstLogical.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="TjanstToHVOService" />
        <map value="HVOService.extension[period].valuePeriod.start" />
      </mapping>
    </element>
    <element id="HVOTjanstLogical.giltigTom">
      <path value="HVOTjanstLogical.giltigTom" />
      <short value="giltigTom" />
      <definition value="Angivelse av den tidpunkt då en tjänst upphör att erbjudas. Ska ej anges när tidpunkt denna tidpunkt är okänd." />
      <min value="0" />
      <max value="1" />
      <base>
        <path value="HVOTjanstLogical.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="TjanstToHVOService" />
        <map value="HVOService.extension[period].valuePeriod.end" />
      </mapping>
    </element>
    <element id="HVOTjanstLogical.har">
      <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="HVOTjanstLogical.har" />
      <short value="har" />
      <definition value="har" />
      <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="HVOTjanstLogical.har" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOKontaktuppgiftLogical" />
      </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="TjanstToHVOService" />
        <map value="HVOService.contact" />
      </mapping>
    </element>
    <element id="HVOTjanstLogical.erbjudsTill">
      <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="HVOTjanstLogical.erbjudsTill" />
      <short value="erbjuds till" />
      <definition value="erbjuds till" />
      <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="HVOTjanstLogical.erbjudsTill" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOMalgruppLogical" />
      </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="TjanstToHVOService" />
        <map value="HVOService.eligibility" />
      </mapping>
    </element>
    <element id="HVOTjanstLogical.finnsTillganglig">
      <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="HVOTjanstLogical.finnsTillganglig" />
      <short value="finns tillgänglig" />
      <definition value="finns tillgänglig" />
      <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="HVOTjanstLogical.finnsTillganglig" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOTillganglighetstidLogical" />
      </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="TjanstToHVOService" />
        <map value="HVOService.availability.availableTime" />
      </mapping>
    </element>
    <element id="HVOTjanstLogical.harTillganglighetsavvikelse">
      <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="HVOTjanstLogical.harTillganglighetsavvikelse" />
      <short value="har tillgänglighetsavvikelse" />
      <definition value="har tillgänglighetsavvikelse" />
      <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="HVOTjanstLogical.harTillganglighetsavvikelse" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOStorningsinformationLogical" />
      </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="TjanstToHVOService" />
        <map value="HVOService.availability.notAvailableTime" />
      </mapping>
    </element>
    <element id="HVOTjanstLogical.harSarskilda">
      <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="HVOTjanstLogical.harSarskilda" />
      <short value="har särskilda" />
      <definition value="har särskilda" />
      <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="HVOTjanstLogical.harSarskilda" />
        <min value="0" />
        <max value="*" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOVillkorLogical" />
      </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="TjanstToHVOService" />
        <map value="HVOService.eligibility" />
      </mapping>
    </element>
    <element id="HVOTjanstLogical.erbjudsPa">
      <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="HVOTjanstLogical.erbjudsPa" />
      <short value="erbjudsPa" />
      <definition value="erbjudsPa" />
      <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="HVOTjanstLogical.erbjudsPa" />
        <min value="0" />
        <max value="*" />
      </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="TjanstToHVOService" />
        <map value="HVOService.location(HVOLocation)" />
      </mapping>
    </element>
    <element id="HVOTjanstLogical.erbjudsAv">
      <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="HVOTjanstLogical.erbjudsAv" />
      <short value="erbjudsAv" />
      <definition value="erbjudsAv" />
      <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="1" />
      <max value="1" />
      <base>
        <path value="HVOTjanstLogical.erbjudsAv" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganisatoriskEnhetLogical" />
      </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="TjanstToHVOService" />
        <map value="HVOService.providedBy(HVOOrganizationalUnit)" />
      </mapping>
    </element>
  </snapshot>
  <differential>
    <element id="HVOTjanstLogical">
      <path value="HVOTjanstLogical" />
      <short value="Tjänst" />
      <definition value="Klassen tjänst håller information aktivitet som erbjuds för att tillgodose ett behov." />
    </element>
    <element id="HVOTjanstLogical.id">
      <path value="HVOTjanstLogical.id" />
      <short value="id" />
      <definition value="Angivelse av identifierare för tjänsten." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Identifier" />
      </type>
      <mapping>
        <identity value="TjanstToHVOService" />
        <map value="HVOService.identifier" />
      </mapping>
    </element>
    <element id="HVOTjanstLogical.typ">
      <path value="HVOTjanstLogical.typ" />
      <short value="typ" />
      <definition value="Angivelse av kod för typ av tjänst." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Coding" />
      </type>
      <mapping>
        <identity value="TjanstToHVOService" />
        <map value="HVOService.type" />
      </mapping>
    </element>
    <element id="HVOTjanstLogical.motesform">
      <path value="HVOTjanstLogical.motesform" />
      <short value="mötesform" />
      <definition value="Angivelse av kod för vilken form tjänstens möten erbjuds i. Exempel är videosamtal, fysisk träff eller chatt." />
      <min value="1" />
      <max value="*" />
      <type>
        <code value="Coding" />
      </type>
      <mapping>
        <identity value="TjanstToHVOService" />
        <map value="HVOService.characteristic" />
      </mapping>
    </element>
    <element id="HVOTjanstLogical.beskrivning">
      <path value="HVOTjanstLogical.beskrivning" />
      <short value="beskrivning" />
      <definition value="Textuell beskrivning av tjänst. Används som komplement för attributet typ i de fall en textuell beskrivning krävs." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="string" />
      </type>
      <mapping>
        <identity value="TjanstToHVOService" />
        <map value="HVOService.comment" />
      </mapping>
    </element>
    <element id="HVOTjanstLogical.giltigFrom">
      <path value="HVOTjanstLogical.giltigFrom" />
      <short value="giltigFrom" />
      <definition value="Angivelse av den tidpunkt från och med vilken tjänsten erbjuds." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="time" />
      </type>
      <mapping>
        <identity value="TjanstToHVOService" />
        <map value="HVOService.extension[period].valuePeriod.start" />
      </mapping>
    </element>
    <element id="HVOTjanstLogical.giltigTom">
      <path value="HVOTjanstLogical.giltigTom" />
      <short value="giltigTom" />
      <definition value="Angivelse av den tidpunkt då en tjänst upphör att erbjudas. Ska ej anges när tidpunkt denna tidpunkt är okänd." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="time" />
      </type>
      <mapping>
        <identity value="TjanstToHVOService" />
        <map value="HVOService.extension[period].valuePeriod.end" />
      </mapping>
    </element>
    <element id="HVOTjanstLogical.har">
      <path value="HVOTjanstLogical.har" />
      <short value="har" />
      <definition value="har" />
      <min value="0" />
      <max value="*" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOKontaktuppgiftLogical" />
      </type>
      <mapping>
        <identity value="TjanstToHVOService" />
        <map value="HVOService.contact" />
      </mapping>
    </element>
    <element id="HVOTjanstLogical.erbjudsTill">
      <path value="HVOTjanstLogical.erbjudsTill" />
      <short value="erbjuds till" />
      <definition value="erbjuds till" />
      <min value="0" />
      <max value="*" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOMalgruppLogical" />
      </type>
      <mapping>
        <identity value="TjanstToHVOService" />
        <map value="HVOService.eligibility" />
      </mapping>
    </element>
    <element id="HVOTjanstLogical.finnsTillganglig">
      <path value="HVOTjanstLogical.finnsTillganglig" />
      <short value="finns tillgänglig" />
      <definition value="finns tillgänglig" />
      <min value="0" />
      <max value="*" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOTillganglighetstidLogical" />
      </type>
      <mapping>
        <identity value="TjanstToHVOService" />
        <map value="HVOService.availability.availableTime" />
      </mapping>
    </element>
    <element id="HVOTjanstLogical.harTillganglighetsavvikelse">
      <path value="HVOTjanstLogical.harTillganglighetsavvikelse" />
      <short value="har tillgänglighetsavvikelse" />
      <definition value="har tillgänglighetsavvikelse" />
      <min value="0" />
      <max value="*" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOStorningsinformationLogical" />
      </type>
      <mapping>
        <identity value="TjanstToHVOService" />
        <map value="HVOService.availability.notAvailableTime" />
      </mapping>
    </element>
    <element id="HVOTjanstLogical.harSarskilda">
      <path value="HVOTjanstLogical.harSarskilda" />
      <short value="har särskilda" />
      <definition value="har särskilda" />
      <min value="0" />
      <max value="*" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOVillkorLogical" />
      </type>
      <mapping>
        <identity value="TjanstToHVOService" />
        <map value="HVOService.eligibility" />
      </mapping>
    </element>
    <element id="HVOTjanstLogical.erbjudsPa">
      <path value="HVOTjanstLogical.erbjudsPa" />
      <short value="erbjudsPa" />
      <definition value="erbjudsPa" />
      <min value="0" />
      <max value="*" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOPlatsLogical" />
      </type>
      <mapping>
        <identity value="TjanstToHVOService" />
        <map value="HVOService.location(HVOLocation)" />
      </mapping>
    </element>
    <element id="HVOTjanstLogical.erbjudsAv">
      <path value="HVOTjanstLogical.erbjudsAv" />
      <short value="erbjudsAv" />
      <definition value="erbjudsAv" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganisatoriskEnhetLogical" />
      </type>
      <mapping>
        <identity value="TjanstToHVOService" />
        <map value="HVOService.providedBy(HVOOrganizationalUnit)" />
      </mapping>
    </element>
  </differential>
</StructureDefinition>