Start Release branch for 5.1.0

This commit is contained in:
jamesagnew
2020-05-29 10:26:09 -04:00
parent 0430a539ff
commit 8aa322caf1
12 changed files with 286 additions and 117 deletions

View File

@@ -1,6 +1,8 @@
package ca.uhn.fhir.jpa.starter;
import ca.uhn.fhir.context.FhirVersionEnum;
import ca.uhn.fhir.jpa.empi.config.EmpiConsumerConfig;
import ca.uhn.fhir.jpa.empi.config.EmpiSubmitterConfig;
import ca.uhn.fhir.jpa.subscription.channel.config.SubscriptionChannelConfig;
import ca.uhn.fhir.jpa.subscription.match.config.SubscriptionProcessorConfig;
import ca.uhn.fhir.jpa.subscription.match.config.WebsocketDispatcherConfig;
@@ -28,13 +30,19 @@ public class ApplicationContext extends AnnotationConfigWebApplicationContext {
}
if (HapiProperties.getSubscriptionEmailEnabled()
|| HapiProperties.getSubscriptionRestHookEnabled()
|| HapiProperties.getSubscriptionWebsocketEnabled()) {
|| HapiProperties.getSubscriptionRestHookEnabled()
|| HapiProperties.getSubscriptionWebsocketEnabled()) {
register(SubscriptionSubmitterConfig.class);
register(SubscriptionProcessorConfig.class);
register(SubscriptionChannelConfig.class);
}
if (HapiProperties.getEmpiEnabled()) {
register(EmpiSubmitterConfig.class);
register(EmpiConsumerConfig.class);
register(EmpiConfig.class);
}
}
}

View File

@@ -0,0 +1,23 @@
package ca.uhn.fhir.jpa.starter;
import ca.uhn.fhir.empi.api.IEmpiSettings;
import ca.uhn.fhir.empi.rules.config.EmpiSettings;
import com.google.common.base.Charsets;
import org.apache.commons.io.IOUtils;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.Resource;
import java.io.IOException;
@Configuration
public class EmpiConfig {
@Bean
IEmpiSettings empiSettings() throws IOException {
DefaultResourceLoader resourceLoader = new DefaultResourceLoader();
Resource resource = resourceLoader.getResource("empi-rules.json");
String json = IOUtils.toString(resource.getInputStream(), Charsets.UTF_8);
return new EmpiSettings().setEnabled(HapiProperties.getEmpiEnabled()).setScriptText(json);
}
}

View File

