Add additional options

This commit is contained in:
James Agnew
2025-06-06 08:49:47 +02:00
parent 299ab28599
commit d0aa399c75
3 changed files with 57 additions and 19 deletions

View File

@@ -18,6 +18,8 @@ import java.util.Map;
import java.util.Objects;
import java.util.Set;
import static org.apache.commons.lang3.ObjectUtils.defaultIfNull;
@ConfigurationProperties(prefix = "hapi.fhir")
@Configuration
@EnableConfigurationProperties
@@ -44,6 +46,7 @@ public class AppProperties {
private Boolean mass_ingestion_mode_enabled = false;
private Boolean language_search_parameter_enabled = false;
private Boolean dao_scheduling_enabled = true;
private Boolean delete_enabled = true;
private Boolean delete_expunge_enabled = false;
private Boolean enable_index_missing_fields = false;
private Boolean enable_index_contained_resource = false;
@@ -107,6 +110,7 @@ public class AppProperties {
private Integer maximum_expansion_size = 1000;
private Map<String, RemoteSystem> remote_terminology_service = null;
private Boolean match_url_cache_enabled = false;
public List<String> getCustomInterceptorClasses() {
return custom_interceptor_classes;
@@ -364,6 +368,14 @@ public class AppProperties {
return delete_expunge_enabled;
}
public boolean getDelete_enabled() {
return defaultIfNull(delete_enabled, true);
}
public void setDelete_enabled(boolean theDelete_enabled) {
delete_enabled = theDelete_enabled;
}
public void setDelete_expunge_enabled(Boolean delete_expunge_enabled) {
this.delete_expunge_enabled = delete_expunge_enabled;
}
@@ -733,6 +745,14 @@ public class AppProperties {
this.remote_terminology_service = remote_terminology_service;
}
public boolean getMatch_url_cache_enabled() {
return defaultIfNull(match_url_cache_enabled, false);
}
public void setMatch_url_cache_enabled(boolean theMatchUrlCacheEnabled) {
match_url_cache_enabled = theMatchUrlCacheEnabled;
}
public static class Cors {
private Boolean allow_Credentials = true;
private List<String> allowed_origin = List.of("*");

View File

@@ -16,6 +16,8 @@ import ca.uhn.fhir.rest.server.mail.MailConfig;
import ca.uhn.fhir.rest.server.mail.MailSvc;
import com.google.common.base.Strings;
import org.hl7.fhir.r4.model.Bundle.BundleType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.env.YamlPropertySourceLoader;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -36,7 +38,7 @@ import static org.apache.commons.lang3.ObjectUtils.defaultIfNull;
@EnableTransactionManagement
public class FhirServerConfigCommon {
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirServerConfigCommon.class);
private static final Logger ourLog = LoggerFactory.getLogger(FhirServerConfigCommon.class);
public FhirServerConfigCommon(AppProperties appProperties) {
ourLog.info("Server configured to " + (appProperties.getAllow_contains_searches() ? "allow" : "deny")
@@ -176,6 +178,8 @@ public class FhirServerConfigCommon {
jpaStorageSettings.setAllowMultipleDelete(appProperties.getAllow_multiple_delete());
jpaStorageSettings.setAllowExternalReferences(appProperties.getAllow_external_references());
jpaStorageSettings.setSchedulingDisabled(!appProperties.getDao_scheduling_enabled());
jpaStorageSettings.setMatchUrlCacheEnabled(appProperties.getMatch_url_cache_enabled());
jpaStorageSettings.setDeleteEnabled(appProperties.getDelete_enabled());
jpaStorageSettings.setDeleteExpungeEnabled(appProperties.getDelete_expunge_enabled());
jpaStorageSettings.setExpungeEnabled(appProperties.getExpunge_enabled());
jpaStorageSettings.setLanguageSearchParameterEnabled(appProperties.getLanguage_search_parameter_enabled());
@@ -286,6 +290,18 @@ public class FhirServerConfigCommon {
}
retVal.setConditionalCreateDuplicateIdentifiersEnabled(
appProperties.getPartitioning().getConditional_create_duplicate_identifiers_enabled());
ourLog.info("""
Partitioning is enabled on this server. Settings:
* Database Partition Mode Enabled: {}
* Default Partition ID : {}
* Cross-Partition References : {}""",
databasePartitionModeEnabled,
defaultPartitionId,
retVal.getAllowReferencesAcrossPartitions());
} else {
ourLog.info("Partitioning is not enabled on this server");
}
return retVal;