After a pharmacy has handed over the prescription and sent a dispense request (POST) a receipt is returned to the pharmacy for billing - see RED interchange API - E-Prescription / Pharmacy / Task receipt. The receipt may be fetched again (e.g. for verification purposes) as log as the prescription is stored on the server.
The receipt request contains a FHIR bundle of type MedicationDispense. In order to create a dispense the user must be in the role of a pharmacist and use a pharmacy SMC-B card.
{{baseURL}}/{{tenant}}/Bundle
See RED Interchange API - Postman Collection 0303 - ERP Dispensation
Dispensation may need a signature. The signature card to be used may be specified by cardname parameter or by ip address and CardHandle of the card.
{{baseURL}}/{{tenant}}/Bundle?action=$dispense&cardname={{cardname}}
{{baseURL}}/{{tenant}}/Bundle?action=$dispense&cardreader={{cardreaderip}}&card={{cardhandle}}
The FHIR bundle must contain the task ID. RED will fetch the secret stored for this prescriptionID and update the task. See https://github.com/gematik/api-erp/blob/master/docs/erp_abrufen.adoc#e-rezept-abgabe-vollziehen for further description
<Parameters xmlns="http://hl7.org/fhir"> <id value="10000"/> <meta> <profile value="https://gematik.de/fhir/erp/StructureDefinition/GEM_ERP_PR_PAR_CloseOperation_Input|1.4"/> </meta> <parameter> <name value="rxDispensation"/> <part> <name value="medicationDispense"/> <resource> <MedicationDispense> <id value="8fdf05c2-0150-4c5e-a45c-3c300ca8d455"/> <meta> <profile value="https://gematik.de/fhir/erp/StructureDefinition/GEM_ERP_PR_MedicationDispense|1.4"/> </meta> <identifier> <system value="https://gematik.de/fhir/erp/NamingSystem/GEM_ERP_NS_PrescriptionId"/> <value value="160.000.239.768.330.22"/> // insert task-id here </identifier> <status value="completed"/> <medicationReference> <reference value="urn:uuid:f18cf2b8-9618-4445-a914-d79083e63be9"/> </medicationReference> <subject> <identifier> <system value="http://fhir.de/sid/gkv/kvid-10"/> <value value="K210140888"/> // insert patient ID here </identifier> </subject> <performer> <actor> <identifier> <system value="https://gematik.de/fhir/sid/telematik-id"/> <value value="3-SMC-B-Testkarte--883110000147769"/> // telematik-ID of SMC-B to be used </identifier> </actor> </performer> <quantity> <value value="2"/> <system value="http://unitsofmeasure.org"/> <code value="{Package}"/> </quantity> <whenHandedOver value="2025-01-19"/> <!--substitution><wasSubstituted value="false"/> </substitution--> </MedicationDispense> </resource> </part> <part> <resource> <Medication> <id value="f18cf2b8-9618-4445-a914-d79083e63be9"/> <meta> <profile value="https://gematik.de/fhir/erp/StructureDefinition/GEM_ERP_PR_Medication|1.4"/> </meta> <code> <coding> <system value="http://fhir.de/CodeSystem/ifa/pzn"/> <code value="06437028"/> </coding> <text value="Doxycyclin 100-1A Pharma Tabletten N2"/> </code> <form> <coding> <system value="https://fhir.kbv.de/CodeSystem/KBV_CS_SFHIR_KBV_DARREICHUNGSFORM"/> <code value="TAB"/> <display value="Tabletten"/> </coding> </form> <amount> <numerator> <extension url="https://gematik.de/fhir/epa-medication/StructureDefinition/medication-packaging-size-extension"> <valueString value="20"/> </extension> <unit value="Stück"/> </numerator> <denominator> <value value="1"/> </denominator> </amount> <ingredient> <itemCodeableConcept> <text value="Doxycyclin"/> </itemCodeableConcept> <strength> <numerator> <value value="100"/> <unit value="mg"/> <system> <extension url="http://hl7.org/fhir/StructureDefinition/data-absent-reason"> <valueCode value="unknown"/> </extension> </system> <code> <extension url="http://hl7.org/fhir/StructureDefinition/data-absent-reason"> <valueCode value="unknown"/> </extension> </code> </numerator> <denominator> <value value="1"/> <system> <extension url="http://hl7.org/fhir/StructureDefinition/data-absent-reason"> <valueCode value="unknown"/> </extension> </system> <code> <extension url="http://hl7.org/fhir/StructureDefinition/data-absent-reason"> <valueCode value="unknown"/> </extension> </code> </denominator> </strength> </ingredient> <batch> <lotNumber value="A9876543210123-45678"/> </batch> </Medication> </resource> </part> </parameter> </Parameters>