<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="abstracthierarchicalorganizationprofile" />
  <url value="http://fhir.xt.dev/StructureDefinition/AbstractHierarchicalOrganization" />
  <version value="2.1.0" />
  <name value="AbstractHierarchicalOrganization" />
  <title value="Abstrakte Hierarchische Organisation" />
  <status value="active" />
  <experimental value="false" />
  <date value="2025-02-26T23:38:01.1306839+00:00" />
  <publisher value="x-tention Informationstechnologie GmbH" />
  <contact>
    <telecom>
      <system value="email" />
      <value value="fhir.profiling@x-tention.com" />
      <use value="work" />
    </telecom>
  </contact>
  <description value="Abstract base profile for all Organization profiles." />
  <jurisdiction>
    <coding>
      <system value="urn:iso:std:iso:3166" />
      <code value="DE" />
    </coding>
  </jurisdiction>
  <purpose value="Common definition for all levels of the organization hierarchy." />
  <copyright value="x-tention Informationstechnologie GmbH" />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="true" />
  <type value="Organization" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Organization" />
  <derivation value="constraint" />
  <differential>
    <element id="Organization.meta">
      <path value="Organization.meta" />
    </element>
    <element id="Organization.meta.security">
      <path value="Organization.meta.security" />
      <requirements value="There must be at least one security label to link the ressource to the Level 0 Organization." />
      <min value="1" />
    </element>
    <element id="Organization.identifier">
      <path value="Organization.identifier" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="$this" />
        </discriminator>
        <ordered value="false" />
        <rules value="open" />
      </slicing>
      <min value="1" />
    </element>
    <element id="Organization.identifier:primaryOrgId">
      <path value="Organization.identifier" />
      <sliceName value="primaryOrgId" />
      <short value="HPD Primary Org ID" />
      <definition value="Primary ID of the organization in the x-tention Healthcare Provider Directory." />
      <min value="1" />
      <max value="1" />
      <patternIdentifier>
        <type>
          <coding>
            <system value="http://fhir.xt.dev/CodeSystem/ProviderIdentifierType" />
            <code value="primary-org-id" />
          </coding>
        </type>
        <system value="urn:ietf:rfc:3986" />
      </patternIdentifier>
    </element>
    <element id="Organization.identifier:primaryOrgId.type">
      <path value="Organization.identifier.type" />
      <min value="1" />
    </element>
    <element id="Organization.identifier:primaryOrgId.type.coding">
      <path value="Organization.identifier.type.coding" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Organization.identifier:primaryOrgId.type.coding.system">
      <path value="Organization.identifier.type.coding.system" />
      <min value="1" />
      <fixedUri value="http://fhir.xt.dev/CodeSystem/ProviderIdentifierType" />
    </element>
    <element id="Organization.identifier:primaryOrgId.type.coding.code">
      <path value="Organization.identifier.type.coding.code" />
      <min value="1" />
      <fixedCode value="primary-org-id" />
    </element>
    <element id="Organization.identifier:primaryOrgId.system">
      <path value="Organization.identifier.system" />
      <requirements value="The identifier value must be globally unique, therefore the rfc 3986 system must be used." />
      <min value="1" />
      <fixedUri value="urn:ietf:rfc:3986" />
    </element>
    <element id="Organization.identifier:primaryOrgId.value">
      <path value="Organization.identifier.value" />
      <short value="URN-encoded OID of the Organization" />
      <requirements value="The value must be an OID to provide better backwards-compatibility with older systems. The OID must be URN-encoded as defined by the FHIR spec (https://hl7.org/fhir/r4/datatypes.html#identifier)." />
      <min value="1" />
    </element>
    <element id="Organization.type">
      <path value="Organization.type" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <short value="Organisations-Typ" />
      <definition value="Typ der Organisation aus dem IHE-Deutschland CodeSystem für die Einrichtungen der patientenbezogenen Gesundheitsversorgung oder aus dem x-tention CodeSystem für Organisationshierarchien." />
      <min value="1" />
    </element>
    <element id="Organization.type:HierarchyElementType">
      <path value="Organization.type" />
      <sliceName value="HierarchyElementType" />
      <short value="Hierarchical Organization Type" />
      <definition value="This slice identifies the type of organization. This type should be enough to determine the level of the organization hierarchy that this (sub-)organization is in. Examples for Germany are the &quot;IHE-Deutschland CodeSystem für die Einrichtungen der patientenbezogenen Gesundheitsversorgung&quot; or the &quot;x-tention CodeSystem für Organisationshierarchien&quot;." />
      <min value="1" />
      <max value="1" />
      <binding>
        <strength value="required" />
        <valueSet value="http://fhir.xt.dev/ValueSet/OrganizationHierarchy" />
      </binding>
    </element>
    <element id="Organization.type:HierarchyElementType.coding">
      <path value="Organization.type.coding" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Organization.type:HierarchyElementType.coding.system">
      <path value="Organization.type.coding.system" />
      <min value="1" />
    </element>
    <element id="Organization.type:HierarchyElementType.coding.code">
      <path value="Organization.type.coding.code" />
      <min value="1" />
    </element>
    <element id="Organization.type:HierarchyElementType.coding.userSelected">
      <path value="Organization.type.coding.userSelected" />
      <max value="0" />
    </element>
    <element id="Organization.type:HierarchyElementType.text">
      <path value="Organization.type.text" />
      <max value="0" />
    </element>
    <element id="Organization.type:Flags">
      <path value="Organization.type" />
      <sliceName value="Flags" />
      <short value="Organization Type Flags" />
      <definition value="Marks organizations as having certain properties, e.g. that they can be authorized to access a patient record.." />
      <patternCodeableConcept>
        <coding>
          <system value="http://fhir.xt.dev/CodeSystem/ProviderFlags" />
        </coding>
      </patternCodeableConcept>
      <binding>
        <strength value="extensible" />
        <valueSet value="http://fhir.xt.dev/ValueSet/ProviderOrganizationFlags" />
      </binding>
    </element>
    <element id="Organization.type:Flags.coding">
      <path value="Organization.type.coding" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Organization.type:Flags.coding.system">
      <path value="Organization.type.coding.system" />
      <min value="1" />
      <fixedUri value="http://fhir.xt.dev/CodeSystem/ProviderFlags" />
    </element>
    <element id="Organization.type:Flags.coding.code">
      <path value="Organization.type.coding.code" />
      <min value="1" />
    </element>
    <element id="Organization.type:Flags.coding.userSelected">
      <path value="Organization.type.coding.userSelected" />
      <max value="0" />
    </element>
    <element id="Organization.type:Flags.text">
      <path value="Organization.type.text" />
      <max value="0" />
    </element>
    <element id="Organization.name">
      <path value="Organization.name" />
      <min value="1" />
    </element>
    <element id="Organization.telecom">
      <path value="Organization.telecom" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="system" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </element>
    <element id="Organization.telecom:cmsLink">
      <path value="Organization.telecom" />
      <sliceName value="cmsLink" />
      <short value="Link to CMS page" />
      <definition value="Link to the Organizations' CMS page" />
      <max value="1" />
    </element>
    <element id="Organization.telecom:cmsLink.system">
      <path value="Organization.telecom.system" />
      <min value="1" />
      <fixedCode value="url" />
    </element>
    <element id="Organization.telecom:cmsLink.value">
      <path value="Organization.telecom.value" />
      <min value="1" />
    </element>
    <element id="Organization.telecom:cmsLink.use">
      <path value="Organization.telecom.use" />
      <min value="1" />
      <fixedCode value="work" />
    </element>
  </differential>
</StructureDefinition>