<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="KBV-PR-ERP-Bundle" />
  <url value="https://fhir.kbv.de/StructureDefinition/KBV_PR_ERP_Bundle" />
  <version value="1.4.2" />
  <name value="KBV_PR_ERP_Bundle" />
  <status value="active" />
  <date value="2026-04-15" />
  <publisher value="Kassenärztliche Bundesvereinigung (KBV)" />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Bundle" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Bundle" />
  <derivation value="constraint" />
  <differential>
    <element id="Bundle">
      <path value="Bundle" />
      <constraint>
        <key value="-erp-angabePruefnummerPflicht" />
        <severity value="error" />
        <human value="In der Ressource vom Typ Composition ist keine Prüfnummer vorhanden, diese ist aber eine Pflichtangabe bei den Kostentraegern der Typen &quot;GKV&quot;, &quot;BG&quot;, &quot;SKT&quot; oder &quot;UK&quot;." />
        <expression value="(entry.where(resource is Composition).exists() and entry.where(resource is Coverage).exists() and (entry.where(resource is Coverage).resource.type.coding.code='GKV' or entry.where(resource is Coverage).resource.type.coding.code='BG' or entry.where(resource is Coverage).resource.type.coding.code='SKT' or entry.where(resource is Coverage).resource.type.coding.code='UK')) implies entry.where(resource is Composition).resource.author.identifier.where(system='https://fhir.kbv.de/NamingSystem/KBV_NS_FOR_Pruefnummer').exists()" />
      </constraint>
      <constraint>
        <key value="-erp-angabePatientenPLZPflicht" />
        <severity value="error" />
        <human value="In der Ressource vom Typ Patient ist keine Postleitzahl vorhanden, diese ist aber eine Pflichtangabe bei den Kostentraegern der Typen Typ &quot;GKV&quot;, &quot;PKV&quot;, &quot;BG&quot;, &quot;SKT&quot; oder &quot;UK&quot; falls der Wohnsitzländercode der Versichertenanschrift den Wert &quot;D&quot; hat." />
        <expression value="(entry.where(resource is Patient).resource.address.country.exists() and entry.where(resource is Patient).resource.address.country = 'D' and (entry.where(resource is Coverage).resource.type.coding.code='GKV' or entry.where(resource is Coverage).resource.type.coding.code='BG' or entry.where(resource is Coverage).resource.type.coding.code='UK' or entry.where(resource is Coverage).resource.type.coding.code='PKV' or entry.where(resource is Coverage).resource.type.coding.code='SKT')) implies entry.where(resource is Patient).resource.address.postalCode.exists()" />
      </constraint>
      <constraint>
        <key value="-erp-angabePatientenAdressePflicht" />
        <severity value="error" />
        <human value="In der Ressource vom Typ Patient ist keine Adresse vorhanden, diese ist aber eine Pflichtangabe." />
        <expression value="entry.where(resource is Patient).exists() implies entry.where(resource is Patient).resource.address.exists()" />
      </constraint>
      <constraint>
        <key value="-erp-angabeRechtsgrundlagePflicht" />
        <severity value="error" />
        <human value="In der Ressource vom Typ Composition ist keine Rechtsgrundlage vorhanden, diese ist aber eine Pflichtangabe bei den Kostentraegern der Typen &quot;GKV&quot;, &quot;PKV&quot;, &quot;BG&quot;, &quot;SKT&quot; oder &quot;UK&quot; ein Pflichtelement." />
        <expression value="(entry.where(resource is MedicationRequest).exists() and entry.where(resource is Composition).exists() and entry.where(resource is Coverage).exists() and (entry.where(resource is Coverage).resource.type.coding.code='GKV' or entry.where(resource is Coverage).resource.type.coding.code='PKV'or entry.where(resource is Coverage).resource.type.coding.code='BG' or entry.where(resource is Coverage).resource.type.coding.code='SKT' or entry.where(resource is Coverage).resource.type.coding.code='UK')) implies entry.where(resource is Composition).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_Legal_basis').exists()" />
      </constraint>
      <constraint>
        <key value="-erp-angabeZuzahlungsstatusPflicht" />
        <severity value="error" />
        <human value="In der Ressource vom Typ Coverage ist kein Zuzahlungsstatus vorhanden, dieser ist aber eine Pflichtangabe bei den Kostentraegern der Typen &quot;GKV&quot; &quot;SKT&quot;, &quot;BG&quot; oder &quot;UK&quot;" />
        <expression value="(entry.where(resource is MedicationRequest).exists() and entry.where(resource is Coverage).exists() and (entry.where(resource is Coverage).resource.type.coding.code='GKV' or entry.where(resource is Coverage).resource.type.coding.code='BG' or entry.where(resource is Coverage).resource.type.coding.code='SKT' or entry.where(resource is Coverage).resource.type.coding.code='UK')) implies entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_StatusCoPayment').exists()" />
      </constraint>
      <constraint>
        <key value="-erp-angabeIdentifikatorAusstellendePersonPflicht" />
        <severity value="error" />
        <human value="In der Ressource vom Typ Practitioner ist der Identifikator der ausstellenden oder verschreibenden Person nicht vorhanden, dieser ist aber eine Pflichtangabe bei den Kostentraegern der Typen &quot;GKV&quot;, &quot;BG&quot;, &quot;SKT&quot;, &quot;UK&quot; oder &quot;PKV&quot;, wenn es sich um einen Arzt, Zahnarzt oder Arzt als Vertreter handelt und keine ASV-Fachgruppennummer angegeben ist." />
        <expression value="entry.where(resource is Practitioner).exists() and entry.where(resource is Coverage).exists() and (entry.where(resource is Coverage).resource.type.coding.code='GKV' or entry.where(resource is Coverage).resource.type.coding.code='BG' or entry.where(resource is Coverage).resource.type.coding.code='SKT' or entry.where(resource is Coverage).resource.type.coding.code='UK' or entry.where(resource is Coverage).resource.type.coding.code='PKV') and entry.where(resource is Composition).resource.author.reference.exists() and entry.where(resource is Composition).resource.author.reference.resolve().qualification.code.coding.where(system='https://fhir.kbv.de/CodeSystem/KBV_CS_FOR_Qualification_Type').all($this.code='00' or $this.code='01' or $this.code='04') implies entry.where(resource is Composition).resource.author.reference.resolve().identifier.exists() or entry.where(resource is Composition).resource.author.reference.resolve().qualification.code.coding.where(system='https://fhir.kbv.de/NamingSystem/KBV_NS_FOR_Fachgruppennummer_ASV').code.exists()" />
      </constraint>
      <constraint>
        <key value="-erp-angabeVerantwortlichePersonVerbot-1" />
        <severity value="error" />
        <human value="Eine Ressource vom Typ Practitioner wird als verantwortliche Person angegeben, diese darf aber nur angegeben werden, wenn es sich bei der ausstellenden Person um einen Arzt in Weiterbildung oder Arzt als Vertreter handelt." />
        <expression value="entry.where(resource is Composition).resource.attester.party.reference.exists() implies entry.where(resource is Composition).resource.author.reference.resolve().qualification.code.coding.where(system='https://fhir.kbv.de/CodeSystem/KBV_CS_FOR_Qualification_Type').all($this.code='03' or $this.code='04')" />
      </constraint>
      <constraint>
        <key value="-erp-angabeVerantwortlichePersonVerbot-2" />
        <severity value="error" />
        <human value="Eine Ressource vom Typ Practitioner wird als verantwortliche Person angegeben, diese darf aber nur angegeben werden, wenn es sich nicht um eine Hebamme oder einen Arzt in Weiterbildung handelt." />
        <expression value="entry.where(resource is Composition).resource.attester.party.reference.exists() implies entry.where(resource is Composition).resource.attester.party.reference.resolve().qualification.code.coding.where(system='https://fhir.kbv.de/CodeSystem/KBV_CS_FOR_Qualification_Type').all($this.code!='02' and $this.code!='03')" />
      </constraint>
      <constraint>
        <key value="-erp-angabeIdentifikatorVerantwortlichePersonPflicht" />
        <severity value="error" />
        <human value="In der Ressource vom Typ Practitioner ist der Identifikator der verantwortlichen Person nicht vorhanden, dieser ist aber eine Pflichtangabe bei den Kostentraegern der Typen &quot;GKV&quot;, &quot;BG&quot;, &quot;SKT&quot; oder &quot;UK&quot;, wenn es sich um einen Arzt, Zahnarzt oder Arzt als Vertreter handelt und keine ASV-Fachgruppennummer angegeben ist." />
        <expression value="entry.where(resource is Practitioner).exists() and entry.where(resource is Coverage).exists() and (entry.where(resource is Coverage).resource.type.coding.code='GKV' or entry.where(resource is Coverage).resource.type.coding.code='BG' or entry.where(resource is Coverage).resource.type.coding.code='SKT' or entry.where(resource is Coverage).resource.type.coding.code='UK') and entry.where(resource is Composition).resource.attester.party.reference.exists() and entry.where(resource is Composition).resource.attester.party.reference.resolve().qualification.code.coding.where(system='https://fhir.kbv.de/CodeSystem/KBV_CS_FOR_Qualification_Type').all($this.code='00' or $this.code='01' or $this.code='04') implies entry.where(resource is Composition).resource.attester.party.reference.resolve().identifier.exists() or entry.where(resource is Composition).resource.attester.party.reference.resolve().qualification.code.coding.where(system='https://fhir.kbv.de/NamingSystem/KBV_NS_FOR_Fachgruppennummer_ASV').code.exists()" />
      </constraint>
      <constraint>
        <key value="-erp-angabeVerantwortlichePersonPflicht" />
        <severity value="error" />
        <human value="Es wird keine Ressource vom Typ Practitioner als verantwortliche Person angegeben, dies ist aber eine Pflichtangabe, wenn es sich bei der ausstellenden oder verschreibenden Person um einen Arzt in Weiterbildung ohne Identifikator handelt." />
        <expression value="entry.where(resource is Composition).resource.author.reference.resolve().qualification.code.coding.where(system='https://fhir.kbv.de/CodeSystem/KBV_CS_FOR_Qualification_Type').all($this.code='03') and entry.where(resource is Composition).resource.author.reference.resolve().identifier.exists().not() implies entry.where(resource is Composition).resource.attester.party.exists()" />
      </constraint>
      <constraint>
        <key value="-erp-angabeFachgruppennummerAsvAusstellendePersonVerbot" />
        <severity value="error" />
        <human value="In einer Ressource vom Typ Practitioner ist eine ASV-Fachgruppennummer der ausstellenden Person vorhanden, diese darf aber nur angegeben werden, wenn die Rechtsgrundlage den Wert &quot;01&quot; oder &quot;11&quot; besitzt und wenn es sich um einen Arzt oder Arzt als Vertreter handelt, für den kein Identifikator angegeben ist." />
        <expression value="entry.where(resource is Composition).resource.author.reference.resolve().qualification.where(code.coding.system='https://fhir.kbv.de/NamingSystem/KBV_NS_FOR_Fachgruppennummer_ASV').exists() and entry.where(resource is Composition).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_Legal_basis').exists() implies entry.where(resource is Composition).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_Legal_basis').all(($this.value as Coding).code='01' or ($this.value as Coding).code='11') and entry.where(resource is Composition).resource.author.reference.resolve().qualification.code.coding.where(system='https://fhir.kbv.de/CodeSystem/KBV_CS_FOR_Qualification_Type').all($this.code='00' or $this.code='04') and entry.where(resource is Composition).resource.author.reference.resolve().identifier.exists().not()" />
      </constraint>
      <constraint>
        <key value="-erp-angabeFachgruppennummerAsvVerantwortlichePersonVerbot" />
        <severity value="error" />
        <human value="In einer Ressource vom Typ Practitioner ist eine ASV-Fachgruppennummer der verantwortlichen Person vorhanden, diese darf aber nur angegeben werden, wenn die Rechtsgrundlage den Wert &quot;01&quot; oder &quot;11&quot; besitzt und wenn es sich um einen Arzt oder Arzt als Vertreter handelt, für den kein Identifikator angegeben ist." />
        <expression value="entry.where(resource is Composition).resource.attester.exists() and entry.where(resource is Composition).resource.attester.party.reference.resolve().qualification.where(code.coding.system='https://fhir.kbv.de/NamingSystem/KBV_NS_FOR_Fachgruppennummer_ASV').exists() and entry.where(resource is Composition).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_Legal_basis').exists() implies entry.where(resource is Composition).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_Legal_basis').all(($this.value as Coding).code='01' or ($this.value as Coding).code='11') and entry.where(resource is Composition).resource.attester.party.reference.resolve().qualification.code.coding.where(system='https://fhir.kbv.de/CodeSystem/KBV_CS_FOR_Qualification_Type').all($this.code='00' or $this.code='04') and entry.where(resource is Composition).resource.attester.party.reference.resolve().identifier.exists().not()" />
      </constraint>
      <constraint>
        <key value="-erp-referenzAufAusstellendePerson-1" />
        <severity value="error" />
        <human value="In der Ressource vom Typ MedicationRequest oder SupplyRequest zeigt die Referenz nicht auf die Ressource vom Typ Practitioner fuer die ausstellende/verschreibende Person." />
        <expression value="entry.where(resource is Composition).resource.author.reference = entry.where(resource is MedicationRequest).resource.requester.reference or entry.where(resource is Composition).resource.author.reference = entry.where(resource is SupplyRequest).resource.requester.reference" />
      </constraint>
      <constraint>
        <key value="-erp-referenzAufAusstellendePerson-2" />
        <severity value="error" />
        <human value="In der Ressource vom Typ PractitionerRole mit einer ASV-Teamnummer zeigt die Referenz nicht auf die Ressource vom Typ Practitioner für die ausstellende/verschreibende Person." />
        <expression value="entry.where(resource is Composition).exists() and entry.where(resource is PractitionerRole).exists() implies entry.where(resource is PractitionerRole).resource.practitioner.reference.distinct()=entry.where(resource is Composition).resource.author.reference" />
      </constraint>
      <constraint>
        <key value="-erp-referenzAufPatientInCoverage" />
        <severity value="error" />
        <human value="In der Ressource vom Typ Coverage zeigt die Referenz der begünstigten Person nicht auf die Ressource vom Typ Patient, die sich im Bundle befindet." />
        <expression value="entry.where(resource is Patient).fullUrl.contains(entry.where(resource is Coverage).resource.beneficiary.reference)" />
      </constraint>
      <constraint>
        <key value="-erp-referenzAufPatientInMedicationRequest" />
        <severity value="error" />
        <human value="In der Ressource vom Typ MedicationRequest zeigt die Referenz der Person, für die Medikation verordnet wurde, nicht auf die Ressource vom Typ Patient, die sich im Bundle befindet." />
        <expression value="entry.where(resource is Patient).fullUrl.contains(entry.where(resource is MedicationRequest).resource.subject.reference)" />
      </constraint>
      <constraint>
        <key value="-erp-referenzAufCoverageInMedicationRequest" />
        <severity value="error" />
        <human value="In der Ressource vom Typ MedicationRequest zeigt die Referenz der Versicherung nicht auf die Ressource vom Typ Coverage, die sich im Bundle befindet." />
        <expression value="entry.where(resource is Coverage).fullUrl.contains(entry.where(resource is MedicationRequest).resource.insurance.reference)" />
      </constraint>
      <constraint>
        <key value="-erp-angabeIdentifikatorEinrichtungPflicht" />
        <severity value="error" />
        <human value="In einer Ressource vom Typ Organization ist kein Identifikator der Einrichtung (z.B. Betriebsstaettennummer) vorhanden, diese ist aber eine Pflichtangabe bei den Kostentraegern der Typen &quot;GKV&quot;, &quot;PKV&quot;, &quot;BG&quot;, &quot;SKT&quot; oder &quot;UK&quot;, wenn es sich bei der austellenden/verschreibenden Person um einen Arzt, Zahnarzt, Arzt in Weiterbildung oder Arzt als Vertreter handelt." />
        <expression value="entry.where(resource is Organization).exists() and entry.where(resource is Coverage).exists() and (entry.where(resource is Coverage).resource.type.coding.code='GKV' or entry.where(resource is Coverage).resource.type.coding.code='BG' or entry.where(resource is Coverage).resource.type.coding.code='SKT' or entry.where(resource is Coverage).resource.type.coding.code='UK' or entry.where(resource is Coverage).resource.type.coding.code='PKV') and entry.where(resource is Composition).resource.author.reference.exists() and entry.where(resource is Composition).resource.author.reference.resolve().qualification.code.coding.where(system='https://fhir.kbv.de/CodeSystem/KBV_CS_FOR_Qualification_Type').all($this.code='00' or $this.code='01' or $this.code='03' or $this.code='04') implies entry.where(resource is Organization).resource.identifier.exists()" />
      </constraint>
      <constraint>
        <key value="-erp-angabeSubstitutionPflicht" />
        <severity value="error" />
        <human value="In der Ressource vom Typ MedicationRequest ist das Kennzeichen Autidem (substitution.allowedBoolean) nicht vorhanden, dies ist aber eine Pflichtangabe bei einer PZN-, Rezeptur- oder Freitext-Verordnung." />
        <expression value="entry.where(resource is MedicationRequest).exists() and (entry.where(resource is Medication).resource.code.coding.system ='http://fhir.de/CodeSystem/ifa/pzn' or entry.where(resource is Medication).resource.code.coding.code ='rezeptur' or entry.where(resource is Medication).resource.code.coding.code ='freitext') implies entry.where(resource is MedicationRequest).resource.substitution.exists()" />
      </constraint>
      <constraint>
        <key value="-erp-angabeSubstitutionVerbot" />
        <severity value="error" />
        <human value="In der Ressource vom Typ MedicationRequest ist das Kennzeichen Autidem (substitution.allowedBoolean) vorhanden, dies ist aber bei einer Wirkstoff-Verordnung nicht erlaubt." />
        <expression value="entry.where(resource is MedicationRequest).exists() and entry.where(resource is Medication).resource.code.coding.code ='wirkstoff' implies entry.where(resource is MedicationRequest).resource.substitution.exists().not()" />
      </constraint>
      <constraint>
        <key value="-erp-angabeIKKostentraegerPflicht" />
        <severity value="error" />
        <human value="In der Ressource vom Typ Coverage ist kein IK des Kostenträgers vorhanden, dies ist aber eine Pflichtangabe bei Kostenträgern vom Typ &quot;BG&quot; oder &quot;UK&quot;," />
        <expression value="(entry.where(resource is Coverage).exists() and (entry.where(resource is Coverage).resource.type.coding.code='BG' or entry.where(resource is Coverage).resource.type.coding.code='UK')) implies  entry.select(resource as Coverage).payor.identifier.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_Alternative_IK').exists()" />
      </constraint>
      <constraint>
        <key value="-erp-angabePatientenIdentifikatorPflicht" />
        <severity value="error" />
        <human value="Wenn eine Ressource vom Typ Patient existiert, muss ein Identifikator des Versicherten angegeben werden." />
        <expression value="entry.where(resource is Patient).exists() implies entry.where(resource is Patient).resource.identifier.exists()" />
      </constraint>
      <constraint>
        <key value="-erp-angabeVersichertenIDPflicht" />
        <severity value="error" />
        <human value="In der Ressource vom Typ Patient ist keine VersichertenID vorhanden, diese ist aber eine Pflichtangabe bei Kostenträgern des Typs &quot;GKV&quot;, &quot;PKV&quot; oder &quot;SKT&quot;, falls ein Identifikator des Patienten angegeben ist." />
        <expression value="entry.where(resource is Coverage).exists() and entry.where(resource is Coverage).resource.type.coding.all($this.code='GKV' or $this.code='PKV' or $this.code='SKT') and entry.where(resource is Patient).resource.identifier.exists() implies entry.where(resource is Patient).resource.identifier.type.coding.exists(code='KVZ10')" />
      </constraint>
      <constraint>
        <key value="-erp-angabeKVKVersichertennummerVerbot" />
        <severity value="error" />
        <human value="In der Ressource vom Typ Patient ist eine KVK-Versichertennummer vorhanden, diese darf nicht angegeben werden." />
        <expression value="entry.where(resource is Patient).exists() and entry.where(resource is Patient).resource.identifier.exists() implies entry.where(resource is Patient).resource.identifier.type.coding.code!='kvk'" />
      </constraint>
      <constraint>
        <key value="-erp-angabePKVTarifVerbot" />
        <severity value="error" />
        <human value="In der Ressource vom Typ Composition ist ein PKV-Tarif angegeben, dies darf aber nur bei einem Kostenträger vom Typ &quot;PKV&quot; erfolgen." />
        <expression value="entry.where(resource is Coverage).exists() and entry.where(resource is Coverage).resource.type.coding.code!='PKV' implies entry.where(resource is Composition).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_PKV_Tariff').exists().not()" />
      </constraint>
      <constraint>
        <key value="-erp-angabeUnfallkennzeichenArbeitsunfallBerufskrankheitVerbot" />
        <severity value="error" />
        <human value="In der Ressource vom Typ MedicationRequest ist das Unfallkennzeichen für einen Arbeitsunfall oder Berufskrankheit angegeben, dies darf aber nur bei einem Kostentraeger vom Typ &quot;BG&quot; oder &quot;UK&quot; erfolgen." />
        <expression value="(entry.where(resource is MedicationRequest).exists().not()) or entry.where(resource is MedicationRequest).exists() and entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_Accident').exists().not() or (entry.where(resource is Coverage).exists() and ((entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_Accident').extension('Unfallkennzeichen').value as Coding).code='2' or(entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_Accident').extension('Unfallkennzeichen').value as Coding).code='4') implies (entry.where(resource is Coverage).resource.type.coding.code='BG' or entry.where(resource is Coverage).resource.type.coding.code='UK'))" />
      </constraint>
      <constraint>
        <key value="-erp-angabeUnfallkennzeichenArbeitsunfallBerufskrankheitPflicht" />
        <severity value="error" />
        <human value="In der Ressource vom Typ MedicationRequest ist kein Unfallkennzeichen für einen Arbeitsunfall oder Berufskrankheit angegeben, dies muss jedoch bei einem Kostentraeger vom Typ &quot;BG&quot; oder &quot;UK&quot; erfolgen." />
        <expression value="entry.where(resource is MedicationRequest).exists() and entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_Accident').exists().not() or entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_Accident').exists() and ((entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_Accident').extension('Unfallkennzeichen').value as Coding).code!='2' and (entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_Accident').extension('Unfallkennzeichen').value as Coding).code!='4') implies entry.where(resource is Coverage).resource.type.coding.code!='BG' and entry.where(resource is Coverage).resource.type.coding.code!='UK'" />
      </constraint>
      <constraint>
        <key value="-erp-angabeUnfallkennzeichenUnfallVerbot" />
        <severity value="error" />
        <human value="In der Ressource vom Typ MedicationRequest ist das Unfallkennzeichen für einen Unfall angegeben, dies darf aber nicht bei einem Kostentraeger vom Typ &quot;BG&quot; oder &quot;UK&quot; erfolgen." />
        <expression value="entry.where(resource is MedicationRequest).exists() and entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_Accident').exists().not() or (entry.where(resource is Coverage).exists() and (entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_Accident').extension('Unfallkennzeichen').value as Coding).code='1' implies (entry.where(resource is Coverage).resource.type.coding.code!='BG' and entry.where(resource is Coverage).resource.type.coding.code!='UK'))" />
      </constraint>
      <constraint>
        <key value="-erp-angabeUnfallkennzeichenZuzahlungsbefreiung" />
        <severity value="error" />
        <human value="Wenn das Ausstellen eines E-Rezeptes im Rahmen eines Arbeitsunfalls (Unfallkennzeichen = 2) oder einer Berufskrankheit (Unfallkennzeichen = 4) geschieht, dann muss der Versicherte von der Zuzahlungspflicht befreit sein (Zuzahlungsstatus = 1)." />
        <expression value="entry.where(resource is MedicationRequest).exists() and entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_Accident').exists() and ((entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_Accident').extension('Unfallkennzeichen').value as Coding).code = '2' or (entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_Accident').extension('Unfallkennzeichen').value as Coding).code = '4') implies (entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_StatusCoPayment').exists() and (entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_StatusCoPayment').value as Coding).code = '1')" />
      </constraint>
      <constraint>
        <key value="-erp-angabeZuzahlungsbefreiungSER" />
        <severity value="error" />
        <human value="Wenn die SER Kennzeichnung auf true gesetzt ist, dann muss der Versicherte von der Zuzahlungspflicht befreit sein (Zuzahlungsstatus = 1)" />
        <expression value="entry.where(resource is MedicationRequest).exists() and (entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_SER').value as boolean)=true implies (entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_StatusCoPayment').exists() and (entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_StatusCoPayment').value as Coding).code = '1')" />
      </constraint>
      <constraint>
        <key value="-erp-geburtsdatumPatient" />
        <severity value="error" />
        <human value="Das Geburtsdatum des Patienten darf nicht nach dem Ausstellungsdatum liegen." />
        <expression value="entry.where(resource is Patient).exists() and entry.where(resource is Patient).resource.birthDate.extension.exists().not() and entry.where(resource is MedicationRequest).resource.authoredOn.exists() implies entry.where(resource is Patient).resource.birthDate.toString() = entry.where(resource is MedicationRequest).resource.authoredOn.toString().substring(0,4) or entry.where(resource is Patient).resource.birthDate.toString() = entry.where(resource is MedicationRequest).resource.authoredOn.toString().substring(0,7) or entry.where(resource is Patient).resource.birthDate &lt;= entry.where(resource is MedicationRequest).resource.authoredOn" />
      </constraint>
      <constraint>
        <key value="-erp-angabeAsvTeamnummerPflicht" />
        <severity value="error" />
        <human value="Es ist keine Ressource vom Typ PractitionerRole mit einer ASV-Teamnummer der ausstellenden Person zugeordnet, obwohl in der Ressource vom Typ Composition die Rechtsgrundlage den Wert &quot;01&quot; oder &quot;11&quot; besitzt." />
        <expression value="entry.where(resource is Composition).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_Legal_basis').exists() and entry.where(resource is Composition).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_Legal_basis').all(($this.value as Coding).code='01' or ($this.value as Coding).code='11') implies entry.where(resource is Composition).resource.section.code.coding.where(code='FOR_PractitionerRole').exists()" />
      </constraint>
      <constraint>
        <key value="-erp-angabeAsvTeamnummerVerbot" />
        <severity value="error" />
        <human value="Es ist eine Ressource vom Typ PractitionerRole mit einer ASV-Teamnummer der ausstellenden Person zugeordnet, obwohl in der Ressource vom Typ Composition die Rechtsgrundlage nicht den Wert &quot;01&quot; oder &quot;11&quot; besitzt." />
        <expression value="entry.where(resource is Composition).resource.section.code.coding.where(code='FOR_PractitionerRole').exists() implies entry.where(resource is Composition).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_Legal_basis').exists() and entry.where(resource is Composition).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_Legal_basis').all(($this.value as Coding).code='01' or ($this.value as Coding).code='11')" />
      </constraint>
      <constraint>
        <key value="-erp-angabeKennzeichenDosierungRezepturTrue" />
        <severity value="error" />
        <human value="Bei einer Rezepturverordnung muss eine Dosierung angegeben werden. Daher muss der Wert für Kennzeichen Dosierung in der Ressource vom Typ MedicationRequest auf true gesetzt sein." />
        <expression value="entry.where(resource is MedicationRequest).exists() and entry.where(resource is Medication).resource.code.coding.code='rezeptur' implies (entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_DosageFlag').value as boolean)=true" />
      </constraint>
      <constraint>
        <key value="-erp-entwederPrescriptionOderPracticeSupply" />
        <severity value="error" />
        <human value="Es ist sowohl eine Ressouce vom Typ MedicationRequest als auch vom Typ SupplyRequest vorhanden, es ist aber nur eine von beiden zulässig." />
        <expression value="entry.where(resource is MedicationRequest).exists() xor entry.where(resource is SupplyRequest).exists()" />
      </constraint>
      <constraint>
        <key value="-erp-anzahlMedication" />
        <severity value="error" />
        <human value="Es muss genau eine Ressource vom Typ Medication vorhanden sein." />
        <expression value="entry.where(resource is Medication).count()=1" />
      </constraint>
      <constraint>
        <key value="-erp-multiplePrescriptionEinloesefristBeginn" />
        <severity value="error" />
        <human value="Der Beginn der Einlösefrist darf nicht vor dem Ausstellungsdatum liegen." />
        <expression value="entry.where(resource is MedicationRequest).exists() and entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Multiple_Prescription').exists() and (entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Multiple_Prescription').extension('Kennzeichen').value as boolean)=true and entry.where(resource is MedicationRequest).resource.authoredOn.exists() implies entry.where(resource is MedicationRequest).resource.authoredOn &lt;= entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Multiple_Prescription').extension('Zeitraum').value.start" />
      </constraint>
      <constraint>
        <key value="-erp-angabeImpfstoffRezepturFalse" />
        <severity value="error" />
        <human value="Da es sich bei einer Rezepturverordnung nicht um einen Impfstoff handeln darf, muss der Wert für Impfstoff in der Ressource vom Typ Medication auf false gesetzt sein." />
        <expression value="entry.where(resource is Medication).resource.code.coding.code='rezeptur' implies (entry.where(resource is Medication).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Vaccine').value as boolean)=false" />
      </constraint>
      <constraint>
        <key value="-erp-angabeErsatzverordnungVerbot" />
        <severity value="error" />
        <human value="Die Angabe des Ersatzverordnungskennzeichens ist bei Freitextverordnung, Wirkstoffverordnung und Rezepturverordnung verboten und nur bei einer PZN-Verordnung erlaubt." />
        <expression value="entry.where(resource is Composition).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_Legal_basis').exists() and entry.where(resource is Composition).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_Legal_basis').all(($this.value as Coding).code='10' or ($this.value as Coding).code='11' or ($this.value as Coding).code='14' or ($this.value as Coding).code='17') implies entry.where(resource is Medication).resource.code.coding.system ='http://fhir.de/CodeSystem/ifa/pzn'" />
      </constraint>
      <constraint>
        <key value="-erp-angabeErsatzverordnungZuzahlungsbefreiungPflicht" />
        <severity value="error" />
        <human value="Wenn ein Ersatzverordnungskennzeichen gesetzt ist, dann muss der Versicherte von der Zuzahlungspflicht befreit sein (Zuzahlungsstatus = 1)." />
        <expression value="entry.where(resource is MedicationRequest).exists() and entry.where(resource is Composition).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_Legal_basis').exists() and entry.where(resource is Composition).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_Legal_basis').all(($this.value as Coding).code='10' or ($this.value as Coding).code='11' or ($this.value as Coding).code='14' or ($this.value as Coding).code='17') implies (entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_StatusCoPayment').exists() and (entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_StatusCoPayment').value as Coding).code = '1')" />
      </constraint>
      <constraint>
        <key value="-erp-angabeBtMAngabenVerbot" />
        <severity value="error" />
        <human value="Wenn es sich nicht um eine Verordnung von Betäubungsmitteln handelt, dürfen BtM-Angaben nicht vorhanden sein." />
        <expression value="entry.where(resource is MedicationRequest).exists() and (entry.where(resource is Medication).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Category').value as Coding).code!='01' implies entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Narcotic').exists().not()" />
      </constraint>
      <constraint>
        <key value="-erp-angabeT-RezeptAngabenVerbot" />
        <severity value="error" />
        <human value="Wenn es sich nicht um eine Verordnung von T-Arzneimitteln handelt, dürfen T-Rezept-Angaben nicht vorhanden sein." />
        <expression value="entry.where(resource is MedicationRequest).exists() and (entry.where(resource is Medication).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Category').value as Coding).code!='02' implies entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Teratogenic').exists().not()" />
      </constraint>
      <constraint>
        <key value="-erp-angabeT-RezeptAngabenPflicht" />
        <severity value="error" />
        <human value="Wenn es sich um eine Verordnung von T-Arzneimitteln handelt, müssen die T-Rezept-Angaben vorhanden sein." />
        <expression value="entry.where(resource is MedicationRequest).exists() and (entry.where(resource is Medication).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Category').value as Coding).code='02' implies entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Teratogenic').exists()" />
      </constraint>
      <constraint>
        <key value="-erp-angabeImpfstoffBtMT-RezeptFalse" />
        <severity value="error" />
        <human value="Da es sich bei der Verordnung eines Betäubungsmittels bzw. T-Arzneimittels nicht um einen Impfstoff handeln darf, muss der Wert für Impfstoff in der Ressource vom Typ Medication auf false gesetzt sein." />
        <expression value="entry.where(resource is MedicationRequest).exists() and entry.where(resource is Medication).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Category').all(($this.value as Coding).code='01' or ($this.value as Coding).code='02') implies (entry.where(resource is Medication).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Vaccine').value as boolean)=false" />
      </constraint>
      <constraint>
        <key value="-erp-angabeKennzeichenMehrfachverordnungBtMT-RezeptFalse" />
        <severity value="error" />
        <human value="Da es sich bei der Verordnung eines Betäubungsmittels bzw. T-Arzneimittels nicht um eine Mehrfachverordnung handeln darf, muss der Wert für Kennzeichen Mehrfachverordnung in der Ressource vom Typ MedicationRequest auf false gesetzt sein." />
        <expression value="entry.where(resource is MedicationRequest).exists() and entry.where(resource is Medication).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Category').all(($this.value as Coding).code='01' or ($this.value as Coding).code='02') implies (entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Multiple_Prescription').extension('Kennzeichen').value as boolean)=false" />
      </constraint>
      <constraint>
        <key value="-erp-angabeMengeBtMPflicht" />
        <severity value="error" />
        <human value="Bei der Verordnung eines Betäubungsmittels müssen die Packungsgröße nach abgeteilter Menge und die Einheit in der Ressource vom Typ Medication angegeben werden, sofern es sich nicht um eine Freitextverordnung handelt." />
        <expression value="entry.where(resource is MedicationRequest).exists() and (entry.where(resource is Medication).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Category').value as Coding).code='01' and entry.where(resource is Medication).resource.code.coding.code!='freitext' implies entry.where(resource is Medication).resource.amount.exists()" />
      </constraint>
      <constraint>
        <key value="-erp-angabeReichdauerBtMSubstitutionsmittelPflicht" />
        <severity value="error" />
        <human value="Bei der Verordnung eines Betäubungsmittels mit dem Sonderkennzeichen 'ST' muss die Reichdauer des Substitutionsmittels in der Ressource vom Typ MedicationRequest angegeben werden." />
        <expression value="entry.where(resource is MedicationRequest).exists() and (entry.where(resource is Medication).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Category').value as Coding).code='01' and entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Narcotic').extension('BtM-Sonderkennzeichen').exists() and (entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Narcotic').extension('BtM-Sonderkennzeichen').value as Coding).code='ST' implies entry.where(resource is MedicationRequest).resource.dispenseRequest.expectedSupplyDuration.exists()" />
      </constraint>
      <constraint>
        <key value="-erp-angabeZahnarztHebammeT-RezeptVerbot" />
        <severity value="error" />
        <human value="Wenn es sich um ein T-Rezept handelt, darf die ausstellende / verschreibende Person kein Zahnarzt und keine Hebamme sein." />
        <expression value="(entry.where(resource is Medication).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Category').value as Coding).code='02' implies entry.where(resource is Composition).resource.author.reference.resolve().qualification.code.coding.where(system='https://fhir.kbv.de/CodeSystem/KBV_CS_FOR_Qualification_Type').all($this.code!='01' and $this.code!='02')" />
      </constraint>
      <constraint>
        <key value="-erp-angabeUnfallinformationenT-RezeptVerbot" />
        <severity value="error" />
        <human value="Wenn es sich um ein T-Rezept handelt, dürfen keine Unfallinformationen angegeben werden." />
        <expression value="entry.where(resource is MedicationRequest).exists() and (entry.where(resource is Medication).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Category').value as Coding).code='02' implies entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_FOR_Accident').exists().not()" />
      </constraint>
      <constraint>
        <key value="-erp-angabeReichdauerVerbot" />
        <severity value="error" />
        <human value="Die Reichdauer darf nur angegeben werden, wenn es sich um ein T-Rezept oder ein BtM-Rezept für ein Substitutionsmittel (Sonderkennzeichen 'S' oder 'ST') handelt." />
        <expression value="entry.where(resource is MedicationRequest).exists() and entry.where(resource is MedicationRequest).resource.dispenseRequest.expectedSupplyDuration.exists() implies (entry.where(resource is Medication).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Category').value as Coding).code='02' or ((entry.where(resource is Medication).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Category').value as Coding).code='01' and (entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Narcotic').extension('BtM-Sonderkennzeichen').all(($this.value as Coding).code='S' or ($this.value as Coding).code='ST')))" />
      </constraint>
      <constraint>
        <key value="-erp-angabeReichdauerT-RezeptPflicht" />
        <severity value="error" />
        <human value="Die Reichdauer muss angegeben werden, wenn es sich um ein T-Rezept handelt." />
        <expression value="entry.where(resource is MedicationRequest).exists() and (entry.where(resource is Medication).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Category').value as Coding).code='02' implies entry.where(resource is MedicationRequest).resource.dispenseRequest.expectedSupplyDuration.exists()" />
      </constraint>
      <constraint>
        <key value="-erp-angabeReichdauerT-RezeptEinheit" />
        <severity value="error" />
        <human value="Die Reicherdauer bei einem T-Rezept muss in Wochen angegeben werden." />
        <expression value="entry.where(resource is MedicationRequest).exists() and entry.where(resource is MedicationRequest).resource.dispenseRequest.expectedSupplyDuration.exists() and (entry.where(resource is Medication).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Category').value as Coding).code='02' implies entry.where(resource is MedicationRequest).resource.dispenseRequest.expectedSupplyDuration.unit='Woche(n)'" />
      </constraint>
      <constraint>
        <key value="-erp-angabeReichdauerT-RezeptMaximalwert" />
        <severity value="error" />
        <human value="Die Reichdauer bei einem T-Rezept für eine gebärfähige Frau darf den Wert von 4 Wochen nicht übersteigen. Grundsätzlich darf die Reichdauer bei einem T-Rezept den Wert von 12 Wochen nicht übersteigen." />
        <expression value="entry.where(resource is MedicationRequest).exists() and entry.where(resource is MedicationRequest).resource.dispenseRequest.expectedSupplyDuration.exists() and (entry.where(resource is Medication).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Category').value as Coding).code='02' and entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Teratogenic').exists() implies (((entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Teratogenic').extension('GebaerfaehigeFrau').value as boolean)=false and entry.where(resource is MedicationRequest).resource.dispenseRequest.expectedSupplyDuration.value &lt;= 12) xor ((entry.where(resource is MedicationRequest).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Teratogenic').extension('GebaerfaehigeFrau').value as boolean)=true and entry.where(resource is MedicationRequest).resource.dispenseRequest.expectedSupplyDuration.value &lt;= 4))" />
      </constraint>
      <constraint>
        <key value="-erp-angabeReichdauerBtM-RezeptEinheit" />
        <severity value="error" />
        <human value="Sofern die Reicherdauer bei einem BtM-Rezept angegeben wird, muss diese in Tagen angegeben werden." />
        <expression value="entry.where(resource is MedicationRequest).exists() and entry.where(resource is MedicationRequest).resource.dispenseRequest.expectedSupplyDuration.exists() and (entry.where(resource is Medication).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Category').value as Coding).code='01' implies entry.where(resource is MedicationRequest).resource.dispenseRequest.expectedSupplyDuration.unit='Tag(e)'" />
      </constraint>
      <constraint>
        <key value="-erp-angabeReichdauerBtM-RezeptMaximalwert" />
        <severity value="error" />
        <human value="Die Reichdauer bei einem BtM-Rezept darf den Wert von 30 Tagen nicht übersteigen." />
        <expression value="entry.where(resource is MedicationRequest).exists() and entry.where(resource is MedicationRequest).resource.dispenseRequest.expectedSupplyDuration.exists() and (entry.where(resource is Medication).resource.extension('https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_Medication_Category').value as Coding).code='01' implies entry.where(resource is MedicationRequest).resource.dispenseRequest.expectedSupplyDuration.value &lt;= 30" />
      </constraint>
    </element>
    <element id="Bundle.id">
      <path value="Bundle.id" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.meta">
      <path value="Bundle.meta" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.meta.versionId">
      <path value="Bundle.meta.versionId" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.meta.lastUpdated">
      <path value="Bundle.meta.lastUpdated" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.meta.source">
      <path value="Bundle.meta.source" />
      <max value="0" />
    </element>
    <element id="Bundle.meta.profile">
      <path value="Bundle.meta.profile" />
      <min value="1" />
      <max value="1" />
      <fixedCanonical value="https://fhir.kbv.de/StructureDefinition/KBV_PR_ERP_Bundle|1.4" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.meta.security">
      <path value="Bundle.meta.security" />
      <max value="0" />
    </element>
    <element id="Bundle.meta.tag">
      <path value="Bundle.meta.tag" />
      <max value="0" />
    </element>
    <element id="Bundle.implicitRules">
      <path value="Bundle.implicitRules" />
      <max value="0" />
    </element>
    <element id="Bundle.language">
      <path value="Bundle.language" />
      <max value="0" />
    </element>
    <element id="Bundle.identifier">
      <path value="Bundle.identifier" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.identifier.use">
      <path value="Bundle.identifier.use" />
      <max value="0" />
    </element>
    <element id="Bundle.identifier.type">
      <path value="Bundle.identifier.type" />
      <max value="0" />
    </element>
    <element id="Bundle.identifier.system">
      <path value="Bundle.identifier.system" />
      <definition value="Für den digitalen Vordruck &quot;Elektronische Arzneimittelverordnung (Vordruck e160)&quot; wird die Dokumenten-ID gemäß den Vorgaben der gematik gesetzt." />
      <min value="1" />
      <fixedUri value="https://gematik.de/fhir/erp/NamingSystem/GEM_ERP_NS_PrescriptionId" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.identifier.value">
      <path value="Bundle.identifier.value" />
      <short value="Dokumenten-ID" />
      <definition value="Eindeutige Identifikation des Dokuments, bzw. der Verordnung. Diese ID wird mit signiert und sichert damit die Verordnung vor Fälschungen.&#xD;&#xA;&#xD;&#xA;Für den digitalen Vordruck &quot;Elektronische Arzneimittelverordnung (Vordruck e160)&quot; wird die Dokumenten-ID gemäß den Vorgaben der gematik gesetzt." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.identifier.period">
      <path value="Bundle.identifier.period" />
      <max value="0" />
    </element>
    <element id="Bundle.identifier.assigner">
      <path value="Bundle.identifier.assigner" />
      <max value="0" />
    </element>
    <element id="Bundle.type">
      <path value="Bundle.type" />
      <fixedCode value="document" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.timestamp">
      <path value="Bundle.timestamp" />
      <definition value="DateTime wann das Dokument technisch erstellt wurde. &#xD;&#xA;Fachlich bildet das Ausstellungsdatum das entscheidende Datum ab." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.total">
      <path value="Bundle.total" />
      <max value="0" />
    </element>
    <element id="Bundle.link">
      <path value="Bundle.link" />
      <max value="0" />
    </element>
    <element id="Bundle.entry">
      <path value="Bundle.entry" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="resource.meta.profile" />
        </discriminator>
        <rules value="closed" />
      </slicing>
      <min value="5" />
      <max value="9" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry.link">
      <path value="Bundle.entry.link" />
      <max value="0" />
    </element>
    <element id="Bundle.entry.fullUrl">
      <path value="Bundle.entry.fullUrl" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry.resource">
      <path value="Bundle.entry.resource" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry.search">
      <path value="Bundle.entry.search" />
      <max value="0" />
    </element>
    <element id="Bundle.entry.request">
      <path value="Bundle.entry.request" />
      <max value="0" />
    </element>
    <element id="Bundle.entry.response">
      <path value="Bundle.entry.response" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:Dokumenteninformation">
      <path value="Bundle.entry" />
      <sliceName value="Dokumenteninformation" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:Dokumenteninformation.link">
      <path value="Bundle.entry.link" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:Dokumenteninformation.fullUrl">
      <path value="Bundle.entry.fullUrl" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:Dokumenteninformation.resource">
      <path value="Bundle.entry.resource" />
      <min value="1" />
      <type>
        <code value="Composition" />
        <profile value="https://fhir.kbv.de/StructureDefinition/KBV_PR_ERP_Composition|1.4" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:Dokumenteninformation.search">
      <path value="Bundle.entry.search" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:Dokumenteninformation.request">
      <path value="Bundle.entry.request" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:Dokumenteninformation.response">
      <path value="Bundle.entry.response" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:Krankenversicherungsverhaeltnis">
      <path value="Bundle.entry" />
      <sliceName value="Krankenversicherungsverhaeltnis" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:Krankenversicherungsverhaeltnis.link">
      <path value="Bundle.entry.link" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:Krankenversicherungsverhaeltnis.fullUrl">
      <path value="Bundle.entry.fullUrl" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:Krankenversicherungsverhaeltnis.resource">
      <path value="Bundle.entry.resource" />
      <min value="1" />
      <type>
        <code value="Coverage" />
        <profile value="https://fhir.kbv.de/StructureDefinition/KBV_PR_FOR_Coverage|1.3" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:Krankenversicherungsverhaeltnis.search">
      <path value="Bundle.entry.search" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:Krankenversicherungsverhaeltnis.request">
      <path value="Bundle.entry.request" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:Krankenversicherungsverhaeltnis.response">
      <path value="Bundle.entry.response" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:Patient">
      <path value="Bundle.entry" />
      <sliceName value="Patient" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:Patient.link">
      <path value="Bundle.entry.link" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:Patient.fullUrl">
      <path value="Bundle.entry.fullUrl" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:Patient.resource">
      <path value="Bundle.entry.resource" />
      <min value="1" />
      <type>
        <code value="Patient" />
        <profile value="https://fhir.kbv.de/StructureDefinition/KBV_PR_FOR_Patient|1.3" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:Patient.search">
      <path value="Bundle.entry.search" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:Patient.request">
      <path value="Bundle.entry.request" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:Patient.response">
      <path value="Bundle.entry.response" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:Einrichtung">
      <path value="Bundle.entry" />
      <sliceName value="Einrichtung" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:Einrichtung.link">
      <path value="Bundle.entry.link" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:Einrichtung.fullUrl">
      <path value="Bundle.entry.fullUrl" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:Einrichtung.resource">
      <path value="Bundle.entry.resource" />
      <min value="1" />
      <type>
        <code value="Organization" />
        <profile value="https://fhir.kbv.de/StructureDefinition/KBV_PR_FOR_Organization|1.3" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:Einrichtung.search">
      <path value="Bundle.entry.search" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:Einrichtung.request">
      <path value="Bundle.entry.request" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:Einrichtung.response">
      <path value="Bundle.entry.response" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:AusstellendeVerschreibendeVerantwortlichePerson">
      <path value="Bundle.entry" />
      <sliceName value="AusstellendeVerschreibendeVerantwortlichePerson" />
      <min value="1" />
      <max value="2" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:AusstellendeVerschreibendeVerantwortlichePerson.link">
      <path value="Bundle.entry.link" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:AusstellendeVerschreibendeVerantwortlichePerson.fullUrl">
      <path value="Bundle.entry.fullUrl" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:AusstellendeVerschreibendeVerantwortlichePerson.resource">
      <path value="Bundle.entry.resource" />
      <min value="1" />
      <type>
        <code value="Practitioner" />
        <profile value="https://fhir.kbv.de/StructureDefinition/KBV_PR_FOR_Practitioner|1.3" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:AusstellendeVerschreibendeVerantwortlichePerson.search">
      <path value="Bundle.entry.search" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:AusstellendeVerschreibendeVerantwortlichePerson.request">
      <path value="Bundle.entry.request" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:AusstellendeVerschreibendeVerantwortlichePerson.response">
      <path value="Bundle.entry.response" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:ASV-Ausuebung">
      <path value="Bundle.entry" />
      <sliceName value="ASV-Ausuebung" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:ASV-Ausuebung.link">
      <path value="Bundle.entry.link" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:ASV-Ausuebung.fullUrl">
      <path value="Bundle.entry.fullUrl" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:ASV-Ausuebung.resource">
      <path value="Bundle.entry.resource" />
      <min value="1" />
      <type>
        <code value="PractitionerRole" />
        <profile value="https://fhir.kbv.de/StructureDefinition/KBV_PR_FOR_PractitionerRole|1.3" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:ASV-Ausuebung.search">
      <path value="Bundle.entry.search" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:ASV-Ausuebung.request">
      <path value="Bundle.entry.request" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:ASV-Ausuebung.response">
      <path value="Bundle.entry.response" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:VerordnungArzneimittel">
      <path value="Bundle.entry" />
      <sliceName value="VerordnungArzneimittel" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:VerordnungArzneimittel.link">
      <path value="Bundle.entry.link" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:VerordnungArzneimittel.fullUrl">
      <path value="Bundle.entry.fullUrl" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:VerordnungArzneimittel.resource">
      <path value="Bundle.entry.resource" />
      <min value="1" />
      <type>
        <code value="MedicationRequest" />
        <profile value="https://fhir.kbv.de/StructureDefinition/KBV_PR_ERP_Prescription|1.4" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:VerordnungArzneimittel.search">
      <path value="Bundle.entry.search" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:VerordnungArzneimittel.request">
      <path value="Bundle.entry.request" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:VerordnungArzneimittel.response">
      <path value="Bundle.entry.response" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:VerordnungSprechstundenbedarf">
      <path value="Bundle.entry" />
      <sliceName value="VerordnungSprechstundenbedarf" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:VerordnungSprechstundenbedarf.link">
      <path value="Bundle.entry.link" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:VerordnungSprechstundenbedarf.fullUrl">
      <path value="Bundle.entry.fullUrl" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:VerordnungSprechstundenbedarf.resource">
      <path value="Bundle.entry.resource" />
      <min value="1" />
      <type>
        <code value="SupplyRequest" />
        <profile value="https://fhir.kbv.de/StructureDefinition/KBV_PR_ERP_PracticeSupply|1.4" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:VerordnungSprechstundenbedarf.search">
      <path value="Bundle.entry.search" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:VerordnungSprechstundenbedarf.request">
      <path value="Bundle.entry.request" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:VerordnungSprechstundenbedarf.response">
      <path value="Bundle.entry.response" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:RezeptierdatenPZNVerordnung">
      <path value="Bundle.entry" />
      <sliceName value="RezeptierdatenPZNVerordnung" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:RezeptierdatenPZNVerordnung.link">
      <path value="Bundle.entry.link" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:RezeptierdatenPZNVerordnung.fullUrl">
      <path value="Bundle.entry.fullUrl" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:RezeptierdatenPZNVerordnung.resource">
      <path value="Bundle.entry.resource" />
      <min value="1" />
      <type>
        <code value="Medication" />
        <profile value="https://fhir.kbv.de/StructureDefinition/KBV_PR_ERP_Medication_PZN|1.4" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:RezeptierdatenPZNVerordnung.search">
      <path value="Bundle.entry.search" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:RezeptierdatenPZNVerordnung.request">
      <path value="Bundle.entry.request" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:RezeptierdatenPZNVerordnung.response">
      <path value="Bundle.entry.response" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:RezeptierdatenWirkstoffverordnung">
      <path value="Bundle.entry" />
      <sliceName value="RezeptierdatenWirkstoffverordnung" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:RezeptierdatenWirkstoffverordnung.link">
      <path value="Bundle.entry.link" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:RezeptierdatenWirkstoffverordnung.fullUrl">
      <path value="Bundle.entry.fullUrl" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:RezeptierdatenWirkstoffverordnung.resource">
      <path value="Bundle.entry.resource" />
      <min value="1" />
      <type>
        <code value="Medication" />
        <profile value="https://fhir.kbv.de/StructureDefinition/KBV_PR_ERP_Medication_Ingredient|1.4" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:RezeptierdatenWirkstoffverordnung.search">
      <path value="Bundle.entry.search" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:RezeptierdatenWirkstoffverordnung.request">
      <path value="Bundle.entry.request" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:RezeptierdatenWirkstoffverordnung.response">
      <path value="Bundle.entry.response" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:RezeptierdatenRezepturverordnung">
      <path value="Bundle.entry" />
      <sliceName value="RezeptierdatenRezepturverordnung" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:RezeptierdatenRezepturverordnung.link">
      <path value="Bundle.entry.link" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:RezeptierdatenRezepturverordnung.fullUrl">
      <path value="Bundle.entry.fullUrl" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:RezeptierdatenRezepturverordnung.resource">
      <path value="Bundle.entry.resource" />
      <min value="1" />
      <type>
        <code value="Medication" />
        <profile value="https://fhir.kbv.de/StructureDefinition/KBV_PR_ERP_Medication_Compounding|1.4" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:RezeptierdatenRezepturverordnung.search">
      <path value="Bundle.entry.search" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:RezeptierdatenRezepturverordnung.request">
      <path value="Bundle.entry.request" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:RezeptierdatenRezepturverordnung.response">
      <path value="Bundle.entry.response" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:RezeptierdatenFreitextverordnung">
      <path value="Bundle.entry" />
      <sliceName value="RezeptierdatenFreitextverordnung" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:RezeptierdatenFreitextverordnung.link">
      <path value="Bundle.entry.link" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:RezeptierdatenFreitextverordnung.fullUrl">
      <path value="Bundle.entry.fullUrl" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:RezeptierdatenFreitextverordnung.resource">
      <path value="Bundle.entry.resource" />
      <min value="1" />
      <type>
        <code value="Medication" />
        <profile value="https://fhir.kbv.de/StructureDefinition/KBV_PR_ERP_Medication_FreeText|1.4" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Bundle.entry:RezeptierdatenFreitextverordnung.search">
      <path value="Bundle.entry.search" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:RezeptierdatenFreitextverordnung.request">
      <path value="Bundle.entry.request" />
      <max value="0" />
    </element>
    <element id="Bundle.entry:RezeptierdatenFreitextverordnung.response">
      <path value="Bundle.entry.response" />
      <max value="0" />
    </element>
  </differential>
</StructureDefinition>