Tutorial: produce QuestionnaireResponse to Kafka topic
Last updated
Was this helpful?
Last updated
Was this helpful?
|
This example showcases producing data to Kafka.
Objectives:
Set up Aidbox and Kafka locally using Docker Compose.
Get FHIR QuestionnaireResponse via .
Learn how work with Kafka to handle the collected data.
Table of Contents
Working directory: aidbox-subscriptions-to-kafka
Copy the .env.tpl
file to .env
:
Add the license key (AIDBOX_LICENSE
) to the .env
file.
Username: admin
Password: password
Kafka is available at http://localhost:9092/
(no authorization required)
The Docker Compose file initializes the environment for both Kafka and Aidbox with the following configuration:
Imports FHIR Questionnaire (see init-aidbox
service).
Creates a Kafka topic for QuestionnaireResponse
(see init-kafka
service).
To create a subscription on the QuestionnaireResponse
resource that has a specific status, open Aidbox UI -> APIs -> REST Console and execute the following request:
This resource describes the data source for the subscription but doesn't execute any activities from Aidbox.
Creating this resource establishes a connection to the Kafka server. When the system produces an event, it will be processed to the specified Kafka topic.
Also you can find example of k8s deployment:
To try it out:
Share form, copy the link.
Open the link and fill form.
Cloned repository:
Get a self-hosted Aidbox license from the .
Aidbox is be available at
Kafka UI is be available at
Open the , click share
-> enable 'allow amend' -> click attach
-> copy the link -> open the link -> fill out the form, and submit it.
Open the Aidbox and get the AidboxTopicDestination status:
Open -> Topics
-> aidbox-forms
-> messages
and review the QuestionnaireResponse
that was created after submitting the form.
Configuration:
Also, you need to pass secrets for Aidbox and Database. See details: . We recommend to use helm.
Configuration resource examples:
A deployed and configured instance with is available for you to explore how Aidbox's SubscriptionTopic works. The SubscriptionTopic in Aidbox is set up to send QuestionnaireResponse
events in the completed
and amended
status to Kafka.
Open
Open the to view your QuestionnaireResponse
in the Kafka messages tab.