<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="patientjournal-personakt-logical-er" />
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-type-characteristics">
    <valueCode value="can-be-target" />
  </extension>
  <url value="http://electronichealth.se/fhir/NDI/StructureDefinition/patientjournal-personakt-logical-er" />
  <name value="PatientjournalPersonaktLogicalEr" />
  <title value="Patientjournal/personakt" />
  <status value="active" />
  <description value="Klassen patientjournal/personakt håller information om förekomst av uppgifter om en vård- och omsorgstagare hos en viss organisation i ett visst system." />
  <fhirVersion value="5.0.0" />
  <kind value="logical" />
  <abstract value="false" />
  <type value="http://electronichealth.se/fhir/NDI/StructureDefinition/patientjournal-personakt-logical-er" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Base" />
  <derivation value="specialization" />
  <snapshot>
    <element id="patientjournal-personakt-logical-er">
      <path value="patientjournal-personakt-logical-er" />
      <short value="Patientjournal/personakt" />
      <definition value="Klassen patientjournal/personakt håller information om förekomst av uppgifter om en vård- och omsorgstagare hos en viss organisation i ett visst system." />
      <min value="0" />
      <max value="*" />
      <base>
        <path value="patientjournal-personakt-logical-er" />
        <min value="0" />
        <max value="*" />
      </base>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
    </element>
    <element id="patientjournal-personakt-logical-er.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="patientjournal-personakt-logical-er.id" />
      <short value="id" />
      <definition value="Angivelse av unik identifierare för en persons patientjournal eller personakt hos en viss vårdgivare eller utförare av socialtjänst." />
      <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="patientjournal-personakt-logical-er.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>
    </element>
    <element id="patientjournal-personakt-logical-er.upprattadTidpunkt">
      <path value="patientjournal-personakt-logical-er.upprattadTidpunkt" />
      <short value="upprättadTidpunkt" />
      <definition value="Angivelse av tidpunkt då patientjournal/personakt upprättades." />
      <min value="1" />
      <max value="1" />
      <base>
        <path value="patientjournal-personakt-logical-er.upprattadTidpunkt" />
        <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>
    </element>
    <element id="patientjournal-personakt-logical-er.finnsI">
      <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="patientjournal-personakt-logical-er.finnsI" />
      <short value="finns i" />
      <definition value="finns i" />
      <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="patientjournal-personakt-logical-er.finnsI" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/NDI/StructureDefinition/system-logical-er" />
      </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="patientjournal-personakt-logical-er.harPersonuppgiftsansvarig">
      <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="patientjournal-personakt-logical-er.harPersonuppgiftsansvarig" />
      <short value="Har personuppgiftsansvarig" />
      <definition value="Har personuppgiftsansvarig" />
      <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="patientjournal-personakt-logical-er.harPersonuppgiftsansvarig" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
      </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="patientjournal-personakt-logical-er.innehallerUppgifterOm">
      <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="patientjournal-personakt-logical-er.innehallerUppgifterOm" />
      <short value="innehåller uppgifter om" />
      <definition value="innehåller uppgifter om" />
      <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="patientjournal-personakt-logical-er.innehallerUppgifterOm" />
        <min value="1" />
        <max value="1" />
      </base>
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
      </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>
  </snapshot>
  <differential>
    <element id="patientjournal-personakt-logical-er">
      <path value="patientjournal-personakt-logical-er" />
      <short value="Patientjournal/personakt" />
      <definition value="Klassen patientjournal/personakt håller information om förekomst av uppgifter om en vård- och omsorgstagare hos en viss organisation i ett visst system." />
    </element>
    <element id="patientjournal-personakt-logical-er.id">
      <path value="patientjournal-personakt-logical-er.id" />
      <short value="id" />
      <definition value="Angivelse av unik identifierare för en persons patientjournal eller personakt hos en viss vårdgivare eller utförare av socialtjänst." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Identifier" />
      </type>
    </element>
    <element id="patientjournal-personakt-logical-er.upprattadTidpunkt">
      <path value="patientjournal-personakt-logical-er.upprattadTidpunkt" />
      <short value="upprättadTidpunkt" />
      <definition value="Angivelse av tidpunkt då patientjournal/personakt upprättades." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="time" />
      </type>
    </element>
    <element id="patientjournal-personakt-logical-er.finnsI">
      <path value="patientjournal-personakt-logical-er.finnsI" />
      <short value="finns i" />
      <definition value="finns i" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://electronichealth.se/fhir/NDI/StructureDefinition/system-logical-er" />
      </type>
    </element>
    <element id="patientjournal-personakt-logical-er.harPersonuppgiftsansvarig">
      <path value="patientjournal-personakt-logical-er.harPersonuppgiftsansvarig" />
      <short value="Har personuppgiftsansvarig" />
      <definition value="Har personuppgiftsansvarig" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
      </type>
    </element>
    <element id="patientjournal-personakt-logical-er.innehallerUppgifterOm">
      <path value="patientjournal-personakt-logical-er.innehallerUppgifterOm" />
      <short value="innehåller uppgifter om" />
      <definition value="innehåller uppgifter om" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
      </type>
    </element>
  </differential>
</StructureDefinition>