Implement FHIR R4 topic-based Subscriptions (R5 backport) to receive real-time notifications when specific resource changes occur, using a REST-hook channel
Discover available subscription topics by querying the server's CapabilityStatement or by GETting [base]/SubscriptionTopic to list supported topics
Create a Subscription resource via POST to [base]/Subscription specifying the topic URL, channel type (rest-hook), endpoint URL, heartbeat period, and any filter criteria on the topic
Respond to the handshake notification sent by the server to the endpoint immediately after subscription creation by returning 200 OK to confirm the endpoint is reachable
Process incoming notification bundles of type subscription-notification, extract the notification-event entries, and use the included focus resources or fetch the changed resources via FHIR queries
Handle heartbeat notifications (empty bundles) to confirm the subscription is still active, and implement reconnect logic if heartbeats stop arriving within the expected window
Known gotchas
R5 backport topic-based subscriptions and older R4 channel-based subscriptions have different Subscription resource structures; confirm which model the target server implements before coding
The notification bundle may contain only resource IDs (id-only notification shape) rather than full resources; clients must be prepared to fetch resources separately
Subscription endpoints must be reachable from the FHIR server's network; firewalls or private endpoints require tunneling or webhook relay services during development
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp