Merge branch 'master' into nih-testing
* master: Update application.yaml Bumped version of Spring Boot in order to fix same issue as https://github.com/Haulmont/jmix-security/issues/90 Upgraded to 5.6.0 Subscription tests fail ... Added OpenAPI / Swagger option simplified helm chart build ARM-compatible images bumped dependencies to latest only push build images to DockerHub Adds ability to change HAPI FHIR JPA server's port with the environment variable server.port Adds ability to control the number of executor threads through environment variables server.tomcat.max-threads and server.tomcat.min-spare-threads. There is not a breaking change and does not affect the function of the JPA server unless these environment variables are set. Adds ability to use delete-expunge operations to the JPA Starter Server. # Conflicts: # pom.xml # src/main/java/ca/uhn/fhir/jpa/starter/AppProperties.java # src/main/java/ca/uhn/fhir/jpa/starter/Application.java # src/main/java/ca/uhn/fhir/jpa/starter/EnvironmentHelper.java # src/main/java/ca/uhn/fhir/jpa/starter/FhirServerConfigCommon.java # src/main/java/ca/uhn/fhir/jpa/starter/FhirServerConfigDstu2.java # src/main/java/ca/uhn/fhir/jpa/starter/FhirServerConfigDstu3.java # src/main/java/ca/uhn/fhir/jpa/starter/FhirServerConfigR4.java # src/main/java/ca/uhn/fhir/jpa/starter/FhirServerConfigR5.java
This commit is contained in:
@@ -19,6 +19,7 @@ import java.util.*;
|
||||
public class AppProperties {
|
||||
|
||||
private Boolean cql_enabled = false;
|
||||
private Boolean openapi_enabled = false;
|
||||
private Boolean mdm_enabled = false;
|
||||
private boolean advanced_lucene_indexing = false;
|
||||
private Boolean allow_cascading_deletes = false;
|
||||
@@ -27,6 +28,7 @@ public class AppProperties {
|
||||
private Boolean allow_multiple_delete = false;
|
||||
private Boolean allow_override_default_search_params = true;
|
||||
private Boolean auto_create_placeholder_reference_targets = false;
|
||||
private Boolean delete_expunge_enabled = false;
|
||||
private Boolean enable_index_missing_fields = false;
|
||||
private Boolean enable_index_contained_resource = false;
|
||||
private Boolean enable_repository_validating_interceptor = false;
|
||||
@@ -72,9 +74,17 @@ public class AppProperties {
|
||||
private Boolean use_apache_address_strategy = false;
|
||||
private Boolean use_apache_address_strategy_https = false;
|
||||
|
||||
private Integer bundle_batch_pool_size = 20;
|
||||
private Integer bundle_batch_pool_max_size = 100;
|
||||
private List<String> local_base_urls = new ArrayList<>();
|
||||
private Integer bundle_batch_pool_size = 20;
|
||||
private Integer bundle_batch_pool_max_size = 100;
|
||||
private List<String> local_base_urls = new ArrayList<>();
|
||||
|
||||
public Boolean getOpenapi_enabled() {
|
||||
return openapi_enabled;
|
||||
}
|
||||
|
||||
public void setOpenapi_enabled(Boolean openapi_enabled) {
|
||||
this.openapi_enabled = openapi_enabled;
|
||||
}
|
||||
|
||||
public Boolean getUse_apache_address_strategy() {
|
||||
return use_apache_address_strategy;
|
||||
@@ -275,6 +285,14 @@ public class AppProperties {
|
||||
this.default_page_size = default_page_size;
|
||||
}
|
||||
|
||||
public Boolean getDelete_expunge_enabled() {
|
||||
return delete_expunge_enabled;
|
||||
}
|
||||
|
||||
public void setDelete_expunge_enabled(Boolean delete_expunge_enabled) {
|
||||
this.delete_expunge_enabled = delete_expunge_enabled;
|
||||
}
|
||||
|
||||
public Boolean getEnable_index_missing_fields() {
|
||||
return enable_index_missing_fields;
|
||||
}
|
||||
|
||||
@@ -29,8 +29,6 @@ public class Application extends SpringBootServletInitializer {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
|
||||
System.setProperty("spring.batch.job.enabled", "false");
|
||||
SpringApplication.run(Application.class, args);
|
||||
|
||||
//Server is now accessible at eg. http://localhost:8080/fhir/metadata
|
||||
|
||||
@@ -28,6 +28,7 @@ import ca.uhn.fhir.mdm.provider.MdmProviderLoader;
|
||||
import ca.uhn.fhir.narrative.DefaultThymeleafNarrativeGenerator;
|
||||
import ca.uhn.fhir.narrative.INarrativeGenerator;
|
||||
import ca.uhn.fhir.narrative2.NullNarrativeGenerator;
|
||||
import ca.uhn.fhir.rest.openapi.OpenApiInterceptor;
|
||||
import ca.uhn.fhir.rest.server.ApacheProxyAddressStrategy;
|
||||
import ca.uhn.fhir.rest.server.ETagSupportEnum;
|
||||
import ca.uhn.fhir.rest.server.HardcodedServerAddressStrategy;
|
||||
@@ -357,6 +358,10 @@ public class BaseJpaRestfulServer extends RestfulServer {
|
||||
|
||||
daoConfig.setDeferIndexingForCodesystemsOfSize(appProperties.getDefer_indexing_for_codesystems_of_size());
|
||||
|
||||
if (appProperties.getOpenapi_enabled()) {
|
||||
registerInterceptor(new OpenApiInterceptor());
|
||||
}
|
||||
|
||||
// Bulk Export
|
||||
if (appProperties.getBulk_export_enabled()) {
|
||||
registerProvider(bulkDataExportProvider);
|
||||
|
||||
@@ -26,7 +26,8 @@ import java.util.*;
|
||||
|
||||
public class EnvironmentHelper {
|
||||
|
||||
public static Properties getHibernateProperties(ConfigurableEnvironment environment, ConfigurableListableBeanFactory theBeanFactory) {
|
||||
public static Properties getHibernateProperties(ConfigurableEnvironment environment,
|
||||
ConfigurableListableBeanFactory myConfigurableListableBeanFactory) {
|
||||
Properties properties = new Properties();
|
||||
Map<String, Object> jpaProps = getPropertiesStartingWith(environment, "spring.jpa.properties");
|
||||
for (Map.Entry<String, Object> entry : jpaProps.entrySet()) {
|
||||
@@ -42,7 +43,7 @@ public class EnvironmentHelper {
|
||||
//properties.putIfAbsent(AvailableSettings.BEAN_CONTAINER, new SpringBeanContainer(beanFactory));
|
||||
|
||||
//hapi-fhir-jpaserver-base "sensible defaults"
|
||||
Map<String, Object> hapiJpaPropertyMap = new HapiFhirLocalContainerEntityManagerFactoryBean(theBeanFactory).getJpaPropertyMap();
|
||||
Map<String, Object> hapiJpaPropertyMap = new HapiFhirLocalContainerEntityManagerFactoryBean(myConfigurableListableBeanFactory).getJpaPropertyMap();
|
||||
hapiJpaPropertyMap.forEach(properties::putIfAbsent);
|
||||
|
||||
//hapi-fhir-jpaserver-starter defaults
|
||||
|
||||
@@ -43,6 +43,7 @@ public class FhirServerConfigCommon {
|
||||
ourLog.info("Server configured to " + (appProperties.getAllow_contains_searches() ? "allow" : "deny") + " contains searches");
|
||||
ourLog.info("Server configured to " + (appProperties.getAllow_multiple_delete() ? "allow" : "deny") + " multiple deletes");
|
||||
ourLog.info("Server configured to " + (appProperties.getAllow_external_references() ? "allow" : "deny") + " external references");
|
||||
ourLog.info("Server configured to " + (appProperties.getDelete_expunge_enabled() ? "enable" : "disable") + " delete expunges");
|
||||
ourLog.info("Server configured to " + (appProperties.getExpunge_enabled() ? "enable" : "disable") + " expunges");
|
||||
ourLog.info("Server configured to " + (appProperties.getAllow_override_default_search_params() ? "allow" : "deny") + " overriding default search params");
|
||||
ourLog.info("Server configured to " + (appProperties.getAuto_create_placeholder_reference_targets() ? "allow" : "disable") + " auto-creating placeholder references");
|
||||
@@ -88,6 +89,7 @@ public class FhirServerConfigCommon {
|
||||
retVal.setAllowContainsSearches(appProperties.getAllow_contains_searches());
|
||||
retVal.setAllowMultipleDelete(appProperties.getAllow_multiple_delete());
|
||||
retVal.setAllowExternalReferences(appProperties.getAllow_external_references());
|
||||
retVal.setDeleteExpungeEnabled(appProperties.getDelete_expunge_enabled());
|
||||
retVal.setExpungeEnabled(appProperties.getExpunge_enabled());
|
||||
if(appProperties.getSubscription() != null && appProperties.getSubscription().getEmail() != null)
|
||||
retVal.setEmailFromAddress(appProperties.getSubscription().getEmail().getFrom());
|
||||
@@ -214,20 +216,22 @@ public class FhirServerConfigCommon {
|
||||
@Bean()
|
||||
public IEmailSender emailSender(AppProperties appProperties, Optional<SubscriptionDeliveryHandlerFactory> subscriptionDeliveryHandlerFactory) {
|
||||
if (appProperties.getSubscription() != null && appProperties.getSubscription().getEmail() != null) {
|
||||
AppProperties.Subscription.Email email = appProperties.getSubscription().getEmail();
|
||||
MailConfig mailConfig = new MailConfig();
|
||||
mailConfig.setSmtpHostname(email.getHost());
|
||||
mailConfig.setSmtpUseStartTLS(email.getStartTlsRequired());
|
||||
mailConfig.setSmtpPort(email.getPort());
|
||||
mailConfig.setSmtpUsername(email.getUsername());
|
||||
mailConfig.setSmtpPassword(email.getPassword());
|
||||
EmailSenderImpl emailSender = new EmailSenderImpl(mailConfig);
|
||||
|
||||
if(subscriptionDeliveryHandlerFactory.isPresent()) {
|
||||
subscriptionDeliveryHandlerFactory.get().setEmailSender(emailSender);
|
||||
}
|
||||
AppProperties.Subscription.Email email = appProperties.getSubscription().getEmail();
|
||||
mailConfig.setSmtpHostname(email.getHost());
|
||||
mailConfig.setSmtpPort(email.getPort());
|
||||
mailConfig.setSmtpUsername(email.getUsername());
|
||||
mailConfig.setSmtpPassword(email.getPassword());
|
||||
mailConfig.setSmtpUseStartTLS(email.getStartTlsEnable());
|
||||
|
||||
}
|
||||
IEmailSender emailSender = new EmailSenderImpl(mailConfig);
|
||||
|
||||
if(subscriptionDeliveryHandlerFactory.isPresent())
|
||||
subscriptionDeliveryHandlerFactory.get().setEmailSender(emailSender);
|
||||
|
||||
return emailSender;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -59,8 +59,9 @@ public class FhirServerConfigDstu2 extends BaseJavaConfigDstu2 {
|
||||
|
||||
@Override
|
||||
@Bean()
|
||||
public LocalContainerEntityManagerFactoryBean entityManagerFactory(ConfigurableListableBeanFactory theBeanFactory) {
|
||||
LocalContainerEntityManagerFactoryBean retVal = super.entityManagerFactory(theBeanFactory);
|
||||
public LocalContainerEntityManagerFactoryBean entityManagerFactory(
|
||||
ConfigurableListableBeanFactory myConfigurableListableBeanFactory) {
|
||||
LocalContainerEntityManagerFactoryBean retVal = super.entityManagerFactory(myConfigurableListableBeanFactory);
|
||||
retVal.setPersistenceUnitName("HAPI_PU");
|
||||
|
||||
try {
|
||||
@@ -68,7 +69,7 @@ public class FhirServerConfigDstu2 extends BaseJavaConfigDstu2 {
|
||||
} catch (Exception e) {
|
||||
throw new ConfigurationException("Could not set the data source due to a configuration issue", e);
|
||||
}
|
||||
retVal.setJpaProperties(EnvironmentHelper.getHibernateProperties(configurableEnvironment, theBeanFactory));
|
||||
retVal.setJpaProperties(EnvironmentHelper.getHibernateProperties(configurableEnvironment, myConfigurableListableBeanFactory));
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
@@ -63,8 +63,9 @@ public class FhirServerConfigDstu3 extends BaseJavaConfigDstu3 {
|
||||
|
||||
@Override
|
||||
@Bean
|
||||
public LocalContainerEntityManagerFactoryBean entityManagerFactory(ConfigurableListableBeanFactory theBeanFactory) {
|
||||
LocalContainerEntityManagerFactoryBean retVal = super.entityManagerFactory(theBeanFactory);
|
||||
public LocalContainerEntityManagerFactoryBean entityManagerFactory(
|
||||
ConfigurableListableBeanFactory myConfigurableListableBeanFactory) {
|
||||
LocalContainerEntityManagerFactoryBean retVal = super.entityManagerFactory(myConfigurableListableBeanFactory);
|
||||
retVal.setPersistenceUnitName("HAPI_PU");
|
||||
|
||||
try {
|
||||
@@ -73,7 +74,9 @@ public class FhirServerConfigDstu3 extends BaseJavaConfigDstu3 {
|
||||
throw new ConfigurationException("Could not set the data source due to a configuration issue", e);
|
||||
}
|
||||
|
||||
retVal.setJpaProperties(EnvironmentHelper.getHibernateProperties(configurableEnvironment, theBeanFactory));
|
||||
retVal.setJpaProperties(EnvironmentHelper.getHibernateProperties(configurableEnvironment,
|
||||
myConfigurableListableBeanFactory));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
@@ -59,8 +59,9 @@ public class FhirServerConfigR4 extends BaseJavaConfigR4 {
|
||||
|
||||
@Override
|
||||
@Bean()
|
||||
public LocalContainerEntityManagerFactoryBean entityManagerFactory(ConfigurableListableBeanFactory theBeanFactory) {
|
||||
LocalContainerEntityManagerFactoryBean retVal = super.entityManagerFactory(theBeanFactory);
|
||||
public LocalContainerEntityManagerFactoryBean entityManagerFactory(
|
||||
ConfigurableListableBeanFactory myConfigurableListableBeanFactory) {
|
||||
LocalContainerEntityManagerFactoryBean retVal = super.entityManagerFactory(myConfigurableListableBeanFactory);
|
||||
retVal.setPersistenceUnitName("HAPI_PU");
|
||||
|
||||
try {
|
||||
@@ -69,7 +70,8 @@ public class FhirServerConfigR4 extends BaseJavaConfigR4 {
|
||||
throw new ConfigurationException("Could not set the data source due to a configuration issue", e);
|
||||
}
|
||||
|
||||
retVal.setJpaProperties(EnvironmentHelper.getHibernateProperties(configurableEnvironment, theBeanFactory));
|
||||
retVal.setJpaProperties(EnvironmentHelper.getHibernateProperties(configurableEnvironment,
|
||||
myConfigurableListableBeanFactory));
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
@@ -60,8 +60,9 @@ public class FhirServerConfigR5 extends BaseJavaConfigR5 {
|
||||
|
||||
@Override
|
||||
@Bean()
|
||||
public LocalContainerEntityManagerFactoryBean entityManagerFactory(ConfigurableListableBeanFactory theBeanFactory) {
|
||||
LocalContainerEntityManagerFactoryBean retVal = super.entityManagerFactory(theBeanFactory);
|
||||
public LocalContainerEntityManagerFactoryBean entityManagerFactory(
|
||||
ConfigurableListableBeanFactory myConfigurableListableBeanFactory) {
|
||||
LocalContainerEntityManagerFactoryBean retVal = super.entityManagerFactory(myConfigurableListableBeanFactory);
|
||||
retVal.setPersistenceUnitName("HAPI_PU");
|
||||
|
||||
try {
|
||||
@@ -70,7 +71,8 @@ public class FhirServerConfigR5 extends BaseJavaConfigR5 {
|
||||
throw new ConfigurationException("Could not set the data source due to a configuration issue", e);
|
||||
}
|
||||
|
||||
retVal.setJpaProperties(EnvironmentHelper.getHibernateProperties(configurableEnvironment, theBeanFactory));
|
||||
retVal.setJpaProperties(EnvironmentHelper.getHibernateProperties(configurableEnvironment,
|
||||
myConfigurableListableBeanFactory));
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,9 @@ spring:
|
||||
# database connection pool size
|
||||
hikari:
|
||||
maximum-pool-size: 10
|
||||
flyway:
|
||||
check-location: false
|
||||
baselineOnMigrate: true
|
||||
jpa:
|
||||
properties:
|
||||
hibernate.format_sql: false
|
||||
@@ -35,6 +38,8 @@ spring:
|
||||
enabled: false
|
||||
hapi:
|
||||
fhir:
|
||||
### This enables the swagger-ui at /fhir/swagger-ui/index.html as well as the /fhir/api-docs (see https://hapifhir.io/hapi-fhir/docs/server_plain/openapi.html)
|
||||
openapi_enabled: true
|
||||
### This is the FHIR version. Choose between, DSTU2, DSTU3, R4 or R5
|
||||
fhir_version: R4
|
||||
### enable to use the ApacheProxyAddressStrategy which uses X-Forwarded-* headers
|
||||
@@ -70,6 +75,7 @@ hapi:
|
||||
# default_encoding: JSON
|
||||
# default_pretty_print: true
|
||||
# default_page_size: 20
|
||||
# delete_expunge_enabled: true
|
||||
# enable_repository_validating_interceptor: false
|
||||
# enable_index_missing_fields: false
|
||||
# enable_index_contained_resource: false
|
||||
|
||||
Reference in New Issue
Block a user