Feature/using package installer spec (#577)
* Adjusting to HAPI core classes * Added example as default * Commented the example IG out again
This commit is contained in:
committed by
GitHub
parent
d6e9abad8c
commit
37a9317355
@@ -4,6 +4,7 @@ package ca.uhn.fhir.jpa.starter;
|
|||||||
import ca.uhn.fhir.context.FhirVersionEnum;
|
import ca.uhn.fhir.context.FhirVersionEnum;
|
||||||
import ca.uhn.fhir.jpa.api.config.JpaStorageSettings.ClientIdStrategyEnum;
|
import ca.uhn.fhir.jpa.api.config.JpaStorageSettings.ClientIdStrategyEnum;
|
||||||
import ca.uhn.fhir.jpa.model.entity.NormalizedQuantitySearchLevel;
|
import ca.uhn.fhir.jpa.model.entity.NormalizedQuantitySearchLevel;
|
||||||
|
import ca.uhn.fhir.jpa.packages.PackageInstallationSpec;
|
||||||
import ca.uhn.fhir.rest.api.EncodingEnum;
|
import ca.uhn.fhir.rest.api.EncodingEnum;
|
||||||
import org.hl7.fhir.r4.model.Bundle;
|
import org.hl7.fhir.r4.model.Bundle;
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
@@ -74,7 +75,7 @@ public class AppProperties {
|
|||||||
private Partitioning partitioning = null;
|
private Partitioning partitioning = null;
|
||||||
private Boolean install_transitive_ig_dependencies = true;
|
private Boolean install_transitive_ig_dependencies = true;
|
||||||
private Boolean reload_existing_implementationguides = false;
|
private Boolean reload_existing_implementationguides = false;
|
||||||
private Map<String, ImplementationGuide> implementationGuides = null;
|
private Map<String, PackageInstallationSpec> implementationGuides = null;
|
||||||
|
|
||||||
private String staticLocation = null;
|
private String staticLocation = null;
|
||||||
|
|
||||||
@@ -148,11 +149,11 @@ public class AppProperties {
|
|||||||
this.defer_indexing_for_codesystems_of_size = defer_indexing_for_codesystems_of_size;
|
this.defer_indexing_for_codesystems_of_size = defer_indexing_for_codesystems_of_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, ImplementationGuide> getImplementationGuides() {
|
public Map<String, PackageInstallationSpec> getImplementationGuides() {
|
||||||
return implementationGuides;
|
return implementationGuides;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setImplementationGuides(Map<String, ImplementationGuide> implementationGuides) {
|
public void setImplementationGuides(Map<String, PackageInstallationSpec> implementationGuides) {
|
||||||
this.implementationGuides = implementationGuides;
|
this.implementationGuides = implementationGuides;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -696,36 +697,6 @@ public class AppProperties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class ImplementationGuide
|
|
||||||
{
|
|
||||||
private String url;
|
|
||||||
private String name;
|
|
||||||
private String version;
|
|
||||||
|
|
||||||
public String getUrl() {
|
|
||||||
return url;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUrl(String url) {
|
|
||||||
this.url = url;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getVersion() {
|
|
||||||
return version;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setVersion(String version) {
|
|
||||||
this.version = version;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class Validation {
|
public static class Validation {
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,6 @@ import org.springframework.web.cors.CorsConfiguration;
|
|||||||
|
|
||||||
import javax.persistence.EntityManagerFactory;
|
import javax.persistence.EntityManagerFactory;
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import static ca.uhn.fhir.jpa.starter.common.validation.IRepositoryValidationInterceptorFactory.ENABLE_REPOSITORY_VALIDATING_INTERCEPTOR;
|
import static ca.uhn.fhir.jpa.starter.common.validation.IRepositoryValidationInterceptorFactory.ENABLE_REPOSITORY_VALIDATING_INTERCEPTOR;
|
||||||
@@ -194,13 +193,15 @@ public class StarterJpaConfig {
|
|||||||
jobDefinitionRegistry.addJobDefinitionIfNotRegistered(reindexJobParametersJobDefinition);
|
jobDefinitionRegistry.addJobDefinitionIfNotRegistered(reindexJobParametersJobDefinition);
|
||||||
|
|
||||||
if (appProperties.getImplementationGuides() != null) {
|
if (appProperties.getImplementationGuides() != null) {
|
||||||
Map<String, AppProperties.ImplementationGuide> guides = appProperties.getImplementationGuides();
|
Map<String, PackageInstallationSpec> guides = appProperties.getImplementationGuides();
|
||||||
for (Map.Entry<String, AppProperties.ImplementationGuide> guide : guides.entrySet()) {
|
for (Map.Entry<String, PackageInstallationSpec> guidesEntry : guides.entrySet()) {
|
||||||
PackageInstallationSpec packageInstallationSpec = new PackageInstallationSpec().setPackageUrl(guide.getValue().getUrl()).setName(guide.getValue().getName()).setVersion(guide.getValue().getVersion()).setInstallMode(PackageInstallationSpec.InstallModeEnum.STORE_AND_INSTALL);
|
PackageInstallationSpec packageInstallationSpec = guidesEntry.getValue();
|
||||||
packageInstallationSpec.setReloadExisting(appProperties.getReload_existing_implementationguides());
|
|
||||||
if (appProperties.getInstall_transitive_ig_dependencies()) {
|
if (appProperties.getInstall_transitive_ig_dependencies()) {
|
||||||
packageInstallationSpec.setFetchDependencies(true);
|
|
||||||
packageInstallationSpec.setDependencyExcludes(List.of("hl7.fhir.r2.core", "hl7.fhir.r3.core", "hl7.fhir.r4.core", "hl7.fhir.r5.core"));
|
packageInstallationSpec.addDependencyExclude("hl7.fhir.r2.core")
|
||||||
|
.addDependencyExclude("hl7.fhir.r3.core")
|
||||||
|
.addDependencyExclude("hl7.fhir.r4.core")
|
||||||
|
.addDependencyExclude("hl7.fhir.r5.core");
|
||||||
}
|
}
|
||||||
packageInstallerSvc.install(packageInstallationSpec);
|
packageInstallerSvc.install(packageInstallationSpec);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,9 +82,10 @@ hapi:
|
|||||||
# swiss:
|
# swiss:
|
||||||
# name: swiss.mednet.fhir
|
# name: swiss.mednet.fhir
|
||||||
# version: 0.8.0
|
# version: 0.8.0
|
||||||
|
# reloadExisting : false
|
||||||
# example not from registry
|
# example not from registry
|
||||||
# ips_1_0_0:
|
# ips_1_0_0:
|
||||||
# url: https://build.fhir.org/ig/HL7/fhir-ips/package.tgz
|
# packageUrl: https://build.fhir.org/ig/HL7/fhir-ips/package.tgz
|
||||||
# name: hl7.fhir.uv.ips
|
# name: hl7.fhir.uv.ips
|
||||||
# version: 1.0.0
|
# version: 1.0.0
|
||||||
# supported_resource_types:
|
# supported_resource_types:
|
||||||
|
|||||||
@@ -64,9 +64,10 @@ hapi:
|
|||||||
# swiss:
|
# swiss:
|
||||||
# name: swiss.mednet.fhir
|
# name: swiss.mednet.fhir
|
||||||
# version: 0.8.0
|
# version: 0.8.0
|
||||||
|
# reloadExisting : false
|
||||||
# example not from registry
|
# example not from registry
|
||||||
# ips_1_0_0:
|
# ips_1_0_0:
|
||||||
# url: https://build.fhir.org/ig/HL7/fhir-ips/package.tgz
|
# packageUrl: https://build.fhir.org/ig/HL7/fhir-ips/package.tgz
|
||||||
# name: hl7.fhir.uv.ips
|
# name: hl7.fhir.uv.ips
|
||||||
# version: 1.0.0
|
# version: 1.0.0
|
||||||
# supported_resource_types:
|
# supported_resource_types:
|
||||||
|
|||||||
Reference in New Issue
Block a user