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

DRR Measure Failure #27

Closed
jeffeastman opened this issue Dec 20, 2017 · 4 comments
Closed

DRR Measure Failure #27

jeffeastman opened this issue Dec 20, 2017 · 4 comments

Comments

@jeffeastman
Copy link

I'm getting e500s on some of the patients:

Sending 'GET' request to URL: http://localhost:8080/cqf-ruler/baseDstu3?_getpages=78a5d336-16a1-4712-88a7-3e28e33b7d40&_getpagesoffset=70&_count=10&_pretty=true&_bundletype=searchset
Response = 200

Sending 'GET' request to URL: http://localhost:8080/cqf-ruler/baseDstu3?_getpages=78a5d336-16a1-4712-88a7-3e28e33b7d40&_getpagesoffset=80&_count=10&_pretty=true&_bundletype=searchset
Response = 200

Sending 'GET' request to URL: http://localhost:8080/cqf-ruler/baseDstu3?_getpages=78a5d336-16a1-4712-88a7-3e28e33b7d40&_getpagesoffset=90&_count=10&_pretty=true&_bundletype=searchset
Response = 200

Sending 'GET' request to URL: http://localhost:8080/cqf-ruler/baseDstu3/Measure/measure-drr/$evaluate?patient=Patient-1137&startPeriod=2017-1&endPeriod=2017-12&_raw=true
e500 http://localhost:8080/cqf-ruler/baseDstu3/Patient/Patient-1137/_history/1

Sending 'GET' request to URL: http://localhost:8080/cqf-ruler/baseDstu3/Measure/measure-drr/$evaluate?patient=Patient-6529&startPeriod=2017-1&endPeriod=2017-12&_raw=true
e500 http://localhost:8080/cqf-ruler/baseDstu3/Patient/Patient-6529/_history/1

Sending 'GET' request to URL: http://localhost:8080/cqf-ruler/baseDstu3/Measure/measure-drr/$evaluate?patient=Patient-1132&startPeriod=2017-1&endPeriod=2017-12&_raw=true
e500 http://localhost:8080/cqf-ruler/baseDstu3/Patient/Patient-1132/_history/1

Sending 'GET' request to URL: http://localhost:8080/cqf-ruler/baseDstu3/Measure/measure-drr/$evaluate?patient=Patient-6481&startPeriod=2017-1&endPeriod=2017-12&_raw=true

2017-12-20 12:13:00.047 [http-nio-8080-exec-3] ERROR c.u.f.r.s.i.ExceptionHandlingInterceptor [ExceptionHandlingInterceptor.java:129] Failure during REST processing
ca.uhn.fhir.rest.server.exceptions.InternalErrorException: Failed to call access method
	at ca.uhn.fhir.rest.server.method.BaseMethodBinding.invokeServerMethod(BaseMethodBinding.java:253)
	at ca.uhn.fhir.rest.server.method.OperationMethodBinding.invokeServer(OperationMethodBinding.java:254)
	at ca.uhn.fhir.rest.server.method.BaseResourceReturningMethodBinding.doInvokeServer(BaseResourceReturningMethodBinding.java:157)
	at ca.uhn.fhir.rest.server.method.BaseResourceReturningMethodBinding.invokeServer(BaseResourceReturningMethodBinding.java:136)
	at ca.uhn.fhir.rest.server.method.OperationMethodBinding.invokeServer(OperationMethodBinding.java:229)
	at ca.uhn.fhir.rest.server.RestfulServer.handleRequest(RestfulServer.java:858)
	at ca.uhn.fhir.rest.server.RestfulServer.doGet(RestfulServer.java:1453)
	at ca.uhn.fhir.rest.server.RestfulServer.service(RestfulServer.java:1429)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	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:239)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:521)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1096)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:674)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
	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.GeneratedMethodAccessor228.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at ca.uhn.fhir.rest.server.method.BaseMethodBinding.invokeServerMethod(BaseMethodBinding.java:248)
	... 32 common frames omitted
