Subscribe to new Patient resource
From this tutorial you will learn how to make Aidbox notify your service when a new Patient resource is created using Subscription module.
Aidbox subscriptions module is a way to subscribe and get notifications about updating resources on server. It introduces two new resourceTypes into Aidbox:
SubsSubscription — a meta-resource, which binds events (create/update/delete resource) with communication channel through which a subscriber will be notified about.
SubsNotification — a resource, which represents the notification with its status (sent or not).
In order to start receive notifications, you have to register your services as a subscriber in Aidbox by creating a SubsSubscription resource.
As external service to integrate Aidbox with, we will use RequestCatcher. We will use aidbox name, so the final name of our service will be https://aidbox.requestcatcher.com/. You can use your own name.
Open https://aidbox.requestcatcher.com/ in new tab, then create next SubsSubsription resource in your Aidbox instance:
After that, aidbox sends a handshake notification on channel.endpoint, which you can see on your opened tab with RequestCatcher.
Let's create a new patient then.
Then you can back to RequestCatcher service and see a new notification.
And next, you can see SubsNotification resource created for this notification in Aidbox.
If you will update your patient, then the notification will not be created, because we subscribed only for the creation of a Patient resource.
Check RequestCatcher and SubsNotification. You will not find new notifications there.
Last updated