From 710d9fc998c22da54703bc7b063f458f96f18e01 Mon Sep 17 00:00:00 2001 From: Adam Stevenson Date: Thu, 27 Feb 2025 09:57:59 -0700 Subject: [PATCH 1/5] Expose expansion properties as configuration --- .../uhn/fhir/jpa/starter/AppProperties.java | 35 +++++++++++++++++++ .../common/FhirServerConfigCommon.java | 14 ++++++++ src/main/resources/application.yaml | 6 ++++ src/main/resources/cds.application.yaml | 7 ++++ 4 files changed, 62 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 58c5bac..cd0bf74 100644 --- a/src/main/java/ca/uhn/fhir/jpa/starter/AppProperties.java +++ b/src/main/java/ca/uhn/fhir/jpa/starter/AppProperties.java @@ -100,6 +100,11 @@ public class AppProperties { private boolean userRequestRetryVersionConflictsInterceptorEnabled = false; private List search_prefetch_thresholds = new ArrayList<>(); + private Boolean pre_expand_value_sets = true; + private Boolean enable_task_pre_expand_value_sets = true; + private Integer pre_expand_value_sets_default_count = 1000; + private Integer pre_expand_value_sets_max_count = 1000; + private Integer maximum_expansion_size = 1000; public List getCustomInterceptorClasses() { return custom_interceptor_classes; @@ -678,6 +683,36 @@ public class AppProperties { this.resource_dbhistory_enabled = resource_dbhistory_enabled; } + public Boolean getPre_expand_value_sets() { return this.pre_expand_value_sets; } + + public void setPre_expand_value_sets(Boolean pre_expand_value_sets) { + this.pre_expand_value_sets = pre_expand_value_sets; + } + + public Boolean getEnable_task_pre_expand_value_sets() { return this.enable_task_pre_expand_value_sets; } + + public void setEnable_task_pre_expand_value_setss(Boolean enable_task_pre_expand_value_sets) { + this.enable_task_pre_expand_value_sets = enable_task_pre_expand_value_sets; + } + + public Integer getPre_expand_value_sets_default_count() {return pre_expand_value_sets_default_count; } + + public void setPre_expand_value_sets_default_count(Integer pre_expand_value_sets_default_count) { + this.pre_expand_value_sets_default_count = pre_expand_value_sets_default_count; + } + + public Integer getPre_expand_value_sets_max_count() { return pre_expand_value_sets_max_count; } + + public void setPre_expand_value_sets_max_count(Integer pre_expand_value_sets_max_count) { + this.pre_expand_value_sets_max_count = pre_expand_value_sets_max_count; + } + + public Integer getMaximum_expansion_size() { return maximum_expansion_size; } + + public void setMaximum_expansion_size(Integer maximum_expansion_size) { + this.maximum_expansion_size = maximum_expansion_size; + } + 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 f77d3b2..a5046bd 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 @@ -88,6 +88,14 @@ public class FhirServerConfigCommon { if (appProperties.getEnable_index_contained_resource() == Boolean.TRUE) { ourLog.info("Indexed on contained resource enabled"); } + + ourLog.info("Server configured to " + (appProperties.getPre_expand_value_sets() ? "enable" : "disable") + + " value set pre-expansion"); + ourLog.info("Server configured to " + (appProperties.getEnable_task_pre_expand_value_sets() ? "enable" : "disable") + + " value set pre-expansion task"); + ourLog.info("Server configured for pre-expand value set default count of " + (appProperties.getPre_expand_value_sets_default_count().toString())); + ourLog.info("Server configured for pre-expand value set max count of " + (appProperties.getPre_expand_value_sets_default_count().toString())); + ourLog.info("Server configured for maximum expansion size of " + (appProperties.getPre_expand_value_sets_default_count().toString())); } @Bean @@ -130,6 +138,12 @@ public class FhirServerConfigCommon { public JpaStorageSettings jpaStorageSettings(AppProperties appProperties) { JpaStorageSettings jpaStorageSettings = new JpaStorageSettings(); + jpaStorageSettings.setPreExpandValueSets(appProperties.getPre_expand_value_sets()); + jpaStorageSettings.setEnableTaskPreExpandValueSets(appProperties.getEnable_task_pre_expand_value_sets()); + jpaStorageSettings.setPreExpandValueSetsDefaultCount(appProperties.getPre_expand_value_sets_default_count()); + jpaStorageSettings.setPreExpandValueSetsMaxCount(appProperties.getPre_expand_value_sets_max_count()); + jpaStorageSettings.setMaximumExpansionSize(appProperties.getMaximum_expansion_size()); + jpaStorageSettings.setIndexMissingFields( appProperties.getEnable_index_missing_fields() ? StorageSettings.IndexEnabledEnum.ENABLED diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 5165d9c..3ea2e3c 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -218,6 +218,12 @@ hapi: # userRequestRetryVersionConflictsInterceptorEnabled : false # local_base_urls: # - https://hapi.fhir.org/baseR4 + # pre_expand_value_sets: true + # enable_task_pre_expand_value_sets: true + # pre_expand_value_sets_default_count: 1000 + # pre_expand_value_sets_max_count: 1000 + # maximum_expansion_size: 1000 + logical_urls: - http://terminology.hl7.org/* - https://terminology.hl7.org/* diff --git a/src/main/resources/cds.application.yaml b/src/main/resources/cds.application.yaml index e94030c..90d4da7 100644 --- a/src/main/resources/cds.application.yaml +++ b/src/main/resources/cds.application.yaml @@ -215,6 +215,13 @@ hapi: mdm_rules_json_location: "mdm-rules.json" # local_base_urls: # - https://hapi.fhir.org/baseR4 + + # pre_expand_value_sets: true + # enable_task_pre_expand_value_sets: true + # pre_expand_value_sets_default_count: 1000 + # pre_expand_value_sets_max_count: 1000 + # maximum_expansion_size: 1000 + logical_urls: - http://terminology.hl7.org/* - https://terminology.hl7.org/* From ec6b12e8648adaa839f0c3b6e5101485fd40c858 Mon Sep 17 00:00:00 2001 From: Yoann Isaac Date: Sun, 2 Mar 2025 23:13:31 +0100 Subject: [PATCH 2/5] Externalizes more subscription parameters (#783) * Externalizes more subscription parameters Allows : - to parametrize the polling interval of subscription - to enable the setting to queue the subscription jobs immediately. Following the change in hapifhir/hapi-fhir/pull/6395 * Fix formatting --- .../uhn/fhir/jpa/starter/AppProperties.java | 38 ++++++++++++++++--- .../common/FhirServerConfigCommon.java | 28 +++++++++++--- src/main/resources/application.yaml | 2 + 3 files changed, 57 insertions(+), 11 deletions(-) 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 cd0bf74..cfbf8b6 100644 --- a/src/main/java/ca/uhn/fhir/jpa/starter/AppProperties.java +++ b/src/main/java/ca/uhn/fhir/jpa/starter/AppProperties.java @@ -683,31 +683,41 @@ public class AppProperties { this.resource_dbhistory_enabled = resource_dbhistory_enabled; } - public Boolean getPre_expand_value_sets() { return this.pre_expand_value_sets; } + public Boolean getPre_expand_value_sets() { + return this.pre_expand_value_sets; + } public void setPre_expand_value_sets(Boolean pre_expand_value_sets) { this.pre_expand_value_sets = pre_expand_value_sets; } - public Boolean getEnable_task_pre_expand_value_sets() { return this.enable_task_pre_expand_value_sets; } + public Boolean getEnable_task_pre_expand_value_sets() { + return this.enable_task_pre_expand_value_sets; + } public void setEnable_task_pre_expand_value_setss(Boolean enable_task_pre_expand_value_sets) { this.enable_task_pre_expand_value_sets = enable_task_pre_expand_value_sets; } - public Integer getPre_expand_value_sets_default_count() {return pre_expand_value_sets_default_count; } + public Integer getPre_expand_value_sets_default_count() { + return pre_expand_value_sets_default_count; + } public void setPre_expand_value_sets_default_count(Integer pre_expand_value_sets_default_count) { this.pre_expand_value_sets_default_count = pre_expand_value_sets_default_count; } - public Integer getPre_expand_value_sets_max_count() { return pre_expand_value_sets_max_count; } + public Integer getPre_expand_value_sets_max_count() { + return pre_expand_value_sets_max_count; + } public void setPre_expand_value_sets_max_count(Integer pre_expand_value_sets_max_count) { this.pre_expand_value_sets_max_count = pre_expand_value_sets_max_count; } - public Integer getMaximum_expansion_size() { return maximum_expansion_size; } + public Integer getMaximum_expansion_size() { + return maximum_expansion_size; + } public void setMaximum_expansion_size(Integer maximum_expansion_size) { this.maximum_expansion_size = maximum_expansion_size; @@ -914,6 +924,8 @@ public class AppProperties { private Boolean resthook_enabled = false; private Boolean websocket_enabled = false; private Email email = null; + private Integer polling_interval_ms = null; + private Boolean immediately_queued = false; public Boolean getResthook_enabled() { return resthook_enabled; @@ -939,6 +951,22 @@ public class AppProperties { this.email = email; } + public Integer getPolling_interval_ms() { + return polling_interval_ms; + } + + public void setPolling_interval_ms(Integer polling_interval_ms) { + this.polling_interval_ms = polling_interval_ms; + } + + public Boolean getImmediately_queued() { + return immediately_queued; + } + + public void setImmediately_queued(Boolean immediately_queued) { + this.immediately_queued = immediately_queued; + } + public static class Email { private String from; private String host; 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 a5046bd..3abbed5 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 @@ -90,12 +90,16 @@ public class FhirServerConfigCommon { } ourLog.info("Server configured to " + (appProperties.getPre_expand_value_sets() ? "enable" : "disable") - + " value set pre-expansion"); - ourLog.info("Server configured to " + (appProperties.getEnable_task_pre_expand_value_sets() ? "enable" : "disable") - + " value set pre-expansion task"); - ourLog.info("Server configured for pre-expand value set default count of " + (appProperties.getPre_expand_value_sets_default_count().toString())); - ourLog.info("Server configured for pre-expand value set max count of " + (appProperties.getPre_expand_value_sets_default_count().toString())); - ourLog.info("Server configured for maximum expansion size of " + (appProperties.getPre_expand_value_sets_default_count().toString())); + + " value set pre-expansion"); + ourLog.info( + "Server configured to " + (appProperties.getEnable_task_pre_expand_value_sets() ? "enable" : "disable") + + " value set pre-expansion task"); + ourLog.info("Server configured for pre-expand value set default count of " + + (appProperties.getPre_expand_value_sets_default_count().toString())); + ourLog.info("Server configured for pre-expand value set max count of " + + (appProperties.getPre_expand_value_sets_default_count().toString())); + ourLog.info("Server configured for maximum expansion size of " + + (appProperties.getPre_expand_value_sets_default_count().toString())); } @Bean @@ -122,6 +126,18 @@ public class FhirServerConfigCommon { subscriptionSettings.addSupportedSubscriptionType( org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.WEBSOCKET); } + if (appProperties.getSubscription().getPolling_interval_ms() != null) { + ourLog.info( + "Setting subscription polling interval to {} ms", + appProperties.getSubscription().getPolling_interval_ms()); + subscriptionSettings.setSubscriptionIntervalInMs( + appProperties.getSubscription().getPolling_interval_ms()); + } + if (appProperties.getSubscription().getImmediately_queued()) { + ourLog.info("Subscription update will be queued immediately"); + subscriptionSettings.setSubscriptionChangeQueuedImmediately( + appProperties.getSubscription().getImmediately_queued()); + } } if (appProperties.getMdm_enabled()) { // MDM requires the subscription of type message diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 3ea2e3c..a0756d6 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -309,6 +309,8 @@ hapi: # subscription: # resthook_enabled: true # websocket_enabled: false +# polling_interval_ms: 5000 +# immediately_queued: false # email: # from: some@test.com # host: google.com From f32ad20ac7283ccdac7df3986d709994cd6f91f5 Mon Sep 17 00:00:00 2001 From: dotasek Date: Tue, 4 Mar 2025 15:11:26 -0500 Subject: [PATCH 3/5] Uncouple version from parent for release purposes --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index 771de2a..1c2ab48 100644 --- a/pom.xml +++ b/pom.xml @@ -18,6 +18,7 @@ hapi-fhir-jpaserver-starter + 8.1.0-SNAPSHOT war From bdc2795a6b693f34f59b030206f64d0e6809b241 Mon Sep 17 00:00:00 2001 From: dotasek Date: Tue, 11 Mar 2025 09:30:27 -0400 Subject: [PATCH 4/5] Use revision number versioning --- pom.xml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 1c2ab48..ef2aec2 100644 --- a/pom.xml +++ b/pom.xml @@ -3,6 +3,11 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 + + 17 + 1 + +