Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subject of Group in $evaluate-measure errors #495

Open
rob-reynolds opened this issue Mar 26, 2022 · 7 comments
Open

subject of Group in $evaluate-measure errors #495

rob-reynolds opened this issue Mar 26, 2022 · 7 comments
Labels
bug Something isn't working cr FHIR Clinical Reasoning module

Comments

@rob-reynolds
Copy link

rob-reynolds commented Mar 26, 2022

Is:
Providing a subject argument of group (Group/ID) errors

Should be:
Should return a result, no error

Repro:

  1. add knowledge artifacts and a group to CQF Ruler
  2. call $evaluate-measure using the Group id as the subject (using the form "Group/ID")
  3. you will get an error
{
  "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: org.opencds.cqf.cql.engine.exception.InvalidOperatorArgument: Expected a list with at most one element, but found a list with multiple elements.</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: org.opencds.cqf.cql.engine.exception.InvalidOperatorArgument: Expected a list with at most one element, but found a list with multiple elements."
  } ]
}

Example:
https://cloud.alphora.com/sandbox/r4/gic/fhir/Measure/ColorectalCancerScreeningsFHIR/$evaluate-measure?periodStart=2020-01-01&periodEnd=2020-12-31&subject=Group/atr-group

@rob-reynolds rob-reynolds added bug Something isn't working cr FHIR Clinical Reasoning module labels Mar 26, 2022
@JPercival
Copy link
Contributor

JPercival commented Apr 5, 2022

Tracked this down. The issue is that the code for this wasn't yet merged into the cql-evaluator upstream. @mdnazmulkarim is looking at that.

@p9g
Copy link

p9g commented May 5, 2022

What is happening with this?

@rob-reynolds
Copy link
Author

I think maybe it was the victim of prioritization?

Will look into it.

@p9g
Copy link

p9g commented May 26, 2022

@rob-reynolds have you had a chance to look into it? Would be nice to use Group subjects for CMS connectathon.

@rob-reynolds
Copy link
Author

@p9g
Pinging Nazmul now.

@mdnazmulkarim
Copy link
Contributor

mdnazmulkarim commented May 26, 2022

@p9g We have Group support in measure evaluation now. Have you been able to test on latest on cqf-ruler or evaluators latest snapshots please!

@delcroip
Copy link

delcroip commented Mar 28, 2023

Hi,

I am facing a similar error when doing Library/$evaluate but it does work in the with android-fhir

in the log I see that the context is DSTU3 can I configure the cqf-ruler to use R4 ?

call :

@host=https://fhir.ruler.dk.swisstph-mis.ch/fhir
@lib = emcaredt01
@patientid = 2f82c2f5-b57e-4b48-a7ef-327459f6ec99
@encounterid = 0ea41310-0a3e-4390-b621-e3ff45128c92
POST {{host}}/Library/{{lib}}/$evaluate?subject=/Patient/{{patientid}}
content-type: application/json

{
  "resourceType": "Parameters",
  "parameter": [
    {
      "name": "parameters",
      "resource": {
        "resourceType": "Parameters",
        "parameter": [
          {
            "name": "encounterid",
            "valueString":"{{encounterid}}"
            
          }
        ]
      }
    }
  ]
}

trace:

ruler_1     | org.opencds.cqf.cql.engine.exception.InvalidOperatorArgument: Expected a list with at most one element, but found a list with multiple elements.
ruler_1     | 	at org.opencds.cqf.cql.engine.elm.execution.SingletonFromEvaluator.singletonFrom(SingletonFromEvaluator.java:32)
ruler_1     | 	at org.opencds.cqf.cql.engine.elm.execution.SingletonFromEvaluator.internalEvaluate(SingletonFromEvaluator.java:47)
ruler_1     | 	at org.opencds.cqf.cql.engine.elm.execution.Executable.evaluate(Executable.java:14)
ruler_1     | 	at org.opencds.cqf.cql.engine.elm.execution.ExpressionDefEvaluator.internalEvaluate(ExpressionDefEvaluator.java:23)
ruler_1     | 	at org.opencds.cqf.cql.engine.elm.execution.Executable.evaluate(Executable.java:14)
ruler_1     | 	at org.opencds.cqf.cql.engine.execution.CqlEngine.evaluateExpressions(CqlEngine.java:191)
ruler_1     | 	at org.opencds.cqf.cql.engine.execution.CqlEngine.evaluate(CqlEngine.java:169)
ruler_1     | 	at org.opencds.cqf.cql.engine.execution.CqlEngine.evaluate(CqlEngine.java:148)
ruler_1     | 	at org.opencds.cqf.cql.evaluator.CqlEvaluator.evaluate(CqlEvaluator.java:89)
ruler_1     | 	at org.opencds.cqf.cql.evaluator.library.LibraryEvaluator.evaluate(LibraryEvaluator.java:47)
ruler_1     | 	at org.opencds.cqf.ruler.cpg.r4.provider.LibraryEvaluationProvider.evaluate(LibraryEvaluationProvider.java:183)
ruler_1     | 	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
ruler_1     | 	at java.base/java.lang.reflect.Method.invoke(Method.java:577)
ruler_1     | 	at ca.uhn.fhir.rest.server.method.BaseMethodBinding.invokeServerMethod(BaseMethodBinding.java:265)
ruler_1     | 	at ca.uhn.fhir.rest.server.method.OperationMethodBinding.invokeServer(OperationMethodBinding.java:335)
ruler_1     | 	at ca.uhn.fhir.rest.server.method.BaseResourceReturningMethodBinding.doInvokeServer(BaseResourceReturningMethodBinding.java:325)
ruler_1     | 	at ca.uhn.fhir.rest.server.method.BaseResourceReturningMethodBinding.invokeServer(BaseResourceReturningMethodBinding.java:432)
ruler_1     | 	at ca.uhn.fhir.rest.server.method.OperationMethodBinding.invokeServer(OperationMethodBinding.java:310)
ruler_1     | 	at ca.uhn.fhir.rest.server.RestfulServer.handleRequest(RestfulServer.java:1153)
ruler_1     | 	at ca.uhn.fhir.rest.server.RestfulServer.doPost(RestfulServer.java:424)
ruler_1     | 	at ca.uhn.fhir.rest.server.RestfulServer.service(RestfulServer.java:1862)
ruler_1     | 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
ruler_1     | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
ruler_1     | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
ruler_1     | 	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
ruler_1     | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
ruler_1     | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
ruler_1     | 	at org.springframework.web.servlet.resource.ResourceUrlEncodingFilter.doFilter(ResourceUrlEncodingFilter.java:67)
ruler_1     | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
ruler_1     | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
ruler_1     | 	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
ruler_1     | 	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
ruler_1     | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
ruler_1     | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
ruler_1     | 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
ruler_1     | 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
ruler_1     | 	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
ruler_1     | 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
ruler_1     | 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
ruler_1     | 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
ruler_1     | 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
ruler_1     | 	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
ruler_1     | 	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
ruler_1     | 	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890)
ruler_1     | 	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1743)
ruler_1     | 	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
ruler_1     | 	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
ruler_1     | 	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
ruler_1     | 	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
ruler_1     | 	at java.base/java.lang.Thread.run(Thread.java:833)


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cr FHIR Clinical Reasoning module
Projects
None yet
Development

No branches or pull requests

5 participants