Giter Club home page Giter Club logo

cqf-ruler's Introduction

cqf-ruler

Maven Central Build Status docker image project chat


NOTICE: The maintainers of the cqf-ruler (Alphora) and Smile Digital Health have merged! All the functionality in the cqf-ruler is in the process of being migrated upstream to the hapi-fhir-jpaserver-starter project


The cqf-ruler is based on the HAPI FHIR JPA Server Starter and adds a set of plugins that provide an implementation of FHIR's Clinical Reasoning Module, serve as a knowledge artifact repository, and a cds-hooks compatible clinical decision support service. The cqf-ruler provides an extensibility API to allow adding custom FHIR operations without the need to fork or clone the entire project.

See the wiki for more information

Usage

Public Sandbox

The public sandbox is not persistent, has no authentication, and is regularly reset. Do not store any sensitive data, PHI, or anything you need to be persistent on the sandbox:

GUI

Open API Docs

Swagger UI

Docker

The easiest way to get started with the cqf-ruler is to pull and run the docker image. For avoiding to run docker container by default root user permission, the container from this image will run with a user named cqfruler

docker pull alphora/cqf-ruler
docker run -p 8080:8080 alphora/cqf-ruler

This will make the cqf-ruler available on http://localhost:8080

Other options for deployment are listed on the wiki for more documentation.

GUI

The cqf-ruler provides the HAPI FHIR Tester UI which allows FHIR Resource CRUD at the server base url. That's http://localhost:8080 if you're running with the Docker command above.

Swagger / Open API

The cqf-ruler provides Swagger UI for the REST API and test interface at http://localhost:8080/fhir/swagger-ui/.

Similarly, Open API docs are available at http://localhost:8080/fhir/api-docs.

Example Operations

The wiki provides walkthroughs of several of the features of the cqf-ruler such as Quality Measure Processing.

In general, you need to load the cqf-ruler with FHIR Resources prior to using it. One way to do this is to start a cqf-ruler server and use the FHIR REST API to load resources. See Resource Loading on the wiki for a description of how to do that.

Development

Dependencies

Git Submodules

This project includes the hapi-fhir-jpaserver-starter project as a submodule and includes the compiled classes as a jar called cqf-ruler-external. Be sure to use the following command when cloning this repository to ensure the submodules are initialized correctly:

git clone --recurse-submodules https://github.com/DBCG/cqf-ruler.git

or if you've already checked out the repo, use

git submodule update --init --recursive

to clean up any unneeded or unused files, use:

git clean -fdx

Java

Go to http://www.oracle.com/technetwork/java/javase/downloads/ and download the latest (version 11 or higher) JDK for your platform, and install it.

Apache Maven

This project uses the Maven wrapper to ensure the correct version of Maven is available on your machine. Use ./mvnw to invoke it.

Build

./mvnw package

Run

To run the cqf-ruler directory from this project use:

java -jar server/target/cqf-ruler-server-*.war

Contributing

See Contributing on the wiki for more information about developing and contributing to the cqf-ruler project.

Plugins

The cqf-ruler offers a basic plugin framework to allow the addition of custom FHIR operations. See Plugins on the wiki for more information.

A complete example of a dynamically loaded plugin is available in the example directory.

Architecture

See Architecture on the wiki.

Getting Help

Additional documentation is on the wiki.

Bugs and feature requests can be filed with Github Issues.

The implementers are active on the official FHIR Zulip chat for CQL.

Inquires for commercial support can be directed to [email protected].

Related Projects

HAPI FHIR - Provides the FHIR API and server upon which the cqf-ruler is built.

Clinical Quality Language - Tooling in support of the CQL specification, including the CQL verifier/translator used in this project.

CQF Clinical Reasoning - Provides the CQL and Clinical Reasoning support used by the cqf-ruler.

CQF Tooling - Provides several operations that the cqf-ruler exposes are services, such as $refresh-generated content.

CQL Support for VS Code - CQL IDE plugin with syntax highlighting, linting, and local CQL evaluation.

Operation Migration

Several operations that once were built and exposed in the cqf-ruler have since migrated upstream into Clinical-Reasoning and exposed in versions of Hapi-Fhir & Hapi-Fhir-JpaServer-Starter.

This table maintains a current view of what operations have migrated out of this project and which are remaining.

  • Migrated = source code in Clinical-Reasoning
  • To Do = source code in Cqf-Ruler
Plugin ResourceType Operation Status
CR Measure $evaluate-measure migrated
CR Measure $submit-data migrated
CR Measure $care-gaps migrated
CR Measure $data-requirements To do
CR Measure $collect-data To do
CR PlanDefinition $apply migrated
CR PlanDefinition $package migrated
CR ActivityDefinition $apply migrated
CPG N/A $cql migrated
CPG Library $evaluate migrated
SDC Questionnaire $package migrated
SDC Questionnaire $populate migrated
SDC QuestionnaireResponse $extract migrated
SDC Observation $transform dropped1
RA Measure $davinci-ra.evaluate-measure dropped2
Case-Reporting MeasureReport $extract-line-list-data To do
Case-Reporting N/A $process-message-bundle To do
ERSD N/A $ersd-v2-to-v1-transform To do
cds-hooks N/A discovery and service In progress

1 This was a provisional operation in the SDC Ig that has been removed

2 The RA IG has evolved significantly and this operation needs to be reimplemented.

License

Copyright 2019+ Dynamic Content Group, LLC (dba Alphora)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

cqf-ruler's People

Contributors

barhodes avatar bryantaustin13 avatar brynrhodes avatar bvdh avatar c-schuler avatar capt-mac avatar cday-semanticbits avatar dehall avatar dependabot[bot] avatar drdavec avatar dubem7 avatar duncand avatar jinip avatar jpercival avatar jreyno77 avatar mdnazmulkarim avatar mdube7 avatar michael-misiaszek avatar ohsucmp avatar radamson avatar seanmcilvenna avatar sliver007 avatar workcartersmith avatar zackaustin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cqf-ruler's Issues

FHIRActivityDefinitionResourceProvider is not accessible for $apply operation

This is apparently a known issue in FHIRPlanDefinitionResourceProvider, because it's commented out with TODO as shown below. The temporary fix uses the DataProvider server when attempting to invoke ActivityDefinition $apply operation, but this fails when the CDS Hooks request uses a data server that is different from the cql-ruler server. At this time, when using ActivityDefinition as part of a plan, the data server must be cql-ruler. I want to use HSPC Sandbox for my data server, but that is not possible with current build.

// TODO - fix this
// FHIRActivityDefinitionResourceProvider activitydefinitionProvider = (FHIRActivityDefinitionResourceProvider) provider.resolveResourceProvider("ActivityDefinition");

Values in cds-hook Suggestion response

First, I want to say Thank You for this awesome framework and service for CQL and cds-hooks, it will be a huge benefit for me to learn CQL and develop/test cds-hook services using PlanDefinition!

I installed the server and am testing examples from cds-quality-summit. Comparing with cds-hooks spec, the Suggestion response appears to contain two errors:

  • the "type" value should be lower case, "create" instead of "CREATE"

  • As copied below from a response, the actions "resource" value is serialized into a string. This should be a Resource object, not a string??

    "suggestions": [
      {
        "actions": [
          {
            "type": "CREATE",
            "resource": "{\n  \"resourceType\": \"ProcedureRequest\",\n  \"status\": \"draft\",\n  \"intent\": \"order\",\n  \"code\": {\n    \"coding\": [\n      {\n        \"system\": \"http://www.ama-assn.org/go/cpt\",\n        \"code\": \"82272\",\n        \"display\": \"Fecal Occult Blood Test\"\n      }\n    ]\n  },\n  \"subject\": {\n    \"reference\": \"Patient/Patient-276\"\n  }\n}"
          }
        ]
    

Thanks!
Dave Carlson

DRR Measure Failure

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

Measure Evaluation Performance Awful

I'm evaluating CBP and other measures against patients on (http://52.54.163.181:8080/cqf-ruler/tester/home) with the mihin branch and the performance is terrible! Its taking many seconds to evaluate a single measure such as for Irma. If patients aren't in the IPP the processing goes much much faster.

Irma Carol Johnson [73]  (Patient-6484) is in initial-population
	and also in numerator
	and also in denominator

The server appears to be spending huge amounts of time waiting for some search result:

2018-05-29 11:37:13.561 [http-nio-8080-exec-2] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:638] Waiting, as we only have 0 results
2018-05-29 11:37:13.566 [http-nio-8080-exec-2] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:638] Waiting, as we only have 0 results
2018-05-29 11:37:13.572 [http-nio-8080-exec-2] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:638] Waiting, as we only have 0 results
2018-05-29 11:37:13.577 [http-nio-8080-exec-2] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:638] Waiting, as we only have 0 results
2018-05-29 11:37:13.583 [http-nio-8080-exec-2] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:638] Waiting, as we only have 0 results
2018-05-29 11:37:13.588 [http-nio-8080-exec-2] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:638] Waiting, as we only have 0 results
2018-05-29 11:37:13.593 [http-nio-8080-exec-2] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:638] Waiting, as we only have 0 results
2018-05-29 11:37:13.598 [http-nio-8080-exec-2] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:638] Waiting, as we only have 0 results
2018-05-29 11:37:13.604 [http-nio-8080-exec-2] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:638] Waiting, as we only have 0 results
2018-05-29 11:37:13.609 [http-nio-8080-exec-2] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:638] Waiting, as we only have 0 results
2018-05-29 11:37:13.615 [http-nio-8080-exec-2] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:638] Waiting, as we only have 0 results
2018-05-29 11:37:13.620 [http-nio-8080-exec-2] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:638] Waiting, as we only have 0 results
2018-05-29 11:37:13.625 [http-nio-8080-exec-2] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:638] Waiting, as we only have 0 results
2018-05-29 11:37:13.631 [http-nio-8080-exec-2] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:638] Waiting, as we only have 0 results
2018-05-29 11:37:13.636 [http-nio-8080-exec-2] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:638] Waiting, as we only have 0 results
2018-05-29 11:37:13.642 [http-nio-8080-exec-2] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:638] Waiting, as we only have 0 results
2018-05-29 11:37:13.647 [http-nio-8080-exec-2] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:638] Waiting, as we only have 0 results
2018-05-29 11:37:13.652 [http-nio-8080-exec-2] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:638] Waiting, as we only have 0 results
2018-05-29 11:37:13.658 [http-nio-8080-exec-2] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:638] Waiting, as we only have 0 results
2018-05-29 11:37:13.663 [http-nio-8080-exec-2] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:638] Waiting, as we only have 0 results
2018-05-29 11:37:13.668 [http-nio-8080-exec-2] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:638] Waiting, as we only have 0 results
2018-05-29 11:37:13.673 [http-nio-8080-exec-2] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:638] Waiting, as we only have 0 results
2018-05-29 11:37:13.679 [http-nio-8080-exec-2] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:638] Waiting, as we only have 0 results
2018-05-29 11:37:13.684 [http-nio-8080-exec-2] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:638] Waiting, as we only have 0 results
2018-05-29 11:37:13.689 [http-nio-8080-exec-2] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:638] Waiting, as we only have 0 results
2018-05-29 11:37:13.695 [http-nio-8080-exec-2] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:638] Waiting, as we only have 0 results
2018-05-29 11:37:13.700 [http-nio-8080-exec-2] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:638] Waiting, as we only have 0 results
2018-05-29 11:37:13.705 [http-nio-8080-exec-2] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:638] Waiting, as we only have 0 results
2018-05-29 11:37:13.711 [http-nio-8080-exec-2] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:638] Waiting, as we only have 0 results
2018-05-29 11:37:13.716 [http-nio-8080-exec-2] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:647] Proceeding, as we have 71 results
2018-05-29 11:37:13.716 [http-nio-8080-exec-2] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:662] Done syncing results