Caused by: java.lang.IllegalArgumentException: The validated expression is false
	at org.apache.commons.lang3.Validate.isTrue(Validate.java:183)
	at ca.uhn.fhir.jpa.dao.BaseHapiFhirDao.translateForcedIdToPids(BaseHapiFhirDao.java:2086)
	at ca.uhn.fhir.jpa.dao.BaseHapiFhirDao.translateForcedIdToPid(BaseHapiFhirDao.java:1313)
	at ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.readEntity(BaseHapiFhirResourceDao.java:799)
	at ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.readEntity(BaseHapiFhirResourceDao.java:790)
	at ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.read(BaseHapiFhirResourceDao.java:767)
	at ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao.read(BaseHapiFhirResourceDao.java:752)
	at sun.reflect.GeneratedMethodAccessor208.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	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:282)
	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.$Proxy103.read(Unknown Source)
	at org.opencds.cqf.providers.JpaTerminologyProvider.expand(JpaTerminologyProvider.java:41)
	at org.opencds.cqf.providers.JpaDataProvider.retrieve(JpaDataProvider.java:73)
	at org.opencds.cqf.cql.elm.execution.RetrieveEvaluator.evaluate(RetrieveEvaluator.java:52)
	at org.opencds.cqf.cql.elm.execution.UnionEvaluator.evaluate(UnionEvaluator.java:81)
	at org.opencds.cqf.cql.elm.execution.QueryEvaluator.evaluate(QueryEvaluator.java:226)
	at org.opencds.cqf.cql.elm.execution.DistinctEvaluator.evaluate(DistinctEvaluator.java:39)
	at org.opencds.cqf.cql.elm.execution.ExpressionDefEvaluator.evaluate(ExpressionDefEvaluator.java:20)
	at org.opencds.cqf.cql.elm.execution.ExpressionRefEvaluator.evaluate(ExpressionRefEvaluator.java:14)
	at org.opencds.cqf.cql.elm.execution.QueryEvaluator.evaluate(QueryEvaluator.java:226)
	at org.opencds.cqf.cql.elm.execution.ExistsEvaluator.evaluate(ExistsEvaluator.java:32)
	at org.opencds.cqf.cql.elm.execution.AndEvaluator.evaluate(AndEvaluator.java:38)
	at org.opencds.cqf.cql.elm.execution.ExpressionDefEvaluator.evaluate(ExpressionDefEvaluator.java:20)
	at org.opencds.cqf.helpers.FhirMeasureEvaluator.resolveGroupings(FhirMeasureEvaluator.java:28)
	at org.opencds.cqf.helpers.FhirMeasureEvaluator.evaluate(FhirMeasureEvaluator.java:84)
	at org.opencds.cqf.helpers.FhirMeasureEvaluator.evaluate(FhirMeasureEvaluator.java:88)
	at org.opencds.cqf.providers.FHIRMeasureResourceProvider.evaluatePatientMeasure(FHIRMeasureResourceProvider.java:223)
	at org.opencds.cqf.providers.FHIRMeasureResourceProvider.evaluateMeasure(FHIRMeasureResourceProvider.java:195)
	... 36 common frames omitted
2017-12-20 12:13:00.048 [http-nio-8080-exec-3] INFO  logging.accesslog [LoggingInterceptor.java:155] ERROR - extended-operation-instance - Measure/measure-drr

@jeffeastman
Copy link
Author

This logic evaluates well in-memory

Measure = Measure/measure-drr
	denominator = 21
	initial-population = 35
	numerator = 17

@jeffeastman
Copy link
Author

Looks like this is blowing up evaluating this:

define "PHQ-9 Assessments":
	distinct (
		[Observation: "PHQ-9 Tool"]
		union
		[Observation: "PHQ-9 Modified Score"]
	) PHQ
		where PHQ.status.value in { 'final', 'amended' }
			and PHQ.value is not null

and inside of JpaDataProvider.retrieve here:

        if (codePath != null && !codePath.equals("")) {

            if (terminologyProvider != null && expandValueSets) {
                ValueSetInfo valueSetInfo = new ValueSetInfo().withId(valueSet);
                codes = terminologyProvider.expand(valueSetInfo);
            }
            if (codes != null) {
                TokenOrListParam codeParams = new TokenOrListParam();
                for (Code code : codes) {
                    codeParams.addOr(new TokenParam(code.getSystem(), code.getCode()));
                }
                map.add(convertPathToSearchParam(codePath), codeParams);
            }
        }

In this situation, the valueSet argument is null because of

// code "Major Depression and Dysthymia": '78667006' from "SNOMED"
code "PHQ-9 Modified Score": '00009' from "CQFramework"
code "PHQ-9 Tool": '44249-1' from "LOINC"

the codes argument, however, looks to be correctly set from the PHQ-9 Tool declaration. Might be that a simple valueSet != null in the 2nd if() clause would avoid the exception.

@jeffeastman
Copy link
Author

Yup. That fixed it:

e500 Denise Kristin Miles http://localhost:8080/cqf-ruler/baseDstu3/Patient/Patient-6538/_history/1
e500 Domingo Madera Gonzales http://localhost:8080/cqf-ruler/baseDstu3/Patient/Patient-1135/_history/1
e500 Donna Lynn Jones http://localhost:8080/cqf-ruler/baseDstu3/Patient/Patient-1138/_history/1
e500 Dora Marian Neal http://localhost:8080/cqf-ruler/baseDstu3/Patient/Patient-6543/_history/1
[here's where I inserted the test]
http://localhost:8080/cqf-ruler/baseDstu3/Patient/Patient-6526/_history/1
http://localhost:8080/cqf-ruler/baseDstu3/Patient/Patient-6501/_history/1
http://localhost:8080/cqf-ruler/baseDstu3/Patient/Patient-6527/_history/1
	patient is in initial-population

This was referenced Jan 18, 2018
@jeffeastman
Copy link
Author

Closing this issue since the latest pull no longer throws this error. I'm no longer getting any positive results with the test. But that's a different issue that may be in my test data.

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

No branches or pull requests

1 participant