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.
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 theorg.opencds.cqf.cql.engine.elm.execution.ParameterRefEvaluator
which has a name ofencounter
in theorg.opencds.cqf.cql.engine.elm.execution.SplitEvaluator.internalEvaluate()
, thegetStringToSplit().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