{
  "resourceType": "StructureDefinition",
  "id": "AmbulanterSchein",
  "url": "https://tiplu.de/fhir/StructureDefinition/AmbulanterSchein",
  "version": "2.0.2",
  "name": "AmbulanterSchein",
  "title": "Ambulanter Schein",
  "status": "active",
  "date": "2026-04-02",
  "publisher": "Tiplu GmbH",
  "contact": [
    {
      "name": "Tiplu GmbH",
      "telecom": [
        {
          "system": "email",
          "value": "fhir@tiplu.de"
        }
      ]
    }
  ],
  "description": "Dieses Profil beschreibt einen ambulanten Schein. Für einen ambulanten Fall können mehrere Behandlungsscheine existieren, welche von unterschiedlichen Kostenträgern gedeckt werden können.",
  "copyright": "Tiplu GmbH",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Account",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Account",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Account.extension",
        "path": "Account.extension",
        "min": 1
      },
      {
        "id": "Account.extension:Ausstellungsdatum",
        "path": "Account.extension",
        "sliceName": "Ausstellungsdatum",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://tiplu.de/fhir/StructureDefinition/Ausstellungsdatum"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Account.extension:Ausstellungsdatum.value[x]",
        "path": "Account.extension.value[x]",
        "mustSupport": true
      },
      {
        "id": "Account.extension:BillingStatus",
        "path": "Account.extension",
        "sliceName": "BillingStatus",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.org/fhir/5.0/StructureDefinition/extension-Account.billingStatus"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Account.extension:BillingStatus.value[x]",
        "path": "Account.extension.value[x]",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "https://tiplu.de/fhir/ValueSet/Scheinstatus"
        }
      },
      {
        "id": "Account.extension:ScheinEigenschaften",
        "path": "Account.extension",
        "sliceName": "ScheinEigenschaften",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://tiplu.de/fhir/StructureDefinition/ScheinEigenschaften"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Account.extension:ScheinEigenschaften.value[x]",
        "path": "Account.extension.value[x]",
        "mustSupport": true
      },
      {
        "id": "Account.identifier",
        "path": "Account.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "pattern",
              "path": "$this"
            }
          ],
          "rules": "open"
        },
        "mustSupport": true
      },
      {
        "id": "Account.identifier:Scheinnummer",
        "path": "Account.identifier",
        "sliceName": "Scheinnummer",
        "short": "Eindeutige Nummer eines Scheines.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Identifier",
            "profile": [
              "https://tiplu.de/fhir/StructureDefinition/identifier-scheinnummer"
            ]
          }
        ],
        "patternIdentifier": {
          "type": {
            "coding": [
              {
                "code": "ASN",
                "system": "https://tiplu.de/fhir/CodeSystem/identifier-type-de-basis-erweitert"
              }
            ]
          }
        },
        "mustSupport": true
      },
      {
        "id": "Account.identifier:Scheinnummer.type",
        "path": "Account.identifier.type",
        "mustSupport": true
      },
      {
        "id": "Account.identifier:Scheinnummer.system",
        "path": "Account.identifier.system",
        "mustSupport": true
      },
      {
        "id": "Account.identifier:Scheinnummer.value",
        "path": "Account.identifier.value",
        "mustSupport": true
      },
      {
        "id": "Account.status",
        "path": "Account.status",
        "mustSupport": true
      },
      {
        "id": "Account.type",
        "path": "Account.type",
        "patternCodeableConcept": {
          "coding": [
            {
              "code": "AMB",
              "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode"
            }
          ]
        },
        "mustSupport": true
      },
      {
        "id": "Account.type.extension:Scheinart",
        "path": "Account.type.extension",
        "sliceName": "Scheinart",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://tiplu.de/fhir/StructureDefinition/Scheinart"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Account.type.extension:Scheinart.value[x]",
        "path": "Account.type.extension.value[x]",
        "mustSupport": true
      },
      {
        "id": "Account.type.extension:Scheinuntergruppe",
        "path": "Account.type.extension",
        "sliceName": "Scheinuntergruppe",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://tiplu.de/fhir/StructureDefinition/Scheinuntergruppe"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Account.type.extension:Scheinuntergruppe.value[x]",
        "path": "Account.type.extension.value[x]",
        "mustSupport": true
      },
      {
        "id": "Account.type.coding",
        "path": "Account.type.coding",
        "mustSupport": true
      },
      {
        "id": "Account.servicePeriod",
        "path": "Account.servicePeriod",
        "short": "Gültigkeit des Scheins",
        "mustSupport": true
      },
      {
        "id": "Account.coverage.extension:Abrechnungsart",
        "path": "Account.coverage.extension",
        "sliceName": "Abrechnungsart",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://tiplu.de/fhir/StructureDefinition/Abrechnungsart"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Account.coverage.extension:Abrechnungsart.value[x]",
        "path": "Account.coverage.extension.value[x]",
        "mustSupport": true
      },
      {
        "id": "Account.coverage.extension:Abrechnungsbereich",
        "path": "Account.coverage.extension",
        "sliceName": "Abrechnungsbereich",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://tiplu.de/fhir/StructureDefinition/Abrechnungsbereich"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Account.coverage.extension:Abrechnungsbereich.value[x]",
        "path": "Account.coverage.extension.value[x]",
        "mustSupport": true
      },
      {
        "id": "Account.coverage.coverage",
        "path": "Account.coverage.coverage",
        "mustSupport": true
      },
      {
        "id": "Account.owner",
        "path": "Account.owner",
        "short": "Verwaltende Organisation des Scheins.",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://tiplu.de/fhir/StructureDefinition/Ambulanz",
              "https://fhir.kbv.de/StructureDefinition/KBV_PR_Base_Organization"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Account.partOf",
        "path": "Account.partOf",
        "mustSupport": true
      },
      {
        "id": "Account.partOf.identifier",
        "path": "Account.partOf.identifier",
        "short": "Zugehörige Fallnummer",
        "min": 1,
        "type": [
          {
            "code": "Identifier",
            "profile": [
              "http://fhir.de/StructureDefinition/identifier-aufnahmenummer"
            ]
          }
        ],
        "mustSupport": true
      }
    ]
  }
}