| features |
|
|---|
This example demonstrates how to implement FHIR R5 topic-based subscriptions in Aidbox.
The example shows how to:
- Define a custom
SubscriptionTopicfor ClaimResponse resources - Configure an
AidboxTopicDestinationfor R5-compliant subscriptions - Create a
Subscriptionthat filters events by organization - Receive webhook notifications when matching resources are created or updated
Defines what events trigger notifications:
- Resource:
ClaimResponse - Trigger Criteria:
status = 'active' - Filter: Can filter by insurer organization identifier
Configures the R5 subscription behavior:
- Kind:
fhir-native-topic-based-subscription - Content:
full-resource(sends complete resource in notifications) - Deliverers: 2 parallel workers
- Event Retention: 24 hours (86400 seconds)
The actual subscription that listens for events:
- Topic: Da Vinci PAS SubscriptionTopic
- Filter: Only ClaimResponse for
Organization/org-1 - Endpoint:
http://echo-server:9090/webhook - Channel: REST hook (webhook)
- Heartbeat: Every 60 seconds
- Timeout: 30 seconds
A simple HTTP echo service that:
- Logs all incoming webhook requests
- Responds with request details
- Runs on port 9090
docker-compose up -dOpen Aidbox, and activate your Aidbox.
GET /fhir/Subscription/pas-subscription-r5The subscription should have status: "active" once Aidbox processes it.
This ClaimResponse will trigger a notification because it:
- Has
status: "active" - References
Organization/org-1as the insurer
POST http://localhost:8080/fhir/ClaimResponse
{
"resourceType": "ClaimResponse",
"status": "active",
"type": {
"coding": [{
"system": "http://terminology.hl7.org/CodeSystem/claim-type",
"code": "institutional"
}]
},
"use": "preauthorization",
"patient": {
"reference": "Patient/example"
},
"created": "2024-01-15T10:00:00Z",
"insurer": {
"reference": "Organization/org-1"
},
"outcome": "complete"
}View the webhook notification received by the echo server:
docker-compose logs echo-serverYou should see a POST request to /webhook with the full ClaimResponse resource in the notification bundle.