<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="HVOVerksamhetLogical" />
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-type-characteristics">
    <valueCode value="can-be-target" />
  </extension>
  <url value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOVerksamhetLogical" />
  <name value="HVOVerksamhetLogical" />
  <title value="Verksamhet" />
  <status value="draft" />
  <description value="Klassen verksamhet håller information om arbete som fortlöpande utförs i linje med viss övergripande inriktning." />
  <fhirVersion value="5.0.0" />
  <mapping>
    <identity value="VerksamhetToHVOBusiness" />
    <uri value="HVOBusiness" />
  </mapping>
  <kind value="logical" />
  <abstract value="false" />
  <type value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOVerksamhetLogical" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Base" />
  <derivation value="specialization" />
  <snapshot>
    <element id="HVOVerksamhetLogical">
      <path value="HVOVerksamhetLogical" />
      <short value="Verksamhet" />
      <definition value="Klassen verksamhet håller information om arbete som fortlöpande utförs i linje med viss övergripande inriktning." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="HVOVerksamhetLogical" />
        <min value="0" />
        <max value="*" />
      </base>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="HVOVerksamhetLogical.inriktning">
      <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="HVOVerksamhetLogical.inriktning" />
      <short value="inriktning" />
      <definition value="Angivelse av vilken typ av målinriktat arbete som utförs, t.ex. allmän intesivvård, förlossningsverksamhet eller  psykiatriverksamhet för barn och unga." />
      <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="HVOVerksamhetLogical.inriktning" />
        <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="VerksamhetToHVOBusiness" />
        <map value="HVOBusiness.category" />
      </mapping>
    </element>
    <element id="HVOVerksamhetLogical.harOppetUnder">
      <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="HVOVerksamhetLogical.harOppetUnder" />
      <short value="har öppet under" />
      <definition value="har öppet under" />
      <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="HVOVerksamhetLogical.harOppetUnder" />
        <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="VerksamhetToHVOBusiness" />
        <map value="HVOBusiness.availability.availableTime" />
      </mapping>
    </element>
    <element id="HVOVerksamhetLogical.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="HVOVerksamhetLogical.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="HVOVerksamhetLogical.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="VerksamhetToHVOBusiness" />
        <map value="HVOBusiness.availability.notAvailable" />
      </mapping>
    </element>
    <element id="HVOVerksamhetLogical.bedrivsPa">
      <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="HVOVerksamhetLogical.bedrivsPa" />
      <short value="bedrivsPa" />
      <definition value="bedrivsPa" />
      <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="HVOVerksamhetLogical.bedrivsPa" />
        <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="VerksamhetToHVOBusiness" />
        <map value="HVOBusiness.location(HVOLocation)" />
      </mapping>
    </element>
    <element id="HVOVerksamhetLogical.bedriver">
      <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="HVOVerksamhetLogical.bedriver" />
      <short value="bedriver" />
      <definition value="bedriver" />
      <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="HVOVerksamhetLogical.bedriver" />
        <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="VerksamhetToHVOBusiness" />
        <map value="HVOBusiness.providedBy(HVOOrganizationalUnit)" />
      </mapping>
    </element>
  </snapshot>
  <differential>
    <element id="HVOVerksamhetLogical">
      <path value="HVOVerksamhetLogical" />
      <short value="Verksamhet" />
      <definition value="Klassen verksamhet håller information om arbete som fortlöpande utförs i linje med viss övergripande inriktning." />
    </element>
    <element id="HVOVerksamhetLogical.inriktning">
      <path value="HVOVerksamhetLogical.inriktning" />
      <short value="inriktning" />
      <definition value="Angivelse av vilken typ av målinriktat arbete som utförs, t.ex. allmän intesivvård, förlossningsverksamhet eller  psykiatriverksamhet för barn och unga." />
      <min value="0" />
      <max value="*" />
      <type>
        <code value="Coding" />
      </type>
      <mapping>
        <identity value="VerksamhetToHVOBusiness" />
        <map value="HVOBusiness.category" />
      </mapping>
    </element>
    <element id="HVOVerksamhetLogical.harOppetUnder">
      <path value="HVOVerksamhetLogical.harOppetUnder" />
      <short value="har öppet under" />
      <definition value="har öppet under" />
      <min value="0" />
      <max value="*" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOTillganglighetstidLogical" />
      </type>
      <mapping>
        <identity value="VerksamhetToHVOBusiness" />
        <map value="HVOBusiness.availability.availableTime" />
      </mapping>
    </element>
    <element id="HVOVerksamhetLogical.harTillganglighetsavvikelse">
      <path value="HVOVerksamhetLogical.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="VerksamhetToHVOBusiness" />
        <map value="HVOBusiness.availability.notAvailable" />
      </mapping>
    </element>
    <element id="HVOVerksamhetLogical.bedrivsPa">
      <path value="HVOVerksamhetLogical.bedrivsPa" />
      <short value="bedrivsPa" />
      <definition value="bedrivsPa" />
      <min value="0" />
      <max value="*" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOPlatsLogical" />
      </type>
      <mapping>
        <identity value="VerksamhetToHVOBusiness" />
        <map value="HVOBusiness.location(HVOLocation)" />
      </mapping>
    </element>
    <element id="HVOVerksamhetLogical.bedriver">
      <path value="HVOVerksamhetLogical.bedriver" />
      <short value="bedriver" />
      <definition value="bedriver" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganisatoriskEnhetLogical" />
      </type>
      <mapping>
        <identity value="VerksamhetToHVOBusiness" />
        <map value="HVOBusiness.providedBy(HVOOrganizationalUnit)" />
      </mapping>
    </element>
  </differential>
</StructureDefinition>