Koppeltaal 2.0 Dev Guide
  • Developer Guide
  • POC (Walking Skeleton)
    • Proof Of Concept
      • Koppeltaal Server
      • Domain Management
      • Auth Server
      • Koppeltaal IdP
      • Domain Access Test Suite
      • Koppeltaal Test Tooling
  • Domain access
    • Joining a domain
    • Role-based access control
      • Autorisation model
      • Creating a role
      • Search Narrowing
      • Revoke Permission
  • Technical HOW-TO
    • Koppeltaal Test Tooling
    • Request Koppeltaal server metadata
    • Connecting to Koppeltaal
      • Requirements
        • Create a key pair
        • Signing the JWT
        • JWKS setup
      • Access to Koppeltaal
    • Managing resources
      • Versioning
      • CRUD Operations
        • Retrieve all Resources
        • Retrieve specific Resource
        • Create a Resource
        • Update a Resource
        • Delete a Resource
      • Subscribing to changes
    • Launching
      • HTI Flow
      • SHOF Flow
      • Compose a launch
      • Initiating a launch
      • Receiving a HTI launch
        • Token introspection
      • Receiving a SHOF launch
    • Detailed technical guidance
  • Hackathon Use Cases
    • Requirements
      • Install and configure Yivi
    • Use-Cases
      • Use-Case 1: Create a Task
        • Create an ActivityDefinition
      • Use-Case 2: HTI Launch
      • Use-case 3: SHOF Launch
      • Use-case 4: Subscribing to changes
  • Useful Links
    • Simplifier Profiles
    • FHIR Docs
    • HTI documentation
    • GitHub
    • Koppeltaal 2.0 Specifications & Architecture
    • Koppeltaal 2.0 Implementation Guide
    • Koppeltaal 2.0 OpenAPI Specs
Powered by GitBook
On this page
  • Subscribe to changes
  • Limitations
  • Example Subscription
  • Topics

Was this helpful?

  1. Technical HOW-TO
  2. Managing resources

Subscribing to changes

It is often important to be notified of changes to specific resources. Within Koppeltaal it is possible to be notified of changes on a very accurate level.

PreviousDelete a ResourceNextLaunching

Last updated 8 months ago

Was this helpful?

The notification mechanism has a maturity level 3. We know that FHIR is working hard to improve the notification mechanism. In the future version, it is very likely that this functionality will change. For example, currently there is no notification when a resource is deleted.

Subscribe to changes

Applications can create their own notification using the resource. This must adhere to the . The Subscription, like the other resources, can be managed through the .

Criteria

The Subscription.criteria field can be filled by applications themselves. With each change, the Koppeltaal server will check if there are Subscriptions where the criteria matches the created/changed Resource. If so, a POST notification will be sent to the Subscription.channel.endpoint for the matched subscriptions.

Koppeltaal-specific criteria

It's possible to subscribe to custom search criteria added by Koppeltaal. This is done by defining SearchParameter resources. Koppeltaal provides SearchParameters that are likely to be used. Information on these can be found on .

Channel

The Subscription.channel is used to specify how and where the notification should go. In the POC, Koppeltaal will only support the rest-hook type without a payload.

The Koppeltaal Server applies "Notification Narrowing"; similar to but for notifications. However, when something goes wrong in this process, the notification WILL be sent. In addition, an application may have multiple Subscriptions that match the set criteria.

Applications should therefore note that a notification does not always result in aResource to be retrieved.

Applications should also note that subscriptions might not be received. Perhaps the webhook endpoint was unavailable, or the process runs into an error somewhere. When syncing state is important, it is important to keep the before-mentioned in mind and implement a mechanism that still synchronises all data.

Limitations

There are differences between the FHIR Subscription and the Koppeltaal 2.0 profile. For example, Koppeltaal does not allow the creation of a Subscription where the Subscription.payload is turned on. This way, the notification is purely a "ping" to indicate that something has changed, but not WHAT content has changed. This choice was made to avoid accidentally sending sensitive information to the wrong endpoint.

Example Subscription

{
  "resourceType": "Subscription",
  "meta": {
    "profile": [
      "http://koppeltaal.nl/fhir/StructureDefinition/KT2Subscription"
    ]
  },
  "status": "active",
  "reason": "Process finished Tasks",
  "criteria": "Task?status=ready",
  "channel": {
    "type": "rest-hook",
    "endpoint": "https://koppeltaal-testteam6.nl/fictief-subscription",
    "header": [
      "X-KTSubscription: TaskReady",
      "Authorization: Bearer <TOKEN>"
    ]
  }
}

Topics

Subscription
Koppeltaal 2.0 profile
CRUD Operations
Confluence
Search Narrowing
TOP-KT-005a - Rollen en rechten voor applicatie-instanties
TOP-KT-006 - Abonneren op en signaleren van gebeurtenissen
TOP-KT-009 - Overzicht gebruikte FHIR Resources