update configs and hapi-version
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -14,7 +14,7 @@
|
||||
<parent>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir</artifactId>
|
||||
<version>6.9.6-SNAPSHOT</version>
|
||||
<version>6.9.7-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>hapi-fhir-jpaserver-starter</artifactId>
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package ca.uhn.fhir.jpa.starter.cr;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import ca.uhn.fhir.rest.server.RestfulServer;
|
||||
import ca.uhn.fhir.rest.server.provider.IResourceProviderFactoryObserver;
|
||||
import ca.uhn.fhir.rest.server.provider.ResourceProviderFactory;
|
||||
|
||||
public class PostInitProviderRegisterer {
|
||||
public PostInitProviderRegisterer(RestfulServer restfulServer,
|
||||
ResourceProviderFactory resourceProviderFactory) {
|
||||
resourceProviderFactory.attach(new Observer(restfulServer));
|
||||
}
|
||||
|
||||
private class Observer implements IResourceProviderFactoryObserver {
|
||||
private RestfulServer restfulServer;
|
||||
|
||||
public Observer(RestfulServer restfulServer) {
|
||||
this.restfulServer = restfulServer;
|
||||
}
|
||||
|
||||
public void update(Supplier<Object> theSupplier) {
|
||||
if (theSupplier == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
var provider = theSupplier.get();
|
||||
if (provider == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.restfulServer.registerProvider(provider);
|
||||
|
||||
}
|
||||
|
||||
public void remove(Supplier<Object> theSupplier) {
|
||||
if (theSupplier == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
var provider = theSupplier.get();
|
||||
if (provider == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.restfulServer.unregisterProvider(provider);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,10 @@
|
||||
package ca.uhn.fhir.jpa.starter.cr;
|
||||
|
||||
import ca.uhn.fhir.cr.config.dstu3.CrDstu3Config;
|
||||
import ca.uhn.fhir.cr.config.dstu3.ApplyOperationConfig;
|
||||
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.starter.AppProperties;
|
||||
import ca.uhn.fhir.jpa.starter.annotations.OnDSTU3Condition;
|
||||
import org.cqframework.cql.cql2elm.CqlCompilerOptions;
|
||||
@@ -23,7 +27,11 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
@Configuration
|
||||
@Conditional({ OnDSTU3Condition.class, CrConfigCondition.class })
|
||||
@Import({ CrDstu3Config.class })
|
||||
@Import({ CrDstu3Config.class,
|
||||
ApplyOperationConfig.class,
|
||||
ExtractOperationConfig.class,
|
||||
PackageOperationConfig.class,
|
||||
PopulateOperationConfig.class})
|
||||
public class StarterCrDstu3Config {
|
||||
private static final Logger ourLogger = LoggerFactory.getLogger(StarterCrDstu3Config.class);
|
||||
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
package ca.uhn.fhir.jpa.starter.cr;
|
||||
|
||||
import ca.uhn.fhir.cr.config.r4.CrR4Config;
|
||||
import ca.uhn.fhir.cr.config.r4.*;
|
||||
import ca.uhn.fhir.jpa.starter.annotations.OnR4Condition;
|
||||
import org.springframework.context.annotation.Conditional;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
import ca.uhn.fhir.cr.common.CqlThreadFactory;
|
||||
import ca.uhn.fhir.cr.config.ApplyOperationConfig;
|
||||
import ca.uhn.fhir.cr.config.ExtractOperationConfig;
|
||||
import ca.uhn.fhir.cr.config.PackageOperationConfig;
|
||||
import ca.uhn.fhir.cr.config.PopulateOperationConfig;
|
||||
import ca.uhn.fhir.jpa.starter.AppProperties;
|
||||
import org.cqframework.cql.cql2elm.CqlCompilerOptions;
|
||||
import org.cqframework.cql.cql2elm.model.CompiledLibrary;
|
||||
@@ -29,6 +25,7 @@ import org.springframework.security.concurrent.DelegatingSecurityContextExecutor
|
||||
import java.util.EnumSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
@@ -146,4 +143,14 @@ public class StarterCrR4Config {
|
||||
return evaluationSettings;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Map<VersionedIdentifier, CompiledLibrary> globalLibraryCache() {
|
||||
return new ConcurrentHashMap<>();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Map<ModelIdentifier, Model> globalModelCache() {
|
||||
return new ConcurrentHashMap<>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user