<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="dipag-rechnung" />
  <url value="https://gematik.de/fhir/dipag/StructureDefinition/dipag-rechnung" />
  <version value="1.0.5" />
  <name value="DiPagRechnung" />
  <title value="Digitale Patientenrechnung Rechnung" />
  <status value="active" />
  <experimental value="false" />
  <date value="2026-03-26" />
  <publisher value="gematik GmbH" />
  <contact>
    <telecom>
      <system value="url" />
      <value value="http://gematik.de/" />
    </telecom>
  </contact>
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Invoice" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Invoice" />
  <derivation value="constraint" />
  <differential>
    <element id="Invoice.extension">
      <path value="Invoice.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <ordered value="false" />
        <rules value="open" />
      </slicing>
      <min value="2" />
    </element>
    <element id="Invoice.extension:Behandlungszeitraum">
      <path value="Invoice.extension" />
      <sliceName value="Behandlungszeitraum" />
      <short value="Behandlungszeitraum" />
      <comment value="Entweder ein Behandlungszeitraum, oder ein -datum SOLL vorhanden sein." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/5.0/StructureDefinition/extension-Invoice.period[x]" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Invoice.extension:Behandlungszeitraum.value[x]">
      <path value="Invoice.extension.value[x]" />
      <slicing>
        <discriminator>
          <type value="type" />
          <path value="$this" />
        </discriminator>
        <ordered value="false" />
        <rules value="open" />
      </slicing>
    </element>
    <element id="Invoice.extension:Behandlungszeitraum.value[x]:valuePeriod">
      <path value="Invoice.extension.value[x]" />
      <sliceName value="valuePeriod" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Period" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Invoice.extension:Behandlungszeitraum.value[x]:valuePeriod.start">
      <path value="Invoice.extension.value[x].start" />
      <short value="Startdatum" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.extension:Behandlungszeitraum.value[x]:valuePeriod.end">
      <path value="Invoice.extension.value[x].end" />
      <short value="Enddatum" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.extension:Behandlungszeitraum.value[x]:valueDate">
      <path value="Invoice.extension.value[x]" />
      <sliceName value="valueDate" />
      <short value="Behandlungsdatum" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="date" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Invoice.extension:AbrechnungsDiagnoseProzedur">
      <path value="Invoice.extension" />
      <sliceName value="AbrechnungsDiagnoseProzedur" />
      <short value="Diagnose" />
      <comment value="Im Falle einer GOÄ oder GOÄ-neu Rechnung, SOLLEN Diagnosen und Prozeduren vorhanden sein.&#xA;  Im Falle einer GOZ Rechnung werden keine Diagnosen oder Prozedur gefordert." />
      <min value="0" />
      <max value="*" />
      <type>
        <code value="Extension" />
        <profile value="https://gematik.de/fhir/dipag/StructureDefinition/DiPagAbrechnungsDiagnoseProzedur" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Invoice.extension:AbrechnungsDiagnoseProzedur.extension:Use">
      <path value="Invoice.extension.extension" />
      <sliceName value="Use" />
    </element>
    <element id="Invoice.extension:AbrechnungsDiagnoseProzedur.extension:Use.value[x]">
      <path value="Invoice.extension.extension.value[x]" />
      <short value="Kennzeichen Hauptdiagnose" />
      <comment value="Das Kennzeichen Hauptdiagnose SOLL vorhanden sein, wenn es sich um eine HD handelt." />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.extension:AbrechnungsDiagnoseProzedur.extension:Use.value[x].code">
      <path value="Invoice.extension.extension.value[x].code" />
      <patternCode value="main-diagnosis" />
    </element>
    <element id="Invoice.extension:AbrechnungsDiagnoseProzedur.extension:Referenz">
      <path value="Invoice.extension.extension" />
      <sliceName value="Referenz" />
    </element>
    <element id="Invoice.extension:AbrechnungsDiagnoseProzedur.extension:Referenz.value[x]">
      <path value="Invoice.extension.extension.value[x]" />
      <short value="Zuordnung von Diagnosen oder Prozeduren zur Rechnung" />
      <comment value="Diagnosen und Prozeduren SOLLEN zur Rechnung zugeordnet sein." />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.extension:AbrechnungsDiagnoseProzedurFreitext">
      <path value="Invoice.extension" />
      <sliceName value="AbrechnungsDiagnoseProzedurFreitext" />
      <short value="Einleitung (Diagnose und Prozedure als Freitextangabe)" />
      <comment value="Im Falle einer GOÄ oder GOZ Rechnung, SOLLEN Diagnose und Prozedure als Freitextangabe vorhanden sein.&#xA;  Im Falle einer GOÄ-neu Rechnung werden keine Diagnosen und Prozeduren als Freitext gefordert." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://gematik.de/fhir/dipag/StructureDefinition/DiPagAbrechnungsDiagnoseProzedurFreitext" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Invoice.extension:AbrechnungsDiagnoseProzedurFreitext.value[x]">
      <path value="Invoice.extension.value[x]" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.extension:Behandlungsart">
      <path value="Invoice.extension" />
      <sliceName value="Behandlungsart" />
      <short value="Behandlungsart" />
      <comment value="Die Behandlungsart MUSS vorhanden sein." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://gematik.de/fhir/dipag/StructureDefinition/dipag-behandlungsart" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Invoice.extension:Behandlungsart.value[x]">
      <path value="Invoice.extension.value[x]" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.extension:Behandlungsart.value[x].system">
      <path value="Invoice.extension.value[x].system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.extension:Behandlungsart.value[x].code">
      <path value="Invoice.extension.value[x].code" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.extension:Fachrichtung">
      <path value="Invoice.extension" />
      <sliceName value="Fachrichtung" />
      <short value="Fachrichtung" />
      <comment value="Die Fachrichtung MUSS vorhanden sein.&#xA;  Es wird empfohlen für zahnärztliche Rechnungen immer den Wert MZKH (Zahnmedizin) zu nutzen." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://gematik.de/fhir/dipag/StructureDefinition/dipag-fachrichtung" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Invoice.extension:Fachrichtung.value[x]">
      <path value="Invoice.extension.value[x]" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.extension:Fachrichtung.value[x].system">
      <path value="Invoice.extension.value[x].system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.extension:Fachrichtung.value[x].code">
      <path value="Invoice.extension.value[x].code" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.extension:Korrekturrechnung">
      <path value="Invoice.extension" />
      <sliceName value="Korrekturrechnung" />
      <short value="Info Korrekturrechnung" />
      <comment value="Wenn die Instanz dieser Rechnung eine Korrektur einer anderen Rechnung ist, SOLL die ersetzte Rechnung hier referenziert werden." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://gematik.de/fhir/dipag/StructureDefinition/DiPagInvoiceReplaces" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Invoice.extension:Korrekturrechnung.value[x]">
      <path value="Invoice.extension.value[x]" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://gematik.de/fhir/dipag/StructureDefinition/dipag-rechnung" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Invoice" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Invoice.extension:Korrekturtoken">
      <path value="Invoice.extension" />
      <sliceName value="Korrekturtoken" />
      <short value="Info Korrekturtoken" />
      <comment value="Wenn die Instanz dieser Rechnung eine Korrektur einer anderen Rechnung ist, SOLL das Token der ersetzten Rechnung hier angegeben werden." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://gematik.de/fhir/dipag/StructureDefinition/DiPagTokenStornierteRechnung" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Invoice.extension:Korrekturtoken.value[x]">
      <path value="Invoice.extension.value[x]" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.extension:Korrekturtoken.value[x].system">
      <path value="Invoice.extension.value[x].system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.extension:Korrekturtoken.value[x].value">
      <path value="Invoice.extension.value[x].value" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.extension:Antragsreferenz">
      <path value="Invoice.extension" />
      <sliceName value="Antragsreferenz" />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://gematik.de/fhir/dipag/StructureDefinition/DiPagInvoiceBasedOn" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Invoice.extension:Antragsreferenz.value[x]">
      <path value="Invoice.extension.value[x]" />
      <short value="Referenz auf Heil- und Kostenplan, Kostenvoranschlag oder Kostenübernahmeantrag" />
      <comment value="Die Antragsreferenz SOLL vorhanden sein." />
      <min value="1" />
      <patternIdentifier>
        <type>
          <coding>
            <system value="https://gematik.de/fhir/dipag/CodeSystem/dipag-rechnung-identifier-type-cs" />
            <code value="antragsreferenz" />
          </coding>
        </type>
      </patternIdentifier>
      <mustSupport value="true" />
    </element>
    <element id="Invoice.extension:Antragsreferenz.value[x].type">
      <path value="Invoice.extension.value[x].type" />
      <min value="1" />
      <patternCodeableConcept>
        <coding>
          <system value="https://gematik.de/fhir/dipag/CodeSystem/dipag-rechnung-identifier-type-cs" />
          <code value="antragsreferenz" />
        </coding>
      </patternCodeableConcept>
      <mustSupport value="true" />
    </element>
    <element id="Invoice.extension:Antragsreferenz.value[x].system">
      <path value="Invoice.extension.value[x].system" />
      <short value="NamingSystem der Antragsreferenz" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.extension:Antragsreferenz.value[x].value">
      <path value="Invoice.extension.value[x].value" />
      <short value="Antragsreferenz" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.identifier">
      <path value="Invoice.identifier" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.identifier:Rechnungsnummer">
      <path value="Invoice.identifier" />
      <sliceName value="Rechnungsnummer" />
      <short value="Rechnungs-Nr. (der LEI)" />
      <comment value="Die Rechnungs-Nr. (der LEI) MUSS vorhanden sein." />
      <min value="1" />
      <max value="1" />
      <patternIdentifier>
        <type>
          <coding>
            <system value="https://gematik.de/fhir/dipag/CodeSystem/dipag-rechnung-identifier-type-cs" />
            <code value="invoice" />
          </coding>
        </type>
      </patternIdentifier>
      <mustSupport value="true" />
    </element>
    <element id="Invoice.identifier:Rechnungsnummer.type">
      <path value="Invoice.identifier.type" />
      <min value="1" />
      <patternCodeableConcept>
        <coding>
          <system value="https://gematik.de/fhir/dipag/CodeSystem/dipag-rechnung-identifier-type-cs" />
          <code value="invoice" />
        </coding>
      </patternCodeableConcept>
      <mustSupport value="true" />
    </element>
    <element id="Invoice.identifier:Rechnungsnummer.system">
      <path value="Invoice.identifier.system" />
      <short value="NamingSystem der Rechnungs-Nr. (der LEI)" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.identifier:Rechnungsnummer.value">
      <path value="Invoice.identifier.value" />
      <short value="Rechnungs-Nr. (der LEI)" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.status">
      <path value="Invoice.status" />
      <short value="Status der Rechnung" />
      <comment value="Der Status MUSS vorhanden sein." />
      <patternCode value="issued" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.type">
      <path value="Invoice.type" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.type.coding">
      <path value="Invoice.type.coding" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="$this" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.type.coding:AusrichtungDerRechnung">
      <path value="Invoice.type.coding" />
      <sliceName value="AusrichtungDerRechnung" />
      <short value="Abrechnungsart der Rechnung" />
      <comment value="Die Grundsätzliche Ausrichtung der Rechnung (Abrechnungsart) SOLL vorhanden sein." />
      <min value="0" />
      <max value="1" />
      <patternCoding>
        <system value="https://gematik.de/fhir/dipag/CodeSystem/dipag-rechnung-abrechnungsart-cs" />
      </patternCoding>
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="https://gematik.de/fhir/dipag/ValueSet/dipag-rechnung-abrechnungsart-vs" />
      </binding>
    </element>
    <element id="Invoice.type.coding:AusrichtungDerRechnung.extension:Zusatzinformation">
      <path value="Invoice.type.coding.extension" />
      <sliceName value="Zusatzinformation" />
      <short value="Zusatzinformation zur Abrechnungsart" />
      <comment value="Die Zusatzinformation zur Abrechnungsart SOLL vorhanden sein, wenn es sich um eine Abrechnung nach §13 Abs. 2 SGB V handelt." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://gematik.de/fhir/dipag/StructureDefinition/DiPagZusatzinformationZurAbrechnungsart" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Invoice.type.coding:AusrichtungDerRechnung.extension:Zusatzinformation.value[x]">
      <path value="Invoice.type.coding.extension.value[x]" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.type.coding:AusrichtungDerRechnung.system">
      <path value="Invoice.type.coding.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.type.coding:AusrichtungDerRechnung.code">
      <path value="Invoice.type.coding.code" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.type.coding:Rechnungsart">
      <path value="Invoice.type.coding" />
      <sliceName value="Rechnungsart" />
      <short value="Rechnungsart" />
      <comment value="Die Rechnungsart SOLL vorhanden sein." />
      <min value="0" />
      <max value="1" />
      <patternCoding>
        <system value="https://gematik.de/fhir/dipag/CodeSystem/dipag-rechnungsart-cs" />
      </patternCoding>
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="https://gematik.de/fhir/dipag/ValueSet/dipag-rechnungsart-vs" />
      </binding>
    </element>
    <element id="Invoice.type.coding:Rechnungsart.system">
      <path value="Invoice.type.coding.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.type.coding:Rechnungsart.code">
      <path value="Invoice.type.coding.code" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.subject">
      <path value="Invoice.subject" />
      <short value="Behandelte Person" />
      <comment value="Der Name der behandelten Person SOLL angegeben werden und kann vom Rechnungsempfänger abweichen, z.B. wenn Eltern Rechnungen für ihre Kinder erhalten." />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://gematik.de/fhir/dipag/StructureDefinition/dipag-patient" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Invoice.subject.reference">
      <path value="Invoice.subject.reference" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.recipient">
      <path value="Invoice.recipient" />
      <short value="Rechnungsempfänger" />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://gematik.de/fhir/dipag/StructureDefinition/dipag-patient" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Invoice.recipient.reference">
      <path value="Invoice.recipient.reference" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.recipient.identifier">
      <path value="Invoice.recipient.identifier" />
      <comment value="Das System des Leistungserbringers referenziert hier üblicherweise &#xA;    auf die lokale Instanz des Patienten um die Rechnung einer Patientenakte zuzuordnen. &#xA;    Der Fachdienst substitutiert den Link mit der Referenz auf das Postfach des Patienten &#xA;    bei der Extraktion der Invoice aus dem Bundle. Die Angabe der Versichertennummer dient &#xA;    der Plausibilisierung. Die KV-Nummer in der Instanz des Bundles muss daher mit der &#xA;    KV-Nummer übereinstimmen, die im Fachdienst für das Postfach des Rechnungsempfängers hinterlegt ist." />
      <min value="1" />
      <type>
        <code value="Identifier" />
        <profile value="http://fhir.de/StructureDefinition/identifier-kvid-10" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Invoice.recipient.display">
      <path value="Invoice.recipient.display" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.date">
      <path value="Invoice.date" />
      <short value="Rechnungsdatum" />
      <comment value="Das Rechnungsdatum MUSS vorhanden sein." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.participant">
      <path value="Invoice.participant" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="role" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <short value="weitere behandelnde Leistungserbringer oder abweichender Forderungsinhaber" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.participant.role">
      <path value="Invoice.participant.role" />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="https://gematik.de/fhir/dipag/ValueSet/dipag-participant-role-VS" />
      </binding>
    </element>
    <element id="Invoice.participant:Leistungserbringer">
      <path value="Invoice.participant" />
      <sliceName value="Leistungserbringer" />
      <short value="Weitere behandelnde Leistungserbringer" />
      <comment value="Im Falle einer GOÄ oder GOÄ-neu Rechnung, SOLLLEN weitere behandelnde Leistungserbringer vorhanden sein.&#xA;  Im Falle einer GOZ Rechnung, KÖNNEN weitere behandelnde Leistungserbringer vorhanden sein." />
      <min value="1" />
      <max value="*" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.participant:Leistungserbringer.role">
      <path value="Invoice.participant.role" />
      <min value="1" />
      <patternCodeableConcept>
        <coding>
          <system value="https://gematik.de/fhir/dipag/CodeSystem/dipag-participant-role-cs" />
          <code value="leistungserbringer" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="Invoice.participant:Leistungserbringer.actor">
      <path value="Invoice.participant.actor" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://gematik.de/fhir/dipag/StructureDefinition/dipag-person" />
        <targetProfile value="https://gematik.de/fhir/dipag/StructureDefinition/dipag-institution" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
      </type>
    </element>
    <element id="Invoice.participant:Forderungsinhaber">
      <path value="Invoice.participant" />
      <sliceName value="Forderungsinhaber" />
      <short value="Abweichender Forderungsinhaber" />
      <comment value="Der abweichender Forderungsinhaber SOLL vorhanden sein." />
      <min value="0" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.participant:Forderungsinhaber.role">
      <path value="Invoice.participant.role" />
      <min value="1" />
      <patternCodeableConcept>
        <coding>
          <system value="https://gematik.de/fhir/dipag/CodeSystem/dipag-participant-role-cs" />
          <code value="forderungsinhaber" />
        </coding>
      </patternCodeableConcept>
    </element>
    <element id="Invoice.participant:Forderungsinhaber.actor">
      <path value="Invoice.participant.actor" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://gematik.de/fhir/dipag/StructureDefinition/dipag-person" />
        <targetProfile value="https://gematik.de/fhir/dipag/StructureDefinition/dipag-institution" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
      </type>
    </element>
    <element id="Invoice.issuer">
      <path value="Invoice.issuer" />
      <short value="Rechnungsersteller" />
      <comment value="Der Rechnungsersteller MUSS vorhanden sein." />
      <min value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://gematik.de/fhir/dipag/StructureDefinition/dipag-institution" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Invoice.issuer.reference">
      <path value="Invoice.issuer.reference" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.lineItem">
      <path value="Invoice.lineItem" />
      <short value="Rechnungspositionen" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.lineItem.sequence">
      <path value="Invoice.lineItem.sequence" />
      <short value="Reihenfolge der Rechnungsposition" />
      <comment value="Die Reihenfolge der Rechnungsposition MUSS mit einer Sequenz-Nummer angegeben werden. Die Sequenz muss mit 1 als erste Ziffer beginnen." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.lineItem.chargeItem[x]">
      <path value="Invoice.lineItem.chargeItem[x]" />
      <short value="Referenz auf die Instanz der Rechnungsposition" />
      <comment value="Die Referenz auf die Instanz der Rechnungsposition MUSS vorhanden sein." />
      <type>
        <code value="Reference" />
        <targetProfile value="https://gematik.de/fhir/dipag/StructureDefinition/dipag-rechnungsposition" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/ChargeItem" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Invoice.lineItem.priceComponent">
      <path value="Invoice.lineItem.priceComponent" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="type" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <mustSupport value="true" />
    </element>
    <element id="Invoice.lineItem.priceComponent:BruttoBetrag">
      <path value="Invoice.lineItem.priceComponent" />
      <sliceName value="BruttoBetrag" />
      <short value="Betrag pro Rechnungsposition" />
      <comment value="Im Falle einer GOÄ, GOÄ-neu oder GOZ Rechnungsposition, SOLL der Betrag pro Rechnungsposition vorhanden sein." />
      <min value="0" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.lineItem.priceComponent:BruttoBetrag.type">
      <path value="Invoice.lineItem.priceComponent.type" />
      <patternCode value="base" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.lineItem.priceComponent:BruttoBetrag.factor">
      <path value="Invoice.lineItem.priceComponent.factor" />
      <max value="0" />
    </element>
    <element id="Invoice.lineItem.priceComponent:BruttoBetrag.amount">
      <path value="Invoice.lineItem.priceComponent.amount" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.lineItem.priceComponent:Steuern">
      <path value="Invoice.lineItem.priceComponent" />
      <sliceName value="Steuern" />
      <short value="Steuern enthalten im Brutto Betrag" />
      <comment value="Die enthaltenen Steuern SOLLEN vorhanden sein." />
      <min value="0" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.lineItem.priceComponent:Steuern.type">
      <path value="Invoice.lineItem.priceComponent.type" />
      <patternCode value="tax" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.lineItem.priceComponent:Steuern.factor">
      <path value="Invoice.lineItem.priceComponent.factor" />
      <max value="0" />
    </element>
    <element id="Invoice.lineItem.priceComponent:Steuern.amount">
      <path value="Invoice.lineItem.priceComponent.amount" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.totalPriceComponent">
      <path value="Invoice.totalPriceComponent" />
      <slicing>
        <discriminator>
          <type value="pattern" />
          <path value="code" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <mustSupport value="true" />
    </element>
    <element id="Invoice.totalPriceComponent:SummeRechnungspositionen">
      <path value="Invoice.totalPriceComponent" />
      <sliceName value="SummeRechnungspositionen" />
      <short value="Summe aller Rechnungspositionen" />
      <comment value="Die Summe aller Rechnungspositionen SOLL vorhanden sein." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="BackboneElement" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Invoice.totalPriceComponent:SummeRechnungspositionen.type">
      <path value="Invoice.totalPriceComponent.type" />
      <patternCode value="base" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.totalPriceComponent:SummeRechnungspositionen.code">
      <path value="Invoice.totalPriceComponent.code" />
      <min value="1" />
      <patternCodeableConcept>
        <coding>
          <system value="https://gematik.de/fhir/dipag/CodeSystem/dipag-total-price-component-type-cs" />
          <code value="SummeRechnungspositionen" />
        </coding>
      </patternCodeableConcept>
      <mustSupport value="true" />
    </element>
    <element id="Invoice.totalPriceComponent:SummeRechnungspositionen.factor">
      <path value="Invoice.totalPriceComponent.factor" />
      <max value="0" />
    </element>
    <element id="Invoice.totalPriceComponent:SummeRechnungspositionen.amount">
      <path value="Invoice.totalPriceComponent.amount" />
      <short value="Wert in EUR" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.totalPriceComponent:SummeRechnungspositionen.amount.value">
      <path value="Invoice.totalPriceComponent.amount.value" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.totalPriceComponent:SummeRechnungspositionen.amount.currency">
      <path value="Invoice.totalPriceComponent.amount.currency" />
      <min value="1" />
      <patternCode value="EUR" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.totalPriceComponent:MinderungNachGOZ">
      <path value="Invoice.totalPriceComponent" />
      <sliceName value="MinderungNachGOZ" />
      <short value="Minderungen nach §7 GOZ" />
      <comment value="Im Falle einer GOZ Rechnung SOLLEN die Minderungen nach §7 GOZ vorhanden sein.&#xA;  Im Falle einer GOÄ oder GOÄ-neu Rechnung ist das Element nicht gefordert." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="BackboneElement" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Invoice.totalPriceComponent:MinderungNachGOZ.type">
      <path value="Invoice.totalPriceComponent.type" />
      <patternCode value="deduction" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.totalPriceComponent:MinderungNachGOZ.code">
      <path value="Invoice.totalPriceComponent.code" />
      <min value="1" />
      <patternCodeableConcept>
        <coding>
          <system value="https://gematik.de/fhir/dipag/CodeSystem/dipag-total-price-component-type-cs" />
          <code value="Minderung7GOZ" />
        </coding>
      </patternCodeableConcept>
      <mustSupport value="true" />
    </element>
    <element id="Invoice.totalPriceComponent:MinderungNachGOZ.factor">
      <path value="Invoice.totalPriceComponent.factor" />
      <max value="0" />
    </element>
    <element id="Invoice.totalPriceComponent:MinderungNachGOZ.amount">
      <path value="Invoice.totalPriceComponent.amount" />
      <short value="Wert in EUR" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.totalPriceComponent:MinderungNachGOZ.amount.value">
      <path value="Invoice.totalPriceComponent.amount.value" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.totalPriceComponent:MinderungNachGOZ.amount.currency">
      <path value="Invoice.totalPriceComponent.amount.currency" />
      <min value="1" />
      <patternCode value="EUR" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.totalPriceComponent:Fremdlaborleistungen">
      <path value="Invoice.totalPriceComponent" />
      <sliceName value="Fremdlaborleistungen" />
      <short value="Summe aller Fremdlaborleistungen" />
      <comment value="Die Summe aller Fremdlaborleistungen SOLL vorhanden sein." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="BackboneElement" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Invoice.totalPriceComponent:Fremdlaborleistungen.type">
      <path value="Invoice.totalPriceComponent.type" />
      <patternCode value="base" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.totalPriceComponent:Fremdlaborleistungen.code">
      <path value="Invoice.totalPriceComponent.code" />
      <min value="1" />
      <patternCodeableConcept>
        <coding>
          <system value="https://gematik.de/fhir/dipag/CodeSystem/dipag-total-price-component-type-cs" />
          <code value="Fremdlaborleistungen" />
        </coding>
      </patternCodeableConcept>
      <mustSupport value="true" />
    </element>
    <element id="Invoice.totalPriceComponent:Fremdlaborleistungen.factor">
      <path value="Invoice.totalPriceComponent.factor" />
      <max value="0" />
    </element>
    <element id="Invoice.totalPriceComponent:Fremdlaborleistungen.amount">
      <path value="Invoice.totalPriceComponent.amount" />
      <short value="Wert in EUR" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.totalPriceComponent:Fremdlaborleistungen.amount.value">
      <path value="Invoice.totalPriceComponent.amount.value" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.totalPriceComponent:Fremdlaborleistungen.amount.currency">
      <path value="Invoice.totalPriceComponent.amount.currency" />
      <min value="1" />
      <patternCode value="EUR" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.totalPriceComponent:Abzug">
      <path value="Invoice.totalPriceComponent" />
      <sliceName value="Abzug" />
      <short value="Abzug" />
      <comment value="Der Abzug SOLL vorhanden sein." />
      <min value="0" />
      <max value="*" />
      <type>
        <code value="BackboneElement" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Invoice.totalPriceComponent:Abzug.extension">
      <path value="Invoice.totalPriceComponent.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <ordered value="false" />
        <rules value="open" />
      </slicing>
    </element>
    <element id="Invoice.totalPriceComponent:Abzug.extension:Kassenanteil">
      <path value="Invoice.totalPriceComponent.extension" />
      <sliceName value="Kassenanteil" />
      <short value="Kassenanteil in Prozent" />
      <comment value="Im Falle einer GOZ Rechnung KANN der Kassenanteil in Prozent vorhanden sein.&#xA;    Im Falle einer GOÄ oder GOÄ-neu Rechnung ist das Element nicht gefordert." />
      <min value="0" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://gematik.de/fhir/dipag/StructureDefinition/dipag-abzug-kassenanteil" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Invoice.totalPriceComponent:Abzug.type">
      <path value="Invoice.totalPriceComponent.type" />
      <patternCode value="deduction" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.totalPriceComponent:Abzug.code">
      <path value="Invoice.totalPriceComponent.code" />
      <short value="Kategorisierung des Abzugs" />
      <comment value="Die Kategorisierung des Abzugs SOLL vorhanden sein." />
      <min value="1" />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="https://gematik.de/fhir/dipag/ValueSet/dipag-total-price-component-deduction-type-vs" />
      </binding>
    </element>
    <element id="Invoice.totalPriceComponent:Abzug.factor">
      <path value="Invoice.totalPriceComponent.factor" />
      <max value="0" />
    </element>
    <element id="Invoice.totalPriceComponent:Abzug.amount">
      <path value="Invoice.totalPriceComponent.amount" />
      <short value="Wert in EUR" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.totalPriceComponent:Abzug.amount.value">
      <path value="Invoice.totalPriceComponent.amount.value" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.totalPriceComponent:Abzug.amount.currency">
      <path value="Invoice.totalPriceComponent.amount.currency" />
      <min value="1" />
      <patternCode value="EUR" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.totalNet">
      <path value="Invoice.totalNet" />
      <short value="Rechnungsbetrag (Netto)" />
      <comment value="Der Rechnungsbetrag in Netto MUSS vorhanden sein." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.totalGross">
      <path value="Invoice.totalGross" />
      <short value="Rechnungsbetrag (Brutto)" />
      <comment value="Der Rechnungsbetrag in Brutto MUSS vorhanden sein." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.paymentTerms">
      <path value="Invoice.paymentTerms" />
      <short value="Zahlungsdaten Überweisung und weitere Zahlungsmethoden" />
      <comment value="Die Zahlungsdaten zur Überweisung SOLLEN vorhanden sein.&#xA;  Weitere Zahlungsmethoden wie bspw. Paypal, Klarna, Kreditkarte KÖNNEN auch hier angegeben werden.&#xA;  Ebenfalls sollte hier der Zahlbetrag in EUR inkl. potenzieller Abzüge durch Anzahlungen, Vorauszahlungen oder Abschlagzahlungen." />
      <mustSupport value="true" />
    </element>
    <element id="Invoice.paymentTerms.extension">
      <path value="Invoice.paymentTerms.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <ordered value="false" />
        <rules value="open" />
      </slicing>
      <min value="1" />
    </element>
    <element id="Invoice.paymentTerms.extension:Zahlungsziel">
      <path value="Invoice.paymentTerms.extension" />
      <sliceName value="Zahlungsziel" />
      <short value="Zahlungsziel als Datum oder Fristangabe" />
      <comment value="Das Zahlungsziel SOLL vorhanden sein." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Extension" />
        <profile value="https://gematik.de/fhir/dipag/StructureDefinition/dipag-zahlungsziel" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Invoice.note">
      <path value="Invoice.note" />
      <short value="Hinweise an den Kostenträger" />
      <comment value="Der Hinweise an den Kostenträger KANN vorhanden sein." />
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>