Add local_base_urls configuration to feed DaoConfig.setTreatBaseUrlsAsLocal()

This commit is contained in:
Michael Buckley
2021-10-07 15:14:06 -04:00
parent 3272b8c0d2
commit 097db1642f
3 changed files with 15 additions and 5 deletions

View File

@@ -11,10 +11,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import java.util.ArrayList; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@ConfigurationProperties(prefix = "hapi.fhir") @ConfigurationProperties(prefix = "hapi.fhir")
@Configuration @Configuration
@@ -77,6 +74,7 @@ public class AppProperties {
private Integer bundle_batch_pool_size = 20; private Integer bundle_batch_pool_size = 20;
private Integer bundle_batch_pool_max_size = 100; private Integer bundle_batch_pool_max_size = 100;
private List<String> local_base_urls = new ArrayList<>();
public Boolean getUse_apache_address_strategy() { public Boolean getUse_apache_address_strategy() {
return use_apache_address_strategy; return use_apache_address_strategy;
@@ -190,7 +188,11 @@ public class AppProperties {
this.supported_resource_types = supported_resource_types; this.supported_resource_types = supported_resource_types;
} }
public Logger getLogger() { public List<String> getSupported_resource_types(List<String> supported_resource_types) {
return this.supported_resource_types;
}
public Logger getLogger() {
return logger; return logger;
} }
@@ -499,6 +501,10 @@ public class AppProperties {
this.bundle_batch_pool_max_size = bundle_batch_pool_max_size; this.bundle_batch_pool_max_size = bundle_batch_pool_max_size;
} }
public List<String> getLocal_base_urls() {
return local_base_urls;
}
public static class Cors { public static class Cors {
private Boolean allow_Credentials = true; private Boolean allow_Credentials = true;
private List<String> allowed_origin = ImmutableList.of("*"); private List<String> allowed_origin = ImmutableList.of("*");

View File

@@ -26,6 +26,7 @@ import org.springframework.context.annotation.Primary;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.EnableTransactionManagement;
import java.util.HashSet;
import java.util.Optional; import java.util.Optional;
/** /**
@@ -121,6 +122,7 @@ public class FhirServerConfigCommon {
retVal.setFilterParameterEnabled(appProperties.getFilter_search_enabled()); retVal.setFilterParameterEnabled(appProperties.getFilter_search_enabled());
retVal.setAdvancedLuceneIndexing(appProperties.getAdvanced_lucene_indexing()); retVal.setAdvancedLuceneIndexing(appProperties.getAdvanced_lucene_indexing());
retVal.setTreatBaseUrlsAsLocal(new HashSet<>(appProperties.getLocal_base_urls()));
return retVal; return retVal;
} }

View File

@@ -34,6 +34,8 @@ hapi:
# fhirpath_interceptor_enabled: false # fhirpath_interceptor_enabled: false
# filter_search_enabled: true # filter_search_enabled: true
# graphql_enabled: true # graphql_enabled: true
# local_base_urls:
# - http://hapi.fhir.org/baseR4
#partitioning: #partitioning:
# cross_partition_reference_mode: true # cross_partition_reference_mode: true
# multitenancy_enabled: true # multitenancy_enabled: true