Stream: cql
Topic: Add filter for all queries
Adrien Prost (Jul 07 2021 at 08:25):
Hello, is there a way to restrict all conditions/observation retrieved in queries with a specific time frame? I would like to be able to do so without adding that filter in each query/clause. More generally, is there a feature that lets you add filters for specific resources such that all queries done on these resources use the filter ?
Michael Riley (Jul 07 2021 at 17:43):
Is this using the FhirDataProvider? I don't believe there is one here, unfortunately.
JP (Jul 07 2021 at 23:17):
The only implicit restriction is the context that's set:
context Patient
That automatically applies a restriction to the specific Patient. There aren't any implicit restrictions for time-based queries.
Adrien Prost (Jul 08 2021 at 09:06):
Okay so in this case this would mean I would have to add as a parameter a time period filter to all functions?
Adrien Prost (Jul 08 2021 at 09:07):
Michael Riley said:
Is this using the FhirDataProvider? I don't believe there is one here, unfortunately.
yes
Bryn Rhodes (Jul 08 2021 at 16:13):
Yes, that's typically the way that it is done. For example measures all specify a Measurement Period parameter to specify the reporting period. This is really common though (contextualizing to a timeframe) and so I'm introducing an "AsOf" parameter into some data elements I'm building now. For your use case, would a single timepoint work, or would you need an interval?
Michael Riley (Jul 08 2021 at 20:39):
@Bryn Rhodes 90 percent of my usecases are on a single index datetime. Sometimes there's a range though.
Adrien Prost (Jul 09 2021 at 07:28):
@Bryn Rhodes My main use case would be a single time period in order to retrieve all recent Encounters for examples
Bryn Rhodes (Jul 14 2021 at 19:15):
So perhaps an "Relevant Period" parameter. In the case of decision support, that would be Interval[Now() - 1 year, Now()], and for quality measurement it would be the reporting period.
Last updated: Apr 12 2022 at 19:14 UTC