Merge pull request #684 from hapifhir/rel_7_3_tracking
Update to HAPI 7.4.0 (tracking branch)
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -14,7 +14,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||||
<artifactId>hapi-fhir</artifactId>
|
<artifactId>hapi-fhir</artifactId>
|
||||||
<version>7.2.1</version>
|
<version>7.4.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>hapi-fhir-jpaserver-starter</artifactId>
|
<artifactId>hapi-fhir-jpaserver-starter</artifactId>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import ca.uhn.fhir.jpa.binstore.DatabaseBinaryContentStorageSvcImpl;
|
|||||||
import ca.uhn.fhir.jpa.config.HibernatePropertiesProvider;
|
import ca.uhn.fhir.jpa.config.HibernatePropertiesProvider;
|
||||||
import ca.uhn.fhir.jpa.model.config.PartitionSettings;
|
import ca.uhn.fhir.jpa.model.config.PartitionSettings;
|
||||||
import ca.uhn.fhir.jpa.model.config.PartitionSettings.CrossPartitionReferenceMode;
|
import ca.uhn.fhir.jpa.model.config.PartitionSettings.CrossPartitionReferenceMode;
|
||||||
|
import ca.uhn.fhir.jpa.model.config.SubscriptionSettings;
|
||||||
import ca.uhn.fhir.jpa.model.entity.StorageSettings;
|
import ca.uhn.fhir.jpa.model.entity.StorageSettings;
|
||||||
import ca.uhn.fhir.jpa.starter.AppProperties;
|
import ca.uhn.fhir.jpa.starter.AppProperties;
|
||||||
import ca.uhn.fhir.jpa.starter.util.JpaHibernatePropertiesProvider;
|
import ca.uhn.fhir.jpa.starter.util.JpaHibernatePropertiesProvider;
|
||||||
@@ -87,6 +88,40 @@ public class FhirServerConfigCommon {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public SubscriptionSettings subscriptionSettings(AppProperties appProperties) {
|
||||||
|
SubscriptionSettings subscriptionSettings = new SubscriptionSettings();
|
||||||
|
if (appProperties.getSubscription() != null) {
|
||||||
|
if (appProperties.getSubscription().getEmail() != null)
|
||||||
|
subscriptionSettings.setEmailFromAddress(
|
||||||
|
appProperties.getSubscription().getEmail().getFrom());
|
||||||
|
|
||||||
|
// Subscriptions are enabled by channel type
|
||||||
|
if (appProperties.getSubscription().getResthook_enabled()) {
|
||||||
|
ourLog.info("Enabling REST-hook subscriptions");
|
||||||
|
subscriptionSettings.addSupportedSubscriptionType(
|
||||||
|
org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.RESTHOOK);
|
||||||
|
}
|
||||||
|
if (appProperties.getSubscription().getEmail() != null) {
|
||||||
|
ourLog.info("Enabling email subscriptions");
|
||||||
|
subscriptionSettings.addSupportedSubscriptionType(
|
||||||
|
org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.EMAIL);
|
||||||
|
}
|
||||||
|
if (appProperties.getSubscription().getWebsocket_enabled()) {
|
||||||
|
ourLog.info("Enabling websocket subscriptions");
|
||||||
|
subscriptionSettings.addSupportedSubscriptionType(
|
||||||
|
org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.WEBSOCKET);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if (appProperties.getMdm_enabled()) {
|
||||||
|
// MDM requires the subscription of type message
|
||||||
|
ourLog.info("Enabling message subscriptions");
|
||||||
|
subscriptionSettings.addSupportedSubscriptionType(
|
||||||
|
org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.MESSAGE);
|
||||||
|
}
|
||||||
|
return subscriptionSettings;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Configure FHIR properties around the JPA server via this bean
|
* Configure FHIR properties around the JPA server via this bean
|
||||||
*/
|
*/
|
||||||
@@ -114,10 +149,7 @@ public class FhirServerConfigCommon {
|
|||||||
jpaStorageSettings.setDeleteExpungeEnabled(appProperties.getDelete_expunge_enabled());
|
jpaStorageSettings.setDeleteExpungeEnabled(appProperties.getDelete_expunge_enabled());
|
||||||
jpaStorageSettings.setExpungeEnabled(appProperties.getExpunge_enabled());
|
jpaStorageSettings.setExpungeEnabled(appProperties.getExpunge_enabled());
|
||||||
jpaStorageSettings.setLanguageSearchParameterEnabled(appProperties.getLanguage_search_parameter_enabled());
|
jpaStorageSettings.setLanguageSearchParameterEnabled(appProperties.getLanguage_search_parameter_enabled());
|
||||||
if (appProperties.getSubscription() != null
|
|
||||||
&& appProperties.getSubscription().getEmail() != null)
|
|
||||||
jpaStorageSettings.setEmailFromAddress(
|
|
||||||
appProperties.getSubscription().getEmail().getFrom());
|
|
||||||
|
|
||||||
Integer maxFetchSize = appProperties.getMax_page_size();
|
Integer maxFetchSize = appProperties.getMax_page_size();
|
||||||
jpaStorageSettings.setFetchSizeDefaultMaximum(maxFetchSize);
|
jpaStorageSettings.setFetchSizeDefaultMaximum(maxFetchSize);
|
||||||
@@ -131,24 +163,7 @@ public class FhirServerConfigCommon {
|
|||||||
Long retainCachedSearchesMinutes = appProperties.getRetain_cached_searches_mins();
|
Long retainCachedSearchesMinutes = appProperties.getRetain_cached_searches_mins();
|
||||||
jpaStorageSettings.setExpireSearchResultsAfterMillis(retainCachedSearchesMinutes * 60 * 1000);
|
jpaStorageSettings.setExpireSearchResultsAfterMillis(retainCachedSearchesMinutes * 60 * 1000);
|
||||||
|
|
||||||
if (appProperties.getSubscription() != null) {
|
|
||||||
// Subscriptions are enabled by channel type
|
|
||||||
if (appProperties.getSubscription().getResthook_enabled()) {
|
|
||||||
ourLog.info("Enabling REST-hook subscriptions");
|
|
||||||
jpaStorageSettings.addSupportedSubscriptionType(
|
|
||||||
org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.RESTHOOK);
|
|
||||||
}
|
|
||||||
if (appProperties.getSubscription().getEmail() != null) {
|
|
||||||
ourLog.info("Enabling email subscriptions");
|
|
||||||
jpaStorageSettings.addSupportedSubscriptionType(
|
|
||||||
org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.EMAIL);
|
|
||||||
}
|
|
||||||
if (appProperties.getSubscription().getWebsocket_enabled()) {
|
|
||||||
ourLog.info("Enabling websocket subscriptions");
|
|
||||||
jpaStorageSettings.addSupportedSubscriptionType(
|
|
||||||
org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.WEBSOCKET);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
jpaStorageSettings.setFilterParameterEnabled(appProperties.getFilter_search_enabled());
|
jpaStorageSettings.setFilterParameterEnabled(appProperties.getFilter_search_enabled());
|
||||||
jpaStorageSettings.setAdvancedHSearchIndexing(appProperties.getAdvanced_lucene_indexing());
|
jpaStorageSettings.setAdvancedHSearchIndexing(appProperties.getAdvanced_lucene_indexing());
|
||||||
@@ -204,13 +219,6 @@ public class FhirServerConfigCommon {
|
|||||||
jpaStorageSettings.setBundleBatchPoolSize(appProperties.getBundle_batch_pool_size());
|
jpaStorageSettings.setBundleBatchPoolSize(appProperties.getBundle_batch_pool_size());
|
||||||
jpaStorageSettings.setBundleBatchPoolSize(appProperties.getBundle_batch_pool_max_size());
|
jpaStorageSettings.setBundleBatchPoolSize(appProperties.getBundle_batch_pool_max_size());
|
||||||
|
|
||||||
if (appProperties.getMdm_enabled()) {
|
|
||||||
// MDM requires the subscription of type message
|
|
||||||
ourLog.info("Enabling message subscriptions");
|
|
||||||
jpaStorageSettings.addSupportedSubscriptionType(
|
|
||||||
org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.MESSAGE);
|
|
||||||
}
|
|
||||||
|
|
||||||
storageSettings(appProperties, jpaStorageSettings);
|
storageSettings(appProperties, jpaStorageSettings);
|
||||||
return jpaStorageSettings;
|
return jpaStorageSettings;
|
||||||
}
|
}
|
||||||
@@ -251,10 +259,6 @@ public class FhirServerConfigCommon {
|
|||||||
jpaStorageSettings.setAllowExternalReferences(appProperties.getAllow_external_references());
|
jpaStorageSettings.setAllowExternalReferences(appProperties.getAllow_external_references());
|
||||||
jpaStorageSettings.setDefaultSearchParamsCanBeOverridden(
|
jpaStorageSettings.setDefaultSearchParamsCanBeOverridden(
|
||||||
appProperties.getAllow_override_default_search_params());
|
appProperties.getAllow_override_default_search_params());
|
||||||
if (appProperties.getSubscription() != null
|
|
||||||
&& appProperties.getSubscription().getEmail() != null)
|
|
||||||
jpaStorageSettings.setEmailFromAddress(
|
|
||||||
appProperties.getSubscription().getEmail().getFrom());
|
|
||||||
|
|
||||||
jpaStorageSettings.setNormalizedQuantitySearchLevel(appProperties.getNormalized_quantity_search_level());
|
jpaStorageSettings.setNormalizedQuantitySearchLevel(appProperties.getNormalized_quantity_search_level());
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import ca.uhn.fhir.jpa.graphql.GraphQLProvider;
|
|||||||
import ca.uhn.fhir.jpa.interceptor.CascadingDeleteInterceptor;
|
import ca.uhn.fhir.jpa.interceptor.CascadingDeleteInterceptor;
|
||||||
import ca.uhn.fhir.jpa.interceptor.validation.RepositoryValidatingInterceptor;
|
import ca.uhn.fhir.jpa.interceptor.validation.RepositoryValidatingInterceptor;
|
||||||
import ca.uhn.fhir.jpa.ips.provider.IpsOperationProvider;
|
import ca.uhn.fhir.jpa.ips.provider.IpsOperationProvider;
|
||||||
|
import ca.uhn.fhir.jpa.model.config.SubscriptionSettings;
|
||||||
import ca.uhn.fhir.jpa.packages.IPackageInstallerSvc;
|
import ca.uhn.fhir.jpa.packages.IPackageInstallerSvc;
|
||||||
import ca.uhn.fhir.jpa.packages.PackageInstallationSpec;
|
import ca.uhn.fhir.jpa.packages.PackageInstallationSpec;
|
||||||
import ca.uhn.fhir.jpa.partition.PartitionManagementProvider;
|
import ca.uhn.fhir.jpa.partition.PartitionManagementProvider;
|
||||||
@@ -252,6 +253,7 @@ public class StarterJpaConfig {
|
|||||||
IJpaSystemProvider jpaSystemProvider,
|
IJpaSystemProvider jpaSystemProvider,
|
||||||
ResourceProviderFactory resourceProviderFactory,
|
ResourceProviderFactory resourceProviderFactory,
|
||||||
JpaStorageSettings jpaStorageSettings,
|
JpaStorageSettings jpaStorageSettings,
|
||||||
|
SubscriptionSettings subscriptionSettings,
|
||||||
ISearchParamRegistry searchParamRegistry,
|
ISearchParamRegistry searchParamRegistry,
|
||||||
IValidationSupport theValidationSupport,
|
IValidationSupport theValidationSupport,
|
||||||
DatabaseBackedPagingProvider databaseBackedPagingProvider,
|
DatabaseBackedPagingProvider databaseBackedPagingProvider,
|
||||||
@@ -378,7 +380,7 @@ public class StarterJpaConfig {
|
|||||||
|
|
||||||
corsInterceptor.ifPresent(fhirServer::registerInterceptor);
|
corsInterceptor.ifPresent(fhirServer::registerInterceptor);
|
||||||
|
|
||||||
if (jpaStorageSettings.getSupportedSubscriptionTypes().size() > 0) {
|
if (!subscriptionSettings.getSupportedSubscriptionTypes().isEmpty()) {
|
||||||
// Subscription debug logging
|
// Subscription debug logging
|
||||||
fhirServer.registerInterceptor(new SubscriptionDebugLogInterceptor());
|
fhirServer.registerInterceptor(new SubscriptionDebugLogInterceptor());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
|||||||
RepositoryConfig.class
|
RepositoryConfig.class
|
||||||
}, properties =
|
}, properties =
|
||||||
{
|
{
|
||||||
"spring.profiles.include=storageSettingsTest",
|
|
||||||
"spring.datasource.url=jdbc:h2:mem:dbr3",
|
"spring.datasource.url=jdbc:h2:mem:dbr3",
|
||||||
"hapi.fhir.fhir_version=dstu3",
|
"hapi.fhir.fhir_version=dstu3",
|
||||||
"hapi.fhir.cr_enabled=true",
|
"hapi.fhir.cr_enabled=true",
|
||||||
|
|||||||
@@ -55,11 +55,10 @@ import static org.opencds.cqf.fhir.utility.r4.Parameters.stringPart;
|
|||||||
NicknameServiceConfig.class,
|
NicknameServiceConfig.class,
|
||||||
RepositoryConfig.class
|
RepositoryConfig.class
|
||||||
}, properties = {
|
}, properties = {
|
||||||
"spring.profiles.include=storageSettingsTest",
|
|
||||||
"spring.datasource.url=jdbc:h2:mem:dbr4",
|
"spring.datasource.url=jdbc:h2:mem:dbr4",
|
||||||
"hapi.fhir.enable_repository_validating_interceptor=true",
|
"hapi.fhir.enable_repository_validating_interceptor=true",
|
||||||
"hapi.fhir.fhir_version=r4",
|
"hapi.fhir.fhir_version=r4",
|
||||||
//"hapi.fhir.subscription.websocket_enabled=true",
|
"hapi.fhir.subscription.websocket_enabled=true",
|
||||||
//"hapi.fhir.mdm_enabled=true",
|
//"hapi.fhir.mdm_enabled=true",
|
||||||
"hapi.fhir.cr.enabled=true",
|
"hapi.fhir.cr.enabled=true",
|
||||||
"hapi.fhir.cr.caregaps.section_author=Organization/alphora-author",
|
"hapi.fhir.cr.caregaps.section_author=Organization/alphora-author",
|
||||||
@@ -230,7 +229,7 @@ class ExampleServerR4IT implements IServerSupport {
|
|||||||
IIdType mySubscriptionId = methodOutcome.getId();
|
IIdType mySubscriptionId = methodOutcome.getId();
|
||||||
|
|
||||||
// Wait for the subscription to be activated
|
// Wait for the subscription to be activated
|
||||||
await().atMost(1, TimeUnit.MINUTES).until(()->activeSubscriptionCount(), equalTo(initialActiveSubscriptionCount + 1));
|
await().atMost(1, TimeUnit.MINUTES).until(this::activeSubscriptionCount, equalTo(initialActiveSubscriptionCount + 1));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Attach websocket
|
* Attach websocket
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
package ca.uhn.fhir.jpa.starter;
|
|
||||||
|
|
||||||
import ca.uhn.fhir.jpa.api.config.JpaStorageSettings;
|
|
||||||
import org.hl7.fhir.dstu2.model.Subscription;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.context.annotation.Primary;
|
|
||||||
import org.springframework.context.annotation.Profile;
|
|
||||||
|
|
||||||
@Profile("storageSettingsTest")
|
|
||||||
@Configuration
|
|
||||||
public class JpaStorageSettingsConfig {
|
|
||||||
@Primary
|
|
||||||
@Bean
|
|
||||||
public JpaStorageSettings storageSettings() {
|
|
||||||
JpaStorageSettings retVal = new JpaStorageSettings();
|
|
||||||
|
|
||||||
retVal.addSupportedSubscriptionType(Subscription.SubscriptionChannelType.WEBSOCKET);
|
|
||||||
retVal.addSupportedSubscriptionType(Subscription.SubscriptionChannelType.MESSAGE);
|
|
||||||
return retVal;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -2,6 +2,7 @@ package ca.uhn.fhir.jpa.starter;
|
|||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
import ca.uhn.fhir.jpa.model.config.SubscriptionSettings;
|
||||||
import org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType;
|
import org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -21,9 +22,12 @@ class MdmTest {
|
|||||||
@Autowired
|
@Autowired
|
||||||
JpaStorageSettings jpaStorageSettings;
|
JpaStorageSettings jpaStorageSettings;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
SubscriptionSettings subscriptionSettings;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testApplicationStartedSuccessfully() {
|
void testApplicationStartedSuccessfully() {
|
||||||
assertThat(nicknameService).isNotNull();
|
assertThat(nicknameService).isNotNull();
|
||||||
assertThat(jpaStorageSettings.getSupportedSubscriptionTypes()).contains(SubscriptionChannelType.MESSAGE);
|
assertThat(subscriptionSettings.getSupportedSubscriptionTypes()).contains(SubscriptionChannelType.MESSAGE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ Content-Type: application/json
|
|||||||
});
|
});
|
||||||
const batch_patient_location = response.body.entry[0].response.location;
|
const batch_patient_location = response.body.entry[0].response.location;
|
||||||
const indexOfHistory = batch_patient_location.lastIndexOf("/_history");
|
const indexOfHistory = batch_patient_location.lastIndexOf("/_history");
|
||||||
trimmed_location = batch_patient_location.substring(0, indexOfHistory);
|
var trimmed_location = batch_patient_location.substring(0, indexOfHistory);
|
||||||
trimmed_location = trimmed_location.replace("Patient/", "")
|
trimmed_location = trimmed_location.replace("Patient/", "")
|
||||||
client.global.set("batch_patient_id", trimmed_location);
|
client.global.set("batch_patient_id", trimmed_location);
|
||||||
%}
|
%}
|
||||||
|
|||||||
Reference in New Issue
Block a user