hapi-fhir
hapi-fhir copied to clipboard
Error: Operation $evaluate-measure on a large population
When trying to submit a GET request with Measure operation $evaluate-measure and practitioner as a parameter on a large population an error appears.
Example-Request: *GET http://localhost:8000/Measure/ImmunizationStatus/$evaluate-measure?practitioner=ImmunizationStatus-practitioner-1``
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "error",
"code": "processing",
"diagnostics": "HAPI-0389: Failed to call access method: ca.uhn.fhir.context.ConfigurationException: HAPI-0464: Attempt to request all resources from an asynchronous search result. The SearchParameterMap for this search probably should have been synchronous."
}
]
}
The following POSTman collection, that was tested on the JPA-server-starter project, can be used to reproduce the error. This collection contains one failing request and >1000 test resources, including over 60 test patients.
https://gitlab.com/smilecdr-open-source/immunization-cql-poc/-/blob/main/resources/postman_collection_submission_v1.json
Please note, that you might need to enable cql_enabled=true (for jpa-server-starter in application.yaml).
My hint is that the trouble makers are these LOC / functions:
- https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-jpaserver-cql/src/main/java/ca/uhn/fhir/cql/r4/evaluation/MeasureEvaluation.java#L110
- https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-jpaserver-cql/src/main/java/ca/uhn/fhir/cql/r4/evaluation/MeasureEvaluation.java#L123
and for some reason the result of those large searches when calling Provider.getAllResources()
is empty (or maybe took too long?)
Latest update: This bug has potentially been fixed by this pull request: https://github.com/hapifhir/hapi-fhir/commit/6c0c730ebcf857667a9e810804b50a68c9628468
manual testing with postman collection still pending.
Update, the bug still exists, the threshold to reproduce the bug has just been increase to 50 results. Still being worked on
+1
+1
This should be resolved with #4347.
(Please re-open if the issue re-occurs)