and
Completed search for 36 resources in 15743ms

Ruler Won't Start on Tomcat+OS-X High Sierra

I can run using jetty but on Tomcat the war throws this error. Its unique to High Sierra as it worked fine on Sierra:

2018-05-03 15:05:58.307 [localhost-startStop-1] INFO  org.hibernate.Version [Version.java:45] HHH000412: Hibernate Core {5.2.10.Final}
2018-05-03 15:05:58.310 [localhost-startStop-1] INFO  org.hibernate.cfg.Environment [Environment.java:213] HHH000206: hibernate.properties not found
2018-05-03 15:05:58.374 [localhost-startStop-1] INFO  o.h.annotations.common.Version [JavaReflectionManager.java:66] HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
2018-05-03 15:05:58.384 [localhost-startStop-1] WARN  o.s.w.c.s.AnnotationConfigWebApplicationContext [AbstractApplicationContext.java:551] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in org.opencds.cqf.config.FhirServerConfigDstu3: Invocation of init method failed; nested exception is java.lang.NoSuchFieldError: parallelCapableClassLoaderAvailable
2018-05-03 15:05:58.387 [localhost-startStop-1] ERROR o.s.web.context.ContextLoader [ContextLoader.java:350] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in org.opencds.cqf.config.FhirServerConfigDstu3: Invocation of init method failed; nested exception is java.lang.NoSuchFieldError: parallelCapableClassLoaderAvailable
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1704)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:583)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:502)
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:312)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1078)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:857)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4745)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5207)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
	at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:986)
	at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoSuchFieldError: parallelCapableClassLoaderAvailable
	at org.springframework.instrument.classloading.SimpleThrowawayClassLoader.<clinit>(SimpleThrowawayClassLoader.java:34)
	at org.springframework.orm.jpa.persistenceunit.SpringPersistenceUnitInfo.getNewTempClassLoader(SpringPersistenceUnitInfo.java:93)
	at org.hibernate.jpa.boot.internal.PersistenceUnitInfoDescriptor.getTempClassLoader(PersistenceUnitInfoDescriptor.java:78)
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.populate(EntityManagerFactoryBuilderImpl.java:785)
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:215)
	at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:163)
	at org.hibernate.jpa.boot.spi.Bootstrap.getEntityManagerFactoryBuilder(Bootstrap.java:32)
	at org.hibernate.jpa.boot.spi.Bootstrap.getEntityManagerFactoryBuilder(Bootstrap.java:89)
	at org.hibernate.jpa.HibernatePersistenceProvider.getEntityManagerFactoryBuilder(HibernatePersistenceProvider.java:176)
	at org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:151)
	at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:358)
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:384)
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:373)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1763)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1700)
	... 25 common frames omitted
