<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="GEM-ERP-PR-ChargeItem" />
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-category">
    <valueString value="Financial.General" />
  </extension>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-security-category">
    <valueCode value="patient" />
  </extension>
  <url value="https://gematik.de/fhir/erp/StructureDefinition/GEM_ERP_PR_ChargeItem" />
  <version value="1.2" />
  <name value="GEM_ERP_PR_ChargeItem" />
  <status value="draft" />
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="workflow" />
    <uri value="http://hl7.org/fhir/workflow" />
    <name value="Workflow Pattern" />
  </mapping>
  <mapping>
    <identity value="v2" />
    <uri value="http://hl7.org/v2" />
    <name value="HL7 v2 Mapping" />
  </mapping>
  <mapping>
    <identity value="rim" />
    <uri value="http://hl7.org/v3" />
    <name value="RIM Mapping" />
  </mapping>
  <mapping>
    <identity value="w5" />
    <uri value="http://hl7.org/fhir/fivews" />
    <name value="FiveWs Pattern Mapping" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="ChargeItem" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/ChargeItem" />
  <derivation value="constraint" />
  <differential>
    <element id="ChargeItem.extension">
      <path value="ChargeItem.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <description value="Extensions are always sliced by (at least) url" />
        <rules value="closed" />
      </slicing>
    </element>
    <element id="ChargeItem.extension:markingFlag">
      <path value="ChargeItem.extension" />
      <sliceName value="markingFlag" />
      <min value="0" />
      <max value="*" />
      <type>
        <code value="Extension" />
        <profile value="https://gematik.de/fhir/erp/StructureDefinition/GEM_ERP_EX_MarkingFlag" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="ChargeItem.identifier">
      <path value="ChargeItem.identifier" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="system" />
        </discriminator>
        <description value="The task ressource contains three identifier. The first one is the identifier for the ask representing one e-prescription. The other identifier are representing the patient as owner of the prescription. One is the &quot;Krankenversichertennummer&quot; wich identify each patient by his health insurance company and the other is &quot;Institutionskennzeichen&quot;." />
        <rules value="closed" />
      </slicing>
      <min value="1" />
    </element>
    <element id="ChargeItem.identifier:PrescriptionID">
      <path value="ChargeItem.identifier" />
      <sliceName value="PrescriptionID" />
      <short value="Prescription Identifier" />
      <definition value="The prescription identifier is the main identifier for all the ePrecscription related ressources and the whole prescription workflow. This identifier is genereted by the &quot;E-Rezept Fachdienst&quot; and must not be changed manually." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Identifier" />
        <profile value="https://gematik.de/fhir/erp/StructureDefinition/GEM_ERP_PR_PrescriptionId" />
      </type>
    </element>
    <element id="ChargeItem.identifier:AccessCode">
      <path value="ChargeItem.identifier" />
      <sliceName value="AccessCode" />
      <short value="AccessCode Identifier" />
      <definition value="Generated by the &quot;E-Rezept Fachdienst&quot;. This identifier grants access to others than the patient." />
      <min value="0" />
      <max value="1" />
    </element>
    <element id="ChargeItem.identifier:AccessCode.system">
      <path value="ChargeItem.identifier.system" />
      <min value="1" />
      <fixedUri value="https://gematik.de/fhir/erp/NamingSystem/GEM_ERP_NS_AccessCode" />
    </element>
    <element id="ChargeItem.identifier:AccessCode.value">
      <path value="ChargeItem.identifier.value" />
      <min value="1" />
    </element>
    <element id="ChargeItem.status">
      <path value="ChargeItem.status" />
      <mustSupport value="true" />
    </element>
    <element id="ChargeItem.code">
      <path value="ChargeItem.code" />
      <mustSupport value="true" />
    </element>
    <element id="ChargeItem.code.coding.system">
      <path value="ChargeItem.code.coding.system" />
      <fixedUri value="http://terminology.hl7.org/CodeSystem/data-absent-reason" />
    </element>
    <element id="ChargeItem.code.coding.code">
      <path value="ChargeItem.code.coding.code" />
      <fixedCode value="not-applicable" />
    </element>
    <element id="ChargeItem.subject">
      <path value="ChargeItem.subject" />
      <mustSupport value="true" />
    </element>
    <element id="ChargeItem.subject.identifier">
      <path value="ChargeItem.subject.identifier" />
      <min value="1" />
      <type>
        <code value="Identifier" />
        <profile value="http://fhir.de/StructureDefinition/identifier-kvid-10" />
      </type>
    </element>
    <element id="ChargeItem.enterer">
      <path value="ChargeItem.enterer" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ChargeItem.enterer.identifier">
      <path value="ChargeItem.enterer.identifier" />
      <min value="1" />
      <type>
        <code value="Identifier" />
        <profile value="https://gematik.de/fhir/erp/StructureDefinition/GEM_ERP_PR_TelematikId" />
      </type>
    </element>
    <element id="ChargeItem.enteredDate">
      <path value="ChargeItem.enteredDate" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="ChargeItem.supportingInformation">
      <path value="ChargeItem.supportingInformation" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="type" />
        </discriminator>
        <rules value="closed" />
      </slicing>
      <mustSupport value="true" />
    </element>
    <element id="ChargeItem.supportingInformation:prescriptionItem">
      <path value="ChargeItem.supportingInformation" />
      <sliceName value="prescriptionItem" />
      <definition value="In analogie zu Task.inputwird die Patientenkopie der Verordnung als Bundle gespeichert und trägt in Bundle.signature die Verordnungs-Signatur im JWS-detached Format." />
      <min value="0" />
      <max value="*" />
    </element>
    <element id="ChargeItem.supportingInformation:prescriptionItem.type">
      <path value="ChargeItem.supportingInformation.type" />
      <min value="1" />
      <fixedUri value="https://fhir.kbv.de/StructureDefinition/KBV_PR_ERP_Bundle" />
    </element>
    <element id="ChargeItem.supportingInformation:dispenseItem">
      <path value="ChargeItem.supportingInformation" />
      <sliceName value="dispenseItem" />
      <min value="0" />
      <max value="*" />
    </element>
    <element id="ChargeItem.supportingInformation:dispenseItem.type">
      <path value="ChargeItem.supportingInformation.type" />
      <min value="1" />
      <fixedUri value="http://fhir.abda.de/eRezeptAbgabedaten/StructureDefinition/DAV-PKV-PR-ERP-AbgabedatenBundle" />
    </element>
    <element id="ChargeItem.supportingInformation:receipt">
      <path value="ChargeItem.supportingInformation" />
      <sliceName value="receipt" />
      <definition value="In analogie zu Task.output wird die Quittung als Bundle gespeichert und trägt in Bundle.signature die Quittungs-Signatur im CAdES-enveloping Format [RFC 5652]." />
      <min value="0" />
      <max value="*" />
    </element>
    <element id="ChargeItem.supportingInformation:receipt.type">
      <path value="ChargeItem.supportingInformation.type" />
      <min value="1" />
      <fixedUri value="https://gematik.de/fhir/erp/StructureDefinition/GEM_ERP_PR_Bundle" />
    </element>
  </differential>
</StructureDefinition>