You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 18 Current »

Introduction

RED medical offers a FHIR interface for third-party data providers/consumers. This interface is based on the German regulatory standards §291 (Verordnungssoftware - Schnittstelle / VOS) and §371 (Archiv- und Wechselschnittstelle / AWS) SGB V. These interfaces are based on the international FHIR-Standard with local extensions e.g. for statutory billing purposes.

RED interchange API provides a third-party system with functions

  • to send data to RED for processing and storage. This allows a third-party system e.g. to send data of patients that have been registered to RED. Patient data will be validated in RED as if entered manually and stored in the RED database using the RED end-to-end encryption. 
  • to query data from RED. The third-party system may send query requests to RED (e.g. for patients, patient records or documents) and RED will return data retrieved from its database
  • to execute transactions with the Telematik-Infrastruktur such as basic Konnektor operations (e.g. PIN verification) or complex transactions (e.g. dispensing an electronic prescription)


The RED interchange API uses the XML-based FHIR format for data exchange. Data to be sent to RED must be separated and packaged into FHIR bundles, and data queried from RED will be returned in FHIR bundles. RED uses the FHIR bundles defined by Kassenärztliche Bundesvereinigung in their AWS project.

In order to ensure the secrecy of person-related data (as required by German criminal law) RED uses end-to-end encryption of all person-related data stored in its data-centers. In order to access data in RED Users must authenticate during login and obtain the cryptographic keys necessary to decrypt and encrypt data. Therefore the RED interchange API cannot be a server interface, as encryption keys are in the possession of the users only, and data cannot be encrypted or decrypted server-side. By requirement the RED interchange API expects to communicate with an application installed on the local machine or a locally installed server reachable via localhost.

After a user has logged in successfully and obtained his cryptographic keys a local FHIR server is started by RED on the users machine. If the FHIR server is running RED will act as recipient and listen to POST and GET requests from the sending third-party application.

Setup in RED

To use the RED interchange API it must be set up for each RED terminal (Arbeitsplatz)For development and testing the tool Postman (https://www.postman.com/downloads/) can be used as sending application. Please contact us to receive a Postman collection with sample requests. 

Receiving data from RED - Search and Read

RED interchange API - Search/Read Practitioners

RED interchange API - Search/Read PractitionerRoles

RED interchange API - Search/Read Organizations

RED interchange API - Search/Read Claims

RED interchange API - Search/Read Encounters

RED interchange API - Search/Read Observations

RED interchange API - Search/Read Coverages

RED interchange API - Search/Read DocumentReferences

RED Interchange API - Search/Read Medication



 

Delete Items from RED

> DELETE http://localhost:29221/{tenant}/Bundle/10000

Deletes a stored bundle in RED medical application.


Request an electronic prescription 

The RED interchange API may also be used to communicate with gematik Fachdienst to retrieve stored electronic prescriptions and to send dispense requests.

Request prescription

A prescription is identified by its PrescriptionID and the AccessCode. PrescriptionID and AccessCode are represented by the barcode on the prescription form. The barcode contains a string containing an array of urls. Each url is represented by a string with this format:

Task/<Prescription ID>/$accept?ac=<AccessCode>

{"urls":["Task/160.000.111.065.827.98/$accept?ac=b8d9e513cd11cfe0a1d829b96a503e9df5b17803bbdbc4036f32858494539f28"]}

In this example the prescriptionID is 160.000.111.065.827.98 and AccessCode is b8d9e513cd11cfe0a1d829b96a503e9df5b17803bbdbc4036f32858494539f28.

To get the prescription data for this prescription a GET request is sent:

> GET http://localhost:29221/{tenant}/Task?action=$accept&prescriptionid={PrescriptionID}&accesscode={AccessCode}

Example

http://localhost:29221/{tenant}/Task?action=$accept&prescriptionid=160.000.111.065.827.98&accesscode=b8d9e513cd11cfe0a1d829b96a503e9df5b17803bbdbc4036f32858494539f28

This request returns a FHIR bundle with several items.

  • Composition: contains summary information and references to all items in the bundle
  • MedicationRequest: refers to Medication, patient, requester and insurance. Includes administrative information such as copayment, emergencyFee, substitution (aut-idem) or payer (BVG). Also contains the dosage and quantity
  • Medication: contains data of prescribed product (e.g. PZN ID, flag vaccine, Normgröße, form and amount)
  • Patient: person the prescription was created for, including insurance ID, name and address
  • Practitioner: physician who created and signed the prescription, including LANR, name and qualification
  • Organization: practice which created the prescription, including BSNR, address and contact
  • Coverage: payer and insurance information, including insurance status, WOP, person group, copayment status, payer identification


This GET request can be used for the initial fetch of prescription data as well as further requests to fetch the same data later. When the FHIR bundle is returned from Fachdienst a second access code (“secret”) is added. All further requests to Fachdienst (in order to retrieve prescription data again, cancel or dispense the prescription) must include this secret to prove the requesters authorization to access the data. RED stores the secret in its database and adds it automatically for every further processing action of this request.

Return a prescription

After a pharmacy has requested an electronic prescription from Fachdienst and received the FHIR bundle the Fachdienst locks the prescription. If the pharmacy is not able to deliver the prescribed products the prescription can be returned. If a prescription is returned it is released on Fachdienst and may be requested by someone else.

To return a prescription a GET request is sent. In addition to PrescriptionID and AccessCode RED automatically includes the secret.

> GET http://localhost:29221/{tenant}/Task?action=$reject&prescriptionid={PrescriptionID}&accesscode={AccessCode}

Example

http://localhost:29221/{tenant}/Task?action=$reject&prescriptionid=160.000.111.065.827.98&accesscode=b8d9e513cd11cfe0a1d829b96a503e9df5b17803bbdbc4036f32858494539f28

Dispense a prescription

After a pharmacy has delivered the prescription a dispense request is created. The dispense request contains a FHIR bundle of type MedicationDispense. 

The bundle is sent to RED using POST

> POST http://localhost:29221/{tenant}/Bundle

  • No labels