|
|
|
|
@@ -1,7 +1,6 @@
|
|
|
|
|
package ca.uhn.fhir.jpa.starter.common;
|
|
|
|
|
|
|
|
|
|
import ca.uhn.fhir.batch2.coordinator.JobDefinitionRegistry;
|
|
|
|
|
import ca.uhn.fhir.batch2.jobs.export.BulkDataExportProvider;
|
|
|
|
|
import ca.uhn.fhir.batch2.jobs.imprt.BulkDataImportProvider;
|
|
|
|
|
import ca.uhn.fhir.batch2.jobs.reindex.ReindexJobParameters;
|
|
|
|
|
import ca.uhn.fhir.batch2.jobs.reindex.ReindexProvider;
|
|
|
|
|
@@ -10,6 +9,7 @@ import ca.uhn.fhir.context.ConfigurationException;
|
|
|
|
|
import ca.uhn.fhir.context.FhirContext;
|
|
|
|
|
import ca.uhn.fhir.context.FhirVersionEnum;
|
|
|
|
|
import ca.uhn.fhir.context.support.IValidationSupport;
|
|
|
|
|
|
|
|
|
|
import ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster;
|
|
|
|
|
import ca.uhn.fhir.jpa.api.IDaoRegistry;
|
|
|
|
|
import ca.uhn.fhir.jpa.api.config.JpaStorageSettings;
|
|
|
|
|
@@ -18,6 +18,7 @@ import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
|
|
|
|
|
import ca.uhn.fhir.jpa.api.dao.IFhirSystemDao;
|
|
|
|
|
import ca.uhn.fhir.jpa.binary.interceptor.BinaryStorageInterceptor;
|
|
|
|
|
import ca.uhn.fhir.jpa.binary.provider.BinaryAccessProvider;
|
|
|
|
|
import ca.uhn.fhir.batch2.jobs.export.BulkDataExportProvider;
|
|
|
|
|
import ca.uhn.fhir.jpa.config.util.HapiEntityManagerFactoryUtil;
|
|
|
|
|
import ca.uhn.fhir.jpa.config.util.ResourceCountCacheUtil;
|
|
|
|
|
import ca.uhn.fhir.jpa.config.util.ValidationSupportConfigUtil;
|
|
|
|
|
@@ -60,7 +61,6 @@ import ca.uhn.fhir.rest.server.util.ISearchParamRegistry;
|
|
|
|
|
import ca.uhn.fhir.validation.IValidatorModule;
|
|
|
|
|
import ca.uhn.fhir.validation.ResultSeverityEnum;
|
|
|
|
|
import com.google.common.base.Strings;
|
|
|
|
|
import com.google.common.collect.ImmutableList;
|
|
|
|
|
import org.hl7.fhir.common.hapi.validation.support.CachingValidationSupport;
|
|
|
|
|
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
@@ -73,26 +73,23 @@ import org.springframework.http.HttpHeaders;
|
|
|
|
|
import org.springframework.orm.jpa.JpaTransactionManager;
|
|
|
|
|
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
|
|
|
|
|
import org.springframework.web.cors.CorsConfiguration;
|
|
|
|
|
|
|
|
|
|
import javax.persistence.EntityManagerFactory;
|
|
|
|
|
import javax.sql.DataSource;
|
|
|
|
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
import static ca.uhn.fhir.context.FhirVersionEnum.DSTU3;
|
|
|
|
|
import static ca.uhn.fhir.context.FhirVersionEnum.R4;
|
|
|
|
|
import static ca.uhn.fhir.jpa.starter.common.validation.IRepositoryValidationInterceptorFactory.ENABLE_REPOSITORY_VALIDATING_INTERCEPTOR;
|
|
|
|
|
|
|
|
|
|
@Configuration
|
|
|
|
|
// allow users to configure custom packages to scan for additional beans
|
|
|
|
|
//allow users to configure custom packages to scan for additional beans
|
|
|
|
|
@ComponentScan(basePackages = { "${hapi.fhir.custom-bean-packages:}" })
|
|
|
|
|
@Import({ ThreadPoolFactoryConfig.class })
|
|
|
|
|
@Import(
|
|
|
|
|
ThreadPoolFactoryConfig.class
|
|
|
|
|
)
|
|
|
|
|
public class StarterJpaConfig {
|
|
|
|
|
|
|
|
|
|
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(StarterJpaConfig.class);
|
|
|
|
|
|
|
|
|
|
public StarterJpaConfig() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
|
public IFulltextSearchSvc fullTextSearchSvc() {
|
|
|
|
|
return new FulltextSearchSvcImpl();
|
|
|
|
|
@@ -109,12 +106,14 @@ public class StarterJpaConfig {
|
|
|
|
|
return ValidationSupportConfigUtil.newCachingValidationSupport(theJpaValidationSupportChain);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private ConfigurableEnvironment configurableEnvironment;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Customize the default/max page sizes for search results. You can set these
|
|
|
|
|
* however
|
|
|
|
|
* Customize the default/max page sizes for search results. You can set these however
|
|
|
|
|
* you want, although very large page sizes will require a lot of RAM.
|
|
|
|
|
*/
|
|
|
|
|
@Bean
|
|
|
|
|
@@ -125,6 +124,7 @@ public class StarterJpaConfig {
|
|
|
|
|
return pagingProvider;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
|
public IResourceSupportedSvc resourceSupportedSvc(IDaoRegistry theDaoRegistry) {
|
|
|
|
|
return new DaoRegistryResourceSupportedSvc(theDaoRegistry);
|
|
|
|
|
@@ -137,10 +137,8 @@ public class StarterJpaConfig {
|
|
|
|
|
|
|
|
|
|
@Primary
|
|
|
|
|
@Bean
|
|
|
|
|
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource myDataSource,
|
|
|
|
|
ConfigurableListableBeanFactory myConfigurableListableBeanFactory, FhirContext theFhirContext) {
|
|
|
|
|
LocalContainerEntityManagerFactoryBean retVal = HapiEntityManagerFactoryUtil
|
|
|
|
|
.newEntityManagerFactory(myConfigurableListableBeanFactory, theFhirContext);
|
|
|
|
|
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource myDataSource, ConfigurableListableBeanFactory myConfigurableListableBeanFactory, FhirContext theFhirContext) {
|
|
|
|
|
LocalContainerEntityManagerFactoryBean retVal = HapiEntityManagerFactoryUtil.newEntityManagerFactory(myConfigurableListableBeanFactory, theFhirContext);
|
|
|
|
|
retVal.setPersistenceUnitName("HAPI_PU");
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
@@ -148,8 +146,7 @@ public class StarterJpaConfig {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
throw new ConfigurationException("Could not set the data source due to a configuration issue", e);
|
|
|
|
|
}
|
|
|
|
|
retVal.setJpaProperties(
|
|
|
|
|
EnvironmentHelper.getHibernateProperties(configurableEnvironment, myConfigurableListableBeanFactory));
|
|
|
|
|
retVal.setJpaProperties(EnvironmentHelper.getHibernateProperties(configurableEnvironment, myConfigurableListableBeanFactory));
|
|
|
|
|
return retVal;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -166,10 +163,10 @@ public class StarterJpaConfig {
|
|
|
|
|
return new HSearchSortHelperImpl(mySearchParamRegistry);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
|
@ConditionalOnProperty(prefix = "hapi.fhir", name = ENABLE_REPOSITORY_VALIDATING_INTERCEPTOR, havingValue = "true")
|
|
|
|
|
public RepositoryValidatingInterceptor repositoryValidatingInterceptor(
|
|
|
|
|
IRepositoryValidationInterceptorFactory factory) {
|
|
|
|
|
public RepositoryValidatingInterceptor repositoryValidatingInterceptor(IRepositoryValidationInterceptorFactory factory) {
|
|
|
|
|
return factory.buildUsingStoredStructureDefinitions();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -191,23 +188,20 @@ public class StarterJpaConfig {
|
|
|
|
|
@Bean("packageInstaller")
|
|
|
|
|
@Primary
|
|
|
|
|
@Conditional(OnImplementationGuidesPresent.class)
|
|
|
|
|
public IPackageInstallerSvc packageInstaller(AppProperties appProperties,
|
|
|
|
|
JobDefinition<ReindexJobParameters> reindexJobParametersJobDefinition,
|
|
|
|
|
JobDefinitionRegistry jobDefinitionRegistry, IPackageInstallerSvc packageInstallerSvc) {
|
|
|
|
|
public IPackageInstallerSvc packageInstaller(AppProperties appProperties, JobDefinition<ReindexJobParameters> reindexJobParametersJobDefinition, JobDefinitionRegistry jobDefinitionRegistry, IPackageInstallerSvc packageInstallerSvc)
|
|
|
|
|
{
|
|
|
|
|
jobDefinitionRegistry.addJobDefinitionIfNotRegistered(reindexJobParametersJobDefinition);
|
|
|
|
|
|
|
|
|
|
if (appProperties.getImplementationGuides() != null) {
|
|
|
|
|
Map<String, AppProperties.ImplementationGuide> guides = appProperties.getImplementationGuides();
|
|
|
|
|
for (Map.Entry<String, AppProperties.ImplementationGuide> guide : guides.entrySet()) {
|
|
|
|
|
PackageInstallationSpec packageInstallationSpec = new PackageInstallationSpec()
|
|
|
|
|
.setPackageUrl(guide.getValue().getUrl()).setName(guide.getValue().getName())
|
|
|
|
|
.setVersion(guide.getValue().getVersion())
|
|
|
|
|
.setInstallMode(PackageInstallationSpec.InstallModeEnum.STORE_AND_INSTALL);
|
|
|
|
|
packageInstallationSpec.setReloadExisting(appProperties.getReload_existing_implementationguides());
|
|
|
|
|
Map<String, PackageInstallationSpec> guides = appProperties.getImplementationGuides();
|
|
|
|
|
for (Map.Entry<String, PackageInstallationSpec> guidesEntry : guides.entrySet()) {
|
|
|
|
|
PackageInstallationSpec packageInstallationSpec = guidesEntry.getValue();
|
|
|
|
|
if (appProperties.getInstall_transitive_ig_dependencies()) {
|
|
|
|
|
packageInstallationSpec.setFetchDependencies(true);
|
|
|
|
|
packageInstallationSpec.setDependencyExcludes(
|
|
|
|
|
ImmutableList.of("hl7.fhir.r2.core", "hl7.fhir.r3.core", "hl7.fhir.r4.core", "hl7.fhir.r5.core"));
|
|
|
|
|
|
|
|
|
|
packageInstallationSpec.addDependencyExclude("hl7.fhir.r2.core")
|
|
|
|
|
.addDependencyExclude("hl7.fhir.r3.core")
|
|
|
|
|
.addDependencyExclude("hl7.fhir.r4.core")
|
|
|
|
|
.addDependencyExclude("hl7.fhir.r5.core");
|
|
|
|
|
}
|
|
|
|
|
packageInstallerSvc.install(packageInstallationSpec);
|
|
|
|
|
}
|
|
|
|
|
@@ -247,24 +241,7 @@ public class StarterJpaConfig {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
|
public RestfulServer restfulServer(IFhirSystemDao<?, ?> fhirSystemDao, AppProperties appProperties,
|
|
|
|
|
DaoRegistry daoRegistry,
|
|
|
|
|
Optional<MdmProviderLoader> mdmProviderProvider, IJpaSystemProvider jpaSystemProvider,
|
|
|
|
|
ResourceProviderFactory resourceProviderFactory, JpaStorageSettings jpaStorageSettings,
|
|
|
|
|
ISearchParamRegistry searchParamRegistry, IValidationSupport theValidationSupport,
|
|
|
|
|
DatabaseBackedPagingProvider databaseBackedPagingProvider, LoggingInterceptor loggingInterceptor,
|
|
|
|
|
Optional<TerminologyUploaderProvider> terminologyUploaderProvider,
|
|
|
|
|
Optional<SubscriptionTriggeringProvider> subscriptionTriggeringProvider,
|
|
|
|
|
Optional<CorsInterceptor> corsInterceptor, IInterceptorBroadcaster interceptorBroadcaster,
|
|
|
|
|
Optional<BinaryAccessProvider> binaryAccessProvider, BinaryStorageInterceptor binaryStorageInterceptor,
|
|
|
|
|
IValidatorModule validatorModule, Optional<GraphQLProvider> graphQLProvider,
|
|
|
|
|
BulkDataExportProvider bulkDataExportProvider, BulkDataImportProvider bulkDataImportProvider,
|
|
|
|
|
ValueSetOperationProvider theValueSetOperationProvider, ReindexProvider reindexProvider,
|
|
|
|
|
PartitionManagementProvider partitionManagementProvider,
|
|
|
|
|
Optional<RepositoryValidatingInterceptor> repositoryValidatingInterceptor,
|
|
|
|
|
IPackageInstallerSvc packageInstallerSvc, ThreadSafeResourceDeleterSvc theThreadSafeResourceDeleterSvc,
|
|
|
|
|
ApplicationContext appContext,
|
|
|
|
|
Optional<IpsOperationProvider> theIpsOperationProvider) {
|
|
|
|
|
public RestfulServer restfulServer(IFhirSystemDao<?, ?> fhirSystemDao, AppProperties appProperties, DaoRegistry daoRegistry, Optional<MdmProviderLoader> mdmProviderProvider, IJpaSystemProvider jpaSystemProvider, ResourceProviderFactory resourceProviderFactory, JpaStorageSettings jpaStorageSettings, ISearchParamRegistry searchParamRegistry, IValidationSupport theValidationSupport, DatabaseBackedPagingProvider databaseBackedPagingProvider, LoggingInterceptor loggingInterceptor, Optional<TerminologyUploaderProvider> terminologyUploaderProvider, Optional<SubscriptionTriggeringProvider> subscriptionTriggeringProvider, Optional<CorsInterceptor> corsInterceptor, IInterceptorBroadcaster interceptorBroadcaster, Optional<BinaryAccessProvider> binaryAccessProvider, BinaryStorageInterceptor binaryStorageInterceptor, IValidatorModule validatorModule, Optional<GraphQLProvider> graphQLProvider, BulkDataExportProvider bulkDataExportProvider, BulkDataImportProvider bulkDataImportProvider, ValueSetOperationProvider theValueSetOperationProvider, ReindexProvider reindexProvider, PartitionManagementProvider partitionManagementProvider, Optional<RepositoryValidatingInterceptor> repositoryValidatingInterceptor, IPackageInstallerSvc packageInstallerSvc, ThreadSafeResourceDeleterSvc theThreadSafeResourceDeleterSvc, ApplicationContext appContext, Optional<IpsOperationProvider> theIpsOperationProvider) {
|
|
|
|
|
RestfulServer fhirServer = new RestfulServer(fhirSystemDao.getContext());
|
|
|
|
|
|
|
|
|
|
List<String> supportedResourceTypes = appProperties.getSupported_resource_types();
|
|
|
|
|
@@ -282,21 +259,18 @@ public class StarterJpaConfig {
|
|
|
|
|
fhirSystemDao.getContext().setNarrativeGenerator(new NullNarrativeGenerator());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (appProperties.getMdm_enabled()) {
|
|
|
|
|
mdmProviderProvider.get().loadProvider();
|
|
|
|
|
}
|
|
|
|
|
if (appProperties.getMdm_enabled()) mdmProviderProvider.get().loadProvider();
|
|
|
|
|
|
|
|
|
|
fhirServer.registerProviders(resourceProviderFactory.createProviders());
|
|
|
|
|
fhirServer.registerProvider(jpaSystemProvider);
|
|
|
|
|
fhirServer.setServerConformanceProvider(calculateConformanceProvider(fhirSystemDao, fhirServer,
|
|
|
|
|
jpaStorageSettings, searchParamRegistry, theValidationSupport));
|
|
|
|
|
fhirServer.setServerConformanceProvider(calculateConformanceProvider(fhirSystemDao, fhirServer, jpaStorageSettings, searchParamRegistry, theValidationSupport));
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* ETag Support
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
if (!appProperties.getEtag_support_enabled())
|
|
|
|
|
fhirServer.setETagSupport(ETagSupportEnum.DISABLED);
|
|
|
|
|
if (!appProperties.getEtag_support_enabled()) fhirServer.setETagSupport(ETagSupportEnum.DISABLED);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Default to JSON and pretty printing
|
|
|
|
|
@@ -333,8 +307,7 @@ public class StarterJpaConfig {
|
|
|
|
|
/*
|
|
|
|
|
* If you are hosting this server at a specific DNS name, the server will try to
|
|
|
|
|
* figure out the FHIR base URL based on what the web container tells it, but
|
|
|
|
|
* this doesn't always work. If you are setting links in your search bundles
|
|
|
|
|
* that
|
|
|
|
|
* this doesn't always work. If you are setting links in your search bundles that
|
|
|
|
|
* just refer to "localhost", you might want to use a server address strategy:
|
|
|
|
|
*/
|
|
|
|
|
String serverAddress = appProperties.getServer_address();
|
|
|
|
|
@@ -342,24 +315,19 @@ public class StarterJpaConfig {
|
|
|
|
|
fhirServer.setServerAddressStrategy(new HardcodedServerAddressStrategy(serverAddress));
|
|
|
|
|
} else if (appProperties.getUse_apache_address_strategy()) {
|
|
|
|
|
boolean useHttps = appProperties.getUse_apache_address_strategy_https();
|
|
|
|
|
fhirServer.setServerAddressStrategy(
|
|
|
|
|
useHttps ? ApacheProxyAddressStrategy.forHttps() : ApacheProxyAddressStrategy.forHttp());
|
|
|
|
|
fhirServer.setServerAddressStrategy(useHttps ? ApacheProxyAddressStrategy.forHttps() : ApacheProxyAddressStrategy.forHttp());
|
|
|
|
|
} else {
|
|
|
|
|
fhirServer.setServerAddressStrategy(new IncomingRequestAddressStrategy());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* If you are using DSTU3+, you may want to add a terminology uploader, which
|
|
|
|
|
* allows
|
|
|
|
|
* uploading of external terminologies such as Snomed CT. Note that this
|
|
|
|
|
* uploader
|
|
|
|
|
* does not have any security attached (any anonymous user may use it by
|
|
|
|
|
* default)
|
|
|
|
|
* so it is a potential security vulnerability. Consider using an
|
|
|
|
|
* AuthorizationInterceptor
|
|
|
|
|
* If you are using DSTU3+, you may want to add a terminology uploader, which allows
|
|
|
|
|
* uploading of external terminologies such as Snomed CT. Note that this uploader
|
|
|
|
|
* does not have any security attached (any anonymous user may use it by default)
|
|
|
|
|
* so it is a potential security vulnerability. Consider using an AuthorizationInterceptor
|
|
|
|
|
* with this feature.
|
|
|
|
|
*/
|
|
|
|
|
if (fhirSystemDao.getContext().getVersion().getVersion().isEqualOrNewerThan(DSTU3)) { // <-- ENABLED RIGHT NOW
|
|
|
|
|
if (fhirSystemDao.getContext().getVersion().getVersion().isEqualOrNewerThan(FhirVersionEnum.DSTU3)) { // <-- ENABLED RIGHT NOW
|
|
|
|
|
fhirServer.registerProvider(terminologyUploaderProvider.get());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -377,8 +345,7 @@ public class StarterJpaConfig {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (appProperties.getAllow_cascading_deletes()) {
|
|
|
|
|
CascadingDeleteInterceptor cascadingDeleteInterceptor = new CascadingDeleteInterceptor(
|
|
|
|
|
fhirSystemDao.getContext(), daoRegistry, interceptorBroadcaster, theThreadSafeResourceDeleterSvc);
|
|
|
|
|
CascadingDeleteInterceptor cascadingDeleteInterceptor = new CascadingDeleteInterceptor(fhirSystemDao.getContext(), daoRegistry, interceptorBroadcaster, theThreadSafeResourceDeleterSvc);
|
|
|
|
|
fhirServer.registerInterceptor(cascadingDeleteInterceptor);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -407,7 +374,7 @@ public class StarterJpaConfig {
|
|
|
|
|
|
|
|
|
|
// GraphQL
|
|
|
|
|
if (appProperties.getGraphql_enabled()) {
|
|
|
|
|
if (fhirSystemDao.getContext().getVersion().getVersion().isEqualOrNewerThan(DSTU3)) {
|
|
|
|
|
if (fhirSystemDao.getContext().getVersion().getVersion().isEqualOrNewerThan(FhirVersionEnum.DSTU3)) {
|
|
|
|
|
fhirServer.registerProvider(graphQLProvider.get());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -421,15 +388,16 @@ public class StarterJpaConfig {
|
|
|
|
|
fhirServer.registerProvider(bulkDataExportProvider);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Bulk Import
|
|
|
|
|
//Bulk Import
|
|
|
|
|
if (appProperties.getBulk_import_enabled()) {
|
|
|
|
|
fhirServer.registerProvider(bulkDataImportProvider);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// valueSet Operations i.e $expand
|
|
|
|
|
fhirServer.registerProvider(theValueSetOperationProvider);
|
|
|
|
|
|
|
|
|
|
// reindex Provider $reindex
|
|
|
|
|
//reindex Provider $reindex
|
|
|
|
|
fhirServer.registerProvider(reindexProvider);
|
|
|
|
|
|
|
|
|
|
// Partitioning
|
|
|
|
|
@@ -443,7 +411,8 @@ public class StarterJpaConfig {
|
|
|
|
|
// register custom interceptors
|
|
|
|
|
registerCustomInterceptors(fhirServer, appContext, appProperties.getCustomInterceptorClasses());
|
|
|
|
|
|
|
|
|
|
// register the IPS Provider
|
|
|
|
|
|
|
|
|
|
//register the IPS Provider
|
|
|
|
|
if (!theIpsOperationProvider.isEmpty()) {
|
|
|
|
|
fhirServer.registerProvider(theIpsOperationProvider.get());
|
|
|
|
|
}
|
|
|
|
|
@@ -455,8 +424,7 @@ public class StarterJpaConfig {
|
|
|
|
|
* check the properties for custom interceptor classes and registers them.
|
|
|
|
|
*/
|
|
|
|
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
|
|
|
|
private void registerCustomInterceptors(RestfulServer fhirServer, ApplicationContext theAppContext,
|
|
|
|
|
List<String> customInterceptorClasses) {
|
|
|
|
|
private void registerCustomInterceptors(RestfulServer fhirServer, ApplicationContext theAppContext, List<String> customInterceptorClasses) {
|
|
|
|
|
|
|
|
|
|
if (customInterceptorClasses == null) {
|
|
|
|
|
return;
|
|
|
|
|
@@ -490,37 +458,30 @@ public class StarterJpaConfig {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static IServerConformanceProvider<?> calculateConformanceProvider(IFhirSystemDao fhirSystemDao,
|
|
|
|
|
RestfulServer fhirServer, JpaStorageSettings jpaStorageSettings, ISearchParamRegistry searchParamRegistry,
|
|
|
|
|
IValidationSupport theValidationSupport) {
|
|
|
|
|
public static IServerConformanceProvider<?> calculateConformanceProvider(IFhirSystemDao fhirSystemDao, RestfulServer fhirServer, JpaStorageSettings jpaStorageSettings, ISearchParamRegistry searchParamRegistry, IValidationSupport theValidationSupport) {
|
|
|
|
|
FhirVersionEnum fhirVersion = fhirSystemDao.getContext().getVersion().getVersion();
|
|
|
|
|
if (fhirVersion == FhirVersionEnum.DSTU2) {
|
|
|
|
|
JpaConformanceProviderDstu2 confProvider = new JpaConformanceProviderDstu2(fhirServer, fhirSystemDao,
|
|
|
|
|
jpaStorageSettings);
|
|
|
|
|
JpaConformanceProviderDstu2 confProvider = new JpaConformanceProviderDstu2(fhirServer, fhirSystemDao, jpaStorageSettings);
|
|
|
|
|
confProvider.setImplementationDescription("HAPI FHIR DSTU2 Server");
|
|
|
|
|
return confProvider;
|
|
|
|
|
} else if (fhirVersion == DSTU3) {
|
|
|
|
|
} else if (fhirVersion == FhirVersionEnum.DSTU3) {
|
|
|
|
|
|
|
|
|
|
JpaConformanceProviderDstu3 confProvider = new JpaConformanceProviderDstu3(fhirServer, fhirSystemDao,
|
|
|
|
|
jpaStorageSettings, searchParamRegistry);
|
|
|
|
|
JpaConformanceProviderDstu3 confProvider = new JpaConformanceProviderDstu3(fhirServer, fhirSystemDao, jpaStorageSettings, searchParamRegistry);
|
|
|
|
|
confProvider.setImplementationDescription("HAPI FHIR DSTU3 Server");
|
|
|
|
|
return confProvider;
|
|
|
|
|
} else if (fhirVersion == R4) {
|
|
|
|
|
} else if (fhirVersion == FhirVersionEnum.R4) {
|
|
|
|
|
|
|
|
|
|
JpaCapabilityStatementProvider confProvider = new JpaCapabilityStatementProvider(fhirServer, fhirSystemDao,
|
|
|
|
|
jpaStorageSettings, searchParamRegistry, theValidationSupport);
|
|
|
|
|
JpaCapabilityStatementProvider confProvider = new JpaCapabilityStatementProvider(fhirServer, fhirSystemDao, jpaStorageSettings, searchParamRegistry, theValidationSupport);
|
|
|
|
|
confProvider.setImplementationDescription("HAPI FHIR R4 Server");
|
|
|
|
|
return confProvider;
|
|
|
|
|
} else if (fhirVersion == FhirVersionEnum.R4B) {
|
|
|
|
|
|
|
|
|
|
JpaCapabilityStatementProvider confProvider = new JpaCapabilityStatementProvider(fhirServer, fhirSystemDao,
|
|
|
|
|
jpaStorageSettings, searchParamRegistry, theValidationSupport);
|
|
|
|
|
JpaCapabilityStatementProvider confProvider = new JpaCapabilityStatementProvider(fhirServer, fhirSystemDao, jpaStorageSettings, searchParamRegistry, theValidationSupport);
|
|
|
|
|
confProvider.setImplementationDescription("HAPI FHIR R4B Server");
|
|
|
|
|
return confProvider;
|
|
|
|
|
} else if (fhirVersion == FhirVersionEnum.R5) {
|
|
|
|
|
|
|
|
|
|
JpaCapabilityStatementProvider confProvider = new JpaCapabilityStatementProvider(fhirServer, fhirSystemDao,
|
|
|
|
|
jpaStorageSettings, searchParamRegistry, theValidationSupport);
|
|
|
|
|
JpaCapabilityStatementProvider confProvider = new JpaCapabilityStatementProvider(fhirServer, fhirSystemDao, jpaStorageSettings, searchParamRegistry, theValidationSupport);
|
|
|
|
|
confProvider.setImplementationDescription("HAPI FHIR R5 Server");
|
|
|
|
|
return confProvider;
|
|
|
|
|
} else {
|
|
|
|
|
|