{
  "resourceType": "StructureDefinition",
  "id": "organizationspecificcodesystem-profile",
  "url": "http://fhir.xt.dev/StructureDefinition/OrganizationSpecificCodeSystem",
  "version": "1.1.0",
  "name": "OrganizationSpecificCodeSystem",
  "status": "active",
  "experimental": false,
  "date": "2026-07-13T16:14:48+00:00",
  "publisher": "x-tention Informationstechnologie GmbH",
  "contact": [
    {
      "telecom": [
        {
          "system": "email",
          "value": "fhir.profiling@x-tention.com",
          "use": "work"
        }
      ]
    }
  ],
  "description": "A profile defining code system–specific attribute constraints for organization-specific code systems that are uploaded for a single project.",
  "copyright": "x-tention Informationstechnologie GmbH",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "CodeSystem",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/CodeSystem",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "CodeSystem.meta",
        "path": "CodeSystem.meta"
      },
      {
        "id": "CodeSystem.meta.security",
        "path": "CodeSystem.meta.security",
        "definition": "Security labels applied to this resource. At least one security label should be included to identify the owner organization (usually a Level 1 org) with system \"urn:ietf:rfc:3986\" and the primary-org-id (prefixed with \"urn:oid:\") as code, consistent with the useContext organizationSlice."
      },
      {
        "id": "CodeSystem.text",
        "path": "CodeSystem.text",
        "min": 1
      },
      {
        "id": "CodeSystem.url",
        "path": "CodeSystem.url",
        "short": "Canonical OID for this value set, represented as a URI",
        "min": 1
      },
      {
        "id": "CodeSystem.identifier",
        "path": "CodeSystem.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "pattern",
              "path": "system"
            }
          ],
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "CodeSystem.identifier:oidIdentifier",
        "path": "CodeSystem.identifier",
        "sliceName": "oidIdentifier",
        "min": 1,
        "max": "1"
      },
      {
        "id": "CodeSystem.identifier:oidIdentifier.system",
        "path": "CodeSystem.identifier.system",
        "min": 1,
        "fixedUri": "urn:ietf:rfc:3986"
      },
      {
        "id": "CodeSystem.identifier:oidIdentifier.value",
        "path": "CodeSystem.identifier.value",
        "min": 1
      },
      {
        "id": "CodeSystem.version",
        "path": "CodeSystem.version",
        "definition": "Timestamp in the format yyyymmdd, e.g. 20240207",
        "min": 1
      },
      {
        "id": "CodeSystem.experimental",
        "path": "CodeSystem.experimental",
        "fixedBoolean": false
      },
      {
        "id": "CodeSystem.date",
        "path": "CodeSystem.date",
        "definition": "The date (and optionally time) when the value set was created or revised (e.g. the 'content logical definition').",
        "min": 1
      },
      {
        "id": "CodeSystem.publisher",
        "path": "CodeSystem.publisher",
        "short": "Name of the referenced organization",
        "definition": "The name of the referenced organization, which is assumed to be the publisher of this code systems (e.g. Organization.name).",
        "min": 1
      },
      {
        "id": "CodeSystem.useContext",
        "path": "CodeSystem.useContext",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "code.system"
            },
            {
              "type": "value",
              "path": "code.code"
            }
          ],
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "CodeSystem.useContext:organizationSlice",
        "path": "CodeSystem.useContext",
        "sliceName": "organizationSlice",
        "min": 1,
        "max": "1"
      },
      {
        "id": "CodeSystem.useContext:organizationSlice.code.system",
        "path": "CodeSystem.useContext.code.system",
        "min": 1,
        "fixedUri": "http://fhir.xt.dev/CodeSystem/TerminologyUseContexts"
      },
      {
        "id": "CodeSystem.useContext:organizationSlice.code.version",
        "path": "CodeSystem.useContext.code.version",
        "max": "0"
      },
      {
        "id": "CodeSystem.useContext:organizationSlice.code.code",
        "path": "CodeSystem.useContext.code.code",
        "min": 1,
        "fixedCode": "organization"
      },
      {
        "id": "CodeSystem.useContext:organizationSlice.code.display",
        "path": "CodeSystem.useContext.code.display",
        "definition": "A representation of the meaning of the code in the system, following the rules of the system (e.g. Organization.name)."
      },
      {
        "id": "CodeSystem.useContext:organizationSlice.code.userSelected",
        "path": "CodeSystem.useContext.code.userSelected",
        "max": "0"
      },
      {
        "id": "CodeSystem.useContext:organizationSlice.value[x]",
        "path": "CodeSystem.useContext.value[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "rules": "open"
        },
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Organization"
            ]
          }
        ]
      },
      {
        "id": "CodeSystem.useContext:focusSlice",
        "path": "CodeSystem.useContext",
        "sliceName": "focusSlice",
        "max": "1"
      },
      {
        "id": "CodeSystem.useContext:focusSlice.code.system",
        "path": "CodeSystem.useContext.code.system",
        "min": 1,
        "fixedUri": "http://terminology.hl7.org/CodeSystem/usage-context-type"
      },
      {
        "id": "CodeSystem.useContext:focusSlice.code.code",
        "path": "CodeSystem.useContext.code.code",
        "min": 1,
        "fixedCode": "focus"
      },
      {
        "id": "CodeSystem.useContext:focusSlice.value[x]",
        "path": "CodeSystem.useContext.value[x]",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ]
      },
      {
        "id": "CodeSystem.useContext:focusSlice.value[x].coding",
        "path": "CodeSystem.useContext.value[x].coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "CodeSystem.useContext:focusSlice.value[x].coding.system",
        "path": "CodeSystem.useContext.value[x].coding.system",
        "min": 1
      },
      {
        "id": "CodeSystem.useContext:focusSlice.value[x].coding.version",
        "path": "CodeSystem.useContext.value[x].coding.version",
        "max": "0"
      },
      {
        "id": "CodeSystem.useContext:focusSlice.value[x].coding.code",
        "path": "CodeSystem.useContext.value[x].coding.code",
        "min": 1
      },
      {
        "id": "CodeSystem.useContext:focusSlice.value[x].coding.userSelected",
        "path": "CodeSystem.useContext.value[x].coding.userSelected",
        "max": "0"
      },
      {
        "id": "CodeSystem.useContext:focusSlice.value[x].text",
        "path": "CodeSystem.useContext.value[x].text",
        "max": "0"
      },
      {
        "id": "CodeSystem.caseSensitive",
        "path": "CodeSystem.caseSensitive",
        "min": 1,
        "fixedBoolean": true
      },
      {
        "id": "CodeSystem.content",
        "path": "CodeSystem.content",
        "fixedCode": "complete"
      },
      {
        "id": "CodeSystem.count",
        "path": "CodeSystem.count",
        "min": 1
      },
      {
        "id": "CodeSystem.concept",
        "path": "CodeSystem.concept",
        "min": 1
      },
      {
        "id": "CodeSystem.concept.designation",
        "path": "CodeSystem.concept.designation",
        "min": 1
      },
      {
        "id": "CodeSystem.concept.designation.language",
        "path": "CodeSystem.concept.designation.language",
        "min": 1
      }
    ]
  }
}