Subscribing on Tasks where the ActivityDefinition is published by x

In our application (e-health domain), we want to create a Subscription for all Tasks where the chained ActivityDefinition.meta.source equals a specific URI. This way, the application only gets notified on Task changes that are based on an ActivityDefinition they published.

It seems hard to create this criteria as Task.instantiatesCanonical is not a searchable field. It feels like I am missing something as it seems so logical for this field to be searchable.

Is there a proper/out-of-the-box way to accomplish this?

For now, these are the less favourable options I see:

  1. See if we can make Task.instantiatesCanonical searchable on the (HAPI) FHIR Store. Then see if we can use this into a Subscription criteria.
  2. See if we can make Task.instantiatesCanonical searchable via a StructuredDefinition based on vanilla R4. Then see if we can use this into a Subscription criteria.
  3. Add a Task.activityDefinitionSource extension. Then see if we can use this into a Subscription criteria.
  4. Subscribe to all tasks and let the application deal with figuring out if it wants to handle it. This would cause extra load on the server as we cannot use _include on non-searchable properties.

Thanks in advance!

Joris

I’d say first step is to submit a change request asking for ‘instantiates’ to be defined as a standard search criteria on Task. It won’t fix your problem short-term, but will make things easier long-term.

#1 should be achievable and is probably your best bet.

Thanks a lot for your reply @lloyd! That sounds like an excellent idea. I’ll make sure to submit a change request.

For now #1 will be the way to go then!

Thanks again and have a great day.