All but tests works
This commit is contained in:
11
pom.xml
11
pom.xml
@@ -18,6 +18,12 @@
|
|||||||
|
|
||||||
<artifactId>hapi-fhir-jpaserver-starter</artifactId>
|
<artifactId>hapi-fhir-jpaserver-starter</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<java.version>11</java.version>
|
||||||
|
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||||
|
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||||
|
</properties>
|
||||||
|
|
||||||
<prerequisites>
|
<prerequisites>
|
||||||
<maven>3.6.0</maven>
|
<maven>3.6.0</maven>
|
||||||
</prerequisites>
|
</prerequisites>
|
||||||
@@ -293,8 +299,6 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-logging -->
|
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-logging -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
@@ -374,6 +378,9 @@
|
|||||||
</overlay>
|
</overlay>
|
||||||
</overlays>
|
</overlays>
|
||||||
<webXml>src/main/webapp/WEB-INF/web.xml</webXml>
|
<webXml>src/main/webapp/WEB-INF/web.xml</webXml>
|
||||||
|
|
||||||
|
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||||
|
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package ca.uhn.fhir.jpa.empi;
|
|||||||
import ca.uhn.fhir.empi.api.IEmpiSettings;
|
import ca.uhn.fhir.empi.api.IEmpiSettings;
|
||||||
import ca.uhn.fhir.empi.rules.config.EmpiRuleValidator;
|
import ca.uhn.fhir.empi.rules.config.EmpiRuleValidator;
|
||||||
import ca.uhn.fhir.empi.rules.config.EmpiSettings;
|
import ca.uhn.fhir.empi.rules.config.EmpiSettings;
|
||||||
|
import ca.uhn.fhir.jpa.starter.AppProperties;
|
||||||
import ca.uhn.fhir.jpa.starter.HapiProperties;
|
import ca.uhn.fhir.jpa.starter.HapiProperties;
|
||||||
import com.google.common.base.Charsets;
|
import com.google.common.base.Charsets;
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
@@ -21,11 +22,11 @@ import java.io.IOException;
|
|||||||
public class EmpiConfig {
|
public class EmpiConfig {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
IEmpiSettings empiSettings(EmpiRuleValidator theEmpiRuleValidator) throws IOException {
|
IEmpiSettings empiSettings(EmpiRuleValidator theEmpiRuleValidator, AppProperties appProperties) throws IOException {
|
||||||
DefaultResourceLoader resourceLoader = new DefaultResourceLoader();
|
DefaultResourceLoader resourceLoader = new DefaultResourceLoader();
|
||||||
Resource resource = resourceLoader.getResource("empi-rules.json");
|
Resource resource = resourceLoader.getResource("empi-rules.json");
|
||||||
String json = IOUtils.toString(resource.getInputStream(), Charsets.UTF_8);
|
String json = IOUtils.toString(resource.getInputStream(), Charsets.UTF_8);
|
||||||
return new EmpiSettings(theEmpiRuleValidator).setEnabled(HapiProperties.getEmpiEnabled()).setScriptText(json);
|
return new EmpiSettings(theEmpiRuleValidator).setEnabled(appProperties.getEmpi_enabled()).setScriptText(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,11 @@ 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.DaoConfig.ClientIdStrategyEnum;
|
import ca.uhn.fhir.jpa.api.config.DaoConfig.ClientIdStrategyEnum;
|
||||||
import ca.uhn.fhir.rest.api.EncodingEnum;
|
import ca.uhn.fhir.rest.api.EncodingEnum;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.hl7.fhir.r4.model.Bundle;
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
@@ -16,7 +19,7 @@ import org.springframework.context.annotation.Configuration;
|
|||||||
@EnableConfigurationProperties
|
@EnableConfigurationProperties
|
||||||
public class AppProperties {
|
public class AppProperties {
|
||||||
|
|
||||||
|
private Boolean empi_enabled = false;
|
||||||
private Boolean allow_cascading_deletes = false;
|
private Boolean allow_cascading_deletes = false;
|
||||||
private Boolean allow_contains_searches = true;
|
private Boolean allow_contains_searches = true;
|
||||||
private Boolean allow_external_references = false;
|
private Boolean allow_external_references = false;
|
||||||
@@ -24,7 +27,6 @@ public class AppProperties {
|
|||||||
private Boolean allow_override_default_search_params = true;
|
private Boolean allow_override_default_search_params = true;
|
||||||
private Boolean allow_placeholder_references = true;
|
private Boolean allow_placeholder_references = true;
|
||||||
private Boolean auto_create_placeholder_reference_targets = true;
|
private Boolean auto_create_placeholder_reference_targets = true;
|
||||||
private Integer default_page_size = 20;
|
|
||||||
private Boolean enable_index_missing_fields = false;
|
private Boolean enable_index_missing_fields = false;
|
||||||
private Boolean enforce_referential_integrity_on_delete = true;
|
private Boolean enforce_referential_integrity_on_delete = true;
|
||||||
private Boolean enforce_referential_integrity_on_write = true;
|
private Boolean enforce_referential_integrity_on_write = true;
|
||||||
@@ -35,23 +37,79 @@ public class AppProperties {
|
|||||||
private Boolean graphql_enabled = true;
|
private Boolean graphql_enabled = true;
|
||||||
private Boolean binary_storage_enabled = true;
|
private Boolean binary_storage_enabled = true;
|
||||||
private Boolean bulk_export_enabled = true;
|
private Boolean bulk_export_enabled = true;
|
||||||
private Integer max_binary_size = 104857600;
|
private Boolean default_pretty_print = true;
|
||||||
|
private Integer default_page_size = 20;
|
||||||
|
private Integer max_binary_size = null;
|
||||||
private Integer max_page_size = Integer.MAX_VALUE;
|
private Integer max_page_size = Integer.MAX_VALUE;
|
||||||
private Integer retain_cached_searches_mins = 60;
|
private Long retain_cached_searches_mins = 60L;
|
||||||
private Long reuse_cached_search_results_millis = 60000L;
|
private Long reuse_cached_search_results_millis = 60000L;
|
||||||
|
private String server_address = null;
|
||||||
private EncodingEnum default_encoding = EncodingEnum.JSON;
|
private EncodingEnum default_encoding = EncodingEnum.JSON;
|
||||||
private FhirVersionEnum fhir_version = FhirVersionEnum.R4;
|
private FhirVersionEnum fhir_version = FhirVersionEnum.R4;
|
||||||
private ClientIdStrategyEnum client_id_strategy = ClientIdStrategyEnum.ALPHANUMERIC;
|
private ClientIdStrategyEnum client_id_strategy = ClientIdStrategyEnum.ALPHANUMERIC;
|
||||||
|
private List<String> supported_resource_types = new ArrayList<>();
|
||||||
|
private List<Bundle.BundleType> allowed_bundle_types = null;
|
||||||
|
|
||||||
private Validation validation = new Validation();
|
private Validation validation = new Validation();
|
||||||
private List<Tester> tester = new ArrayList<>();
|
private List<Tester> tester = new ArrayList<>();
|
||||||
private Logger logger = new Logger();
|
private Logger logger = new Logger();
|
||||||
private Subscription subscription = new Subscription();
|
private Subscription subscription = new Subscription();
|
||||||
|
private Cors cors = null;
|
||||||
|
private Partitioning partitioning = null;
|
||||||
|
|
||||||
|
public Partitioning getPartitioning() {
|
||||||
|
return partitioning;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPartitioning(Partitioning partitioning) {
|
||||||
|
this.partitioning = partitioning;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getEmpi_enabled() {
|
||||||
|
return empi_enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmpi_enabled(Boolean empi_enabled) {
|
||||||
|
this.empi_enabled = empi_enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Cors getCors() {
|
||||||
|
return cors;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCors(Cors cors) {
|
||||||
|
this.cors = cors;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Bundle.BundleType> getAllowed_bundle_types() {
|
||||||
|
return allowed_bundle_types;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAllowed_bundle_types(List<Bundle.BundleType> allowed_bundle_types) {
|
||||||
|
this.allowed_bundle_types = allowed_bundle_types;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getServer_address() {
|
||||||
|
return server_address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setServer_address(String server_address) {
|
||||||
|
this.server_address = server_address;
|
||||||
|
}
|
||||||
|
|
||||||
public Subscription getSubscription() {
|
public Subscription getSubscription() {
|
||||||
return subscription;
|
return subscription;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean getDefault_pretty_print() {
|
||||||
|
return default_pretty_print;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDefault_pretty_print(Boolean default_pretty_print) {
|
||||||
|
this.default_pretty_print = default_pretty_print;
|
||||||
|
}
|
||||||
|
|
||||||
public void setSubscription(Subscription subscription) {
|
public void setSubscription(Subscription subscription) {
|
||||||
this.subscription = subscription;
|
this.subscription = subscription;
|
||||||
}
|
}
|
||||||
@@ -64,6 +122,13 @@ public class AppProperties {
|
|||||||
this.validation = validation;
|
this.validation = validation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<String> getSupported_resource_types() {
|
||||||
|
return supported_resource_types;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSupported_resource_types(List<String> supported_resource_types) {
|
||||||
|
this.supported_resource_types = supported_resource_types;
|
||||||
|
}
|
||||||
|
|
||||||
public Logger getLogger() {
|
public Logger getLogger() {
|
||||||
return logger;
|
return logger;
|
||||||
@@ -262,11 +327,11 @@ public class AppProperties {
|
|||||||
this.max_page_size = max_page_size;
|
this.max_page_size = max_page_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getRetain_cached_searches_mins() {
|
public Long getRetain_cached_searches_mins() {
|
||||||
return retain_cached_searches_mins;
|
return retain_cached_searches_mins;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRetain_cached_searches_mins(Integer retain_cached_searches_mins) {
|
public void setRetain_cached_searches_mins(Long retain_cached_searches_mins) {
|
||||||
this.retain_cached_searches_mins = retain_cached_searches_mins;
|
this.retain_cached_searches_mins = retain_cached_searches_mins;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -286,6 +351,29 @@ public class AppProperties {
|
|||||||
this.tester = tester;
|
this.tester = tester;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class Cors {
|
||||||
|
private Boolean allow_Credentials = true;
|
||||||
|
private List<String> allowed_origin = new ArrayList<>();//List.of("*");
|
||||||
|
|
||||||
|
public List<String> getAllowed_origin() {
|
||||||
|
return allowed_origin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAllowed_origin(List<String> allowed_origin) {
|
||||||
|
this.allowed_origin = allowed_origin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getAllow_Credentials() {
|
||||||
|
return allow_Credentials;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAllow_Credentials(Boolean allow_Credentials) {
|
||||||
|
this.allow_Credentials = allow_Credentials;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public static class Logger {
|
public static class Logger {
|
||||||
|
|
||||||
private String name = "fhirtest.access";
|
private String name = "fhirtest.access";
|
||||||
@@ -398,16 +486,22 @@ public class AppProperties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class Partitioning {
|
||||||
|
|
||||||
|
private Boolean partitioning_include_in_search_hashes = false;
|
||||||
|
|
||||||
|
|
||||||
|
public Boolean getPartitioning_include_in_search_hashes() {
|
||||||
|
return partitioning_include_in_search_hashes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPartitioning_include_in_search_hashes(Boolean partitioning_include_in_search_hashes) {
|
||||||
|
this.partitioning_include_in_search_hashes = partitioning_include_in_search_hashes;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static class Subscription {
|
public static class Subscription {
|
||||||
|
|
||||||
public Boolean getEmail_enabled() {
|
|
||||||
return email_enabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEmail_enabled(Boolean email_enabled) {
|
|
||||||
this.email_enabled = email_enabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Boolean getResthook_enabled() {
|
public Boolean getResthook_enabled() {
|
||||||
return resthook_enabled;
|
return resthook_enabled;
|
||||||
}
|
}
|
||||||
@@ -424,8 +518,101 @@ public class AppProperties {
|
|||||||
this.websocket_enabled = websocket_enabled;
|
this.websocket_enabled = websocket_enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Boolean email_enabled = false;
|
|
||||||
private Boolean resthook_enabled = false;
|
private Boolean resthook_enabled = false;
|
||||||
private Boolean websocket_enabled = false;
|
private Boolean websocket_enabled = false;
|
||||||
|
private Email email = null;
|
||||||
|
|
||||||
|
public Email getEmail() {
|
||||||
|
return email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmail(Email email) {
|
||||||
|
this.email = email;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static class Email {
|
||||||
|
public String getFrom() {
|
||||||
|
return from;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFrom(String from) {
|
||||||
|
this.from = from;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHost() {
|
||||||
|
return host;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHost(String host) {
|
||||||
|
this.host = host;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getPort() {
|
||||||
|
return port;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPort(Integer port) {
|
||||||
|
this.port = port;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUsername() {
|
||||||
|
return username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsername(String username) {
|
||||||
|
this.username = username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPassword() {
|
||||||
|
return password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPassword(String password) {
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getAuth() {
|
||||||
|
return auth;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAuth(Boolean auth) {
|
||||||
|
this.auth = auth;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getStartTlsEnable() {
|
||||||
|
return startTlsEnable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStartTlsEnable(Boolean startTlsEnable) {
|
||||||
|
this.startTlsEnable = startTlsEnable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getStartTlsRequired() {
|
||||||
|
return startTlsRequired;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStartTlsRequired(Boolean startTlsRequired) {
|
||||||
|
this.startTlsRequired = startTlsRequired;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getQuitWait() {
|
||||||
|
return quitWait;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setQuitWait(Boolean quitWait) {
|
||||||
|
this.quitWait = quitWait;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String from;
|
||||||
|
private String host;
|
||||||
|
private Integer port = 25;
|
||||||
|
private String username;
|
||||||
|
private String password;
|
||||||
|
private Boolean auth = false;
|
||||||
|
private Boolean startTlsEnable = false;
|
||||||
|
private Boolean startTlsRequired = false;
|
||||||
|
private Boolean quitWait = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class Application {
|
|||||||
|
|
||||||
ServletRegistrationBean registrationBean = new ServletRegistrationBean();
|
ServletRegistrationBean registrationBean = new ServletRegistrationBean();
|
||||||
registrationBean.setServlet(dispatcherServlet);
|
registrationBean.setServlet(dispatcherServlet);
|
||||||
registrationBean.addUrlMappings("/*");
|
registrationBean.addUrlMappings("/hapi-fhir-jpaserver/*", "/*");
|
||||||
registrationBean.setLoadOnStartup(1);
|
registrationBean.setLoadOnStartup(1);
|
||||||
return registrationBean;
|
return registrationBean;
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import ca.uhn.fhir.context.FhirContext;
|
|||||||
import ca.uhn.fhir.context.FhirVersionEnum;
|
import ca.uhn.fhir.context.FhirVersionEnum;
|
||||||
import ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster;
|
import ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster;
|
||||||
import ca.uhn.fhir.interceptor.api.IInterceptorService;
|
import ca.uhn.fhir.interceptor.api.IInterceptorService;
|
||||||
import ca.uhn.fhir.jpa.api.IDaoRegistry;
|
|
||||||
import ca.uhn.fhir.jpa.api.config.DaoConfig;
|
import ca.uhn.fhir.jpa.api.config.DaoConfig;
|
||||||
import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
|
import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
|
||||||
import ca.uhn.fhir.jpa.api.dao.IFhirSystemDao;
|
import ca.uhn.fhir.jpa.api.dao.IFhirSystemDao;
|
||||||
@@ -12,56 +11,36 @@ import ca.uhn.fhir.jpa.binstore.BinaryStorageInterceptor;
|
|||||||
import ca.uhn.fhir.jpa.bulk.provider.BulkDataExportProvider;
|
import ca.uhn.fhir.jpa.bulk.provider.BulkDataExportProvider;
|
||||||
import ca.uhn.fhir.jpa.interceptor.CascadingDeleteInterceptor;
|
import ca.uhn.fhir.jpa.interceptor.CascadingDeleteInterceptor;
|
||||||
import ca.uhn.fhir.jpa.partition.PartitionManagementProvider;
|
import ca.uhn.fhir.jpa.partition.PartitionManagementProvider;
|
||||||
import ca.uhn.fhir.jpa.provider.GraphQLProvider;
|
import ca.uhn.fhir.jpa.provider.*;
|
||||||
import ca.uhn.fhir.jpa.provider.IJpaSystemProvider;
|
|
||||||
import ca.uhn.fhir.jpa.provider.JpaConformanceProviderDstu2;
|
|
||||||
import ca.uhn.fhir.jpa.provider.JpaSystemProviderDstu2;
|
|
||||||
import ca.uhn.fhir.jpa.provider.SubscriptionTriggeringProvider;
|
|
||||||
import ca.uhn.fhir.jpa.provider.TerminologyUploaderProvider;
|
|
||||||
import ca.uhn.fhir.jpa.provider.dstu3.JpaConformanceProviderDstu3;
|
import ca.uhn.fhir.jpa.provider.dstu3.JpaConformanceProviderDstu3;
|
||||||
import ca.uhn.fhir.jpa.provider.dstu3.JpaSystemProviderDstu3;
|
|
||||||
import ca.uhn.fhir.jpa.provider.r4.JpaConformanceProviderR4;
|
import ca.uhn.fhir.jpa.provider.r4.JpaConformanceProviderR4;
|
||||||
import ca.uhn.fhir.jpa.provider.r4.JpaSystemProviderR4;
|
|
||||||
import ca.uhn.fhir.jpa.provider.r5.JpaConformanceProviderR5;
|
import ca.uhn.fhir.jpa.provider.r5.JpaConformanceProviderR5;
|
||||||
import ca.uhn.fhir.jpa.provider.r5.JpaSystemProviderR5;
|
|
||||||
import ca.uhn.fhir.jpa.search.DatabaseBackedPagingProvider;
|
import ca.uhn.fhir.jpa.search.DatabaseBackedPagingProvider;
|
||||||
import ca.uhn.fhir.jpa.searchparam.registry.ISearchParamRegistry;
|
import ca.uhn.fhir.jpa.searchparam.registry.ISearchParamRegistry;
|
||||||
import ca.uhn.fhir.jpa.subscription.util.SubscriptionDebugLogInterceptor;
|
import ca.uhn.fhir.jpa.subscription.util.SubscriptionDebugLogInterceptor;
|
||||||
import ca.uhn.fhir.model.dstu2.composite.MetaDt;
|
|
||||||
import ca.uhn.fhir.narrative.DefaultThymeleafNarrativeGenerator;
|
import ca.uhn.fhir.narrative.DefaultThymeleafNarrativeGenerator;
|
||||||
|
import ca.uhn.fhir.rest.server.ETagSupportEnum;
|
||||||
import ca.uhn.fhir.rest.server.HardcodedServerAddressStrategy;
|
import ca.uhn.fhir.rest.server.HardcodedServerAddressStrategy;
|
||||||
import ca.uhn.fhir.rest.server.RestfulServer;
|
import ca.uhn.fhir.rest.server.RestfulServer;
|
||||||
import ca.uhn.fhir.rest.server.interceptor.CorsInterceptor;
|
import ca.uhn.fhir.rest.server.interceptor.*;
|
||||||
import ca.uhn.fhir.rest.server.interceptor.FhirPathFilterInterceptor;
|
|
||||||
import ca.uhn.fhir.rest.server.interceptor.LoggingInterceptor;
|
|
||||||
import ca.uhn.fhir.rest.server.interceptor.RequestValidatingInterceptor;
|
|
||||||
import ca.uhn.fhir.rest.server.interceptor.ResponseHighlighterInterceptor;
|
|
||||||
import ca.uhn.fhir.rest.server.interceptor.ResponseValidatingInterceptor;
|
|
||||||
import ca.uhn.fhir.rest.server.interceptor.partition.RequestTenantPartitionInterceptor;
|
import ca.uhn.fhir.rest.server.interceptor.partition.RequestTenantPartitionInterceptor;
|
||||||
import ca.uhn.fhir.rest.server.provider.ResourceProviderFactory;
|
import ca.uhn.fhir.rest.server.provider.ResourceProviderFactory;
|
||||||
import ca.uhn.fhir.rest.server.tenant.UrlBaseTenantIdentificationStrategy;
|
import ca.uhn.fhir.rest.server.tenant.UrlBaseTenantIdentificationStrategy;
|
||||||
import ca.uhn.fhir.validation.IValidatorModule;
|
import ca.uhn.fhir.validation.IValidatorModule;
|
||||||
import ca.uhn.fhir.validation.ResultSeverityEnum;
|
import ca.uhn.fhir.validation.ResultSeverityEnum;
|
||||||
import java.util.Arrays;
|
import com.google.common.base.Strings;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.TreeSet;
|
|
||||||
import javax.servlet.ServletException;
|
|
||||||
import org.hl7.fhir.dstu3.model.Bundle;
|
|
||||||
import org.hl7.fhir.dstu3.model.Meta;
|
|
||||||
import org.hl7.fhir.r4.model.Bundle.BundleType;
|
import org.hl7.fhir.r4.model.Bundle.BundleType;
|
||||||
import org.springframework.aop.framework.Advised;
|
|
||||||
import org.springframework.aop.support.AopUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.ApplicationContext;
|
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.web.cors.CorsConfiguration;
|
import org.springframework.web.cors.CorsConfiguration;
|
||||||
|
|
||||||
|
import javax.servlet.ServletException;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
public class BaseJpaRestfulServer extends RestfulServer {
|
public class BaseJpaRestfulServer extends RestfulServer {
|
||||||
|
|
||||||
AppProperties hapiProperties;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
DaoRegistry daoRegistry;
|
DaoRegistry daoRegistry;
|
||||||
@@ -81,8 +60,35 @@ public class BaseJpaRestfulServer extends RestfulServer {
|
|||||||
@Autowired
|
@Autowired
|
||||||
IJpaSystemProvider jpaSystemProvider;
|
IJpaSystemProvider jpaSystemProvider;
|
||||||
|
|
||||||
public BaseJpaRestfulServer(AppProperties appProperties) {
|
@Autowired
|
||||||
this.hapiProperties = appProperties;
|
IInterceptorBroadcaster interceptorBroadcaster;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
DatabaseBackedPagingProvider databaseBackedPagingProvider;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
IInterceptorService interceptorService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
IValidatorModule validatorModule;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
Optional<GraphQLProvider> graphQLProvider;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
BulkDataExportProvider bulkDataExportProvider;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
PartitionManagementProvider partitionManagementProvider;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
BinaryStorageInterceptor binaryStorageInterceptor;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
AppProperties appProperties;
|
||||||
|
|
||||||
|
public BaseJpaRestfulServer() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@@ -92,26 +98,18 @@ public class BaseJpaRestfulServer extends RestfulServer {
|
|||||||
protected void initialize() throws ServletException {
|
protected void initialize() throws ServletException {
|
||||||
super.initialize();
|
super.initialize();
|
||||||
|
|
||||||
ApplicationContext appCtx = (ApplicationContext) getServletContext()
|
|
||||||
.getAttribute("org.springframework.web.context.WebApplicationContext.ROOT");
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create a FhirContext object that uses the version of FHIR
|
* Create a FhirContext object that uses the version of FHIR
|
||||||
* specified in the properties file.
|
* specified in the properties file.
|
||||||
*/
|
*/
|
||||||
// Customize supported resource types
|
// Customize supported resource types
|
||||||
Set<String> supportedResourceTypes = HapiProperties.getSupportedResourceTypes();
|
List<String> supportedResourceTypes = appProperties.getSupported_resource_types();
|
||||||
|
|
||||||
if (!supportedResourceTypes.isEmpty() && !supportedResourceTypes.contains("SearchParameter")) {
|
if (!supportedResourceTypes.isEmpty() && !supportedResourceTypes.contains("SearchParameter")) {
|
||||||
supportedResourceTypes.add("SearchParameter");
|
supportedResourceTypes.add("SearchParameter");
|
||||||
}
|
|
||||||
|
|
||||||
if (!supportedResourceTypes.isEmpty()) {
|
|
||||||
daoRegistry.setSupportedResourceTypes(supportedResourceTypes);
|
daoRegistry.setSupportedResourceTypes(supportedResourceTypes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
setFhirContext(fhirSystemDao.getContext());
|
setFhirContext(fhirSystemDao.getContext());
|
||||||
registerProviders(resourceProviders.createProviders());
|
registerProviders(resourceProviders.createProviders());
|
||||||
registerProvider(jpaSystemProvider);
|
registerProvider(jpaSystemProvider);
|
||||||
@@ -160,7 +158,10 @@ public class BaseJpaRestfulServer extends RestfulServer {
|
|||||||
/*
|
/*
|
||||||
* ETag Support
|
* ETag Support
|
||||||
*/
|
*/
|
||||||
setETagSupport(HapiProperties.getEtagSupport());
|
|
||||||
|
if(appProperties.getEtag_support_enabled() == false)
|
||||||
|
setETagSupport(ETagSupportEnum.DISABLED);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This server tries to dynamically generate narratives
|
* This server tries to dynamically generate narratives
|
||||||
@@ -171,12 +172,12 @@ public class BaseJpaRestfulServer extends RestfulServer {
|
|||||||
/*
|
/*
|
||||||
* Default to JSON and pretty printing
|
* Default to JSON and pretty printing
|
||||||
*/
|
*/
|
||||||
setDefaultPrettyPrint(HapiProperties.getDefaultPrettyPrint());
|
setDefaultPrettyPrint(appProperties.getDefault_pretty_print());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Default encoding
|
* Default encoding
|
||||||
*/
|
*/
|
||||||
setDefaultResponseEncoding(HapiProperties.getDefaultEncoding());
|
setDefaultResponseEncoding(appProperties.getDefault_encoding());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This configures the server to page search results to and from
|
* This configures the server to page search results to and from
|
||||||
@@ -185,7 +186,7 @@ public class BaseJpaRestfulServer extends RestfulServer {
|
|||||||
* but makes the server much more scalable.
|
* but makes the server much more scalable.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
setPagingProvider(appCtx.getBean(DatabaseBackedPagingProvider.class));
|
setPagingProvider(databaseBackedPagingProvider);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This interceptor formats the output using nice colourful
|
* This interceptor formats the output using nice colourful
|
||||||
@@ -195,7 +196,7 @@ public class BaseJpaRestfulServer extends RestfulServer {
|
|||||||
ResponseHighlighterInterceptor responseHighlighterInterceptor = new ResponseHighlighterInterceptor();
|
ResponseHighlighterInterceptor responseHighlighterInterceptor = new ResponseHighlighterInterceptor();
|
||||||
this.registerInterceptor(responseHighlighterInterceptor);
|
this.registerInterceptor(responseHighlighterInterceptor);
|
||||||
|
|
||||||
if (HapiProperties.isFhirPathFilterInterceptorEnabled()) {
|
if (appProperties.getFhirpath_interceptor_enabled()) {
|
||||||
registerInterceptor(new FhirPathFilterInterceptor());
|
registerInterceptor(new FhirPathFilterInterceptor());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -203,10 +204,10 @@ public class BaseJpaRestfulServer extends RestfulServer {
|
|||||||
* Add some logging for each request
|
* Add some logging for each request
|
||||||
*/
|
*/
|
||||||
LoggingInterceptor loggingInterceptor = new LoggingInterceptor();
|
LoggingInterceptor loggingInterceptor = new LoggingInterceptor();
|
||||||
loggingInterceptor.setLoggerName(HapiProperties.getLoggerName());
|
loggingInterceptor.setLoggerName(appProperties.getLogger().getName());
|
||||||
loggingInterceptor.setMessageFormat(HapiProperties.getLoggerFormat());
|
loggingInterceptor.setMessageFormat(appProperties.getLogger().getFormat());
|
||||||
loggingInterceptor.setErrorMessageFormat(HapiProperties.getLoggerErrorFormat());
|
loggingInterceptor.setErrorMessageFormat(appProperties.getLogger().getError_format());
|
||||||
loggingInterceptor.setLogExceptions(HapiProperties.getLoggerLogExceptions());
|
loggingInterceptor.setLogExceptions(appProperties.getLogger().getLog_exceptions());
|
||||||
this.registerInterceptor(loggingInterceptor);
|
this.registerInterceptor(loggingInterceptor);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -215,8 +216,8 @@ public class BaseJpaRestfulServer extends RestfulServer {
|
|||||||
* this doesn't always work. If you are setting links in your search bundles that
|
* this doesn't always work. If you are setting links in your search bundles that
|
||||||
* just refer to "localhost", you might want to use a server address strategy:
|
* just refer to "localhost", you might want to use a server address strategy:
|
||||||
*/
|
*/
|
||||||
String serverAddress = HapiProperties.getServerAddress();
|
String serverAddress = appProperties.getServer_address();
|
||||||
if (serverAddress != null && serverAddress.length() > 0) {
|
if (!Strings.isNullOrEmpty(serverAddress)) {
|
||||||
setServerAddressStrategy(new HardcodedServerAddressStrategy(serverAddress));
|
setServerAddressStrategy(new HardcodedServerAddressStrategy(serverAddress));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,21 +229,21 @@ public class BaseJpaRestfulServer extends RestfulServer {
|
|||||||
* with this feature.
|
* with this feature.
|
||||||
*/
|
*/
|
||||||
if (false) { // <-- DISABLED RIGHT NOW
|
if (false) { // <-- DISABLED RIGHT NOW
|
||||||
registerProvider(appCtx.getBean(TerminologyUploaderProvider.class));
|
//registerProvider(appCtx.getBean(TerminologyUploaderProvider.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
// If you want to enable the $trigger-subscription operation to allow
|
// If you want to enable the $trigger-subscription operation to allow
|
||||||
// manual triggering of a subscription delivery, enable this provider
|
// manual triggering of a subscription delivery, enable this provider
|
||||||
if (false) { // <-- DISABLED RIGHT NOW
|
if (false) { // <-- DISABLED RIGHT NOW
|
||||||
SubscriptionTriggeringProvider retriggeringProvider = appCtx
|
/* SubscriptionTriggeringProvider retriggeringProvider = appCtx
|
||||||
.getBean(SubscriptionTriggeringProvider.class);
|
.getBean(SubscriptionTriggeringProvider.class);
|
||||||
registerProvider(retriggeringProvider);
|
registerProvider(retriggeringProvider);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define your CORS configuration. This is an example
|
// Define your CORS configuration. This is an example
|
||||||
// showing a typical setup. You should customize this
|
// showing a typical setup. You should customize this
|
||||||
// to your specific needs
|
// to your specific needs
|
||||||
if (HapiProperties.getCorsEnabled()) {
|
if (appProperties.getCors() != null) {
|
||||||
CorsConfiguration config = new CorsConfiguration();
|
CorsConfiguration config = new CorsConfiguration();
|
||||||
config.addAllowedHeader(HttpHeaders.ORIGIN);
|
config.addAllowedHeader(HttpHeaders.ORIGIN);
|
||||||
config.addAllowedHeader(HttpHeaders.ACCEPT);
|
config.addAllowedHeader(HttpHeaders.ACCEPT);
|
||||||
@@ -252,17 +253,15 @@ public class BaseJpaRestfulServer extends RestfulServer {
|
|||||||
config.addAllowedHeader("x-fhir-starter");
|
config.addAllowedHeader("x-fhir-starter");
|
||||||
config.addAllowedHeader("X-Requested-With");
|
config.addAllowedHeader("X-Requested-With");
|
||||||
config.addAllowedHeader("Prefer");
|
config.addAllowedHeader("Prefer");
|
||||||
String allAllowedCORSOrigins = HapiProperties.getCorsAllowedOrigin();
|
List<String> allAllowedCORSOrigins = appProperties.getCors().getAllowed_origin();
|
||||||
Arrays.stream(allAllowedCORSOrigins.split(",")).forEach(o -> {
|
allAllowedCORSOrigins.forEach(config::addAllowedOrigin);
|
||||||
config.addAllowedOrigin(o);
|
|
||||||
});
|
|
||||||
config.addAllowedOrigin(HapiProperties.getCorsAllowedOrigin());
|
|
||||||
|
|
||||||
config.addExposedHeader("Location");
|
config.addExposedHeader("Location");
|
||||||
config.addExposedHeader("Content-Location");
|
config.addExposedHeader("Content-Location");
|
||||||
config.setAllowedMethods(
|
config.setAllowedMethods(
|
||||||
Arrays.asList("GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH", "HEAD"));
|
Arrays.asList("GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH", "HEAD"));
|
||||||
config.setAllowCredentials(HapiProperties.getCorsAllowedCredentials());
|
config.setAllowCredentials(appProperties.getCors().getAllow_Credentials());
|
||||||
|
|
||||||
// Create the interceptor and register it
|
// Create the interceptor and register it
|
||||||
CorsInterceptor interceptor = new CorsInterceptor(config);
|
CorsInterceptor interceptor = new CorsInterceptor(config);
|
||||||
@@ -271,40 +270,35 @@ public class BaseJpaRestfulServer extends RestfulServer {
|
|||||||
|
|
||||||
// If subscriptions are enabled, we want to register the interceptor that
|
// If subscriptions are enabled, we want to register the interceptor that
|
||||||
// will activate them and match results against them
|
// will activate them and match results against them
|
||||||
if (HapiProperties.getSubscriptionWebsocketEnabled() ||
|
if (appProperties.getSubscription() != null) {
|
||||||
HapiProperties.getSubscriptionEmailEnabled() ||
|
|
||||||
HapiProperties.getSubscriptionRestHookEnabled()) {
|
|
||||||
// Subscription debug logging
|
// Subscription debug logging
|
||||||
IInterceptorService interceptorService = appCtx.getBean(IInterceptorService.class);
|
|
||||||
interceptorService.registerInterceptor(new SubscriptionDebugLogInterceptor());
|
interceptorService.registerInterceptor(new SubscriptionDebugLogInterceptor());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cascading deletes
|
// Cascading deletes
|
||||||
DaoRegistry daoRegistry = appCtx.getBean(DaoRegistry.class);
|
|
||||||
IInterceptorBroadcaster interceptorBroadcaster = appCtx.getBean(IInterceptorBroadcaster.class);
|
|
||||||
if (HapiProperties.getAllowCascadingDeletes()) {
|
if (appProperties.getAllow_cascading_deletes()) {
|
||||||
CascadingDeleteInterceptor cascadingDeleteInterceptor = new CascadingDeleteInterceptor(ctx,
|
CascadingDeleteInterceptor cascadingDeleteInterceptor = new CascadingDeleteInterceptor(ctx,
|
||||||
daoRegistry, interceptorBroadcaster);
|
daoRegistry, interceptorBroadcaster);
|
||||||
getInterceptorService().registerInterceptor(cascadingDeleteInterceptor);
|
getInterceptorService().registerInterceptor(cascadingDeleteInterceptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Binary Storage
|
// Binary Storage
|
||||||
if (HapiProperties.isBinaryStorageEnabled()) {
|
if (appProperties.getBinary_storage_enabled()) {
|
||||||
BinaryStorageInterceptor binaryStorageInterceptor = appCtx
|
|
||||||
.getBean(BinaryStorageInterceptor.class);
|
|
||||||
getInterceptorService().registerInterceptor(binaryStorageInterceptor);
|
getInterceptorService().registerInterceptor(binaryStorageInterceptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validation
|
// Validation
|
||||||
IValidatorModule validatorModule = appCtx.getBean(IValidatorModule.class);
|
|
||||||
if (validatorModule != null) {
|
if (validatorModule != null) {
|
||||||
if (HapiProperties.getValidateRequestsEnabled()) {
|
if (appProperties.getValidation().getRequests_enabled()) {
|
||||||
RequestValidatingInterceptor interceptor = new RequestValidatingInterceptor();
|
RequestValidatingInterceptor interceptor = new RequestValidatingInterceptor();
|
||||||
interceptor.setFailOnSeverity(ResultSeverityEnum.ERROR);
|
interceptor.setFailOnSeverity(ResultSeverityEnum.ERROR);
|
||||||
interceptor.setValidatorModules(Collections.singletonList(validatorModule));
|
interceptor.setValidatorModules(Collections.singletonList(validatorModule));
|
||||||
registerInterceptor(interceptor);
|
registerInterceptor(interceptor);
|
||||||
}
|
}
|
||||||
if (HapiProperties.getValidateResponsesEnabled()) {
|
if (appProperties.getValidation().getResponses_enabled()) {
|
||||||
ResponseValidatingInterceptor interceptor = new ResponseValidatingInterceptor();
|
ResponseValidatingInterceptor interceptor = new ResponseValidatingInterceptor();
|
||||||
interceptor.setFailOnSeverity(ResultSeverityEnum.ERROR);
|
interceptor.setFailOnSeverity(ResultSeverityEnum.ERROR);
|
||||||
interceptor.setValidatorModules(Collections.singletonList(validatorModule));
|
interceptor.setValidatorModules(Collections.singletonList(validatorModule));
|
||||||
@@ -313,52 +307,33 @@ public class BaseJpaRestfulServer extends RestfulServer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GraphQL
|
// GraphQL
|
||||||
if (HapiProperties.getGraphqlEnabled()) {
|
if (appProperties.getGraphql_enabled()) {
|
||||||
if (fhirVersion.isEqualOrNewerThan(FhirVersionEnum.DSTU3)) {
|
if (fhirVersion.isEqualOrNewerThan(FhirVersionEnum.DSTU3)) {
|
||||||
registerProvider(appCtx.getBean(GraphQLProvider.class));
|
registerProvider(graphQLProvider.get());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!HapiProperties.getAllowedBundleTypes().isEmpty()) {
|
if (appProperties.getAllowed_bundle_types() != null) {
|
||||||
String allowedBundleTypesString = HapiProperties.getAllowedBundleTypes();
|
daoConfig.setBundleTypesAllowedForStorage(appProperties.getAllowed_bundle_types().stream().map(BundleType::toCode).collect(Collectors.toSet()));
|
||||||
Set<String> allowedBundleTypes = new HashSet<>();
|
|
||||||
Arrays.stream(allowedBundleTypesString.split(",")).forEach(o -> {
|
|
||||||
BundleType type = BundleType.valueOf(o);
|
|
||||||
allowedBundleTypes.add(type.toCode());
|
|
||||||
});
|
|
||||||
DaoConfig config = daoConfig;
|
|
||||||
config.setBundleTypesAllowedForStorage(
|
|
||||||
Collections.unmodifiableSet(new TreeSet<>(allowedBundleTypes)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bulk Export
|
// Bulk Export
|
||||||
if (HapiProperties.getBulkExportEnabled()) {
|
if (appProperties.getBulk_export_enabled()) {
|
||||||
registerProvider(appCtx.getBean(BulkDataExportProvider.class));
|
registerProvider(bulkDataExportProvider);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Partitioning
|
// Partitioning
|
||||||
if (HapiProperties.getPartitioningMultitenancyEnabled()) {
|
if (appProperties.getPartitioning() != null) {
|
||||||
registerInterceptor(new RequestTenantPartitionInterceptor());
|
registerInterceptor(new RequestTenantPartitionInterceptor());
|
||||||
setTenantIdentificationStrategy(new UrlBaseTenantIdentificationStrategy());
|
setTenantIdentificationStrategy(new UrlBaseTenantIdentificationStrategy());
|
||||||
registerProviders(appCtx.getBean(PartitionManagementProvider.class));
|
registerProviders(partitionManagementProvider);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HapiProperties.getClientIdStrategy() == DaoConfig.ClientIdStrategyEnum.ANY) {
|
if (appProperties.getClient_id_strategy() == DaoConfig.ClientIdStrategyEnum.ANY) {
|
||||||
daoConfig.setResourceServerIdStrategy(DaoConfig.IdStrategyEnum.UUID);
|
daoConfig.setResourceServerIdStrategy(DaoConfig.IdStrategyEnum.UUID);
|
||||||
daoConfig.setResourceClientIdStrategy(HapiProperties.getClientIdStrategy());
|
daoConfig.setResourceClientIdStrategy(appProperties.getClient_id_strategy());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected <T> T getBeanWithoutProxy(Object bean) {
|
|
||||||
|
|
||||||
if (AopUtils.isAopProxy(bean) && bean instanceof Advised) {
|
|
||||||
try {
|
|
||||||
return (T) ((Advised) bean).getTargetSource().getTarget();
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return (T)bean;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import ca.uhn.fhir.jpa.model.entity.ModelConfig;
|
|||||||
import ca.uhn.fhir.jpa.subscription.channel.subscription.SubscriptionDeliveryHandlerFactory;
|
import ca.uhn.fhir.jpa.subscription.channel.subscription.SubscriptionDeliveryHandlerFactory;
|
||||||
import ca.uhn.fhir.jpa.subscription.match.deliver.email.IEmailSender;
|
import ca.uhn.fhir.jpa.subscription.match.deliver.email.IEmailSender;
|
||||||
import ca.uhn.fhir.jpa.subscription.match.deliver.email.JavaMailEmailSender;
|
import ca.uhn.fhir.jpa.subscription.match.deliver.email.JavaMailEmailSender;
|
||||||
|
import com.google.common.base.Strings;
|
||||||
import org.apache.commons.dbcp2.BasicDataSource;
|
import org.apache.commons.dbcp2.BasicDataSource;
|
||||||
import org.hl7.fhir.dstu2.model.Subscription;
|
import org.hl7.fhir.dstu2.model.Subscription;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -20,6 +21,7 @@ import org.thymeleaf.util.Validate;
|
|||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.sql.Driver;
|
import java.sql.Driver;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the primary configuration file for the example server
|
* This is the primary configuration file for the example server
|
||||||
@@ -30,23 +32,6 @@ public class FhirServerConfigCommon {
|
|||||||
|
|
||||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirServerConfigCommon.class);
|
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirServerConfigCommon.class);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private Boolean subscriptionRestHookEnabled = HapiProperties.getSubscriptionRestHookEnabled();
|
|
||||||
private Boolean subscriptionEmailEnabled = HapiProperties.getSubscriptionEmailEnabled();
|
|
||||||
|
|
||||||
private String emailFrom = HapiProperties.getEmailFrom();
|
|
||||||
private Boolean emailEnabled = HapiProperties.getEmailEnabled();
|
|
||||||
private String emailHost = HapiProperties.getEmailHost();
|
|
||||||
private Integer emailPort = HapiProperties.getEmailPort();
|
|
||||||
private String emailUsername = HapiProperties.getEmailUsername();
|
|
||||||
private String emailPassword = HapiProperties.getEmailPassword();
|
|
||||||
private Boolean emailAuth = HapiProperties.getEmailAuth();
|
|
||||||
private Boolean emailStartTlsEnable = HapiProperties.getEmailStartTlsEnable();
|
|
||||||
private Boolean emailStartTlsRequired = HapiProperties.getEmailStartTlsRequired();
|
|
||||||
private Boolean emailQuitWait = HapiProperties.getEmailQuitWait();
|
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ApplicationContext appContext;
|
private ApplicationContext appContext;
|
||||||
|
|
||||||
@@ -58,24 +43,25 @@ public class FhirServerConfigCommon {
|
|||||||
ourLog.info("Server configured to " + (appProperties.getAllow_placeholder_references() ? "allow" : "deny") + " placeholder references");
|
ourLog.info("Server configured to " + (appProperties.getAllow_placeholder_references() ? "allow" : "deny") + " placeholder references");
|
||||||
ourLog.info("Server configured to " + (appProperties.getAllow_override_default_search_params() ? "allow" : "deny") + " overriding default search params");
|
ourLog.info("Server configured to " + (appProperties.getAllow_override_default_search_params() ? "allow" : "deny") + " overriding default search params");
|
||||||
|
|
||||||
if (this.emailEnabled) {
|
if (appProperties.getSubscription().getEmail() != null) {
|
||||||
ourLog.info("Server is configured to enable email with host '" + this.emailHost + "' and port " + this.emailPort.toString());
|
AppProperties.Subscription.Email email = appProperties.getSubscription().getEmail();
|
||||||
ourLog.info("Server will use '" + this.emailFrom + "' as the from email address");
|
ourLog.info("Server is configured to enable email with host '" + email.getHost() + "' and port " + email.getPort());
|
||||||
|
ourLog.info("Server will use '" + email.getFrom() + "' as the from email address");
|
||||||
|
|
||||||
if (this.emailUsername != null && this.emailUsername.length() > 0) {
|
if (!Strings.isNullOrEmpty(email.getUsername())) {
|
||||||
ourLog.info("Server is configured to use username '" + this.emailUsername + "' for email");
|
ourLog.info("Server is configured to use username '" + email.getUsername() + "' for email");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.emailPassword != null && this.emailPassword.length() > 0) {
|
if (!Strings.isNullOrEmpty(email.getPassword())) {
|
||||||
ourLog.info("Server is configured to use a password for email");
|
ourLog.info("Server is configured to use a password for email");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.subscriptionRestHookEnabled) {
|
if (appProperties.getSubscription().getResthook_enabled()) {
|
||||||
ourLog.info("REST-hook subscriptions enabled");
|
ourLog.info("REST-hook subscriptions enabled");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.subscriptionEmailEnabled) {
|
if (appProperties.getSubscription().getEmail() != null) {
|
||||||
ourLog.info("Email subscriptions enabled");
|
ourLog.info("Email subscriptions enabled");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -96,7 +82,8 @@ public class FhirServerConfigCommon {
|
|||||||
retVal.setAllowExternalReferences(appProperties.getAllow_external_references());
|
retVal.setAllowExternalReferences(appProperties.getAllow_external_references());
|
||||||
retVal.setExpungeEnabled(appProperties.getExpunge_enabled());
|
retVal.setExpungeEnabled(appProperties.getExpunge_enabled());
|
||||||
retVal.setAutoCreatePlaceholderReferenceTargets(appProperties.getAllow_placeholder_references());
|
retVal.setAutoCreatePlaceholderReferenceTargets(appProperties.getAllow_placeholder_references());
|
||||||
retVal.setEmailFromAddress(this.emailFrom);
|
if(appProperties.getSubscription() != null && appProperties.getSubscription().getEmail() != null)
|
||||||
|
retVal.setEmailFromAddress(appProperties.getSubscription().getEmail().getFrom());
|
||||||
|
|
||||||
Integer maxFetchSize = appProperties.getMax_page_size();
|
Integer maxFetchSize = appProperties.getMax_page_size();
|
||||||
retVal.setFetchSizeDefaultMaximum(maxFetchSize);
|
retVal.setFetchSizeDefaultMaximum(maxFetchSize);
|
||||||
@@ -106,21 +93,24 @@ public class FhirServerConfigCommon {
|
|||||||
retVal.setReuseCachedSearchResultsForMillis(reuseCachedSearchResultsMillis);
|
retVal.setReuseCachedSearchResultsForMillis(reuseCachedSearchResultsMillis);
|
||||||
ourLog.info("Server configured to cache search results for {} milliseconds", reuseCachedSearchResultsMillis);
|
ourLog.info("Server configured to cache search results for {} milliseconds", reuseCachedSearchResultsMillis);
|
||||||
|
|
||||||
Long retainCachedSearchesMinutes = HapiProperties.getExpireSearchResultsAfterMins();
|
|
||||||
|
Long retainCachedSearchesMinutes = appProperties.getRetain_cached_searches_mins();
|
||||||
retVal.setExpireSearchResultsAfterMillis(retainCachedSearchesMinutes * 60 * 1000);
|
retVal.setExpireSearchResultsAfterMillis(retainCachedSearchesMinutes * 60 * 1000);
|
||||||
|
|
||||||
// Subscriptions are enabled by channel type
|
if(appProperties.getSubscription() != null) {
|
||||||
if (appProperties.getSubscription().getResthook_enabled()) {
|
// Subscriptions are enabled by channel type
|
||||||
ourLog.info("Enabling REST-hook subscriptions");
|
if (appProperties.getSubscription().getResthook_enabled()) {
|
||||||
retVal.addSupportedSubscriptionType(org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.RESTHOOK);
|
ourLog.info("Enabling REST-hook subscriptions");
|
||||||
}
|
retVal.addSupportedSubscriptionType(org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.RESTHOOK);
|
||||||
if (appProperties.getSubscription().getEmail_enabled()) {
|
}
|
||||||
ourLog.info("Enabling email subscriptions");
|
if (appProperties.getSubscription().getEmail() != null) {
|
||||||
retVal.addSupportedSubscriptionType(org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.EMAIL);
|
ourLog.info("Enabling email subscriptions");
|
||||||
}
|
retVal.addSupportedSubscriptionType(org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.EMAIL);
|
||||||
if (appProperties.getSubscription().getWebsocket_enabled()) {
|
}
|
||||||
ourLog.info("Enabling websocket subscriptions");
|
if (appProperties.getSubscription().getWebsocket_enabled()) {
|
||||||
retVal.addSupportedSubscriptionType(org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.WEBSOCKET);
|
ourLog.info("Enabling websocket subscriptions");
|
||||||
|
retVal.addSupportedSubscriptionType(org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.WEBSOCKET);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
retVal.setFilterParameterEnabled(appProperties.getFilter_search_enabled());
|
retVal.setFilterParameterEnabled(appProperties.getFilter_search_enabled());
|
||||||
@@ -133,7 +123,7 @@ public class FhirServerConfigCommon {
|
|||||||
PartitionSettings retVal = new PartitionSettings();
|
PartitionSettings retVal = new PartitionSettings();
|
||||||
|
|
||||||
// Partitioning
|
// Partitioning
|
||||||
if (HapiProperties.getPartitioningMultitenancyEnabled()) {
|
if (appProperties.getPartitioning() != null) {
|
||||||
retVal.setPartitioningEnabled(true);
|
retVal.setPartitioningEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,14 +137,15 @@ public class FhirServerConfigCommon {
|
|||||||
modelConfig.setAllowContainsSearches(appProperties.getAllow_contains_searches());
|
modelConfig.setAllowContainsSearches(appProperties.getAllow_contains_searches());
|
||||||
modelConfig.setAllowExternalReferences(appProperties.getAllow_external_references());
|
modelConfig.setAllowExternalReferences(appProperties.getAllow_external_references());
|
||||||
modelConfig.setDefaultSearchParamsCanBeOverridden(appProperties.getAllow_override_default_search_params());
|
modelConfig.setDefaultSearchParamsCanBeOverridden(appProperties.getAllow_override_default_search_params());
|
||||||
modelConfig.setEmailFromAddress(this.emailFrom);
|
if(appProperties.getSubscription() != null && appProperties.getSubscription().getEmail() != null)
|
||||||
|
modelConfig.setEmailFromAddress(appProperties.getSubscription().getEmail().getFrom());
|
||||||
|
|
||||||
// You can enable these if you want to support Subscriptions from your server
|
// You can enable these if you want to support Subscriptions from your server
|
||||||
if (this.subscriptionRestHookEnabled) {
|
if (appProperties.getSubscription() != null && appProperties.getSubscription().getResthook_enabled() != null) {
|
||||||
modelConfig.addSupportedSubscriptionType(Subscription.SubscriptionChannelType.RESTHOOK);
|
modelConfig.addSupportedSubscriptionType(Subscription.SubscriptionChannelType.RESTHOOK);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.subscriptionEmailEnabled) {
|
if (appProperties.getSubscription() != null && appProperties.getSubscription().getEmail() != null) {
|
||||||
modelConfig.addSupportedSubscriptionType(Subscription.SubscriptionChannelType.EMAIL);
|
modelConfig.addSupportedSubscriptionType(Subscription.SubscriptionChannelType.EMAIL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,34 +172,33 @@ public class FhirServerConfigCommon {
|
|||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
@Bean
|
@Bean
|
||||||
public IBinaryStorageSvc binaryStorageSvc() {
|
public IBinaryStorageSvc binaryStorageSvc(AppProperties appProperties) {
|
||||||
DatabaseBlobBinaryStorageSvcImpl binaryStorageSvc = new DatabaseBlobBinaryStorageSvcImpl();
|
DatabaseBlobBinaryStorageSvcImpl binaryStorageSvc = new DatabaseBlobBinaryStorageSvcImpl();
|
||||||
|
|
||||||
if (HapiProperties.getMaxBinarySize() != null) {
|
if (appProperties.getMax_binary_size() != null) {
|
||||||
binaryStorageSvc.setMaximumBinarySize(HapiProperties.getMaxBinarySize());
|
binaryStorageSvc.setMaximumBinarySize(appProperties.getMax_binary_size());
|
||||||
}
|
}
|
||||||
|
|
||||||
return binaryStorageSvc;
|
return binaryStorageSvc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean()
|
@Bean()
|
||||||
public IEmailSender emailSender() {
|
public IEmailSender emailSender(AppProperties appProperties, Optional<SubscriptionDeliveryHandlerFactory> subscriptionDeliveryHandlerFactory) {
|
||||||
if (this.emailEnabled) {
|
if (appProperties.getSubscription() != null && appProperties.getSubscription().getEmail() != null) {
|
||||||
JavaMailEmailSender retVal = new JavaMailEmailSender();
|
JavaMailEmailSender retVal = new JavaMailEmailSender();
|
||||||
|
|
||||||
retVal.setSmtpServerHostname(this.emailHost);
|
AppProperties.Subscription.Email email = appProperties.getSubscription().getEmail();
|
||||||
retVal.setSmtpServerPort(this.emailPort);
|
retVal.setSmtpServerHostname(email.getHost());
|
||||||
retVal.setSmtpServerUsername(this.emailUsername);
|
retVal.setSmtpServerPort(email.getPort());
|
||||||
retVal.setSmtpServerPassword(this.emailPassword);
|
retVal.setSmtpServerUsername(email.getUsername());
|
||||||
retVal.setAuth(this.emailAuth);
|
retVal.setSmtpServerPassword(email.getPassword());
|
||||||
retVal.setStartTlsEnable(this.emailStartTlsEnable);
|
retVal.setAuth(email.getAuth());
|
||||||
retVal.setStartTlsRequired(this.emailStartTlsRequired);
|
retVal.setStartTlsEnable(email.getStartTlsEnable());
|
||||||
retVal.setQuitWait(this.emailQuitWait);
|
retVal.setStartTlsRequired(email.getStartTlsRequired());
|
||||||
|
retVal.setQuitWait(email.getQuitWait());
|
||||||
SubscriptionDeliveryHandlerFactory subscriptionDeliveryHandlerFactory = appContext.getBean(SubscriptionDeliveryHandlerFactory.class);
|
|
||||||
Validate.notNull(subscriptionDeliveryHandlerFactory, "No subscription delivery handler");
|
|
||||||
subscriptionDeliveryHandlerFactory.setEmailSender(retVal);
|
|
||||||
|
|
||||||
|
if(subscriptionDeliveryHandlerFactory.isPresent())
|
||||||
|
subscriptionDeliveryHandlerFactory.get().setEmailSender(retVal);
|
||||||
|
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,16 +2,21 @@ package ca.uhn.fhir.jpa.starter;
|
|||||||
|
|
||||||
import javax.servlet.ServletException;
|
import javax.servlet.ServletException;
|
||||||
import javax.servlet.annotation.WebServlet;
|
import javax.servlet.annotation.WebServlet;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Import;
|
import org.springframework.context.annotation.Import;
|
||||||
|
|
||||||
@WebServlet(urlPatterns = {"/fhir/*"})
|
@WebServlet(urlPatterns = {"/hapi-fhir-jpaserver/fhir/*"})
|
||||||
@Import(AppProperties.class)
|
@Import(AppProperties.class)
|
||||||
public class JpaRestfulServer extends BaseJpaRestfulServer {
|
public class JpaRestfulServer extends BaseJpaRestfulServer {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
AppProperties appProperties;
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
public JpaRestfulServer(AppProperties appProperties) {
|
public JpaRestfulServer() {
|
||||||
super(appProperties);
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
spring:
|
spring:
|
||||||
datasource:
|
datasource:
|
||||||
url: 'jdbc:h2:file:./target/database/h2dflkjglkj'
|
url: 'jdbc:h2:file:./target/database/h2'
|
||||||
username: sa
|
username: sa
|
||||||
password: null
|
password: null
|
||||||
driverClassName: org.h2.Driver
|
driverClassName: org.h2.Driver
|
||||||
@@ -10,42 +10,57 @@ spring:
|
|||||||
active: r4
|
active: r4
|
||||||
hapi:
|
hapi:
|
||||||
fhir:
|
fhir:
|
||||||
allow_cascading_deletes: true
|
#supported_resource_types:
|
||||||
allow_contains_searches: true
|
# - Patient
|
||||||
allow_external_references: true
|
# - Observation
|
||||||
allow_multiple_delete: true
|
# allow_cascading_deletes: true
|
||||||
allow_override_default_search_params: true
|
# allow_contains_searches: true
|
||||||
allow_placeholder_references: true
|
# allow_external_references: true
|
||||||
auto_create_placeholder_reference_targets: false
|
# allow_multiple_delete: true
|
||||||
default_encoding: JSON
|
# allow_override_default_search_params: true
|
||||||
default_page_size: 20
|
# allow_placeholder_references: true
|
||||||
enable_index_missing_fields: false
|
# auto_create_placeholder_reference_targets: false
|
||||||
enforce_referential_integrity_on_delete: false
|
# default_encoding: JSON
|
||||||
enforce_referential_integrity_on_write: false
|
# default_pretty_print: true
|
||||||
etag_support_enabled: true
|
# default_page_size: 20
|
||||||
expunge_enabled: true
|
# enable_index_missing_fields: false
|
||||||
daoconfig_client_id_strategy: null
|
# enforce_referential_integrity_on_delete: false
|
||||||
fhirpath_interceptor_enabled: false
|
# enforce_referential_integrity_on_write: false
|
||||||
filter_search_enabled: true
|
# etag_support_enabled: true
|
||||||
graphql_enabled: true
|
# expunge_enabled: true
|
||||||
logger:
|
# daoconfig_client_id_strategy: null
|
||||||
error_format: 'ERROR - ${requestVerb} ${requestUrl}'
|
# fhirpath_interceptor_enabled: false
|
||||||
format: >-
|
# filter_search_enabled: true
|
||||||
Path[${servletPath}] Source[${requestHeader.x-forwarded-for}]
|
# graphql_enabled: true
|
||||||
Operation[${operationType} ${operationName} ${idOrResourceName}]
|
#partitioning:
|
||||||
UA[${requestHeader.user-agent}] Params[${requestParameters}]
|
# cross_partition_reference_mode: true
|
||||||
ResponseEncoding[${responseEncodingNoDefault}]
|
# multitenancy_enabled: true
|
||||||
log_exceptions: true
|
# partitioning_include_in_search_hashes: true
|
||||||
name: fhirtest.access
|
#cors:
|
||||||
max_binary_size: 104857600
|
# allow_Credentials: true
|
||||||
max_page_size: 200
|
# Supports multiple, comma separated allowed origin entries
|
||||||
retain_cached_searches_mins: 60
|
# cors.allowed_origin=http://localhost:8080,https://localhost:8080,https://fhirtest.uhn.ca
|
||||||
reuse_cached_search_results_millis: 60000
|
# allowed_origin:
|
||||||
|
# - '*'
|
||||||
|
|
||||||
|
# logger:
|
||||||
|
# error_format: 'ERROR - ${requestVerb} ${requestUrl}'
|
||||||
|
# format: >-
|
||||||
|
# Path[${servletPath}] Source[${requestHeader.x-forwarded-for}]
|
||||||
|
# Operation[${operationType} ${operationName} ${idOrResourceName}]
|
||||||
|
# UA[${requestHeader.user-agent}] Params[${requestParameters}]
|
||||||
|
# ResponseEncoding[${responseEncodingNoDefault}]
|
||||||
|
# log_exceptions: true
|
||||||
|
# name: fhirtest.access
|
||||||
|
# max_binary_size: 104857600
|
||||||
|
# max_page_size: 200
|
||||||
|
# retain_cached_searches_mins: 60
|
||||||
|
# reuse_cached_search_results_millis: 60000
|
||||||
tester:
|
tester:
|
||||||
-
|
-
|
||||||
id: home
|
id: home
|
||||||
name: Local Tester
|
name: Local Tester
|
||||||
server_address: 'http://localhost:8080/fhir'
|
server_address: 'http://localhost:8080/hapi-fhir-jpaserver/fhir'
|
||||||
refuse_to_fetch_third_party_urls: false
|
refuse_to_fetch_third_party_urls: false
|
||||||
fhir_version: R4
|
fhir_version: R4
|
||||||
-
|
-
|
||||||
@@ -54,23 +69,35 @@ hapi:
|
|||||||
server_address: "http://hapi.fhir.org/baseR4"
|
server_address: "http://hapi.fhir.org/baseR4"
|
||||||
refuse_to_fetch_third_party_urls: false
|
refuse_to_fetch_third_party_urls: false
|
||||||
fhir_version: R4
|
fhir_version: R4
|
||||||
validation:
|
# validation:
|
||||||
requests_enabled: true
|
# requests_enabled: true
|
||||||
responses_enabled: true
|
# responses_enabled: true
|
||||||
binary_storage_enabled: true
|
# binary_storage_enabled: true
|
||||||
bulk_export_enabled: true
|
# bulk_export_enabled: true
|
||||||
partitioning_multitenancy_enabled:
|
# partitioning_multitenancy_enabled:
|
||||||
subscription:
|
# subscription:
|
||||||
email_enabled: false
|
# resthook_enabled: false
|
||||||
resthook_enabled: false
|
# websocket_enabled: false
|
||||||
websocket_enabled: false
|
# email:
|
||||||
elasticsearch:
|
# from: some@test.com
|
||||||
debug:
|
# host: google.com
|
||||||
pretty_print_json_log: false
|
# port:
|
||||||
refresh_after_write: false
|
# username:
|
||||||
enabled: false
|
# password:
|
||||||
password: SomePassword
|
# auth:
|
||||||
required_index_status: YELLOW
|
# startTlsEnable:
|
||||||
rest_url: 'http://localhost:9200'
|
# startTlsRequired:
|
||||||
schema_management_strategy: CREATE
|
# quitWait:
|
||||||
username: SomeUsername
|
|
||||||
|
|
||||||
|
#
|
||||||
|
#elasticsearch:
|
||||||
|
# debug:
|
||||||
|
# pretty_print_json_log: false
|
||||||
|
# refresh_after_write: false
|
||||||
|
# enabled: false
|
||||||
|
# password: SomePassword
|
||||||
|
# required_index_status: YELLOW
|
||||||
|
# rest_url: 'http://localhost:9200'
|
||||||
|
# schema_management_strategy: CREATE
|
||||||
|
# username: SomeUsername
|
||||||
|
|||||||
@@ -26,10 +26,10 @@ public class ExampleServerDstu2IT {
|
|||||||
private static Server ourServer;
|
private static Server ourServer;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
HapiProperties.forceReload();
|
|
||||||
HapiProperties.setProperty(HapiProperties.FHIR_VERSION, "DSTU2");
|
|
||||||
HapiProperties.setProperty(HapiProperties.DATASOURCE_URL, "jdbc:h2:mem:dbr2");
|
|
||||||
ourCtx = FhirContext.forDstu2();
|
ourCtx = FhirContext.forDstu2();
|
||||||
|
System.setProperty("spring.profiles.active", "dstu2");
|
||||||
|
System.setProperty("spring.batch.job.enabled", "false");
|
||||||
|
System.setProperty("spring.datasource.url", "jdbc:h2:mem:dbr2");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -60,7 +60,8 @@ public class ExampleServerDstu2IT {
|
|||||||
|
|
||||||
WebAppContext webAppContext = new WebAppContext();
|
WebAppContext webAppContext = new WebAppContext();
|
||||||
webAppContext.setContextPath("/hapi-fhir-jpaserver");
|
webAppContext.setContextPath("/hapi-fhir-jpaserver");
|
||||||
webAppContext.setDescriptor(path + "/src/main/webapp/WEB-INF/web.xml");
|
|
||||||
|
|
||||||
webAppContext.setResourceBase(path + "/target/hapi-fhir-jpaserver-starter");
|
webAppContext.setResourceBase(path + "/target/hapi-fhir-jpaserver-starter");
|
||||||
webAppContext.setParentLoaderPriority(true);
|
webAppContext.setParentLoaderPriority(true);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user