FHIR Chat · How to interpret multiple criteria in a backported subscr... · subscriptions

Stream: subscriptions

Topic: How to interpret multiple criteria in a backported subscr...


view this post on Zulip Nandha K (Jan 05 2021 at 09:54):

Assuming in a given subscription where main criteria and additional criteria have different resources, need clarification on use cases when all criteria will be considered true.
For example, assuming a subscription(Id:SUB_1) exists with main criteria referring to Patient: (Patient?id=Patient/123) and additional criteria referring to Encounter resource: (Encounter?subject=Patient/123) of the patient.
when a new Encounter resource is added for the patient(Id:123) will this hold good to trigger a notification for the subscription(Id:SUB_1) though Patient details remain unchanged?

view this post on Zulip Gino Canessa (Jan 05 2021 at 16:01):

Having multiple trigger resources constitutes an or operation, so any match would cause a notification. (The reasoning is that and checks can be joined in the trigger itself).

view this post on Zulip Nandha K (Jan 06 2021 at 16:05):

I believe when you mean multiple trigger it means multiple criteria(or filterBy as in R5 specification). With that understanding, while referring R5 link for "filterBy" element( link below mentioned) in Subscription, the explanation as given: "When multiple filters are applied, evaluates to true if all the conditions are met; otherwise it returns false.(i.e., logical AND)."

Link for "filterBy" element:
https://build.fhir.org/subscription-definitions.html#Subscription.filterBy

According to R5 explanation, when multiple filters(or triggers) referring to different resources exist in a subscription then from example in my previous comment, though Encounter resource is added new but patient details remain same the notification should not be sent.

Questions:

  1. Is it (Logical OR )/ (Logical AND to be applied when multiple filters(triggers) exist ?
  2. If Logical AND is to be applied for multiple filters, kindly explain with a scenario

view this post on Zulip Gino Canessa (Jan 06 2021 at 18:17):

There are two situations now (due to changes from the last connectathon), so this text could probably use another update with more clarification.

  • Multiple filters on a single resource trigger (e.g., Encounter). In that scenario, the conditions are joined with and (as described). So, if you wanted to have filters for both Encounter.subject (e.g., Patient/123) and Encounter.class (e.g., http://terminology.hl7.org/CodeSystem/v3-ActCode|AMB), that is perfectly doable. Specifying both means that you want to be notified when there is a new Ambulatory Encounter for Patient 123.

  • Multiple filters on multiple resource triggers (e.g., Encounter and Patient). In that scenario, the conditions are applied only to the specified resource(1). Each resource trigger is intended to be evaluated separately(2), so this is essentially an or. (I believe this is the part that needs further documentation.).

(1): We apparently need more documentation for when Subscription.filterBy.resourceType is not specified as well. I believe the 'best' behavior would be to check resource triggers for matching canFilterBy.searchParamName matches and apply to each of those, but we need to have a discussion on what is reasonable for servers to implement.

(2): The reasoning here is that multiple resource triggers represent different ways of triggering the notification (e.g., I want to capture 'Status A to Status B' and 'Status B to Status C' only, which requires two different triggers. Other identified scenarios are possible within a single resource trigger.

I'm having trouble with the example you are providing, and could use some clarification. Are you asking for a notification when there is a new Encounter and that a Patient's information has changed? I'm not sure how that would be triggered other than a transaction including both changes and a server that evaluates subscriptions on the transaction result instead of individual operations (this hasn't come up yet, so I'm not sure if implementers plan to or not). Could you provide a little more information about the use case you are describing?

view this post on Zulip Nandha K (Jan 07 2021 at 14:53):

Thanks for your detailed explanation on single resource and multiple resource triggers. As you mentioned, the R5 documentation needs an update. I was thinking on terms of multiple resources triggers. Your explanation with example had clarified my doubts on same when logical OR operation will be considered to trigger notifications. Also, currently I don't have use case where in a single transaction(bundle) to monitor multiple resources for notification. I will leave it to implementers :wink:

view this post on Zulip Gino Canessa (Jan 07 2021 at 16:18):

No problem! If you could file a Jira ticket asking for clarification, I would appreciate it. Cheers!

view this post on Zulip Nandha K (Jan 14 2021 at 16:33):

Have not raised ticket in Jira before .. I would like to take your help for the same

view this post on Zulip Josh Mandel (Jan 14 2021 at 17:52):

https://jira.hl7.org/secure/CreateIssue.jspa?pid=11200&issuetype=11300 has a starting point if you're not registered in Jira yet.

view this post on Zulip Josh Mandel (Jan 14 2021 at 17:53):

Once you have an account, http://hl7.org/fhir-issues has a "create" button at the top that will let you submit an issue.

view this post on Zulip Josh Mandel (Jan 14 2021 at 20:45):

https://confluence.hl7.org/display/HL7/Specification+Feedback has good background on how to get started.

view this post on Zulip Nandha K (Jan 14 2021 at 21:21):

Created a ticket successfully :)
https://jira.hl7.org/browse/FHIR-30383


Last updated: Apr 12 2022 at 19:14 UTC