FHIR Chat · CDS Authoring Tool relative time for Encounter criteria · cql

Stream: cql

Topic: CDS Authoring Tool relative time for Encounter criteria


view this post on Zulip Raghavan Chandrabalan (Dec 07 2021 at 20:27):

Hi @Chris Moesel, I'm trying to create an inclusion criteria for the existence of some Encounter within a relative time frame, like one that ended in the last week at the time of execution. Do you know if such a criteria is possible to implement using the Authoring Tool?

I noticed Observations and Procedures have the "Look back" modifier that would work for this, but that modifier isn't available for Encounters. Building a new modifier using the Period property seems close, but the operators only accept absolute datetimes.

Thank you

view this post on Zulip Chris Moesel (Dec 07 2021 at 21:24):

Hi @Raghavan Chandrabalan. You're right. Encounters lack a "lookback" modifier and the operators for Encounter period don't support a lookback either. This is a good area for the Authoring Tool to improve.

If you're familiar enough w/ CQL to write a small library by hand, you could create a library that has a function called "EncounterLookback" that takes a List<Encounter> as the first argument and a quantity or integer as the second argument -- then upload it and use it as an External CQL Modifier.

view this post on Zulip Raghavan Chandrabalan (Dec 07 2021 at 21:40):

Ah I see, I'll try making an external library. Thanks!

view this post on Zulip Chris Moesel (Dec 07 2021 at 22:17):

Sorry for the current limitation. Let me know if you run into any issues!


Last updated: Apr 12 2022 at 19:14 UTC