From 5d84d9fc5948ed20e24650e5ea9dd8bd3b657860 Mon Sep 17 00:00:00 2001 From: Michael Wilson <76768244+michael-wilson-au@users.noreply.github.com> Date: Sat, 9 Nov 2024 19:45:46 +1100 Subject: [PATCH] Config property for validate resource status (#746) * Added configuration property for validate_resource_status_for_package_upload * Added new parameter to test config file * Fixed merge issue --- src/main/java/ca/uhn/fhir/jpa/starter/AppProperties.java | 9 +++++++++ .../fhir/jpa/starter/common/FhirServerConfigCommon.java | 2 +- src/main/resources/application.yaml | 2 ++ src/main/resources/cds.application.yaml | 2 ++ src/test/resources/application.yaml | 2 ++ 5 files changed, 16 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 7abf880..cb06546 100644 --- a/src/main/java/ca/uhn/fhir/jpa/starter/AppProperties.java +++ b/src/main/java/ca/uhn/fhir/jpa/starter/AppProperties.java @@ -80,6 +80,7 @@ public class AppProperties { private Subscription subscription = new Subscription(); private Cors cors = null; private Partitioning partitioning = null; + private Boolean validate_resource_status_for_package_upload = true; private Boolean install_transitive_ig_dependencies = true; private Map implementationGuides = null; @@ -589,6 +590,14 @@ public Cors getCors() { this.install_transitive_ig_dependencies = install_transitive_ig_dependencies; } + public Boolean getValidate_resource_status_for_package_upload() { + return validate_resource_status_for_package_upload; + } + + public void setValidate_resource_status_for_package_upload(Boolean validate_resource_status_for_package_upload) { + this.validate_resource_status_for_package_upload = validate_resource_status_for_package_upload; + } + public Integer getBundle_batch_pool_size() { return this.bundle_batch_pool_size; } 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 51a4648..3c3941b 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 @@ -149,9 +149,9 @@ public class FhirServerConfigCommon { jpaStorageSettings.setDeleteExpungeEnabled(appProperties.getDelete_expunge_enabled()); jpaStorageSettings.setExpungeEnabled(appProperties.getExpunge_enabled()); jpaStorageSettings.setLanguageSearchParameterEnabled(appProperties.getLanguage_search_parameter_enabled()); + jpaStorageSettings.setValidateResourceStatusForPackageUpload(appProperties.getValidate_resource_status_for_package_upload()); jpaStorageSettings.setIndexOnUpliftedRefchains(appProperties.getUpliftedRefchains_enabled()); - if (!appProperties.getSearch_prefetch_thresholds().isEmpty()) { jpaStorageSettings.setSearchPreFetchThresholds(appProperties.getSearch_prefetch_thresholds()); } diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 97d439e..5bb8326 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -152,6 +152,8 @@ hapi: ### enable to set the Server URL # server_address: http://hapi.fhir.org/baseR4 # defer_indexing_for_codesystems_of_size: 101 + ### Flag is true by default. This flag filters resources during package installation, allowing only those resources with a valid status (e.g. active) to be installed. + # validate_resource_status_for_package_upload: false # install_transitive_ig_dependencies: true #implementationguides: ### example from registry (packages.fhir.org) diff --git a/src/main/resources/cds.application.yaml b/src/main/resources/cds.application.yaml index 49c4228..65d28ff 100644 --- a/src/main/resources/cds.application.yaml +++ b/src/main/resources/cds.application.yaml @@ -153,6 +153,8 @@ hapi: ### enable to set the Server URL # server_address: http://hapi.fhir.org/baseR4 # defer_indexing_for_codesystems_of_size: 101 + ### Flag is true by default. This flag filters resources during package installation, allowing only those resources with a valid status (e.g. active) to be installed. + # validate_resource_status_for_package_upload: false # install_transitive_ig_dependencies: true #implementationguides: ### example from registry (packages.fhir.org) diff --git a/src/test/resources/application.yaml b/src/test/resources/application.yaml index 619ea61..a494359 100644 --- a/src/test/resources/application.yaml +++ b/src/test/resources/application.yaml @@ -94,6 +94,8 @@ hapi: ### enable to set the Server URL # server_address: http://hapi.fhir.org/baseR4 # defer_indexing_for_codesystems_of_size: 101 + ### Flag is true by default. This flag filters resources during package installation, allowing only those resources with a valid status (e.g. active) to be installed. + # validate_resource_status_for_package_upload: false # install_transitive_ig_dependencies: true # implementationguides: ### example from registry (packages.fhir.org)