{
  "resourceType": "StructureDefinition",
  "id": "BIV-PR-TA6-Rechnung-Composition",
  "url": "https://fhir.biv-ot.org/eVerordnungAbrechnungsdaten/BIV_PR_TA6_Rechnung_Composition",
  "version": "0.1",
  "name": "BIV_PR_TA6_Rechnung_Composition",
  "title": "BIV_PR_TA6_Rechnung_Composition",
  "status": "draft",
  "date": "2024-05-21",
  "description": "TA6 Rechnung - Composition",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Composition",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Composition",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Composition.meta",
        "path": "Composition.meta",
        "min": 1
      },
      {
        "id": "Composition.meta.profile",
        "path": "Composition.meta.profile",
        "min": 1,
        "max": "1",
        "fixedCanonical": "https://fhir.biv-ot.org/eVerordnungAbrechnungsdaten/BIV_PR_TA6_Rechnung_Composition|1.4"
      },
      {
        "id": "Composition.implicitRules",
        "path": "Composition.implicitRules",
        "max": "0"
      },
      {
        "id": "Composition.language",
        "path": "Composition.language",
        "max": "0"
      },
      {
        "id": "Composition.text",
        "path": "Composition.text",
        "max": "0"
      },
      {
        "id": "Composition.contained",
        "path": "Composition.contained",
        "max": "0"
      },
      {
        "id": "Composition.extension",
        "path": "Composition.extension",
        "slicing": {
          "rules": "closed"
        },
        "min": 2,
        "max": "2"
      },
      {
        "id": "Composition.extension:empfaengerIK",
        "path": "Composition.extension",
        "sliceName": "empfaengerIK",
        "short": "Empfänger-IK",
        "definition": "IK des Empfängers",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://fhir.biv-ot.org/eVerordnungAbrechnungsdaten/BIV_EX_TA6_IK_Empfaenger"
            ]
          }
        ]
      },
      {
        "id": "Composition.extension:kostentraegerIK",
        "path": "Composition.extension",
        "sliceName": "kostentraegerIK",
        "short": "Kostenträger-IK",
        "definition": "IK des Kostenträgers",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://fhir.biv-ot.org/eVerordnungAbrechnungsdaten/BIV_EX_TA6_IK_Kostentraeger"
            ]
          }
        ]
      },
      {
        "id": "Composition.identifier",
        "path": "Composition.identifier",
        "short": "Rechnungsnummer",
        "min": 1
      },
      {
        "id": "Composition.identifier.use",
        "path": "Composition.identifier.use",
        "max": "0"
      },
      {
        "id": "Composition.identifier.type",
        "path": "Composition.identifier.type",
        "max": "0"
      },
      {
        "id": "Composition.identifier.system",
        "path": "Composition.identifier.system",
        "min": 1,
        "fixedUri": "https://fhir.gkvsv.de/NamingSystem/BIV_NS_Rechnungsnummer"
      },
      {
        "id": "Composition.identifier.value",
        "path": "Composition.identifier.value",
        "short": "Rechnungsnummer",
        "min": 1,
        "constraint": [
          {
            "key": "Rechnungsnummer-maxLength",
            "severity": "error",
            "human": "Die Rechnungsnummer darf maximal 20 Zeichen lang sein.",
            "expression": "length() <= 20"
          },
          {
            "key": "char-1",
            "severity": "error",
            "human": "Die Rechnungsnummer darf nicht die Zeichen  \"/:?*\\\"<>|\" enthalten.",
            "expression": "toString().matches('^\\\\S*[\\/:?*\\\\\\\"<>|]\\\\S*$').not()"
          },
          {
            "key": "char-2",
            "severity": "error",
            "human": "Die Rechnungsnummer darf nicht die Zeichenkette \"\\\\\" enthalten.",
            "expression": "toString().contains('\\\\').not()"
          }
        ]
      },
      {
        "id": "Composition.identifier.period",
        "path": "Composition.identifier.period",
        "max": "0"
      },
      {
        "id": "Composition.identifier.assigner",
        "path": "Composition.identifier.assigner",
        "max": "0"
      },
      {
        "id": "Composition.status",
        "path": "Composition.status",
        "fixedCode": "final"
      },
      {
        "id": "Composition.type",
        "path": "Composition.type",
        "short": "Rechnungsart"
      },
      {
        "id": "Composition.type.coding",
        "path": "Composition.type.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Composition.type.coding.system",
        "path": "Composition.type.coding.system",
        "min": 1,
        "fixedUri": "https://fhir.gkvsv.de/CodeSystem/BIV_CS_ERP_Rechnungsart"
      },
      {
        "id": "Composition.type.coding.version",
        "path": "Composition.type.coding.version",
        "max": "0"
      },
      {
        "id": "Composition.type.coding.code",
        "path": "Composition.type.coding.code",
        "min": 1
      },
      {
        "id": "Composition.type.coding.userSelected",
        "path": "Composition.type.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Composition.type.text",
        "path": "Composition.type.text",
        "max": "0"
      },
      {
        "id": "Composition.category",
        "path": "Composition.category",
        "max": "0"
      },
      {
        "id": "Composition.subject",
        "path": "Composition.subject",
        "max": "0"
      },
      {
        "id": "Composition.encounter",
        "path": "Composition.encounter",
        "max": "0"
      },
      {
        "id": "Composition.date",
        "path": "Composition.date",
        "short": "Abrechnungszeitraum",
        "definition": "Anzugeben ist der letzte Tag des Abrechnungszeitraums",
        "constraint": [
          {
            "key": "form-1",
            "severity": "error",
            "human": "Wert muss ein Datum in der Form: YYYY-MM-DD sein.",
            "expression": "toString().matches('^([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1]))?)?$')"
          }
        ]
      },
      {
        "id": "Composition.date.extension",
        "path": "Composition.date.extension",
        "slicing": {
          "rules": "closed"
        },
        "min": 1,
        "max": "1"
      },
      {
        "id": "Composition.date.extension:Rechnungsdatum",
        "path": "Composition.date.extension",
        "sliceName": "Rechnungsdatum",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://fhir.biv-ot.org/eVerordnungAbrechnungsdaten/BIV_EX_ERP_TA6_Rechnungsdatum"
            ]
          }
        ]
      },
      {
        "id": "Composition.author",
        "path": "Composition.author",
        "short": "Absender-IK",
        "definition": "IK des Absenders",
        "max": "1"
      },
      {
        "id": "Composition.author.reference",
        "path": "Composition.author.reference",
        "max": "0"
      },
      {
        "id": "Composition.author.type",
        "path": "Composition.author.type",
        "max": "0"
      },
      {
        "id": "Composition.author.identifier",
        "path": "Composition.author.identifier",
        "min": 1
      },
      {
        "id": "Composition.author.identifier.use",
        "path": "Composition.author.identifier.use",
        "max": "0"
      },
      {
        "id": "Composition.author.identifier.type",
        "path": "Composition.author.identifier.type",
        "max": "0"
      },
      {
        "id": "Composition.author.identifier.system",
        "path": "Composition.author.identifier.system",
        "min": 1,
        "fixedUri": "http://fhir.de/sid/arge-ik/iknr"
      },
      {
        "id": "Composition.author.identifier.value",
        "path": "Composition.author.identifier.value",
        "short": "Absender-IK",
        "definition": "IK des Absenders",
        "min": 1,
        "constraint": [
          {
            "key": "AbsenderIK-length",
            "severity": "error",
            "human": "Die IK des Absenders muss 9 Zeichen lang und numerisch sein.",
            "expression": "toString().matches('^\\\\d{9}$')"
          }
        ]
      },
      {
        "id": "Composition.author.identifier.period",
        "path": "Composition.author.identifier.period",
        "max": "0"
      },
      {
        "id": "Composition.author.identifier.assigner",
        "path": "Composition.author.identifier.assigner",
        "max": "0"
      },
      {
        "id": "Composition.author.display",
        "path": "Composition.author.display",
        "max": "0"
      },
      {
        "id": "Composition.title",
        "path": "Composition.title",
        "fixedString": "elektronische Rechnung"
      },
      {
        "id": "Composition.confidentiality",
        "path": "Composition.confidentiality",
        "max": "0"
      },
      {
        "id": "Composition.attester",
        "path": "Composition.attester",
        "max": "0"
      },
      {
        "id": "Composition.custodian",
        "path": "Composition.custodian",
        "max": "0"
      },
      {
        "id": "Composition.relatesTo",
        "path": "Composition.relatesTo",
        "max": "0"
      },
      {
        "id": "Composition.event",
        "path": "Composition.event",
        "max": "0"
      },
      {
        "id": "Composition.section",
        "path": "Composition.section",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "code.coding.code"
            }
          ],
          "rules": "closed"
        },
        "min": 2
      },
      {
        "id": "Composition.section:Rechnung_List",
        "path": "Composition.section",
        "sliceName": "Rechnung_List",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Composition.section:Rechnung_List.title",
        "path": "Composition.section.title",
        "max": "0"
      },
      {
        "id": "Composition.section:Rechnung_List.code",
        "path": "Composition.section.code",
        "min": 1
      },
      {
        "id": "Composition.section:Rechnung_List.code.coding",
        "path": "Composition.section.code.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Composition.section:Rechnung_List.code.coding.system",
        "path": "Composition.section.code.coding.system",
        "min": 1,
        "fixedUri": "https://fhir.gkvsv.de/CodeSystem/BIV_CS_ERP_TA6"
      },
      {
        "id": "Composition.section:Rechnung_List.code.coding.version",
        "path": "Composition.section.code.coding.version",
        "max": "0"
      },
      {
        "id": "Composition.section:Rechnung_List.code.coding.code",
        "path": "Composition.section.code.coding.code",
        "min": 1,
        "fixedCode": "LR"
      },
      {
        "id": "Composition.section:Rechnung_List.code.coding.display",
        "path": "Composition.section.code.coding.display",
        "fixedString": "Liste der Rechnungen"
      },
      {
        "id": "Composition.section:Rechnung_List.code.coding.userSelected",
        "path": "Composition.section.code.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Composition.section:Rechnung_List.code.text",
        "path": "Composition.section.code.text",
        "max": "0"
      },
      {
        "id": "Composition.section:Rechnung_List.author",
        "path": "Composition.section.author",
        "max": "0"
      },
      {
        "id": "Composition.section:Rechnung_List.focus",
        "path": "Composition.section.focus",
        "max": "0"
      },
      {
        "id": "Composition.section:Rechnung_List.text",
        "path": "Composition.section.text",
        "max": "0"
      },
      {
        "id": "Composition.section:Rechnung_List.mode",
        "path": "Composition.section.mode",
        "max": "0"
      },
      {
        "id": "Composition.section:Rechnung_List.orderedBy",
        "path": "Composition.section.orderedBy",
        "max": "0"
      },
      {
        "id": "Composition.section:Rechnung_List.entry",
        "path": "Composition.section.entry",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.biv-ot.org/eVerordnungAbrechnungsdaten/BIV_PR_TA6_Rechnung_List|1.4"
            ]
          }
        ]
      },
      {
        "id": "Composition.section:Rechnung_List.entry.reference",
        "path": "Composition.section.entry.reference",
        "min": 1
      },
      {
        "id": "Composition.section:Rechnung_List.entry.type",
        "path": "Composition.section.entry.type",
        "max": "0"
      },
      {
        "id": "Composition.section:Rechnung_List.entry.identifier",
        "path": "Composition.section.entry.identifier",
        "max": "0"
      },
      {
        "id": "Composition.section:Rechnung_List.entry.display",
        "path": "Composition.section.entry.display",
        "max": "0"
      },
      {
        "id": "Composition.section:Rechnung_List.emptyReason",
        "path": "Composition.section.emptyReason",
        "max": "0"
      },
      {
        "id": "Composition.section:Rechnung_List.section",
        "path": "Composition.section.section",
        "max": "0"
      },
      {
        "id": "Composition.section:VerordnungBundle",
        "path": "Composition.section",
        "sliceName": "VerordnungBundle",
        "min": 1
      },
      {
        "id": "Composition.section:VerordnungBundle.title",
        "path": "Composition.section.title",
        "max": "0"
      },
      {
        "id": "Composition.section:VerordnungBundle.code",
        "path": "Composition.section.code",
        "min": 1
      },
      {
        "id": "Composition.section:VerordnungBundle.code.coding",
        "path": "Composition.section.code.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Composition.section:VerordnungBundle.code.coding.system",
        "path": "Composition.section.code.coding.system",
        "min": 1,
        "fixedUri": "https://fhir.gkvsv.de/CodeSystem/BIV_CS_ERP_TA6"
      },
      {
        "id": "Composition.section:VerordnungBundle.code.coding.version",
        "path": "Composition.section.code.coding.version",
        "max": "0"
      },
      {
        "id": "Composition.section:VerordnungBundle.code.coding.code",
        "path": "Composition.section.code.coding.code",
        "min": 1,
        "fixedCode": "RB"
      },
      {
        "id": "Composition.section:VerordnungBundle.code.coding.display",
        "path": "Composition.section.code.coding.display",
        "fixedString": "Rezept-Bundle"
      },
      {
        "id": "Composition.section:VerordnungBundle.code.coding.userSelected",
        "path": "Composition.section.code.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Composition.section:VerordnungBundle.code.text",
        "path": "Composition.section.code.text",
        "max": "0"
      },
      {
        "id": "Composition.section:VerordnungBundle.author",
        "path": "Composition.section.author",
        "max": "0"
      },
      {
        "id": "Composition.section:VerordnungBundle.focus",
        "path": "Composition.section.focus",
        "max": "0"
      },
      {
        "id": "Composition.section:VerordnungBundle.text",
        "path": "Composition.section.text",
        "max": "0"
      },
      {
        "id": "Composition.section:VerordnungBundle.mode",
        "path": "Composition.section.mode",
        "max": "0"
      },
      {
        "id": "Composition.section:VerordnungBundle.orderedBy",
        "path": "Composition.section.orderedBy",
        "max": "0"
      },
      {
        "id": "Composition.section:VerordnungBundle.entry",
        "path": "Composition.section.entry",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.biv-ot.org/eVerordnungAbrechnungsdaten/BIV_PR_TA6_VerordnungBundle"
            ]
          }
        ]
      },
      {
        "id": "Composition.section:VerordnungBundle.entry.reference",
        "path": "Composition.section.entry.reference",
        "min": 1
      },
      {
        "id": "Composition.section:VerordnungBundle.entry.type",
        "path": "Composition.section.entry.type",
        "max": "0"
      },
      {
        "id": "Composition.section:VerordnungBundle.entry.identifier",
        "path": "Composition.section.entry.identifier",
        "max": "0"
      },
      {
        "id": "Composition.section:VerordnungBundle.entry.display",
        "path": "Composition.section.entry.display",
        "max": "0"
      },
      {
        "id": "Composition.section:VerordnungBundle.emptyReason",
        "path": "Composition.section.emptyReason",
        "max": "0"
      },
      {
        "id": "Composition.section:VerordnungBundle.section",
        "path": "Composition.section.section",
        "max": "0"
      }
    ]
  }
}