cqframework / clinical_quality_language

Clinical Quality Language (CQL) is an HL7 specification for the expression of clinical knowledge that can be used within both the Clinical Decision Support (CDS) and Clinical Quality Measurement (CQM) domains. This repository contains complementary tooling in support of that specification.
https://confluence.hl7.org/display/CDS/Clinical+Quality+Language
Apache License 2.0
257 stars 120 forks source link

need help : Trying to understand how the engine works with QDM data model #855

Closed developerNovo closed 10 months ago

developerNovo commented 1 year ago

Hi,

I am new in the cql technology, I am trying to understand how to use QDM data model to send patient data in the cql engine. I am not trying to do anything with the FHIR part, my usecase is to set a data model with multiple patient data and then send that to the engine to retrive matched patients. It seems I can not understand how I can achive that. Till now I am able to generate the elm json file successfully and then initialize the Library with the elm json file. Next I am trying to understand how to set the patient data and send that in to the cql engine. I have already went over the engine testcases and was able to run them successfully, but If I am missing anything, can you please point me to a direction that can help me take the next step.

Thank you for your time !

@brynrhodes : I went over some of your answers, very good details. If you can help me with the above question or any direction will really help !

brynrhodes commented 1 year ago

CQL defines contexts that facilitate authoring logic from different perspectives in the data model. The most common one (and best supported one) so far is the Patient context. It is up to the evaluation environment to provide the patient context to the engine, and if population level evaluation for patient context logic is needed, to run the logic for each patient in the source data. For example measures are written in Patient context, and the evaluation environment typically runs the measure logic for each patient in the source data. See the measure evaluation logic in the evaluator for an example of this, but the upshot is that the evaluating environment is responsible for ranging over the patients in the source data and running the evaluation for each one.

brynrhodes commented 1 year ago

Patient information is provided via the "context" to the engine: https://github.com/cqframework/clinical_quality_language/blob/master/Src/java/engine/src/main/java/org/opencds/cqf/cql/engine/execution/Context.java

So part of setting up the engine evaluation is establishing the context where you provide the id of the current patient.

JPercival commented 10 months ago

Closed due to lack of activity