FHIR Chat · cql & fhir extensions · cql

Stream: cql

Topic: cql & fhir extensions


view this post on Zulip Jeffrey Taylor (Oct 23 2019 at 19:37):

Is there a way to specific a FHIR extension in a CQL query?

Here is an example:

library "test" version '1'

valueset "Some Condition VS": '1.2.3.4'

context Patient

define "Some Condition":
  exists([Condition: "Some Condition VS"])
  and exists // extension with url "http://test.com" & valueString "123"

The operator exists([Condition: "Some Condition VS"]) finds the patients that have a condition inside of the '1.2.3.4' valueset, but I want to further restrain the query by looking for a specific value on a fhir extension.

view this post on Zulip Bryn Rhodes (Oct 23 2019 at 22:45):

Yes, extensions are exposed in the FHIR model, so you can access them like any other element:

library "test" version '1'

valueset "Some Condition VS": '1.2.3.4'

context Patient

define "Some Condition":
  exists(
        [Condition: "Some Condition VS"] C
          where exists (
                C.extension E
                  where E.url = 'http://test.com'
                      and E.value = '123'
            )
    )

view this post on Zulip Mohammad Afaq Khan (Oct 24 2019 at 00:09):

(deleted)

view this post on Zulip Saoji Adhe (Oct 24 2019 at 11:26):

Hi ,
i want to test cqf-ruler-0.1.13-SNAPSHOT.jar with hapi-fhir-3.8 , to test $evaluate-measure
but it's not working with example given by hspc in there documentation
anybody know about where i will get example related to $evaluate-measure, $apply, cds-hooks etc...
Thank you in advance.

view this post on Zulip Jeffrey Taylor (Oct 24 2019 at 13:09):

Thanks @Bryn Rhodes, this clicked - appreciate you sharing this example.

view this post on Zulip Alexander Kiel (Oct 24 2019 at 14:05):

@Saoji Adhe I would be more than happy, if you gave Blaze a try. It supports $evaluate-measure, although with initial-population only were the CQL expression has to be called InInitialPopulation. Please also see this script which calls $evaluate-measure the way it's currently supported.

view this post on Zulip Eghonghon Okpah (Feb 13 2020 at 20:20):

@Bryn Rhodes Thanks you for sharing the fhir extension cql query structure
Please find below a code snap and test patient extension structure I am testing out
define ValidBasic:
exists(
[Basic] B
where exists (
B.extension HE
where HE.url = 'http://sample.com/fhir/StructureDefinition/isHospice'
and HE.value = true
)
)

"extension": [
{
"url": "http://sample.com/fhir-extensions/Basic-originalReasonEntitlementCode",
"valueCodeableConcept": {
"coding": [
{
"system": "CodeSystem",
"code": "11429006",
"display": "OREC"
}
]
}},
{
"url": "http://sample.com/fhir/StructureDefinition/isHospice",
"valueBoolean": "true"
}
],

My results evaluate to a false when I execute my test case, even though the URL and the value are both contained within the extension

view this post on Zulip Bryn Rhodes (Feb 14 2020 at 22:38):

Hi @Eghonghon Okpah , I can confirm this behavior in the cql-runner, but I think we have fixed this already in the latest version of the engine. Where are you seeing this behavior?

view this post on Zulip Eghonghon Okpah (Feb 19 2020 at 07:28):

@Bryn Rhodes we are using CQL Engine Version: 1.3.10-SNAPSHOT

view this post on Zulip Bryn Rhodes (Feb 19 2020 at 15:30):

So digging on this a bit more and it is a known issue that we are currently working on a fix for: https://github.com/DBCG/cql_engine/issues/262 and https://github.com/cqframework/clinical_quality_language/pull/482


Last updated: Apr 12 2022 at 19:14 UTC