Skip to content

Subscription Interceptor Proposal

Ken Stevens edited this page Jan 14, 2019 · 9 revisions

HAPI FHIR JPA Server 3.7 currently provides a mechanism for registering interceptors with the FHIR Server endpoint.

Informed by unit test needs and end-user needs, this document proposes a similar interceptor mechanism for subscriptions.

Here are the proposed interception points:

SubscriptionRegistry.registerSubscription(IIdType theId, IBaseResource theSubscription)

  • boolean incomingSubscriptionPreProcessed(IIdType theId, IBaseResource theSubscription)
  • void incomingSubscriptionPostProcessed(CanonicalSubscription theSubscription)

SubscriptionMatchingSubscriber.matchActiveSubscriptionsAndDeliver(ResourceModifiedMessage theMsg)

  • boolean incomingResourcePreProcessed(ResourceModifiedMessage theMsg)
  • boolean subscriptionMatchBeforeDelivery(ResourceModifiedMessage theMsg, CanonicalSubscription theSubscription)
  • void incomingResourcePostProcessed(ResourceModifiedMessage theMsg)

SubscriptionDeliveringRestHookSubscriber.doDelivery(ResourceDeliveryMessage theMsg, CanonicalSubscription theSubscription, EncodingEnum thePayloadType, IGenericClient theClient, IBaseResource thePayloadResource)

  • boolean incomingRequestPreProcessed(ResourceDeliveryMessage theMsg, CanonicalSubscription theSubscription, EncodingEnum thePayloadType, IGenericClient theClient, IBaseResource thePayloadResource)
  • Map<String, List> preDeliverHttpClientParams()
  • List<ca.uhn.fhir.rest.client.api> preDeliverHttpHeaders()
  • void postDeliver(IHttpRequest request, IHttpResponse response)