Add support for the _filter
search parameter in Subscription.criteria
#3627
Labels
subscriptions
Features and fixes related to subscriptions
Milestone
_filter
search parameter in Subscription.criteria
#3627
Currently it's not possible to use
_filter
search parameter forSubscription.criteria
. This is because the internal functionmatchesCriteria()
makes use of the in-memory search, which currently has some limitations, one of which is the inability to use_filter
._filter
can be really useful, especially for complex queries where a logical OR is needed, so it would be great if we could get this added toSubscription.criteria
, especially onceWebSocket
subscriptions are available for usage.For example, a criteria for
Communication
resources representing a live chat session could be written as such:Communication?patient={patientId}&_filter=(sender re Practitioner/123 or recipient re Practitioner/123)
However in the current system without
_filter
, we would have to create twoSubscription
s, each with a criteria representing either side of theor
operator in the_filter
parameter above. That means adding the_filter
search parameter forSubscription.criteria
could reduce total subscriptions across all clients by half for a chat service modeled by Medplum's WebSocket subscriptions.I can see two solutions; either seems like a decent path forward for.
_filter
query parameter to the in-memory search implementation. Probably better for performance.matchesCriteria()
to database search. Maybe less work (?)The text was updated successfully, but these errors were encountered: