From c10e84e3332758e36d71aefacf1d91ada3658478 Mon Sep 17 00:00:00 2001 From: Muazzam Khan Date: Mon, 29 Apr 2024 18:12:24 -0400 Subject: [PATCH] issue-5884-Add-Config-Resource-History : Adding configuration for Disabling Resource History. --- .../java/ca/uhn/fhir/jpa/starter/AppProperties.java | 10 ++++++++++ .../jpa/starter/common/FhirServerConfigCommon.java | 3 +++ src/main/resources/application.yaml | 1 + 3 files changed, 14 insertions(+) diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/AppProperties.java b/src/main/java/ca/uhn/fhir/jpa/starter/AppProperties.java index 3c53719..eb15699 100644 --- a/src/main/java/ca/uhn/fhir/jpa/starter/AppProperties.java +++ b/src/main/java/ca/uhn/fhir/jpa/starter/AppProperties.java @@ -96,6 +96,8 @@ public class AppProperties { private Integer bundle_batch_pool_max_size = 100; private final Set local_base_urls = new HashSet<>(); private final Set logical_urls = new HashSet<>(); + + private Boolean resource_dbhistory_enabled = true; private final List custom_interceptor_classes = new ArrayList<>(); @@ -903,4 +905,12 @@ public Cors getCors() { public void setEnable_index_of_type(boolean enable_index_of_type) { this.enable_index_of_type = enable_index_of_type; } + +public Boolean getResource_dbhistory_enabled() { + return resource_dbhistory_enabled; +} + +public void setResource_dbhistory_enabled(Boolean resource_dbhistory_enabled) { + this.resource_dbhistory_enabled = resource_dbhistory_enabled; +} } \ No newline at end of file diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/common/FhirServerConfigCommon.java b/src/main/java/ca/uhn/fhir/jpa/starter/common/FhirServerConfigCommon.java index 1347028..d113c7e 100644 --- a/src/main/java/ca/uhn/fhir/jpa/starter/common/FhirServerConfigCommon.java +++ b/src/main/java/ca/uhn/fhir/jpa/starter/common/FhirServerConfigCommon.java @@ -194,6 +194,9 @@ public class FhirServerConfigCommon { jpaStorageSettings.setResourceServerIdStrategy(appProperties.getServer_id_strategy()); ourLog.info("Server configured to use '" + appProperties.getServer_id_strategy() + "' Server ID Strategy"); } + + //to Disable the Resource History + jpaStorageSettings.setResourceDbHistoryEnabled(appProperties.getResource_dbhistory_enabled()); // Parallel Batch GET execution settings jpaStorageSettings.setBundleBatchPoolSize(appProperties.getBundle_batch_pool_size()); diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 013c29e..d7dcaf1 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -127,6 +127,7 @@ hapi: # enable_index_missing_fields: false # enable_index_of_type: true # enable_index_contained_resource: false + # resource_dbhistory_enabled: false ### !!Extended Lucene/Elasticsearch Indexing is still a experimental feature, expect some features (e.g. _total=accurate) to not work as expected!! ### more information here: https://hapifhir.io/hapi-fhir/docs/server_jpa/elastic.html advanced_lucene_indexing: false