@@ -10,7 +10,6 @@ import ca.uhn.fhir.jpa.subscription.match.deliver.email.IEmailSender;
import ca.uhn.fhir.jpa.subscription.match.deliver.email.JavaMailEmailSender;
import org.apache.commons.dbcp2.BasicDataSource;
import org.hl7.fhir.dstu2.model.Subscription;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -25,7 +24,7 @@ import java.sql.Driver;
* This is the primary configuration file for the example server
*/
@Configuration
@EnableTransactionManagement()
@EnableTransactionManagement
public class FhirServerConfigCommon {
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirServerConfigCommon.class);
@@ -198,11 +197,10 @@ public class FhirServerConfigCommon {
retVal.setSmtpServerPort(this.emailPort);
retVal.setSmtpServerUsername(this.emailUsername);
retVal.setSmtpServerPassword(this.emailPassword);
// TODO KHS add these when HAPI 4.2.0 is released
// retVal.setAuth(this.emailAuth);
// retVal.setStartTlsEnable(this.emailStartTlsEnable);
// retVal.setStartTlsRequired(this.emailStartTlsRequired);
// retVal.setQuitWait(this.emailQuitWait);
retVal.setAuth(this.emailAuth);
retVal.setStartTlsEnable(this.emailStartTlsEnable);
retVal.setStartTlsRequired(this.emailStartTlsRequired);
retVal.setQuitWait(this.emailQuitWait);
SubscriptionDeliveryHandlerFactory subscriptionDeliveryHandlerFactory = myAppCtx.getBean(SubscriptionDeliveryHandlerFactory.class);
Validate.notNull(subscriptionDeliveryHandlerFactory, "No subscription delivery handler");

View File

@@ -57,6 +57,11 @@ public class HapiProperties {
static final String SUBSCRIPTION_EMAIL_ENABLED = "subscription.email.enabled";
static final String SUBSCRIPTION_RESTHOOK_ENABLED = "subscription.resthook.enabled";
static final String SUBSCRIPTION_WEBSOCKET_ENABLED = "subscription.websocket.enabled";
static final String EMPI_ENABLED = "empi.enabled";
static final String PARTITIONING_ENABLED = "partitioning.enabled";
static final String PARTITIONING_CROSS_PARTITION_REFERENCE_MODE = "partitioning.cross_partition_reference_mode";
private static final String PARTITIONING_INCLUDE_PARTITION_IN_SEARCH_HASHES = "partitioning.partitioning_include_in_search_hashes";
static final String ALLOWED_BUNDLE_TYPES = "allowed_bundle_types";
static final String TEST_PORT = "test.port";
static final String TESTER_CONFIG_REFUSE_TO_FETCH_THIRD_PARTY_URLS = "tester.config.refuse_to_fetch_third_party_urls";
@@ -373,6 +378,22 @@ public class HapiProperties {
return HapiProperties.getBooleanProperty(SUBSCRIPTION_WEBSOCKET_ENABLED, false);
}
public static Boolean getEmpiEnabled() {
return HapiProperties.getBooleanProperty(EMPI_ENABLED, false);
}
public static Boolean getPartitioningEnabled() {
return HapiProperties.getBooleanProperty(PARTITIONING_ENABLED, false);
}
public static String getPartitioningCrossPartitionReferenceMode() {
return HapiProperties.getProperty(PARTITIONING_CROSS_PARTITION_REFERENCE_MODE, "NOT_ALLOWED");
}
public static Boolean getIncludePartitionInSearchHashes() {
return HapiProperties.getBooleanProperty(PARTITIONING_INCLUDE_PARTITION_IN_SEARCH_HASHES, true);
}
public static Boolean getAllowContainsSearches() {
return HapiProperties.getBooleanProperty(ALLOW_CONTAINS_SEARCHES, true);
}

View File

@@ -7,10 +7,11 @@ import ca.uhn.fhir.interceptor.api.IInterceptorService;
import ca.uhn.fhir.jpa.api.config.DaoConfig;
import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
import ca.uhn.fhir.jpa.api.dao.IFhirSystemDao;
import ca.uhn.fhir.jpa.api.rp.ResourceProviderFactory;
import ca.uhn.fhir.jpa.binstore.BinaryStorageInterceptor;
import ca.uhn.fhir.jpa.bulk.BulkDataExportProvider;
import ca.uhn.fhir.jpa.interceptor.CascadingDeleteInterceptor;
import ca.uhn.fhir.jpa.model.config.PartitionSettings;
import ca.uhn.fhir.jpa.partition.PartitionManagementProvider;
import ca.uhn.fhir.jpa.provider.GraphQLProvider;
import ca.uhn.fhir.jpa.provider.JpaConformanceProviderDstu2;
import ca.uhn.fhir.jpa.provider.JpaSystemProviderDstu2;
@@ -35,6 +36,7 @@ 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.provider.ResourceProviderFactory;
import ca.uhn.fhir.validation.IValidatorModule;
import ca.uhn.fhir.validation.ResultSeverityEnum;
import org.hl7.fhir.dstu3.model.Bundle;
@@ -318,6 +320,13 @@ public class JpaRestfulServer extends RestfulServer {
registerProvider(appCtx.getBean(BulkDataExportProvider.class));
}
if (HapiProperties.getPartitioningEnabled()) {
PartitionSettings partitionSettings = appCtx.getBean(PartitionSettings.class);
partitionSettings.setPartitioningEnabled(true);
PartitionSettings.CrossPartitionReferenceMode mode = PartitionSettings.CrossPartitionReferenceMode.valueOf(HapiProperties.getPartitioningCrossPartitionReferenceMode());
partitionSettings.setAllowReferencesAcrossPartitions(mode);
partitionSettings.setIncludePartitionInSearchHashes(HapiProperties.getIncludePartitionInSearchHashes());
registerProvider(appCtx.getBean(PartitionManagementProvider.class));
}
}
}

View File

@@ -0,0 +1,35 @@
{
"candidateSearchParams" : [ {
"resourceType" : "Patient",
"searchParam" : "birthdate"
}, {
"resourceType" : "*",
"searchParam" : "identifier"
},{
"resourceType" : "Patient",
"searchParam" : "general-practitioner"
} ],
"candidateFilterSearchParams" : [ {
"resourceType" : "*",
"searchParam" : "active",
"fixedValue" : "true"
} ],
"matchFields" : [ {
"name" : "given-name",
"resourceType" : "*",
"resourcePath" : "name.given",
"metric" : "COSINE",
"matchThreshold" : 0.8
}, {
"name" : "last-name",
"resourceType" : "*",
"resourcePath" : "name.family",
"metric" : "JARO_WINKLER",
"matchThreshold" : 0.8
}],
"matchResultMap" : {
"given-name" : "POSSIBLE_MATCH",
"given-name,last-name" : "MATCH"
},
"eidSystem": "http://company.io/fhir/NamingSystem/custom-eid-system"
}

View File

@@ -149,3 +149,11 @@ email.password=
# Enable Websocket Subscription Channel
subscription.websocket.enabled=false
# EMPI
empi.enabled=false
# Partitioning
partitioning.enabled=false
partitioning.cross_partition_reference_mode=NOT_ALLOWED
partitioning.partitioning_include_in_search_hashes=true

View File

@@ -9,6 +9,25 @@
</encoder>
</appender>
<appender name="EMPI_TROUBLESHOOTING" class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"><level>DEBUG</level></filter>
<file>${smile.basedir}/log/empi-troubleshooting.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>${smile.basedir}/log/empi-troubleshooting.log.%i.gz</fileNamePattern>
<minIndex>1</minIndex>
<maxIndex>9</maxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>5MB</maxFileSize>
</triggeringPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n${log.stackfilter.pattern}</pattern>
</encoder>
</appender>
<logger name="ca.uhn.fhir.log.empi_troubleshooting" level="TRACE">
<appender-ref ref="EMPI_TROUBLESHOOTING"/>
</logger>
<root level="INFO">
<appender-ref ref="STDOUT" />
</root>