Merged in changes from the rel_5_3_0 Branch.

This commit is contained in:
Kevin Dougan
2021-02-16 11:57:15 -05:00
7 changed files with 248 additions and 61 deletions

View File

@@ -11,8 +11,8 @@ import ca.uhn.fhir.jpa.api.dao.IFhirSystemDao;
import ca.uhn.fhir.jpa.binstore.BinaryStorageInterceptor;
import ca.uhn.fhir.jpa.bulk.provider.BulkDataExportProvider;
import ca.uhn.fhir.jpa.interceptor.CascadingDeleteInterceptor;
import ca.uhn.fhir.jpa.interceptor.validation.RepositoryValidatingInterceptor;
import ca.uhn.fhir.jpa.packages.IPackageInstallerSvc;
import ca.uhn.fhir.jpa.packages.PackageInstallOutcomeJson;
import ca.uhn.fhir.jpa.packages.PackageInstallationSpec;
import ca.uhn.fhir.jpa.partition.PartitionManagementProvider;
import ca.uhn.fhir.jpa.provider.*;
@@ -98,6 +98,9 @@ public class BaseJpaRestfulServer extends RestfulServer {
@Autowired
ApplicationContext myApplicationContext;
@Autowired(required = false)
IRepositoryValidationInterceptorFactory factory;
// These are set only if the features are enabled
private CqlProviderLoader cqlProviderLoader;
@@ -354,28 +357,24 @@ public class BaseJpaRestfulServer extends RestfulServer {
if (appProperties.getImplementationGuides() != null) {
Map<String, AppProperties.ImplementationGuide> guides = appProperties.getImplementationGuides();
for (Map.Entry<String, AppProperties.ImplementationGuide> guide : guides.entrySet()) {
packageInstallerSvc.install(new PackageInstallationSpec()
.setPackageUrl(guide.getValue().getUrl())
.setName(guide.getValue().getName())
.setVersion(guide.getValue().getVersion())
.setInstallMode(PackageInstallationSpec.InstallModeEnum.STORE_AND_INSTALL));
packageInstallerSvc.install(new PackageInstallationSpec()
.setPackageUrl(guide.getValue().getUrl())
.setName(guide.getValue().getName())
.setVersion(guide.getValue().getVersion())
.setInstallMode(PackageInstallationSpec.InstallModeEnum.STORE_AND_INSTALL));
}
}
if(factory != null) {
interceptorService.registerInterceptor(factory.buildUsingStoredStructureDefinitions());
}
if (appProperties.getLastn_enabled()) {
daoConfig.setLastNEnabled(true);
}
daoConfig.getModelConfig().setNormalizedQuantitySearchLevel(appProperties.getNormalized_quantity_search_level());
// Repository Validating Interceptor
if (Boolean.TRUE.equals(appProperties.getEnable_repository_validating_interceptor())) {
RepositoryValidationInterceptorFactory repositoryValidationInterceptorFactory = myApplicationContext.getBean(RepositoryValidationInterceptorFactory.class);
RepositoryValidatingInterceptor interceptor = repositoryValidationInterceptorFactory.build();
interceptorService.registerInterceptor(interceptor);
}
}
}