Skip to content

fix: replace CompositeParam with separate date params in populateDate…#944

Open
cjsvimat wants to merge 3 commits intocqframework:masterfrom
cjsvimat:fix/composite-param-date-cast
Open

fix: replace CompositeParam with separate date params in populateDate…#944
cjsvimat wants to merge 3 commits intocqframework:masterfrom
cjsvimat:fix/composite-param-date-cast

Conversation

@cjsvimat
Copy link

…SearchParams

CompositeParam<DateParam, DateParam> causes a ClassCastException when the HAPI JPA search engine attempts to cast each element to DateParam during date-range query execution:

java.lang.ClassCastException: class ca.uhn.fhir.rest.param.CompositeParam
cannot be cast to class ca.uhn.fhir.rest.param.DateParam

The Multimap already supports AND semantics via multiple put() calls on the same key, so wrapping in CompositeParam is unnecessary and incorrect. This replaces the single CompositeParam entry with two separate entries (one for

= start, one for <= end), which the JPA layer handles correctly.

Affects all FHIR versions (DSTU3, R4, R5) since BaseRetrieveProvider is shared.

Reproducer:

  1. Enable clinical-reasoning on HAPI FHIR 8.x
  2. POST an eCQM measure bundle (e.g. CMS125 Breast Cancer Screening)
  3. GET [base]/Measure/BreastCancerScreeningFHIR/$evaluate-measure ?periodStart=2025-01-01&periodEnd=2025-12-31
  4. Response returns status: error with CompositeParam ClassCastException in server logs

After fix: status: complete with correct population counts.

cjsvimat added 2 commits March 3, 2026 11:27
…SearchParams

CompositeParam<DateParam, DateParam> causes a ClassCastException when the
HAPI JPA search engine attempts to cast each element to DateParam during
date-range query execution:

  java.lang.ClassCastException: class ca.uhn.fhir.rest.param.CompositeParam
  cannot be cast to class ca.uhn.fhir.rest.param.DateParam

The Multimap already supports AND semantics via multiple put() calls on the
same key, so wrapping in CompositeParam is unnecessary and incorrect. This
replaces the single CompositeParam entry with two separate entries (one for
>= start, one for <= end), which the JPA layer handles correctly.

Affects all FHIR versions (DSTU3, R4, R5) since BaseRetrieveProvider is
shared.

Reproducer:
1. Enable clinical-reasoning on HAPI FHIR 8.x
2. POST an eCQM measure bundle (e.g. CMS125 Breast Cancer Screening)
3. GET [base]/Measure/BreastCancerScreeningFHIR/$evaluate-measure
   ?periodStart=2025-01-01&periodEnd=2025-12-31
4. Response returns status: error with CompositeParam ClassCastException
   in server logs

After fix: status: complete with correct population counts.
@cjsvimat cjsvimat force-pushed the fix/composite-param-date-cast branch from bb9fc39 to 8148d48 Compare March 3, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant