Added option for installing transitive IG's - default is true

This commit is contained in:
jvi
2021-06-24 11:14:30 +02:00
parent 131cb12111
commit 1d82c9cd40
4 changed files with 22 additions and 7 deletions

View File

@@ -14,7 +14,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>5.4.0</version>
<version>5.4.1</version>
</parent>
<artifactId>hapi-fhir-jpaserver-starter</artifactId>

View File

@@ -62,6 +62,7 @@ public class AppProperties {
private Subscription subscription = new Subscription();
private Cors cors = null;
private Partitioning partitioning = null;
private Boolean install_transitive_ig_dependencies = true;
private Map<String, ImplementationGuide> implementationGuides = null;
private Boolean lastn_enabled = false;
@@ -73,7 +74,7 @@ public class AppProperties {
private Boolean use_apache_address_strategy = false;
private Boolean use_apache_address_strategy_https = false;
public Boolean getUse_apache_address_strategy() {
public Boolean getUse_apache_address_strategy() {
return use_apache_address_strategy;
}
@@ -462,7 +463,15 @@ public class AppProperties {
this.search_coord_queue_capacity = search_coord_queue_capacity;
}
public static class Cors {
public boolean getInstall_transitive_ig_dependencies() {
return install_transitive_ig_dependencies;
}
public void setInstall_transitive_ig_dependencies(boolean install_transitive_ig_dependencies) {
this.install_transitive_ig_dependencies = install_transitive_ig_dependencies;
}
public static class Cors {
private Boolean allow_Credentials = true;
private List<String> allowed_origin = ImmutableList.of("*");

View File

@@ -45,6 +45,7 @@ import ca.uhn.fhir.rest.server.util.ISearchParamRegistry;
import ca.uhn.fhir.validation.IValidatorModule;
import ca.uhn.fhir.validation.ResultSeverityEnum;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableList;
import org.hl7.fhir.r4.model.Bundle.BundleType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
@@ -365,12 +366,16 @@ public class BaseJpaRestfulServer extends RestfulServer {
if (appProperties.getImplementationGuides() != null) {
Map<String, AppProperties.ImplementationGuide> guides = appProperties.getImplementationGuides();
for (Map.Entry<String, AppProperties.ImplementationGuide> guide : guides.entrySet()) {
packageInstallerSvc.install(new PackageInstallationSpec()
PackageInstallationSpec packageInstallationSpec = new PackageInstallationSpec()
.setPackageUrl(guide.getValue().getUrl())
.setName(guide.getValue().getName())
.setVersion(guide.getValue().getVersion())
.setInstallMode(PackageInstallationSpec.InstallModeEnum.STORE_AND_INSTALL));
.setVersion(guide.getValue().getVersion());
if(appProperties.getInstall_transitive_ig_dependencies()) {
packageInstallationSpec.setFetchDependencies(true)
.setInstallMode(PackageInstallationSpec.InstallModeEnum.STORE_AND_INSTALL);
packageInstallationSpec.setDependencyExcludes(ImmutableList.of("hl7.fhir.r2.core", "hl7.fhir.r3.core", "hl7.fhir.r4.core", "hl7.fhir.r5.core"));
}
packageInstallerSvc.install(packageInstallationSpec);
}
}

View File

@@ -44,6 +44,7 @@ hapi:
### enable to set the Server URL
# server_address: http://hapi.fhir.org/baseR4
# defer_indexing_for_codesystems_of_size: 101
# install_transitive_ig_dependencies: true
# implementationguides:
### example from registry (packages.fhir.org)
# swiss: