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

Population Measure crashes when subjectIds is null or empty #358

Closed vitorpamplona closed 8 months ago

vitorpamplona commented 9 months ago

if subjectIds is null or empty, it crashes the app.

Keep in mind that orElse evaluates even if its object is filled. subjectIds.get(0) == null should probably be the last expression in this if.

https://github.com/cqframework/clinical-reasoning/blob/0fe8e3afd23437d0afe09677ebfe22d36723e066/cqf-fhir-cr/src/main/java/org/opencds/cqf/fhir/cr/measure/r4/R4MeasureProcessor.java#L88

Same happens in R5