cqframework / clinical-reasoning

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

Exception propagates out of `R4MeasureService.ensureSupplementalDataElementSearchParameter` #451

Open smailliwcs opened 2 months ago

smailliwcs commented 2 months ago

R4MeasureService.ensureSupplementalDataElementSearchParameter is written to swallow NotImplementedOperationException:

https://github.com/cqframework/clinical-reasoning/blob/b6377c2c2f37034ddf5745f32b362f34e502d674/cqf-fhir-cr/src/main/java/org/opencds/cqf/fhir/cr/measure/r4/R4MeasureService.java#L120-L124

But in at least one case (InMemoryFhirRepository), the exception thrown by the repository is a NotImplementedException:

https://github.com/cqframework/clinical-reasoning/blob/b6377c2c2f37034ddf5745f32b362f34e502d674/cqf-fhir-utility/src/main/java/org/opencds/cqf/fhir/utility/repository/InMemoryFhirRepository.java#L198

Should the thrown/caught exception types be compatible here? Prior to #435, R4MeasureService caught UnsupportedOperationException, which did swallow the (subclassing) NotImplementedException.