FHIR Chat · Best Way To Retrieve FHIR Extension data with CQL · cql

Stream: cql

Topic: Best Way To Retrieve FHIR Extension data with CQL


view this post on Zulip Michael Riley (Nov 04 2021 at 15:09):

What would be the best approach to pull extension data like race/ethnicity from a US-Core Patient FHIR Resource definition like in this example here? https://www.hl7.org/fhir/us/core/Patient-example.json.html

view this post on Zulip Corey Sanders (Nov 04 2021 at 19:18):

There are some examples on how to do this in the SupplementalDataElements library here - https://github.com/DBCG/connectathon/blob/master/fhir401/input/pagecontent/cql/SupplementalDataElements-2.0.0.cql

view this post on Zulip Bryn Rhodes (Nov 04 2021 at 22:10):

There is a FHIRCommon library here that defines Extension functions for this purpose.

view this post on Zulip Bryn Rhodes (Nov 04 2021 at 22:11):

They are based on the Extension functions used in the eCQM content, but trying to get a base common FHIR library that defines them once and gets reused.

view this post on Zulip Bryn Rhodes (Nov 04 2021 at 22:12):

Also note that in 1.5, we are starting to use fluent functions to enable access to extensions like this QICoreElements

view this post on Zulip Michael Riley (Nov 05 2021 at 16:06):

thank you Bryn, what's the best way to use the FHIRCommons library in cqf-ruler? We're trying to load FHIRCommons in a script but the engine can't find the source library..

view this post on Zulip Bryn Rhodes (Nov 06 2021 at 18:59):

Is the FHIRCommon library loaded in the ruler?

view this post on Zulip Michael Riley (Nov 10 2021 at 19:57):

Sorry for the late response Bryn, yes we have FHIRCommons as a library within CQF-Ruler. name: "FHIRCommon", title" "FHIR Commons". Is that all we need for cql-engine to reference the library?

view this post on Zulip Bryn Rhodes (Nov 10 2021 at 23:16):

Yes, that should do it. Are you running a Library/$evaluate?

view this post on Zulip Michael Riley (Nov 11 2021 at 19:33):

Yes, we're running Library/<id>/$evaulate with an embedded dataendpoint like so:

{
    "resourceType": "Parameters",
    "parameter": [{
            "name": "patientId",
            "valueString": "11364"
        },
        {
            "name": "context",
            "valueString": "Patient"
        },
        {
            "name": "dataEndpoint",
            "valueEndpoint": {
                "resourceType": "Endpoint",
                "id": "428",
                "meta": {
                    "versionId": "1",
                    "lastUpdated": "2021-10-20T13:53:15.805+00:00",
                    "source": "#5cb4405b-5cad-41"
                },
                "identifier": [{
                    "system": "http://example.org/enpoint-identifier",
                    "value": "omopv53onfhir4"
                }],
                "status": "active",
                "connectionType": {
                    "system": "http://terminology.hl7.org/CodeSystem/endpoint-connection-type",
                    "code": "hl7-fhir-rest"
                },
                "name": "OMOPonFHIR v5.3.1 on R4",
                "payloadType": [{
                    "coding": [{
                        "system": "http://terminology.hl7.org/CodeSystem/endpoint-payload-type",
                        "code": "any"
                    }]
                }],
                "address": "https://OMMITINGENDPOINT/fhir/",
                "header": ["Basic OMMITINGCREDENTIALS"]
            }
        }
    ]
}

view this post on Zulip Andy Stevens (Dec 09 2021 at 17:46):

@Bryn Rhodes I wanted to follow up on this again, we also wanted to have a common library of helper function for internal uses that we can refer to in other libraries, how exactly should the library be referenced in the CQL? We've tried include FHIRCommon version 4.0.1 but that didn't work

view this post on Zulip Bryn Rhodes (Dec 13 2021 at 19:44):

There's an explanation of how to do it here: https://fhir.org/guides/cqf/common/#contents

view this post on Zulip Bryn Rhodes (Dec 13 2021 at 19:45):

Note that we are working on NPM resolution in the atom and vs code plugins, so while the approach described at that link works for the refresh tooling (and the publisher if you're using the pub;isher to do CQL translation directly), it will give errors in the Atom and VS Code plugins until next release.

view this post on Zulip Michael Riley (Dec 13 2021 at 20:12):

Is there a more direct approach we can use in CQF ruler itself? We do need the common libraries hosted in the IG, but we have a few utilities we wrote ourselves that we want to host in CQF ruler and use as well.

view this post on Zulip JP (Dec 13 2021 at 21:30):

Is there an issue that prevents you from loading a FHIR Library with your utilities in it to the cqf-ruler?

view this post on Zulip Andy Stevens (Dec 17 2021 at 15:15):

So we can load libraries into cqf ruler fine, our main question is how do we refer to them in other scripts. For example, the link Bryn included says to have a line for include fhir.cqf.common.FHIRCommon to use functions in there. If we had a CQL Library named "ObservationHelperFunctions", how would we refer to it (what would the namespace be) in another script to use those functions defined in the file?

view this post on Zulip JP (Dec 17 2021 at 19:57):

The cqf-ruler currently doesn't support namespaces or loading referenced IGs, so if you placed the same file on the server the include would be:

include FHIRCommon

I thought we had an issue tracking that but we did not so I added one:
https://github.com/DBCG/cqf-ruler/issues/406


Last updated: Apr 12 2022 at 19:14 UTC