evaluate_measure operation

445 views
Skip to first unread message

Yuri Titov

unread,
Jul 28, 2021, 12:52:49 PM7/28/21
to HAPI FHIR
Greetings,

I am trying to run `$evaluate_measure` to generate a `MeasureReport`.  I am using the instructions at https://hapifhir.io/hapi-fhir/docs/server_jpa_cql/cql.html.  To start the server I used the https://github.com/hapifhir/hapi-fhir-jpaserver-starter using the docker instructions.  Everything seems to work fine.  I loaded a measure from the cqframework/ecqm-content-r4 github.  This is the bundle I used: https://github.com/cqframework/ecqm-content-r4/tree/master/bundles/measure/ColorectalCancerScreeningsFHIR

I generated synthetic patient data using the synthea tool.  When I attempt to evaluate the measure via: `http://localhost:8080/fhir/Measure/ColorectalCancerScreeningsFHIR/$evaluate-measure` I get the following error:

```json
{
"resourceType": "OperationOutcome",
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h1>Operation Outcome</h1><table border=\"0\"><tr><td style=\"font-weight: bold;\">ERROR</td><td>[]</td><td><pre>Failed to call access method: ca.uhn.fhir.context.ConfigurationException: Attempt to request all resources from an asynchronous search result. The SearchParameterMap for this search probably should have been synchronous.</pre></td>\n\t\t\t</tr>\n\t\t</table>\n\t</div>"
},
"issue": [ {
"severity": "error",
"code": "processing",
"diagnostics": "Failed to call access method: ca.uhn.fhir.context.ConfigurationException: Attempt to request all resources from an asynchronous search result. The SearchParameterMap for this search probably should have been synchronous."
} ]
}
```

If anyone could point me in the right direction, would really appreciate it!

-Yuri

Praveen Kumar

unread,
Sep 1, 2021, 10:00:54 AM9/1/21
to HAPI FHIR
I tried to follow your steps and I am getting a different error. I understand this is not helping your question but I want to try executing the CQL. 

Exception in thread "main" ca.uhn.fhir.rest.server.exceptions.InvalidRequestException: HTTP 400 Bad Request: Invalid request: The FHIR endpoint on this server does not know how to handle GET operation[Measure/ColorectalCancerScreeningsFHIR/$evaluate-measure] with parameters [[measure, periodStart, periodEnd]]
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException.newInstance(BaseServerResponseException.java:305)
at ca.uhn.fhir.rest.client.impl.BaseClient.invokeClient(BaseClient.java:351)
at ca.uhn.fhir.rest.client.impl.GenericClient$BaseClientExecutable.invoke(GenericClient.java:540)
at ca.uhn.fhir.rest.client.impl.GenericClient$OperationInternal.execute(GenericClient.java:1319)
at FHIR.ExecuteMeasure.main(ExecuteMeasure.java:53)


Praveen Kumar

unread,
Sep 2, 2021, 5:50:49 PM9/2/21
to HAPI FHIR
By the way Yuri, I am also getting the same error. Did you happen to solve your issue ? 

On Wednesday, 28 July 2021 at 12:52:49 UTC-4 yti...@gmail.com wrote:

Tom Wilson

unread,
Sep 17, 2022, 1:59:30 PM9/17/22
to HAPI FHIR
I am getting the same error. I tried again on a fresh hapi-fhir docker image following just the instructions to load a new CQL measure found here:


It's as simple an example as can be:

Example Measure

Several example Measures are available in the ecqm-content-r4 IG. Full Bundles with all the required supporting resources are available here. You can download a Bundle and load it on your server as a transaction:

POST http://your-server-base/fhir BreastCancerScreeningFHIR-bundle.json
Copy

These Bundles also include example Patient clinical data so once posted Measure evaluation can be invoked with:



And I'm getting this error. Any thoughts on how to debug, or what might be the cause? 

{
    "resourceType": "OperationOutcome",
    "text": {
        "status": "generated",
        "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h1>Operation Outcome</h1><table border=\"0\"><tr><td style=\"font-weight: bold;\">ERROR</td><td>[]</td><td><pre>Invalid request: The FHIR endpoint on this server does not know how to handle GET operation[Measure/BreastCancerScreeningFHIR/$evaluate-measure] with parameters [[reportType, subject, periodStart, periodEnd]]</pre></td>\n\t\t\t</tr>\n\t\t</table>\n\t</div>"
    },
    "issue": [
        {
            "severity": "error",
            "code": "not-supported",
            "diagnostics": "Invalid request: The FHIR endpoint on this server does not know how to handle GET operation[Measure/BreastCancerScreeningFHIR/$evaluate-measure] with parameters [[reportType, subject, periodStart, periodEnd]]"
        }
    ]
}

Richard Stanley

unread,
Sep 18, 2022, 10:08:56 AM9/18/22
to HAPI FHIR
I've seen this before and it was because the CQL features were not enabled by the JPA Server, e.g. its not in the public hosted HAPI server. Make sure that the $evaluate-measure is listed as a supported operation on the server at /metadata.

Tom Wilson

unread,
Sep 23, 2022, 6:42:50 PM9/23/22
to HAPI FHIR
I suspected as much. The instructions for enabling $evaluate-measure are pretty short. I started with the hapi-fhir-jpaserver-starter project, set cql_enabled: true in the application.yaml and rebuilt/redeployed to docker. 

Praveen Kumar

unread,
Sep 30, 2022, 9:28:55 AM9/30/22
to HAPI FHIR
You need to enable CQL in the JPA project you are using.  After you are done enabling, verify by going to - http://localhost:8080/fhir/swagger-ui/?page=Measure. Scroll down to the bottom of the page and you should see  $evaluate-measure operation. 
Message has been deleted

spandana borra

unread,
Oct 10, 2022, 5:00:37 AM10/10/22
to HAPI FHIR
Hi. 
 I am trying to run $evaluate_measure to generate a MeasureReport.  I am using the instructions at https://hapifhir.io/hapi-fhir/docs/server_jpa_cql/cql.html.  To start the server I used the https://github.com/hapifhir/hapi-fhir-jpaserver-starter . I configured cql_enabled =true in application.yaml file but facing the same error. I tried adding the hapi-fhir/MeasureOperationsProvider.java at aafc42fdd81c55fb5c5a61a7f5d6466725ac8380 · hapifhir/hapi-fhir (github.com) MeasureOperationsProvider.java file in cql folder in HAPI FHIR. But getting the error. Any suggestions on how to debug this or any suggestions on configure changes.

NOTE:  I am not able to see the $evaluate_measure in /metadata  

Praveen Kumar

unread,
Oct 11, 2022, 6:17:14 PM10/11/22
to HAPI FHIR
I ran into similar kind of error. It seems that there was some code changes due to which you are not able to enable CQL processing. If you take the code from commit done by Kevin - Kevin Dougan SmileCDR  on 2022-08-15 07:57:39  "Commit 4978f32e320da49317ba490db11712d83834c8c6", you will be able to enable the CQL processing. There may be few more challenges but first get through this step and let me know. 
Message has been deleted
Message has been deleted

Thomas Wilson

unread,
Mar 17, 2023, 11:18:15 AM3/17/23
to HAPI FHIR
Just wondering, has this issue been fixed or is it still a matter of going back to that Aug 15, 2022 commit?

Praveen Kumar

unread,
Apr 5, 2023, 12:23:20 PM4/5/23
to HAPI FHIR
I installed the latest version and trying to check. I will let you know if this is fixed in the latest version. 
Reply all
Reply to author
Forward
0 new messages