FHIR Chat · PlanDefinition trigger question · implementers

Stream: implementers

Topic: PlanDefinition trigger question


view this post on Zulip David Winters (Oct 28 2019 at 18:43):

I'm trying to wrap my head around where the triggers specified within each action element of a PlanDefinition resource would actually be used in a workflow. I understand that a PlanDefinition is meant to define a set of possible actions that are patient-agnostic. I also understand that executing the $apply operation is meant to generate the corresponding request resources like CarePlan and RequestGroup which can be focused on a Patient context. But those request resources don't contain any TriggerDefition-valued elements, so it appears triggers only appear at the definitional level.

How is this expected to work in practice? The documentation on Workflows and applying a PlanDefinition don't say much about triggers. Is the expectation that triggers are registered when a PlanDefinition is created and then indirectly referenced by the corresponding request resources (e.g., via RequestGroup.instantiatesCanonical) after the $apply operation has been called? It seems like either the documentation could use some clarification on this topic (a possibility) or I am missing something (pretty likely). Any thoughts are appreciated!

view this post on Zulip Bryn Rhodes (Oct 28 2019 at 23:53):

The trigger element is intended to represent a fairly broad set of use cases: 1) a named-event, conceptually the same as the "hook" pattern in CDS Hooks, i.e. a named, pre-coordinated event understood by both sides of the interaction. 2) a data-event, patterned after database triggers, and 3) a periodic trigger, which would be invoked by a scheduler. As far as when any of those are actually invoked, that's really a part of the implementation strategy. The most common use case I've seen applied is the first one, and it is generally (though not always) mapped directly to a CDS Hooks hook definition. We are also working on aligning the trigger element in R5 with the upcoming changes to the subscription resource, so that will result in some changes to the trigger element.

view this post on Zulip David Winters (Oct 29 2019 at 11:27):

Thanks @Bryn Rhodes; your response confirms my understanding after reading the clinical reasoning documentation. I'll take another look at that and see if I have any other gaps in my understanding.


Last updated: Apr 12 2022 at 19:14 UTC