cqframework / clinical-reasoning

CQF Clinical Reasoning on FHIR for Java
https://www.cqframework.org/clinical-reasoning/
Apache License 2.0
34 stars 24 forks source link

encounter parameter is not passed during the CQL engine execution #334

Closed dkayiwa closed 7 months ago

dkayiwa commented 11 months ago

For all these ANC measures, the encounter parameter does not get passed to the engine execution. Therefore, when evaluating Last(Split(encounter, '/')) as seen on this line, using the org.opencds.cqf.cql.engine.elm.execution.ParameterRefEvaluator which has a name of encounter in the org.opencds.cqf.cql.engine.elm.execution.SplitEvaluator.internalEvaluate(), the getStringToSplit().evaluate(context) method call returns NULL.

This is the data bundle that i am using: https://github.com/openmrs/openmrs-module-cql/blob/main/api/src/test/resources/org/openmrs/module/cql/measure/Observation-ANCIND7-Bundle.json

This is the measure: https://github.com/WorldHealthOrganization/smart-anc/blob/master/input/resources/measure/measure-ANCIND07.json

This is the library: https://github.com/WorldHealthOrganization/smart-anc/blob/master/input/resources/library/library-ANCIND07.json

And the test looks like this: https://github.com/openmrs/openmrs-module-cql/blob/main/api/src/test/java/org/openmrs/module/cql/AncDakTest.java#L131-L154