From 7cd0637c88b0f8d8d8679d0dbf31bfa27e6c7bf2 Mon Sep 17 00:00:00 2001 From: Michal Sevcik <99325737+SevcikMichal@users.noreply.github.com> Date: Sun, 8 Jun 2025 11:40:26 +0200 Subject: [PATCH] Enable configuration of store_meta_source_information (#825) * Enable configuration of store_meta_source_information * Update src/main/java/ca/uhn/fhir/jpa/starter/common/FhirServerConfigCommon.java Co-authored-by: James Agnew * Apply spotless style checks --------- Co-authored-by: James Agnew --- .../java/ca/uhn/fhir/jpa/starter/AppProperties.java | 12 ++++++++++++ .../jpa/starter/common/FhirServerConfigCommon.java | 4 ++++ src/main/resources/application.yaml | 3 ++- 3 files changed, 18 insertions(+), 1 deletion(-) 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 05f90b9..34b0c75 100644 --- a/src/main/java/ca/uhn/fhir/jpa/starter/AppProperties.java +++ b/src/main/java/ca/uhn/fhir/jpa/starter/AppProperties.java @@ -1,6 +1,7 @@ package ca.uhn.fhir.jpa.starter; import ca.uhn.fhir.context.FhirVersionEnum; +import ca.uhn.fhir.jpa.api.config.JpaStorageSettings; import ca.uhn.fhir.jpa.api.config.JpaStorageSettings.ClientIdStrategyEnum; import ca.uhn.fhir.jpa.api.config.JpaStorageSettings.IdStrategyEnum; import ca.uhn.fhir.jpa.model.entity.NormalizedQuantitySearchLevel; @@ -106,6 +107,8 @@ public class AppProperties { private Integer pre_expand_value_sets_default_count = 1000; private Integer pre_expand_value_sets_max_count = 1000; private Integer maximum_expansion_size = 1000; + private JpaStorageSettings.StoreMetaSourceInformationEnum store_meta_source_information = + JpaStorageSettings.StoreMetaSourceInformationEnum.NONE; private Map remote_terminology_service = null; @@ -742,6 +745,15 @@ public class AppProperties { this.remote_terminology_service = remote_terminology_service; } + public JpaStorageSettings.StoreMetaSourceInformationEnum getStore_meta_source_information() { + return store_meta_source_information; + } + + public void setStore_meta_source_information( + JpaStorageSettings.StoreMetaSourceInformationEnum store_meta_source_information) { + this.store_meta_source_information = store_meta_source_information; + } + public static class Cors { private Boolean allow_Credentials = true; private List allowed_origin = List.of("*"); 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 9c2007f..60f9948 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 @@ -254,6 +254,10 @@ public class FhirServerConfigCommon { jpaStorageSettings.setBundleBatchPoolSize(appProperties.getBundle_batch_pool_size()); jpaStorageSettings.setBundleBatchPoolSize(appProperties.getBundle_batch_pool_max_size()); + // Set store meta source information + ourLog.debug("Server configured to Store Meta Source: {}", appProperties.getStore_meta_source_information()); + jpaStorageSettings.setStoreMetaSourceInformation(appProperties.getStore_meta_source_information()); + storageSettings(appProperties, jpaStorageSettings); return jpaStorageSettings; } diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 849a6fa..cb0c0ce 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -276,7 +276,8 @@ hapi: # classes listed here will be fetched from the Spring context when combined with 'custom-bean-packages', # or will be instantiated via reflection using an no-arg contructor; then registered with the server #custom-provider-classes: - + # specify what should be stored in meta.source based on StoreMetaSourceInformationEnum defaults to NONE + # store_meta_source_information: NONE # Threadpool size for BATCH'ed GETs in a bundle. # bundle_batch_pool_size: 10 # bundle_batch_pool_max_size: 50