FHIR Chat · Introductory level questions · cql

Stream: cql

Topic: Introductory level questions


view this post on Zulip Matthew Dugal (Jan 26 2018 at 17:52):

I am diving into CQL and have some fairly basic questions. The one I am working on now is trying to add a where clause to an encounter to ensure the patient is a certain age at the time of the encounter. Does anyone know how I would code that in CQL?

view this post on Zulip Bryn Rhodes (Jan 28 2018 at 02:50):

CQL has an "AgeInYearsAt" operator, you pass the time of the encounter, so:

view this post on Zulip Bryn Rhodes (Jan 28 2018 at 02:50):

  [Encounter] E
    where AgeInYearsAt(E.period."start") >= 18

view this post on Zulip Matthew Dugal (Jan 29 2018 at 17:52):

Is it possible to define your own retrieve data types in CQL? Or is it required that an data model in XML be used?

view this post on Zulip Bryn Rhodes (Jan 30 2018 at 00:17):

Yes, you can provide your own data model, you just have to provide the model info to describe the structures. We provide model info for multiple versions of QDM and FHIR, as well as QUICK and some specialized models for some decision support related to Opioid usage.


Last updated: Apr 12 2022 at 19:14 UTC