diff --git a/pom.xml b/pom.xml
index b477e48..9549b8c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -14,7 +14,7 @@
ca.uhn.hapi.fhir
hapi-fhir
- 6.9.10-SNAPSHOT
+ 6.10.0
hapi-fhir-jpaserver-starter
@@ -132,6 +132,10 @@
hapi-fhir-jpaserver-mdm
${project.version}
+
+ org.springframework
+ spring-context
+
ca.uhn.hapi.fhir
diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/cr/BaseCrConfig.java b/src/main/java/ca/uhn/fhir/jpa/starter/cr/BaseCrConfig.java
deleted file mode 100644
index 04101af..0000000
--- a/src/main/java/ca/uhn/fhir/jpa/starter/cr/BaseCrConfig.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package ca.uhn.fhir.jpa.starter.cr;
-
-import ca.uhn.fhir.cr.common.CodeCacheResourceChangeListener;
-import ca.uhn.fhir.cr.common.ElmCacheResourceChangeListener;
-import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
-import ca.uhn.fhir.jpa.cache.IResourceChangeListenerRegistry;
-import ca.uhn.fhir.jpa.cache.ResourceChangeListenerRegistryInterceptor;
-import ca.uhn.fhir.jpa.searchparam.SearchParameterMap;
-import org.cqframework.cql.cql2elm.model.CompiledLibrary;
-import org.cqframework.cql.cql2elm.model.Model;
-import org.hl7.cql.model.ModelIdentifier;
-import org.hl7.elm.r1.VersionedIdentifier;
-import org.opencds.cqf.cql.engine.runtime.Code;
-import org.opencds.cqf.fhir.cql.EvaluationSettings;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-@Configuration
-public class BaseCrConfig {
- @Bean
- public CrProperties crProperties() {
- return new CrProperties();
- }
-
- @Bean
- public Map globalLibraryCache() {
- return new ConcurrentHashMap<>();
- }
-
- @Bean
- public Map globalModelCache() {
- return new ConcurrentHashMap<>();
- }
-
- @Bean
- public Map> globalValueSetCache() {
- return new ConcurrentHashMap<>();
- }
-
- @Bean
- public ElmCacheResourceChangeListener elmCacheResourceChangeListener(
- IResourceChangeListenerRegistry theResourceChangeListenerRegistry,
- DaoRegistry theDaoRegistry,
- EvaluationSettings theEvaluationSettings) {
- ElmCacheResourceChangeListener listener =
- new ElmCacheResourceChangeListener(theDaoRegistry, theEvaluationSettings.getLibraryCache());
- theResourceChangeListenerRegistry.registerResourceResourceChangeListener(
- "Library", SearchParameterMap.newSynchronous(), listener, 1000);
- return listener;
- }
-
- @Bean
- public CodeCacheResourceChangeListener codeCacheResourceChangeListener(
- IResourceChangeListenerRegistry theResourceChangeListenerRegistry,
- EvaluationSettings theEvaluationSettings,
- DaoRegistry theDaoRegistry) {
-
- CodeCacheResourceChangeListener listener = new CodeCacheResourceChangeListener(theDaoRegistry, theEvaluationSettings.getValueSetCache());
- //registry
- theResourceChangeListenerRegistry.registerResourceResourceChangeListener(
- "ValueSet", SearchParameterMap.newSynchronous(), listener,1000);
-
- return listener;
- }
-
- // These beans were being duplicated
- // @Bean
- // public IResourceChangeListenerRegistry resourceChangeListenerRegistry(InMemoryResourceMatcher theInMemoryResourceMatcher, FhirContext theFhirContext, ResourceChangeListenerCacheFactory theResourceChangeListenerCacheFactory) {
- // return new ResourceChangeListenerRegistryImpl(theFhirContext, theResourceChangeListenerCacheFactory, theInMemoryResourceMatcher);
- // }
-
- // @Bean
- // IResourceChangeListenerCacheRefresher resourceChangeListenerCacheRefresher() {
- // return new ResourceChangeListenerCacheRefresherImpl();
- // }
-
- @Bean
- public ResourceChangeListenerRegistryInterceptor resourceChangeListenerRegistryInterceptor() {
- return new ResourceChangeListenerRegistryInterceptor();
- }
-}
diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/cr/StarterCrDstu3Config.java b/src/main/java/ca/uhn/fhir/jpa/starter/cr/StarterCrDstu3Config.java
index 78bd7fd..2ad1e15 100644
--- a/src/main/java/ca/uhn/fhir/jpa/starter/cr/StarterCrDstu3Config.java
+++ b/src/main/java/ca/uhn/fhir/jpa/starter/cr/StarterCrDstu3Config.java
@@ -1,10 +1,16 @@
package ca.uhn.fhir.jpa.starter.cr;
+import ca.uhn.fhir.cr.common.CodeCacheResourceChangeListener;
+import ca.uhn.fhir.cr.common.ElmCacheResourceChangeListener;
import ca.uhn.fhir.cr.config.dstu3.ApplyOperationConfig;
import ca.uhn.fhir.cr.config.dstu3.CrDstu3Config;
import ca.uhn.fhir.cr.config.dstu3.ExtractOperationConfig;
import ca.uhn.fhir.cr.config.dstu3.PackageOperationConfig;
import ca.uhn.fhir.cr.config.dstu3.PopulateOperationConfig;
+import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
+import ca.uhn.fhir.jpa.cache.IResourceChangeListenerRegistry;
+import ca.uhn.fhir.jpa.cache.ResourceChangeListenerRegistryInterceptor;
+import ca.uhn.fhir.jpa.searchparam.SearchParameterMap;
import ca.uhn.fhir.jpa.starter.annotations.OnDSTU3Condition;
import ca.uhn.fhir.rest.server.RestfulServer;
import ca.uhn.fhir.rest.server.provider.ResourceProviderFactory;
@@ -26,11 +32,12 @@ import java.util.EnumSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
@Configuration
@Conditional({ OnDSTU3Condition.class, CrConfigCondition.class })
@Import({
- BaseCrConfig.class,
+ //BaseCrConfig.class,
CrDstu3Config.class,
ApplyOperationConfig.class,
ExtractOperationConfig.class,
@@ -132,4 +139,54 @@ public class StarterCrDstu3Config {
ResourceProviderFactory theResourceProviderFactory) {
return new PostInitProviderRegisterer(theRestfulServer, theResourceProviderFactory);}
+ @Bean
+ public CrProperties crProperties() {
+ return new CrProperties();
+ }
+
+ @Bean
+ public Map globalLibraryCache() {
+ return new ConcurrentHashMap<>();
+ }
+
+ @Bean
+ public Map globalModelCache() {
+ return new ConcurrentHashMap<>();
+ }
+
+ @Bean
+ public Map> globalValueSetCache() {
+ return new ConcurrentHashMap<>();
+ }
+
+ @Bean
+ public ElmCacheResourceChangeListener elmCacheResourceChangeListener(
+ IResourceChangeListenerRegistry theResourceChangeListenerRegistry,
+ DaoRegistry theDaoRegistry,
+ EvaluationSettings theEvaluationSettings) {
+ ElmCacheResourceChangeListener listener =
+ new ElmCacheResourceChangeListener(theDaoRegistry, theEvaluationSettings.getLibraryCache());
+ theResourceChangeListenerRegistry.registerResourceResourceChangeListener(
+ "Library", SearchParameterMap.newSynchronous(), listener, 1000);
+ return listener;
+ }
+
+ @Bean
+ public CodeCacheResourceChangeListener codeCacheResourceChangeListener(
+ IResourceChangeListenerRegistry theResourceChangeListenerRegistry,
+ EvaluationSettings theEvaluationSettings,
+ DaoRegistry theDaoRegistry) {
+
+ CodeCacheResourceChangeListener listener = new CodeCacheResourceChangeListener(theDaoRegistry, theEvaluationSettings.getValueSetCache());
+ //registry
+ theResourceChangeListenerRegistry.registerResourceResourceChangeListener(
+ "ValueSet", SearchParameterMap.newSynchronous(), listener,1000);
+
+ return listener;
+ }
+
+ @Bean
+ public ResourceChangeListenerRegistryInterceptor resourceChangeListenerRegistryInterceptor() {
+ return new ResourceChangeListenerRegistryInterceptor();
+ }
}
diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/cr/StarterCrR4Config.java b/src/main/java/ca/uhn/fhir/jpa/starter/cr/StarterCrR4Config.java
index a562e58..c42f44a 100644
--- a/src/main/java/ca/uhn/fhir/jpa/starter/cr/StarterCrR4Config.java
+++ b/src/main/java/ca/uhn/fhir/jpa/starter/cr/StarterCrR4Config.java
@@ -1,10 +1,16 @@
package ca.uhn.fhir.jpa.starter.cr;
+import ca.uhn.fhir.cr.common.CodeCacheResourceChangeListener;
+import ca.uhn.fhir.cr.common.ElmCacheResourceChangeListener;
import ca.uhn.fhir.cr.config.r4.ApplyOperationConfig;
import ca.uhn.fhir.cr.config.r4.CrR4Config;
import ca.uhn.fhir.cr.config.r4.ExtractOperationConfig;
import ca.uhn.fhir.cr.config.r4.PackageOperationConfig;
import ca.uhn.fhir.cr.config.r4.PopulateOperationConfig;
+import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
+import ca.uhn.fhir.jpa.cache.IResourceChangeListenerRegistry;
+import ca.uhn.fhir.jpa.cache.ResourceChangeListenerRegistryInterceptor;
+import ca.uhn.fhir.jpa.searchparam.SearchParameterMap;
import ca.uhn.fhir.jpa.starter.annotations.OnR4Condition;
import ca.uhn.fhir.rest.server.RestfulServer;
import ca.uhn.fhir.rest.server.provider.ResourceProviderFactory;
@@ -34,13 +40,13 @@ import java.util.EnumSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@Configuration
@Conditional({ OnR4Condition.class, CrConfigCondition.class })
@Import({
- BaseCrConfig.class,
CrR4Config.class,
ApplyOperationConfig.class,
ExtractOperationConfig.class,
@@ -163,4 +169,55 @@ public class StarterCrR4Config {
return new PostInitProviderRegisterer(theRestfulServer, theResourceProviderFactory);
}
+ @Bean
+ public CrProperties crProperties() {
+ return new CrProperties();
+ }
+
+ @Bean
+ public Map globalLibraryCache() {
+ return new ConcurrentHashMap<>();
+ }
+
+ @Bean
+ public Map globalModelCache() {
+ return new ConcurrentHashMap<>();
+ }
+
+ @Bean
+ public Map> globalValueSetCache() {
+ return new ConcurrentHashMap<>();
+ }
+
+ @Bean
+ public ElmCacheResourceChangeListener elmCacheResourceChangeListener(
+ IResourceChangeListenerRegistry theResourceChangeListenerRegistry,
+ DaoRegistry theDaoRegistry,
+ EvaluationSettings theEvaluationSettings) {
+ ElmCacheResourceChangeListener listener =
+ new ElmCacheResourceChangeListener(theDaoRegistry, theEvaluationSettings.getLibraryCache());
+ theResourceChangeListenerRegistry.registerResourceResourceChangeListener(
+ "Library", SearchParameterMap.newSynchronous(), listener, 1000);
+ return listener;
+ }
+
+ @Bean
+ public CodeCacheResourceChangeListener codeCacheResourceChangeListener(
+ IResourceChangeListenerRegistry theResourceChangeListenerRegistry,
+ EvaluationSettings theEvaluationSettings,
+ DaoRegistry theDaoRegistry) {
+
+ CodeCacheResourceChangeListener listener = new CodeCacheResourceChangeListener(theDaoRegistry, theEvaluationSettings.getValueSetCache());
+ //registry
+ theResourceChangeListenerRegistry.registerResourceResourceChangeListener(
+ "ValueSet", SearchParameterMap.newSynchronous(), listener,1000);
+
+ return listener;
+ }
+
+ @Bean
+ public ResourceChangeListenerRegistryInterceptor resourceChangeListenerRegistryInterceptor() {
+ return new ResourceChangeListenerRegistryInterceptor();
+ }
+
}
diff --git a/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerDstu3IT.java b/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerDstu3IT.java
index a9d7e1d..636a6ad 100644
--- a/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerDstu3IT.java
+++ b/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerDstu3IT.java
@@ -42,8 +42,8 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = {Application.class, JpaStarterWebsocketDispatcherConfig.class}, properties =
{
"spring.datasource.url=jdbc:h2:mem:dbr3",
- "hapi.fhir.cr_enabled=true",
"hapi.fhir.fhir_version=dstu3",
+ "hapi.fhir.cr_enabled=true",
"hapi.fhir.subscription.websocket_enabled=true",
"hapi.fhir.allow_external_references=true",
"hapi.fhir.allow_placeholder_references=true",