03-May-2018 15:05:58.387 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
03-May-2018 15:05:58.461 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal Context [/cqf-ruler] startup failed due to previous errors
03-May-2018 15:05:58.477 WARNING [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc The web application [cqf-ruler] registered the JDBC driver [org.apache.derby.jdbc.AutoloadedDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
03-May-2018 15:05:58.478 WARNING [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [cqf-ruler] appears to have started a thread named [logback-1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 sun.misc.Unsafe.park(Native Method)

New Name?

With all the new functionality being added to this service, the cql_measure_processor name is no longer a very descriptive moniker for what the service is capable of. Consider revising...

Question About Libraries

The database-init-bundle.json contains two flavors of Library: text/cql and application/elm+xml. The Measure Processor examples refer to the elm libraries.

  • What is the function of the CQL libraries?
  • Are they automatically converted into ELM inside the cqf-ruler?
  • If so, where?
  • Where in the cqf-ruler are the ELM libraries evaluated?

Pointers into the code would be useful in helping me understand it.

ASF Measure Failure

I'm getting this failure for all patients on a localhost version of cqf-ruler. Also on our public FHIR PIT. I believe I have the latest HEDIS resources and cqf-ruler. Looks deep in the bowels:

2017-12-20 11:58:45.530 [http-nio-8080-exec-5] 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.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: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.QueryEvaluator.evaluate(QueryEvaluator.java:226)
	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.ExistsEvaluator.evaluate(ExistsEvaluator.java:32)
	at org.opencds.cqf.cql.elm.execution.OrEvaluator.evaluate(OrEvaluator.java:30)
	at org.opencds.cqf.cql.elm.execution.OrEvaluator.evaluate(OrEvaluator.java:30)
	at org.opencds.cqf.cql.elm.execution.OrEvaluator.evaluate(OrEvaluator.java:30)
	at org.opencds.cqf.cql.elm.execution.OrEvaluator.evaluate(OrEvaluator.java:30)
	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)
	... 37 common frames omitted
2017-12-20 11:58:45.530 [http-nio-8080-exec-5] INFO  logging.accesslog [LoggingInterceptor.java:155] ERROR - extended-operation-instance - Measure/measure-asf

Parameterized Source Data for Measure Evaluation

This is an enhancement request to enable users to pass in source data as a Bundle parameter to the measure evaluation operation. The evaluation will then use the passed in source data to evaluate the measure instead of querying the database. The passed in source data MUST NOT be loaded into the database or otherwise made public.

Cannot build the package because of failed test cases

Please double check again. I cannot build the package because of failed test cases.

Below is the surefire report for the test cases:

[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 s - in org.opencds.cqf.RulerHelperTests
[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR]   TestBase.runHedisCdsTests:76 ยป UnprocessableEntity HTTP 422 Unprocessable Enti...
[ERROR]   TestBase.runMeasureEvaluationTests:27 ยป UnprocessableEntity HTTP 422 Unprocess...
[INFO]
[ERROR] Tests run: 9, Failures: 0, Errors: 2, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:23 min
[INFO] Finished at: 2018-05-10T22:30:08+02:00
[INFO] ------------------------------------------------------------------------

-------------------------------------------------------------------------------
Test set: org.opencds.cqf.TestBase
-------------------------------------------------------------------------------
Tests run: 4, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 62.823 s <<< FAILURE! - in org.opencds.cqf.TestBase
runHedisCdsTests(org.opencds.cqf.TestBase)  Time elapsed: 0.171 s  <<< ERROR!
ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException: HTTP 422 Unprocessable Entity: Can not create multiple code systems with URI "https://www.cms.gov/Medicare/CMS-Forms/CMS-Forms/CMS-Forms-Items/CMS1196256.html/fl42", already have one with resource ID: CodeSystem/2.16.840.1.113883.3.88.12.3221.8.11
	at org.opencds.cqf.TestBase.runHedisCdsTests(TestBase.java:76)

runMeasureEvaluationTests(org.opencds.cqf.TestBase)  Time elapsed: 3.407 s  <<< ERROR!
ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException: HTTP 422 Unprocessable Entity: Can not create multiple code systems with URI "https://www.cms.gov/Medicare/CMS-Forms/CMS-Forms/CMS-Forms-Items/CMS1196256.html/fl42", already have one with resource ID: CodeSystem/2.16.840.1.113883.3.88.12.3221.8.11
	at org.opencds.cqf.TestBase.runMeasureEvaluationTests(TestBase.java:27)

Opioid "Triple Threat" Detection

Concurrent use of three types of medications โ€“ opioids, benzodiazepines and muscle relaxants โ€“ called the โ€œTriple Threat,โ€ puts patients at a significant risk for overdose and death. This is probably out of scope right now for this hook, but its an important use case to consider for the future.

There is currently Rx data on http://54.165.182.195:8080 for patient Terry Zavala (Patient-6497) for Xanax and Flexeril and we will use it in the upcoming hackathon.

Infinite Loop In TerminologySvcImpl

When I attempt to post ValueSet 2.16.840.1.113883.3.464.1004.1453 using the latest build and the same provisioning tests I've been using for months, the program hangs at

Sending 'PUT' request to URL : http://localhost:8080/cqf-ruler/baseDstu3/ValueSet/2.16.840.1.113883.3.464.1004.1453

and the server seems to be looping forever deleting old code system versions. Any ideas?

2018-07-24 16:14:25.897 [http-nio-8080-exec-3] INFO  c.u.f.j.t.BaseHapiTerminologySvcImpl [BaseHapiTerminologySvcImpl.java:850]  * Deleting code system version 371
2018-07-24 16:14:25.899 [http-nio-8080-exec-3] INFO  c.u.f.j.t.BaseHapiTerminologySvcImpl [BaseHapiTerminologySvcImpl.java:850]  * Deleting code system version 372
2018-07-24 16:14:25.901 [http-nio-8080-exec-3] INFO  c.u.f.j.t.BaseHapiTerminologySvcImpl [BaseHapiTerminologySvcImpl.java:850]  * Deleting code system version 373
2018-07-24 16:14:25.904 [http-nio-8080-exec-3] INFO  c.u.f.j.t.BaseHapiTerminologySvcImpl [BaseHapiTerminologySvcImpl.java:850]  * Deleting code system version 374
2018-07-24 16:14:25.906 [http-nio-8080-exec-3] INFO  c.u.f.j.t.BaseHapiTerminologySvcImpl [BaseHapiTerminologySvcImpl.java:850]  * Deleting code system version 375
2018-07-24 16:14:25.908 [http-nio-8080-exec-3] INFO  c.u.f.j.t.BaseHapiTerminologySvcImpl [BaseHapiTerminologySvcImpl.java:850]  * Deleting code system version 376
2018-07-24 16:14:25.910 [http-nio-8080-exec-3] INFO  c.u.f.j.t.BaseHapiTerminologySvcImpl [BaseHapiTerminologySvcImpl.java:850]  * Deleting code system version 377
2018-07-24 16:14:25.913 [http-nio-8080-exec-3] INFO  c.u.f.j.t.BaseHapiTerminologySvcImpl [BaseHapiTerminologySvcImpl.java:850]  * Deleting code system version 378
2018-07-24 16:14:25.915 [http-nio-8080-exec-3] INFO  c.u.f.j.t.BaseHapiTerminologySvcImpl [BaseHapiTerminologySvcImpl.java:850]  * Deleting code system version 379
2018-07-24 16:14:25.917 [http-nio-8080-exec-3] INFO  c.u.f.j.t.BaseHapiTerminologySvcImpl [BaseHapiTerminologySvcImpl.java:850]  * Deleting code system version 380
2018-07-24 16:14:25.919 [http-nio-8080-exec-3] INFO  c.u.f.j.t.BaseHapiTerminologySvcImpl [BaseHapiTerminologySvcImpl.java:850]  * Deleting code system version 381
2018-07-24 16:14:25.922 [http-nio-8080-exec-3] INFO  c.u.f.j.t.BaseHapiTerminologySvcImpl [BaseHapiTerminologySvcImpl.java:850]  * Deleting code system version 382
2018-07-24 16:14:25.926 [http-nio-8080-exec-3] INFO  c.u.f.j.t.BaseHapiTerminologySvcImpl [BaseHapiTerminologySvcImpl.java:850]  * Deleting code system version 383
2018-07-24 16:14:25.928 [http-nio-8080-exec-3] INFO  c.u.f.j.t.BaseHapiTerminologySvcImpl [BaseHapiTerminologySvcImpl.java:850]  * Deleting code system version 384

Does Ruler Return Correct evaluatedResourceBundle?

This query gets back a bundle from the MiHIN Connectathon Quality Server but it can't seem to return the evaluated resource bundle. So I wonder if this is working or is it my test code (again)?

Sending 'GET' request to URL: https://fire-pit.mihin.org/cqf-ruler/baseDstu3/Measure/measure-bcs/$evaluate-measure?patient=Patient-1137&periodStart=2016-1&periodEnd=2018-12&reportType=patient

Sending 'GET' request to URL: https://fire-pit.mihin.org/cqf-ruler/baseDstu3/#8d416c27-7a7b-4621-9d9f-eefcadc5e73e?_raw=true
e400 null
java.lang.RuntimeException: FHIR Read error 400
	at org.mihin.patientgen.fhir.FhirServer.read(FhirServer.java:129)
	at org.mihin.patientgen.cql.MiHINConnectathonTests.convertReport(MiHINConnectathonTests.java:293)
	at org.mihin.patientgen.cql.MiHINConnectathonTests.testConvertMeasureReport(MiHINConnectathonTests.java:282)

How To Set Measurement Period?

For my local testing I'm creating a MeasureEvaluation using my own dataProvider and setting the Measurement Period as below. When the Context.isType compares my class java.util.Date with class org.opencds.cqf.cql.runtime.DateTime it fails.

		Interval period = new Interval(Population.getReportStartDate().getTime(), true,
				Population.getReportEndDate().getTime(), true);
		cxt.setParameter(null, "Measurement Period", period);
		MeasureReport report = new MeasureEvaluation(dataProvider, period).evaluatePatientMeasure(measure, cxt,
				patient.getResourceId());

I tried using DateTime like in FHIRMeasureResourceProvider but that blows up somewhere else because DateTimes can't be cast to Dates.

        context.setParameter(
                null, "Measurement Period",
                new Interval(
                        DateTime.fromJavaDate((Date) measurementPeriod.getStart()), true,
                        DateTime.fromJavaDate((Date) measurementPeriod.getEnd()), true
                )
        );

User Not Required in Hook Request

The user field of the hook is not required. The patient field is required however it is informational only and is not interpreted as a resourceId. I'm unsure of the semantics here, so close this if its not an issue.

Sending 'POST' request to URL: http://54.165.182.195:8080/cqf-ruler/cds-services/cdc-opioid-guidance
{
  "hook": "medication-prescribe",
  "hookInstance": "5bacb720-f493-4fe7-8750-c02595cbb72b",
  "fhirServer": "http://localhost:8080/cqf-ruler/baseDstu3",
  "patient": "Patient-xyz",
  "context": [
{
  "resourceType": "MedicationRequest",
  "status": "active",
  "medicationCodeableConcept": {
    "coding": [
      {
        "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
        "code": "197696",
        "display": "fentaNYL 75 MCG/HR 3 Day Transdermal Patch"
      }
    ]
  },
  "subject": {
    "reference": "Patient/Patient-1121",
    "display": "Jerry Phillip Goodwall [80]"
  },
  "authoredOn": "2017-01-01T00:00:00-05:00",
  "reasonCode": [
    {
      "coding": [
        {
          "system": "http://snomed.info/sct",
          "code": "82423001",
          "display": "Chronic pain"
        }
      ],
      "text": "Chronic pain"
    }
  ],
  "dosageInstruction": [
    {
      "text": "Apply once every three days for pain.",
      "timing": {
        "repeat": {
          "count": 1,
          "durationUnit": "d",
          "frequency": 1,
          "frequencyMax": 1,
          "period": 3
        }
      },
      "asNeededBoolean": false,
      "doseQuantity": {
        "value": 1,
        "unit": "tbl",
        "system": "http://unitsofmeasure.org",
        "code": "tbl"
      }
    }
  ],
  "dispenseRequest": {
    "quantity": {
      "value": 30,
      "unit": "day",
      "system": "http://unitsofmeasure.org",
      "code": "d"
    }
  }
}]
}

Response = 200
{
  "cards": [
    {},
    {
      "summary": "High risk for opioid overdose.",
      "detail": "Total morphine milligram equivalent (MME) exceeds recommended amount. Taper to less than 50."
    }
  ]
}

Opioid Hook Prefetch Rx Not Counted in MME

Seems like 4x of Oxycontin 15mg 3x day should be over the 50mg limit, so it doesn't seem like the prefetch Rx are included in the MME calculation. The actual hook request is on the other issue. The testhookFentaNYLPrefetchFentaNYL test probably illustrates the same issue. Running locally where the MME is returned it has the same result as testhookFentaNYLNoPrefetch.

hookCODONE15mgPrefix3RxOxyCODONE15mg:

Sending 'POST' request to URL: http://54.165.182.195:8080/cqf-ruler/cds-services/cdc-opioid-guidance
{
  "cards": [
    {}
  ]
}

Null ValueSet.getId() Query Evaluating DMS, DRR with Histories v14

This also works in-memory with but fails on cqf-ruler server.

Getting ValueSet = null **(my added debug code to JpaTerminologyProvider)**
2017-11-06 15:45:48.134 [http-nio-8080-exec-8] 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:175)
	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.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: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.GeneratedMethodAccessor177.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:42)
	at org.opencds.cqf.providers.JpaDataProvider.retrieve(JpaDataProvider.java:69)
	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.resolveRelationship(QueryEvaluator.java:38)
	at org.opencds.cqf.cql.elm.execution.QueryEvaluator.evaluate(QueryEvaluator.java:236)
	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)
	... 37 common frames omitted
2017-11-06 15:45:48.134 [http-nio-8080-exec-8] INFO  logging.accesslog [LoggingInterceptor.java:155] ERROR - extended-operation-instance - Measure/measure-dms

Implement $care-gaps prototype operation for Measure evaluation

In Parameters:
measure ID - String - required
patient ID - String - required
topic - String - required
periodStart - String - required
periodEnd - String - required

Returns a Bundle containing:
Composition resource with human friendly summary of the operation results
MeasureReport resources for results that failed to satisfy the improvementNotation for the Measure

The "topic" parameter identifies which Measures to run and corresponds to the topic property for the Measure resource. Note that this is a prototype and only does patient-level evaluation at this time.

Batch Measure Evaluation

This is an enhancement request for batch measure evaluation. The gist of this ticket is to provide a way for users to evaluate a Bundle of measures, which would then return a Bundle of MeasureReports.

ensure value sets with urn oid prefix work

Officially a valueset referenced in terms of an oid should typically be declared with the prefix "urn:oid:" before the number sequence. The task of this ticket is to ensure that the CQF Ruler accepts CQL value set declarations with this prefix and handles them intelligently, so users can write to this best practice and not have to worry if an implementation otherwise requires the prefix to be absent or present.

DSF Measure Failure

I'm getting this result for all patients evaluating the DSF measure against (I think) all the latest bits:

2017-12-20 12:05:19.076 [http-nio-8080-exec-4] 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: ca.uhn.fhir.parser.DataFormatException: Invalid date/time format: "-value"
	at ca.uhn.fhir.model.primitive.BaseDateTimeDt.throwBadDateFormat(BaseDateTimeDt.java:650)
	at ca.uhn.fhir.model.primitive.BaseDateTimeDt.parseInt(BaseDateTimeDt.java:444)
	at ca.uhn.fhir.model.primitive.BaseDateTimeDt.parse(BaseDateTimeDt.java:347)
	at ca.uhn.fhir.model.primitive.BaseDateTimeDt.parse(BaseDateTimeDt.java:39)
	at ca.uhn.fhir.model.api.BasePrimitive.setValueAsString(BasePrimitive.java:111)
	at ca.uhn.fhir.model.primitive.BaseDateTimeDt.setValueAsString(BaseDateTimeDt.java:638)
	at ca.uhn.fhir.rest.param.DateParam.setValueAsString(DateParam.java:202)
	at ca.uhn.fhir.rest.param.DateParam.<init>(DateParam.java:89)
	at org.opencds.cqf.providers.JpaDataProvider.retrieve(JpaDataProvider.java:88)
	at org.opencds.cqf.cql.elm.execution.RetrieveEvaluator.evaluate(RetrieveEvaluator.java:52)
	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:05:19.076 [http-nio-8080-exec-4] INFO  logging.accesslog [LoggingInterceptor.java:155] ERROR - extended-operation-instance - Measure/measure-dsf

Build Error

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 24.713 s
[INFO] Finished at: 2018-05-15T10:20:14-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project cqf-ruler: Compilation failure
[ERROR] /Users/jeff/gitrepo/cqf-ruler/src/main/java/org/opencds/cqf/providers/FHIRMeasureResourceProvider.java:[88,42] cannot find symbol
[ERROR] symbol: method getDao(java.lang.Class<org.hl7.fhir.dstu3.model.Library>)
[ERROR] location: interface ca.uhn.fhir.jpa.dao.IFhirResourceDao<capture#1 of ? extends org.hl7.fhir.instance.model.api.IAnyResource>
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

e500 in DMS Evaluation

For some patients, I'm getting an NPE exception in IncludedInEvaluator.included(..) because the precisions of the left and right Intervals are different in DMS QueryEvaluator 214's where clause:

left = Interval [ 2017-09-01T00:00:00, 2017-09-01T00:00:00 ]
right = Interval [ 2017-09-01T00:00:00.000, 2017-12-30T23:59:59.999 ]

This is because TimeBaseTemporal.compareTo(..) returns null in this situation. The query & where clause is:

              <source localId="214" xsi:type="Query">
                  <source localId="203" alias="E">
                     <expression localId="202" name="Depression Encounters" xsi:type="ExpressionRef"/>
                  </source>
                  <where localId="208" xsi:type="IncludedIn">
                     <operand localId="206" name="PeriodToIntervalOfDT" xsi:type="FunctionRef">
                        <operand localId="205" path="period" scope="E" xsi:type="Property"/>
                     </operand>
                     <operand localId="207" name="Assessment Period Three" xsi:type="ExpressionRef"/>
                  </where>

Haven't yet tracked down why this is occurring, so more to come on this.

e500 Evaluating Opioid CDS Hook

I also tried this with line 77 of OpioidGuidanceProcessor changed to be the same as the name of the Library I imported from opioid-cds/resources. Both versions returned the same e500. None of the execution of this post shows up in the catalina.out log on Tomcat so its hard to get more information.

Library library = getLibraryLoader().load(new org.cqframework.cql.elm.execution.VersionedIdentifier().withId("opioidcds-stu3").withVersion("0.1.0"));

Sending 'POST' request to URL: http://localhost:8080/cqf-ruler/cds-services/cdc-opioid-guidance

{
	"hook": "medication-prescribe",
	"hookInstance": "5bacb720-f493-4fe7-8750-c02595cbb72b",
	"fhirServer": "http://localhost:8080/cqf-ruler/baseDstu3",
	"user": "Practitioner-2516",
	"patient": "Patient-1121",
	"context": [
		{
			"resourceType": "MedicationRequest",
			"authoredOn": "2017-01-01",
			"status": "active",
			"subject": {
				"reference": "Patient/Patient-1121",
				"display": "Jerry Phillip Goodwall"
			},
			"reasonCode": [
				{
					"coding": [
						{
							"system": "http://snomed.info/sct",
							"code": "82423001",
							"display": "Chronic pain"
						}
					],
					"text": "Chronic pain"
				}
			]
		}
	],
	"prefetch": {
		
	}
}

Returns e500

How Is "patient-list" Being Determined?

I've written an in-memory test that evaluates evaluator.evaluate(context, measure, patients, measurementPeriod, MeasureReport.MeasureReportType.PATIENTLIST); inside FHIRMeasureResourceProvider.evaluatePatientListMeasure(...) by building the patients list by looking at all of the practitioner's Encounters' subjects. This test produces reasonable results.

I'm not sure by reading the code, how evaluatePatientListMeasure(...) is doing it, however. I tried adding generalPractitioners to my test patients and am still getting e500 errors because the code in the method isn't finding any patients.

BTW I think throwing an exception is a terrible way to handle this situation! IMHO a better approach would be to return a MeasureReport with all 0 counts. Then the client doesn't have to catch the e500 and figure out what to do. But perhaps this is just a temporary hack?

Opioid Hook Card Anomalies

When I run my tests on yesterdays? cqf-ruler I get these cards back:

hookFentaNYLPrefetchFentaNYL:

Sending 'POST' request to URL: http://localhost:8080/cqf-ruler/cds-services/cdc-opioid-guidance
{
  "cards": [
    {
      "summary": "High risk for opioid overdose - taper now",
      "indicator": "warning",
      "detail": "Total morphine milligram equivalent (MME) is 504.000mg/d. Taper to less than 50."
    }
  ]
}


hookOxyCODONE15mgPrefetchFentaNYL:

Sending 'POST' request to URL: http://localhost:8080/cqf-ruler/cds-services/cdc-opioid-guidance
{
  "cards": [
    {
      "summary": "High risk for opioid overdose - taper now",
      "indicator": "warning",
      "detail": "Total morphine milligram equivalent (MME) is 526.500mg/d. Taper to less than 50."
    }
  ]
}


hookFentaNYLNoPrefetch:

Sending 'POST' request to URL: http://localhost:8080/cqf-ruler/cds-services/cdc-opioid-guidance
{
  "cards": [
    {
      "summary": "High risk for opioid overdose - taper now",
      "indicator": "warning",
      "detail": "Total morphine milligram equivalent (MME) is 504.000mg/d. Taper to less than 50."
    }
  ]
}


hookOxyCODONE80mgPrefetchFentaNYL:

Sending 'POST' request to URL: http://localhost:8080/cqf-ruler/cds-services/cdc-opioid-guidance
{
  "cards": [
    {
      "summary": "High risk for opioid overdose - taper now",
      "indicator": "warning",
      "detail": "Total morphine milligram equivalent (MME) is 624.000mg/d. Taper to less than 50."
    }
  ]
}


hookCODONE15mgPrefix3RxOxyCODONE15mg:

Sending 'POST' request to URL: http://localhost:8080/cqf-ruler/cds-services/cdc-opioid-guidance
{
  "cards": [
    {
      "summary": "Success",
      "indicator": "info",
      "detail": "Prescription satisfies recommendation #5 of the cdc opioid guidance."
    }
  ]
}


hookOxyCODONE80mgNoPrefix:

Sending 'POST' request to URL: http://localhost:8080/cqf-ruler/cds-services/cdc-opioid-guidance
{
  "cards": [
    {
      "summary": "High risk for opioid overdose - taper now",
      "indicator": "warning",
      "detail": "Total morphine milligram equivalent (MME) is 120.00mg/d. Taper to less than 50."
    }
  ]
}

When I run the same tests on today's cqf-ruler I get these cards back. Extra empty card and no MME values:

hookFentaNYLPrefetchFentaNYL:


Sending 'POST' request to URL: http://54.165.182.195:8080/cqf-ruler/cds-services/cdc-opioid-guidance
{
  "cards": [
    {},
    {
      "summary": "High risk for opioid overdose.",
      "detail": "Total morphine milligram equivalent (MME) exceeds recommended amount. Taper to less than 50."
    }
  ]
}


hookOxyCODONE15mgPrefetchFentaNYL:

Sending 'POST' request to URL: http://54.165.182.195:8080/cqf-ruler/cds-services/cdc-opioid-guidance
{
  "cards": [
    {},
    {
      "summary": "High risk for opioid overdose.",
      "detail": "Total morphine milligram equivalent (MME) exceeds recommended amount. Taper to less than 50."
    }
  ]
}


hookFentaNYLNoPrefetch:

Sending 'POST' request to URL: http://54.165.182.195:8080/cqf-ruler/cds-services/cdc-opioid-guidance
{
  "cards": [
    {},
    {
      "summary": "High risk for opioid overdose.",
      "detail": "Total morphine milligram equivalent (MME) exceeds recommended amount. Taper to less than 50."
    }
  ]
}


hookOxyCODONE80mgPrefetchFentaNYL:

Sending 'POST' request to URL: http://54.165.182.195:8080/cqf-ruler/cds-services/cdc-opioid-guidance
{
  "cards": [
    {},
    {
      "summary": "High risk for opioid overdose.",
      "detail": "Total morphine milligram equivalent (MME) exceeds recommended amount. Taper to less than 50."
    }
  ]
}


hookCODONE15mgPrefix3RxOxyCODONE15mg:

Sending 'POST' request to URL: http://54.165.182.195:8080/cqf-ruler/cds-services/cdc-opioid-guidance
{
  "cards": [
    {}
  ]
}


hookOxyCODONE80mgNoPrefix:

Sending 'POST' request to URL: http://54.165.182.195:8080/cqf-ruler/cds-services/cdc-opioid-guidance
{
  "cards": [
    {},
    {
      "summary": "High risk for opioid overdose.",
      "detail": "Total morphine milligram equivalent (MME) exceeds recommended amount. Taper to less than 50."
    }
  ]
}

hookCODONE15mgPrefix3RxOxyCODONE15mg.json.txt
hookFentaNYLNoPrefetch.json.txt
hookFentaNYLPrefetchFentaNYL.json.txt
hookOxyCODONE15mgPrefetchFentaNYL.json.txt
hookOxyCODONE80mgNoPrefix.json.txt
hookOxyCODONE80mgPrefetchFentaNYL.json.txt

e500s On Tomcat

Creating an issue for this so we can track it. These tests all return values with Jetty.

hookFentaNYLPrefetchFentaNYL:

Sending 'POST' request to URL: http://localhost:8080/cqf-ruler/cds-services/cdc-opioid-guidance
Returned e500


hookOxyCODONE15mgPrefetchFentaNYL:

Sending 'POST' request to URL: http://localhost:8080/cqf-ruler/cds-services/cdc-opioid-guidance
Returned e500


hookFentaNYLNoPrefetch:

Sending 'POST' request to URL: http://localhost:8080/cqf-ruler/cds-services/cdc-opioid-guidance
Returned e500


hookOxyCODONE80mgPrefetchFentaNYL:

Sending 'POST' request to URL: http://localhost:8080/cqf-ruler/cds-services/cdc-opioid-guidance
Returned e500


hookCODONE15mgPrefix3RxOxyCODONE15mg:

Sending 'POST' request to URL: http://localhost:8080/cqf-ruler/cds-services/cdc-opioid-guidance
Returned e500


hookOxyCODONE80mgNoPrefix:

Sending 'POST' request to URL: http://localhost:8080/cqf-ruler/cds-services/cdc-opioid-guidance
Returned e500

Subject Not Required In Context Rx

It doesn't appear to be required. Is this ok? It certainly makes it simpler to write tests if its not needed. I'll check if its required in prefetch next and add a comment.

Sending 'POST' request to URL: http://54.165.182.195:8080/cqf-ruler/cds-services/cdc-opioid-guidance
{
  "hook": "medication-prescribe",
  "hookInstance": "5bacb720-f493-4fe7-8750-c02595cbb72b",
  "fhirServer": "http://localhost:8080/cqf-ruler/baseDstu3",
  "user": "Practitioner-2516",
  "patient": "Patient-1121",
  "context": [
{
  "resourceType": "MedicationRequest",
  "status": "active",
  "medicationCodeableConcept": {
    "coding": [
      {
        "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
        "code": "197696",
        "display": "fentaNYL 75 MCG/HR 3 Day Transdermal Patch"
      }
    ]
  },
  "authoredOn": "2017-01-01T00:00:00-05:00",
  "reasonCode": [
    {
      "coding": [
        {
          "system": "http://snomed.info/sct",
          "code": "82423001",
          "display": "Chronic pain"
        }
      ],
      "text": "Chronic pain"
    }
  ],
  "dosageInstruction": [
    {
      "text": "Apply once every three days for pain.",
      "timing": {
        "repeat": {
          "count": 1,
          "durationUnit": "d",
          "frequency": 1,
          "frequencyMax": 1,
          "period": 3
        }
      },
      "asNeededBoolean": false,
      "doseQuantity": {
        "value": 1,
        "unit": "tbl",
        "system": "http://unitsofmeasure.org",
        "code": "tbl"
      }
    }
  ],
  "dispenseRequest": {
    "quantity": {
      "value": 30,
      "unit": "day",
      "system": "http://unitsofmeasure.org",
      "code": "d"
    }
  }
}]
}

Response = 200
{
  "cards": [
    {},
    {
      "summary": "High risk for opioid overdose.",
      "detail": "Total morphine milligram equivalent (MME) exceeds recommended amount. Taper to less than 50."
    }
  ]
}

Fentanyl Patch MME=504 Too High

From https://www.cms.gov/Medicare/Prescription-Drug-Coverage/PrescriptionDrugCovContra/Downloads/Opioid-Morphine-EQ-Conversion-Factors-March-2015.pdf:

The MME conversion factor for fentanyl patches is based on the assumption that one milligram of parenteral fentanyl is equivalent to 100 milligrams of oral morphine and that one patch delivers the dispensed micrograms per hour over a 24 hour day. Example: 25 ug/hr fentanyl patch * 24 hrs = 600 ug/day fentanyl = 60 mg/day oral morphine milligram equivalent. In other words, the conversion factor not accounting for days of use would be 60/25 or 2.4. However, since the fentanyl patch remains in place for 3 days, we have multiplied the conversion factor by 3 (2.4 X 3 = 7.2). In this example, MME/day for ten 25 ฮผg/hr fentanyl patches dispensed for use over 30 days would work out as follows: Example: 25 ug/hr fentanyl patch * (10 patches/30 days)* 7.2 = 60 MME/day.

A 75 mcg/day patch ought to be 180mme. Still way too high but not 504

MeasureGroupComponent Codes Don't Reflect Multiple Populations

The odd numerator and denominator counts in my tests are due to a defect in the FhirMeasureEvaluator that does not properly code the MeasureReportGroupComponents to handle multiple numerators, denominators, etc. For example, DMS measure has 3 numerators and 3 denominators that aren't being coded correctly. Here's a snippet from a successful MeasureReport:

  "type": "individual",
  "measure": {
    "reference": "Measure/measure-dms"
  },
  "patient": {
    "reference": "Patient/Patient-2517"
  },
  "period": {
    "start": "2017-01-01T00:00:00-05:00",
    "end": "2017-12-31T00:00:00-05:00"
  },
  "group": [
    {
      "population": [
        {
          "code": {
            "coding": [
              {
                "code": "initial-population"
              }
            ]
          },
          "count": 1
        },
        {
          "code": {
            "coding": [
              {
                "code": "numerator"
              }
            ]
          },
          "count": 1
        },
        {
          "code": {
            "coding": [
              {
                "code": "denominator"
              }
            ]
          },
          "count": 1
        },
        {
          "code": {
            "coding": [
              {
                "code": "numerator"
              }
            ]
          },
          "count": 1
        },
        {
          "code": {
            "coding": [
              {
                "code": "denominator"
              }
            ]
          },
          "count": 1
        },
        {
          "code": {
            "coding": [
              {
                "code": "numerator"
              }
            ]
          },
          "count": 1
        },
        {
          "code": {
            "coding": [
              {
                "code": "denominator"
              }
            ]
          },
          "count": 1
        }
      ]
    }
  ],
  "evaluatedResources": {
    "reference": "#cd3c4385-e2bb-4218-89c0-d044c99c68e9"
  }
}
Aaron Kelly Peters [75] is in initial-population
Aaron Kelly Peters [75] is in numerator
Aaron Kelly Peters [75] is in denominator
Aaron Kelly Peters [75] is in numerator
Aaron Kelly Peters [75] is in denominator
Aaron Kelly Peters [75] is in numerator
Aaron Kelly Peters [75] is in denominator

Use knowledge model server for terminology as default

In PatientViewProcessor (and all other CDS processors), the terminology server is set to use the data server from the CDS Hooks request, as shown below. I think that a better default assumption is that the terminology server will be same as the knowledge asset server that hosts the PlanDefinition resources. In my test environment, I use the HSPC Sandbox for my data server. I propose that the default setting be changed.

I am not too familiar with HAPI framework and unsure how to modify this code to set the terminology server to be same as the library/model server. Suggestions?

// TODO - assuming terminology service is same as data provider - not a great assumption...
dstu3Provider.setTerminologyProvider(new FhirTerminologyProvider().withEndpoint(request.getFhirServer()));

Date Error Evaluating DSF with Histories v14

Measure evaluates fine in-memory with mostly cqf-ruler code but fails on cqf-ruler.

Caused by: ca.uhn.fhir.parser.DataFormatException: Invalid date/time format: "-value"
	at ca.uhn.fhir.model.primitive.BaseDateTimeDt.throwBadDateFormat(BaseDateTimeDt.java:650)
	at ca.uhn.fhir.model.primitive.BaseDateTimeDt.parseInt(BaseDateTimeDt.java:444)
	at ca.uhn.fhir.model.primitive.BaseDateTimeDt.parse(BaseDateTimeDt.java:347)
	at ca.uhn.fhir.model.primitive.BaseDateTimeDt.parse(BaseDateTimeDt.java:39)
	at ca.uhn.fhir.model.api.BasePrimitive.setValueAsString(BasePrimitive.java:111)
	at ca.uhn.fhir.model.primitive.BaseDateTimeDt.setValueAsString(BaseDateTimeDt.java:638)
	at ca.uhn.fhir.rest.param.DateParam.setValueAsString(DateParam.java:202)
	at ca.uhn.fhir.rest.param.DateParam.<init>(DateParam.java:89)
	at org.opencds.cqf.providers.JpaDataProvider.retrieve(JpaDataProvider.java:84)
	at org.opencds.cqf.cql.elm.execution.RetrieveEvaluator.evaluate(RetrieveEvaluator.java:52)
	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)
	... 37 common frames omitted
2017-11-06 15:09:39.511 [http-nio-8080-exec-5] INFO  logging.accesslog [LoggingInterceptor.java:155] ERROR - extended-operation-instance - Measure/measure-dsf

Measure Evaluation Needs Better Documentation

Quality Measure Processing documentation is unhelpful in understanding what has changed recently. This is a showstopper for my testing.

Sending 'GET' request to URL: http://52.54.163.181:8080/cqf-ruler/baseDstu3/Measure/measure-bcs/$evaluate-measure?patient=Patient-6490&periodStart=2016-1
e500 Carolyn Hickman Vega http://52.54.163.181:8080/cqf-ruler/baseDstu3/Patient/Patient-6490/_history/1

Sending 'GET' request to URL: http://52.54.163.181:8080/cqf-ruler/baseDstu3/Measure/measure-bcs/$evaluate-measure?patient=Patient-6487&periodStart=2016-1
e500 Cassandra Graham Vasquez http://52.54.163.181:8080/cqf-ruler/baseDstu3/Patient/Patient-6487/_history/1

Sending 'GET' request to URL: http://52.54.163.181:8080/cqf-ruler/baseDstu3/Measure/measure-bcs/$evaluate-measure?patient=Patient-6485&periodStart=2016-1
e500 Catherine Reyes Herman http://52.54.163.181:8080/cqf-ruler/baseDstu3/Patient/Patient-6485/_history/1

PlanDefinition can be applied by $apply operation but there is an error when uses it as cds-services

Case 1: I were using plandefinition-apply.json to test $apply operation. It works as expected.
However, I made some changes to the apply-example PlanDefinition as below:

"library": [
  {
    "reference": "Library/plandefinitionApplyTest"
  }
],
"action": [
  {
    "triggerDefinition": {
      "type": "named-event",
      "eventName": "medication-prescribe"
    }, // <-- **NEW CHANGE HERE**
    "condition": [
      {
        "kind": "applicability",
        "description": "Simple test",
        "language": "text/cql",
        "expression": "plandefinitionApplyTest.Results"
      }
    ],
    "dynamicValue": [
      {
        "description": "Set CarePlan detail definition",
        "path": "title",
        "expression": "plandefinitionApplyTest.\"Dynamic Detail Definition\""
      }
    ]
  }
]

After that, I created a request, sent it to http://localhost:8080/cqf-ruler/cds-services/apply-example service,
and then the service encountered an error: "Could not resolve expression reference 'plandefinitionApplyTest.Results' in library 'plandefinitionApplyTest'."

java.lang.IllegalArgumentException: Could not resolve expression reference 'plandefinitionApplyTest.Results' in library 'plandefinitionApplyTest'.
	at org.opencds.cqf.cql.execution.Context.resolveExpressionRef(Context.java:227)
	at org.opencds.cqf.providers.FHIRPlanDefinitionResourceProvider.resolveActions(FHIRPlanDefinitionResourceProvider.java:278)
	at org.opencds.cqf.providers.FHIRPlanDefinitionResourceProvider.resolveCdsHooksPlanDefinition(FHIRPlanDefinitionResourceProvider.java:257)
	at org.opencds.cqf.cdshooks.request.CdsRequest.process(CdsRequest.java:86)
	at org.opencds.cqf.servlet.CdsServicesServlet.doPost(CdsServicesServlet.java:40)
	at ca.uhn.fhir.rest.server.RestfulServer.service(RestfulServer.java:1460)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:860)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
	at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:206)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
	at org.ebaysf.web.cors.CORSFilter.handleNonCORS(CORSFilter.java:437)
	at org.ebaysf.web.cors.CORSFilter.doFilter(CORSFilter.java:172)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1629)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:219)
	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.Server.handle(Server.java:530)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:347)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:256)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:382)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:708)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:626)
	at java.lang.Thread.run(Thread.java:748)

Case 2: I tried to send different request to http://localhost:8080/cqf-ruler/cds-services/cdc-opioid-guidance-05. The service works as expected. Nevertheless, cdc-opioid-guidance-05 PlanDefinition cannot be applied using $apply operation.

ca.uhn.fhir.rest.server.exceptions.InternalErrorException: Failed to call access method
	at ca.uhn.fhir.rest.server.method.BaseMethodBinding.invokeServerMethod(BaseMethodBinding.java:261)
	at ca.uhn.fhir.rest.server.method.OperationMethodBinding.invokeServer(OperationMethodBinding.java:254)
	at ca.uhn.fhir.rest.server.method.BaseResourceReturningMethodBinding.doInvokeServer(BaseResourceReturningMethodBinding.java:237)
	at ca.uhn.fhir.rest.server.method.BaseResourceReturningMethodBinding.invokeServer(BaseResourceReturningMethodBinding.java:371)
	at ca.uhn.fhir.rest.server.method.OperationMethodBinding.invokeServer(OperationMethodBinding.java:229)
	at ca.uhn.fhir.rest.server.RestfulServer.handleRequest(RestfulServer.java:877)
	at ca.uhn.fhir.rest.server.RestfulServer.doPost(RestfulServer.java:1488)
	at ca.uhn.fhir.rest.server.RestfulServer.service(RestfulServer.java:1460)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:860)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
	at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:206)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
	at org.ebaysf.web.cors.CORSFilter.handleNonCORS(CORSFilter.java:437)
	at org.ebaysf.web.cors.CORSFilter.doFilter(CORSFilter.java:172)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1629)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:219)
	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.Server.handle(Server.java:530)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:347)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:256)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:382)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:708)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:626)
	at java.lang.Thread.run(Thread.java:748)
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:498)
	at ca.uhn.fhir.rest.server.method.BaseMethodBinding.invokeServerMethod(BaseMethodBinding.java:256)
	... 45 common frames omitted
Caused by: java.lang.IllegalArgumentException: [LocalLibrary[1:262, 1:268]Could not resolve identifier Results in the current library.]
	at org.opencds.cqf.helpers.LibraryHelper.getTranslator(LibraryHelper.java:64)
	at org.opencds.cqf.helpers.LibraryHelper.translateLibrary(LibraryHelper.java:75)
	at org.opencds.cqf.helpers.LibraryHelper.translateLibrary(LibraryHelper.java:71)
	at org.opencds.cqf.providers.CqlExecutionProvider.evaluateInContext(CqlExecutionProvider.java:173)
	at org.opencds.cqf.providers.FHIRPlanDefinitionResourceProvider.meetsConditions(FHIRPlanDefinitionResourceProvider.java:212)
	at org.opencds.cqf.providers.FHIRPlanDefinitionResourceProvider.resolveActions(FHIRPlanDefinitionResourceProvider.java:96)
	at org.opencds.cqf.providers.FHIRPlanDefinitionResourceProvider.applyPlanDefinition(FHIRPlanDefinitionResourceProvider.java:90)

Root cause: From my investigation, when $apply in the case 1, the system can resolve the condition's expression as Results defined in PlanDefinition. However, when processing the cds-services' request, the system resolves the condition's expression as plandefinitionApplyTest.Results, not Results anymore.

Missing Dosage Instruction Error

When I post this:

{
	"hook": "medication-prescribe",
	"hookInstance": "5bacb720-f493-4fe7-8750-c02595cbb72b",
	"fhirServer": "http://localhost:8081/cqf-ruler/baseDstu3/",
	"user": "Practitioner-2516",
	"patient": "Patient-1121",
	"context": [
		{
			"resourceType": "MedicationRequest",
			"status": "active",
			"medicationCodeableConcept": {
				"coding": [
					{
						"system": "http://www.nlm.nih.gov/research/umls/rxnorm",
						"code": "197696",
						"display": "Fentanyl 75 MCG/HR 3 Day Transdermal Patch"
					}
				]
			},
			"subject": {
				"reference": "Patient/Patient-1121",
				"display": "Jerry Phillip Goodwall [80]"
			},
			"authoredOn": "2017-01-01T00:00:00-05:00",
			"reasonCode": [
				{
					"coding": [
						{
							"system": "http://snomed.info/sct",
							"code": "82423001",
							"display": "Chronic pain"
						}
					],
					"text": "Chronic pain"
				}
			],
			"dosageInstruction": [
				{
					"text": "Apply once every three days for pain.",
					"timing": {
						"repeat": {
							"count": 1,
							"durationUnit": "d",
							"frequency": 1,
							"period": 3
						}
					},
					"asNeededBoolean": false,
					"doseQuantity": {
						"value": 1,
						"unit": "tbl",
						"system": "http://unitsofmeasure.org",
						"code": "tbl"
					}
				}
			],
			"dispenseRequest": {
				"quantity": {
					"value": 30,
					"unit": "day",
					"system": "http://unitsofmeasure.org",
					"code": "d"
				}
			}
		}
	]
}

I get this e500 error:

[WARNING] /cqf-ruler/cds-services/cdc-opioid-guidance
java.lang.RuntimeException: Missing dosageInstruction structure in prescription http://localhost:8081/cqf-ruler/baseDstu3/MedicationRequest/MedicationRequest-667190/_history/1
	at org.opencds.cqf.cds.OpioidGuidanceProcessor.validateContextAndPrefetchResources(OpioidGuidanceProcessor.java:124)
	at org.opencds.cqf.cds.OpioidGuidanceProcessor.process(OpioidGuidanceProcessor.java:76)
	at org.opencds.cqf.servlet.CdsServicesServlet.doPost(CdsServicesServlet.java:95)
	at ca.uhn.fhir.rest.server.RestfulServer.service(RestfulServer.java:1435)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:841)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)

Cross-Posting Issue From cal_engine

When I use the cqf-ruler as terminology provider and evaluate the col-logic against two encounters I get this result:

ValueSet 2.16.840.1.113883.3.464.1003.108.11.1001 does not contain 'http://snomed.info/sct' 285312008
ValueSet 2.16.840.1.113883.3.464.1003.198.12.1019 does not contain 'http://loinc.org' 2335-8
ValueSet 2.16.840.1.113883.3.464.1003.198.12.1019 does not contain 'http://snomed.info/sct' 44441009
ValueSet 2.16.840.1.113883.3.464.1003.108.12.1020 does not contain 'http://loinc.org' 2335-8
ValueSet 2.16.840.1.113883.3.464.1003.108.12.1020 does not contain 'http://snomed.info/sct' 44441009
ValueSet 2.16.840.1.113883.3.464.1003.108.12.1020 does not contain 'http://loinc.org' 14563-1
ValueSet 2.16.840.1.113883.3.464.1003.108.12.1020 does not contain 'http://loinc.org' 8716-3
ValueSet 2.16.840.1.113883.3.464.1003.108.12.1020 does not contain 'http://snomed.info/sct' 415527002
ValueSet 2.16.840.1.113883.3.464.1003.108.12.1020 does not contain 'http://loinc.org' 8716-3
ValueSet 2.16.840.1.113883.3.464.1003.198.12.1010 does not contain 'http://loinc.org' 2335-8
ValueSet 2.16.840.1.113883.3.464.1003.198.12.1010 does not contain 'http://snomed.info/sct' 44441009
ValueSet 2.16.840.1.113883.3.464.1003.198.12.1010 does not contain 'http://loinc.org' 14563-1
ValueSet 2.16.840.1.113883.3.464.1003.198.12.1010 does not contain 'http://loinc.org' 8716-3
ValueSet 2.16.840.1.113883.3.464.1003.198.12.1010 does not contain 'http://snomed.info/sct' 415527002
ValueSet 2.16.840.1.113883.3.464.1003.198.12.1010 does not contain 'http://loinc.org' 8716-3
ValueSet 2.16.840.1.113883.3.464.1003.198.12.1011 contains 'http://loinc.org' 2335-8
ValueSet 2.16.840.1.113883.3.464.1003.198.12.1011 does not contain 'http://snomed.info/sct' 44441009
ValueSet 2.16.840.1.113883.3.464.1003.198.12.1011 contains 'http://loinc.org' 14563-1
ValueSet 2.16.840.1.113883.3.464.1003.198.12.1011 does not contain 'http://loinc.org' 8716-3
ValueSet 2.16.840.1.113883.3.464.1003.198.12.1011 does not contain 'http://snomed.info/sct' 415527002
ValueSet 2.16.840.1.113883.3.464.1003.198.12.1011 does not contain 'http://loinc.org' 8716-3
2017-07-21 12:22:58 INFO  FhirContext:172 - Creating new FHIR context for FHIR version [DSTU3]

When I copy the JpaTerminologyProvider code into a LocalFhirTerminologyProvider that loads the downloaded valueSets into a Map and run the same test, I get:

ValueSet 2.16.840.1.113883.3.464.1003.108.11.1001 contains 'http://snomed.info/sct' 285312008
ValueSet 2.16.840.1.113883.3.464.1003.198.12.1019 does not contain 'http://loinc.org' 2335-8
ValueSet 2.16.840.1.113883.3.464.1003.198.12.1019 does not contain 'http://snomed.info/sct' 44441009
ValueSet 2.16.840.1.113883.3.464.1003.108.12.1020 does not contain 'http://loinc.org' 2335-8
ValueSet 2.16.840.1.113883.3.464.1003.108.12.1020 does not contain 'http://snomed.info/sct' 44441009
ValueSet 2.16.840.1.113883.3.464.1003.108.12.1020 does not contain 'http://loinc.org' 14563-1
ValueSet 2.16.840.1.113883.3.464.1003.108.12.1020 does not contain 'http://loinc.org' 8716-3
ValueSet 2.16.840.1.113883.3.464.1003.108.12.1020 does not contain 'http://snomed.info/sct' 415527002
ValueSet 2.16.840.1.113883.3.464.1003.108.12.1020 does not contain 'http://loinc.org' 8716-3
ValueSet 2.16.840.1.113883.3.464.1003.198.12.1010 does not contain 'http://loinc.org' 2335-8
ValueSet 2.16.840.1.113883.3.464.1003.198.12.1010 contains 'http://snomed.info/sct' 44441009
ValueSet 2.16.840.1.113883.3.464.1003.198.12.1010 does not contain 'http://loinc.org' 14563-1
ValueSet 2.16.840.1.113883.3.464.1003.198.12.1010 does not contain 'http://loinc.org' 8716-3
ValueSet 2.16.840.1.113883.3.464.1003.198.12.1010 does not contain 'http://snomed.info/sct' 415527002
ValueSet 2.16.840.1.113883.3.464.1003.198.12.1010 does not contain 'http://loinc.org' 8716-3
ValueSet 2.16.840.1.113883.3.464.1003.198.12.1011 contains 'http://loinc.org' 2335-8
ValueSet 2.16.840.1.113883.3.464.1003.198.12.1011 does not contain 'http://snomed.info/sct' 44441009
ValueSet 2.16.840.1.113883.3.464.1003.198.12.1011 contains 'http://loinc.org' 14563-1
ValueSet 2.16.840.1.113883.3.464.1003.198.12.1011 does not contain 'http://loinc.org' 8716-3
ValueSet 2.16.840.1.113883.3.464.1003.198.12.1011 does not contain 'http://snomed.info/sct' 415527002
ValueSet 2.16.840.1.113883.3.464.1003.198.12.1011 does not contain 'http://loinc.org' 8716-3
2017-07-21 12:28:01 INFO  FhirContext:172 - Creating new FHIR context for FHIR version [DSTU3]

From this I conclude that there's different behavior in Jpa's ValueSet vs = valueSetProvider.getDao().read(new IdType(valueSet.getId())); and my local 'ValueSet vs = valueSets.get(valueSet.getId());'

Code system http://www.nlm.nih.gov/research/umls/rxnorm is incomplete

There is an error Code system http://www.nlm.nih.gov/research/umls/rxnorm is incomplete when setting valueset in CQL as below:
valueset "Benzodiazepines": 'benzodiazepines'

or $expand by sending this request to FHIR server
http://measure.eval.kanvix.com/cqf-ruler/baseDstu3/ValueSet/benzodiazepines/$expand

What is the meaning of Code system is incomplete?

Here is the detail of the error:

{
  "resourceType": "OperationOutcome",
  "issue": [
    {
      "severity": "error",
      "code": "processing",
      "diagnostics": "Code system http://www.nlm.nih.gov/research/umls/rxnorm is incomplete"
    }
  ]
}
ca.uhn.fhir.rest.server.exceptions.InvalidRequestException: HTTP 400 Bad Request: Code system http://www.nlm.nih.gov/research/umls/rxnorm is incomplete
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException.newInstance(BaseServerResponseException.java:301)
	at ca.uhn.fhir.rest.client.impl.BaseClient.invokeClient(BaseClient.java:323)
	at ca.uhn.fhir.rest.client.impl.GenericClient$BaseClientExecutable.invoke(GenericClient.java:446)
	at ca.uhn.fhir.rest.client.impl.GenericClient$OperationInternal.execute(GenericClient.java:1155)
	at org.opencds.cqf.cql.terminology.fhir.FhirTerminologyProvider.expand(FhirTerminologyProvider.java:108)
	at org.opencds.cqf.cql.data.fhir.FhirDataProviderStu3.retrieve(FhirDataProviderStu3.java:84)
	at org.opencds.cqf.cql.elm.execution.RetrieveEvaluator.evaluate(RetrieveEvaluator.java:52)
	at org.opencds.cqf.cql.elm.execution.QueryEvaluator.evaluate(QueryEvaluator.java:232)
	at org.opencds.cqf.cql.execution.Executor.evaluateCql(Executor.java:253)
	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:498)
	at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:76)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:148)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:191)
	at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:243)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:103)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:493)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:415)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:104)
	at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:277)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:272)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:268)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:316)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:298)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:268)
	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:289)
	at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:256)
	at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:703)
	at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:416)
	at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:370)
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:389)
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:342)
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:229)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:860)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
	at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:206)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
	at org.ebaysf.web.cors.CORSFilter.handleSimpleCORS(CORSFilter.java:302)
	at org.ebaysf.web.cors.CORSFilter.doFilter(CORSFilter.java:164)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1629)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:219)
	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.Server.handle(Server.java:530)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:347)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:256)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:382)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:708)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:626)
	at java.lang.Thread.run(Thread.java:748)

ASF Classification Differences

While BCS, CCS & COL measures classify identically in-memory and on cqf-ruler this one does not. The classification differences seem to be of the same nature. Not sure where the problem lies yet so I'll keep working to characterize further. These are with histories 16 that I've not yet shared. I'll attach if the problem lies outside of my code.

Only the differences are printed out in this log.

Measure = measure-asf
	Aiden Michael Jones [1]
	Alan Everett Shea III [34]
	Alex Ramirez Gonzales [54]
	Alfredo Curtis Cooley III [35]
		numerator 1: In-memory = 1 Server = 0
		numerator 2: In-memory = 1 Server = 0
		denominator 2: In-memory = 1 Server = 0
	Alice Vargas [27]
	Andrea Andrade Woodard [8]
	Angelica Desiree Jones [25]
	Antonio Casey Hayden [7]
	April Rhodes Nielsen [50]
	Barbara April Howe [62]
	Becky Trevino Craig [72]
	Billy Robert Chen [6]
	Brad Ray Stone Jr [47]
	Cady Grace Paulson [6]
	Carolyn Gillespie Gallegos [53]
		numerator 1: In-memory = 1 Server = 0
		numerator 2: In-memory = 1 Server = 0
		denominator 2: In-memory = 1 Server = 0
	Carolyn Hickman Vega [86]
	Cassandra Graham Vasquez [55]
	Catherine Reyes Herman [17]
	Claude Roberto Andersen Jr [58]
	Darrell Shaffer Riggs [64]
	Denise Kristin Miles [71]
	Domingo Madera Gonzales [16]
	Donna Lynn Jones [57]
	Dora Marian Neal [24]
	Doris Bertha Francis [71]
		numerator 1: In-memory = 1 Server = 0
		numerator 2: In-memory = 1 Server = 0
		denominator 2: In-memory = 1 Server = 0
	Dwight Mitchell McCarty [64]
	Earl Herbert Newman [20]
	Edith Elaine Brandt [30]
	Eduardo Joel Tucker Jr [10]
	Elise Louise Paulson [8]
	Ellen Sandoval Sanford [67]
		numerator 1: In-memory = 1 Server = 0
		numerator 2: In-memory = 1 Server = 0
		denominator 2: In-memory = 1 Server = 0
	Erica Ortega Lam [81]
	Erika Amy Moore [66]
		numerator 1: In-memory = 1 Server = 0
		numerator 2: In-memory = 1 Server = 0
		denominator 2: In-memory = 1 Server = 0
	Fred Michael Walsh [0]
	Gabriel Bill Good [65]
		numerator 1: In-memory = 1 Server = 0
		numerator 2: In-memory = 1 Server = 0
		denominator 2: In-memory = 1 Server = 0
	Gabriel Oconnell Stevenson [36]
	George Clay Tullison [62]
	Glen Cochran Estrada [28]
	Glen Hicks Jacobson [28]
	Helen Marjorie Medina [40]
	Herman Galloway Gonzalez [47]
	Irma Carol Johnson [73]
	Jamie Cain Melendez [71]
	Jamie Davis Baird Jr [6]
	Janet Ramona Curry [96]
		numerator 1: In-memory = 1 Server = 0
		numerator 2: In-memory = 1 Server = 0
		denominator 2: In-memory = 1 Server = 0
	Jared Gentry Baldwin [24]
	Jeanette Ramona Pugh [12]
	Jeffery Frank Gray [45]
	Jerry Phillip Goodwall [81]
	Jessica Pauleen Campbell [37]
	Joan Frances Chen [30]
		numerator 1: In-memory = 1 Server = 0
		numerator 2: In-memory = 1 Server = 0
		denominator 2: In-memory = 1 Server = 0
	Jordan Webb Moses Jr [68]
		numerator 1: In-memory = 1 Server = 0
		numerator 2: In-memory = 1 Server = 0
		denominator 2: In-memory = 1 Server = 0
	Juanita Brittany Fuller [2]
	Karl Ron Costa [40]
	Kathryn House Weeks [73]
	Kathy Howell Ware [50]
	Lee Alvin Huynh [5]
	Lillian Marcia Hicks [34]
	Lloyd Cardenas Villegas [33]
	Lois Peterson Zuniga [4]
	Louise Foster Campbell [6]
	Luis Norris Ayala [51]
	Mabel Haynes James [44]
	Margie Beck Espinoza [34]
	Marie Kerr Koch [26]
	Mario Jared Stout [63]
	Martha Bertha Wagner [16]
	Melinda Stella McCoy [84]
		numerator 1: In-memory = 1 Server = 0
		numerator 2: In-memory = 1 Server = 0
		denominator 2: In-memory = 1 Server = 0
	Melvin Dale Matthews [37]
	Michael Jesus Gonzales [25]
	Micheal Clarence McKee [52]
	Olga Grace Dunlap [54]
		numerator 1: In-memory = 1 Server = 0
		numerator 2: In-memory = 1 Server = 0
		denominator 2: In-memory = 1 Server = 0
	Pauline Shepherd Sweeney [71]
	Perry Ford Tran [73]
	Phillip Ball Reilly Jr [57]
		numerator 1: In-memory = 1 Server = 0
		numerator 2: In-memory = 1 Server = 0
		denominator 2: In-memory = 1 Server = 0
	Ramon Combs Payne [15]
	Raoul Santiago Gonzales [19]
	Renee Yu Cabrera [58]
	Rick Troy Hanson [57]
	Rosa Bullock Berg [53]
	Ross Sheppard Cobb [6]
	Russell Dominguez Lambert [28]
	Russell Jamie Henderson Jr [46]
	Ruth Pamela Johnson [3]
	Ryan Arthur Paulson [39]
	Samantha Jo King [6]
	Shawn Conley Owen Jr [62]
	Tammy Toni Robbins [53]
		numerator 1: In-memory = 1 Server = 0
		numerator 2: In-memory = 1 Server = 0
		denominator 2: In-memory = 1 Server = 0
	Ted Griffith Briggs [7]
	Terrance Clyde Richard [64]
		numerator 1: In-memory = 1 Server = 0
		numerator 2: In-memory = 1 Server = 0
		denominator 2: In-memory = 1 Server = 0
	Terri Reilly Zavala [32]
		numerator 1: In-memory = 1 Server = 0
		numerator 2: In-memory = 1 Server = 0
		denominator 2: In-memory = 1 Server = 0
	Terry Harvey Waller [81]
	Tricia Lynn Franklin [30]
	Trudy Mae Campbell [7]
	Victoria Palmer Gray [53]
	Viola Jean Campbell [61]
	Virgil Dwayne Hamilton [23]
	Wendy Danielle Vaughn [81]
	William Yung Chen [33]
	Yolanda Dawn Miranda [47]

===== In-memory Summary =====
	denominator 1 = 76
	denominator 2 = 15
	initial-population = 76
	numerator 1 = 15
	numerator 2 = 15

===== Server Summary =====
	denominator 1 = 76
	denominator 2 = 0
	initial-population = 76
	numerator 1 = 0
	numerator 2 = 0

DMS Measure Failure

I'm getting this result for some of the patients, on the latest bits:

Sending 'GET' request to URL: http://localhost:8080/cqf-ruler/baseDstu3?_getpages=e0a40855-5bc7-452e-bdd0-794fc99df0ed&_getpagesoffset=80&_count=10&_pretty=true&_bundletype=searchset
Response = 200

Sending 'GET' request to URL: http://localhost:8080/cqf-ruler/baseDstu3?_getpages=e0a40855-5bc7-452e-bdd0-794fc99df0ed&_getpagesoffset=90&_count=10&_pretty=true&_bundletype=searchset
Response = 200

Sending 'GET' request to URL: http://localhost:8080/cqf-ruler/baseDstu3/Measure/measure-dms/$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-dms/$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-dms/$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-dms/$evaluate?patient=Patient-6481&startPeriod=2017-1&endPeriod=2017-12&_raw=true
e500 http://localhost:8080/cqf-ruler/baseDstu3/Patient/Patient-6481/_history/1

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

2017-12-20 12:09:22.765 [http-nio-8080-exec-9] 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.resolveRelationship(QueryEvaluator.java:38)
	at org.opencds.cqf.cql.elm.execution.QueryEvaluator.evaluate(QueryEvaluator.java:236)
	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:09:22.765 [http-nio-8080-exec-9] INFO  logging.accesslog [LoggingInterceptor.java:155] ERROR - extended-operation-instance - Measure/measure-dms

Runtime Error 500

I updated and rebuilt the project today and loaded the bundle at cqf-ruler/src/main/resources/database-init-bundle.json. Running the following query from the documentation still yields the following errors.

Sending 'GET' request to URL: http://localhost:8080/cqf-ruler/baseDstu3/Measure/col/$evaluate?patient=Patient-12214&startPeriod=2014-01&endPeriod=2014-12
Error 500

2017-07-17 10:15:23.069 [http-nio-8080-exec-6] INFO  ca.uhn.fhir.context.FhirContext [FhirContext.java:172] Creating new FHIR context for FHIR version [DSTU3]
2017-07-17 10:15:23.084 [http-nio-8080-exec-6] INFO  c.u.f.j.dao.BaseHapiFhirResourceDao [BaseHapiFhirResourceDao.java:788] Processed read on Measure/col in 62ms
2017-07-17 10:15:23.087 [http-nio-8080-exec-6] INFO  c.u.f.j.dao.BaseHapiFhirResourceDao [BaseHapiFhirResourceDao.java:788] Processed read on Library/col-logic in 2ms
2017-07-17 10:15:23.606 [http-nio-8080-exec-6] INFO  c.u.f.j.dao.BaseHapiFhirResourceDao [BaseHapiFhirResourceDao.java:788] Processed read on Patient-12214 in 2ms
2017-07-17 10:15:23.702 [http-nio-8080-exec-6] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:342] Search initial phase completed in 13ms
2017-07-17 10:15:23.703 [http-nio-8080-exec-6] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:567] Requesting search PIDs from 0-50
2017-07-17 10:15:23.762 [search_coord_1] INFO  ca.uhn.fhir.jpa.dao.SearchBuilder [SearchBuilder.java:2025] Initial query result returned in 21ms for query 4a42b02a-5d13-4188-9e13-77ed8388b0d1
2017-07-17 10:15:23.763 [search_coord_1] INFO  ca.uhn.fhir.jpa.dao.SearchBuilder [SearchBuilder.java:2029] Query found 1 matches in 22ms for query 4a42b02a-5d13-4188-9e13-77ed8388b0d1
2017-07-17 10:15:23.791 [search_coord_1] INFO  c.u.f.j.s.SearchCoordinatorSvcImpl [SearchCoordinatorSvcImpl.java:484] Completed search for 1 resources in 89ms
2017-07-17 10:15:24.235 [http-nio-8080-exec-6] ERROR c.u.f.r.s.i.ExceptionHandlingInterceptor [ExceptionHandlingInterceptor.java:128] Failure during REST processing
ca.uhn.fhir.rest.server.exceptions.InternalErrorException: Failed to call access method
	at ca.uhn.fhir.rest.method.BaseMethodBinding.invokeServerMethod(BaseMethodBinding.java:263)
	at ca.uhn.fhir.rest.method.OperationMethodBinding.invokeServer(OperationMethodBinding.java:300)
	at ca.uhn.fhir.rest.method.BaseResourceReturningMethodBinding.doInvokeServer(BaseResourceReturningMethodBinding.java:306)
	at ca.uhn.fhir.rest.method.BaseResourceReturningMethodBinding.invokeServer(BaseResourceReturningMethodBinding.java:258)
	at ca.uhn.fhir.rest.method.OperationMethodBinding.invokeServer(OperationMethodBinding.java:275)
	at ca.uhn.fhir.rest.server.RestfulServer.handleRequest(RestfulServer.java:643)
	at ca.uhn.fhir.rest.server.RestfulServer.doGet(RestfulServer.java:1193)
	at ca.uhn.fhir.rest.server.RestfulServer.service(RestfulServer.java:1169)
	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)

Update CDS Hooks request processing to use PlanDefinition library

I am planning for expanded use of cqf-ruler for CDS Hooks processing during the May HL7 FHIR connectathon. Several issues must be fixed for more general use, this is the first.

I just created a PR to remove use of hard-coded library ID for CDS Hooks request processor, e.g. "patient-view" and instead load libraries specified in PlanDefinition. If acceptable, the other two request processor must be updated also, similar to PatientViewProcessor. Also, the examples for BCS, CCS, and COL must be updated to not use the same library name, "patient-view".

New Test Data, Odd Results

I'm running a larger population of simulated patient encounters and am using the latest cqf-ruler jars. For some measures, I'm seeing larger denominator and numerator results for the whole population (evaluated individually, one patient at a time) than the IPP values. I thought cqf-ruler was manually enforcing IPP membership for the other populations but these results suggest otherwise.

I will debug further to better characterize the issue but am posting this to see if I may have overlooked something.

---------------------
Measure = Measure/measure-asf

===== In-memory Summary =====
	denominator 1 = 469
	denominator 2 = 0
	initial-population = 469
	numerator 1 = 0
	numerator 2 = 0


---------------------
Measure = Measure/measure-bcs

===== In-memory Summary =====
	denominator = 64
	initial-population = 64
	numerator = 64


---------------------
Measure = Measure/measure-ccs

===== In-memory Summary =====
	denominator = 792
	initial-population = 180
	numerator = 314


---------------------
Measure = Measure/measure-col

===== In-memory Summary =====
	denominator = 792
	initial-population = 129
	numerator = 292


---------------------
Measure = Measure/measure-dsf

===== In-memory Summary =====
	denominator 1 = 505
	denominator 2 = 6
	initial-population = 505
	numerator 1 = 505
	numerator 2 = 6


---------------------
Measure = Measure/measure-dms

===== In-memory Summary =====
	denominator 1 = 792
	denominator 2 = 792
	denominator 3 = 792
	initial-population = 5
	numerator 1 = 6
	numerator 2 = 6
	numerator 3 = 6


---------------------
Measure = Measure/measure-drr

===== In-memory Summary =====
	denominator 1 = 2
	denominator 2 = 2
	denominator 3 = 2
	initial-population = 5
	numerator 1 = 2
	numerator 2 = 1
	numerator 3 = 1


---------------------
Measure = Measure/measure-pvs

===== In-memory Summary =====
	denominator = 91
	initial-population = 91
	numerator = 26

IPP Calculation Errors

When I evaluate the ASF measure against Aiden Michael Jones (age 0) the IPP comes back true. This is incorrect, because the IPP requires Aiden to be >= 18 years old.

Sending 'GET' request to URL: http://localhost:8080/cqf-ruler/baseDstu3/Measure/measure-asf/$evaluate-measure?patient=Patient-1137&periodStart=2017-1&periodEnd=2017-12&reportType=patient

Aiden Michael Jones [0]  (Patient-1137) is in initial-population

Investigating, it appears that the ExistsEvaluator localId=25 in the IPP expression is returning true when the exists(operand) method is given the array [ **false** ].

I'm not sure where the error actually is because the exists() method is pretty simple and the GreaterOrEqualEvaluator is correctly returning false.

This seems to occur in other measures too but I haven't characterized them to this level yet.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.