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

Problems with Chained Parameters #441

Closed
Crudelus opened this Issue Sep 9, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@Crudelus

Crudelus commented Sep 9, 2016

Hello,
I Currently try to request a MedicationAdministration by a code of its Medication. Therefore i wanted to use a Chained Request (I use a recent version of the Example JPA ).

I made sure there is a correct medication Resource present and that i can properly query it with:
https://localhost:8443/hapi/baseDstu2/Medication?code=04823543

The query with the Chained command is:
https://localhost:8443/hapi/baseDstu2/MedicationAdministration?medication.code=04823543

I now 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</pre></td>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t</tr>\n\t\t</table>\n\t</div>"
  },
  "issue": [
    {
      "severity": "error",
      "code": "processing",
      "diagnostics": "Failed to call access method"
    }
  ]
}

From the Server I can extract

ca.uhn.fhir.rest.server.exceptions.InternalErrorException: Failed to call access method
    at ca.uhn.fhir.rest.method.BaseMethodBinding.invokeServerMethod(BaseMethodBinding.java:276)
    at ca.uhn.fhir.rest.method.SearchMethodBinding.invokeServer(SearchMethodBinding.java:279)
    at ca.uhn.fhir.rest.method.SearchMethodBinding.invokeServer(SearchMethodBinding.java:55)
    at ca.uhn.fhir.rest.method.BaseResourceReturningMethodBinding.doInvokeServer(BaseResourceReturningMethodBinding.java:306)
    at ca.uhn.fhir.rest.method.BaseResourceReturningMethodBinding.invokeServer(BaseResourceReturningMethodBinding.java:257)
    at ca.uhn.fhir.rest.server.RestfulServer.handleRequest(RestfulServer.java:659)
    at ca.uhn.fhir.rest.server.RestfulServer.doGet(RestfulServer.java:1203)
    at ca.uhn.fhir.rest.server.RestfulServer.service(RestfulServer.java:1179)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.ebaysf.web.cors.CORSFilter.handleNonCORS(CORSFilter.java:437)
    at org.ebaysf.web.cors.CORSFilter.doFilter(CORSFilter.java:172)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:108)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:522)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:1110)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:785)
    at org.apache.tomcat.util.net.Nio2Endpoint$SocketProcessor.doRun(Nio2Endpoint.java:1627)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at org.apache.tomcat.util.net.AbstractEndpoint.processSocket(AbstractEndpoint.java:830)
    at org.apache.tomcat.util.net.SecureNio2Channel$HandshakeReadCompletionHandler.completed(SecureNio2Channel.java:98)
    at org.apache.tomcat.util.net.SecureNio2Channel$HandshakeReadCompletionHandler.completed(SecureNio2Channel.java:91)
    at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
    at sun.nio.ch.Invoker$2.run(Invoker.java:218)
    at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException: null
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at ca.uhn.fhir.rest.method.BaseMethodBinding.invokeServerMethod(BaseMethodBinding.java:271)
    ... 40 common frames omitted
Caused by: ca.uhn.fhir.context.ConfigurationException: Property MedicationAdministration.medicationReference of type MedicationAdministration is not a resource: class ca.uhn.fhir.context.RuntimeChildChoiceDefinition
    at ca.uhn.fhir.jpa.dao.SearchBuilder.addPredicateReference(SearchBuilder.java:612)
    at ca.uhn.fhir.jpa.dao.SearchBuilder.searchForIdsWithAndOr(SearchBuilder.java:1951)
    at ca.uhn.fhir.jpa.dao.SearchBuilder.search(SearchBuilder.java:1832)
    at ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.search(BaseHapiFhirResourceDao.java:900)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
    at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
    at com.sun.proxy.$Proxy81.search(Unknown Source)
    at ca.uhn.fhir.jpa.rp.dstu2.MedicationAdministrationResourceProvider.search(MedicationAdministrationResourceProvider.java:157)
    ... 45 common frames omitted

I think i have a coorect query and hope you can help me with this Problem.

Best Regards,
Daniel

@Crudelus

This comment has been minimized.

Show comment
Hide comment
@Crudelus

Crudelus Sep 20, 2016

I also tried this Query on the http://fhirtest.uhn.ca/baseDstu2 server and there I'm also not allowed to query anything below the medication Reference. do you have any idea how this could be solved? I'm working on my Master Thesis right now and need to find Medication Administrations for a specific Medication.

Thank you for your Time,
Daniel

Crudelus commented Sep 20, 2016

I also tried this Query on the http://fhirtest.uhn.ca/baseDstu2 server and there I'm also not allowed to query anything below the medication Reference. do you have any idea how this could be solved? I'm working on my Master Thesis right now and need to find Medication Administrations for a specific Medication.

Thank you for your Time,
Daniel

@jamesagnew

This comment has been minimized.

Show comment
Hide comment
@jamesagnew

jamesagnew Sep 30, 2016

Owner

Hi @Crudelus, thanks for reporting!

I believe I have this all solved now. Basically there was a bug where chains didn't work if the parameter pointed to a path that had a choice containing both a resource and a non-resource type (e.g. MedicationAdministration.meditcation[x] is both reference and codeableconcept.

The following search now works: http://fhirtest.uhn.ca/baseDstu2/MedicationAdministration?medication.code=96068333

Owner

jamesagnew commented Sep 30, 2016

Hi @Crudelus, thanks for reporting!

I believe I have this all solved now. Basically there was a bug where chains didn't work if the parameter pointed to a path that had a choice containing both a resource and a non-resource type (e.g. MedicationAdministration.meditcation[x] is both reference and codeableconcept.

The following search now works: http://fhirtest.uhn.ca/baseDstu2/MedicationAdministration?medication.code=96068333

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment