Merge pull request #72 from hapifhir/rel_4_2_0

Start 4.2.0 release branch
This commit is contained in:
James Agnew
2020-02-16 09:40:57 -05:00
committed by GitHub
6 changed files with 413 additions and 386 deletions

View File

@@ -11,7 +11,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId> <artifactId>hapi-fhir</artifactId>
<version>4.1.0</version> <version>4.2.0</version>
</parent> </parent>
<artifactId>hapi-fhir-jpaserver-starter</artifactId> <artifactId>hapi-fhir-jpaserver-starter</artifactId>
@@ -276,7 +276,7 @@
<plugin> <plugin>
<groupId>org.eclipse.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId> <artifactId>jetty-maven-plugin</artifactId>
<version>9.4.22.v20191022</version> <version>${jetty_version}</version>
<configuration> <configuration>
<webApp> <webApp>
<contextPath>/hapi-fhir-jpaserver</contextPath> <contextPath>/hapi-fhir-jpaserver</contextPath>

View File

@@ -173,7 +173,13 @@ public class FhirServerConfigCommon {
@Lazy @Lazy
@Bean @Bean
public IBinaryStorageSvc binaryStorageSvc() { public IBinaryStorageSvc binaryStorageSvc() {
return new DatabaseBlobBinaryStorageSvcImpl(); DatabaseBlobBinaryStorageSvcImpl binaryStorageSvc = new DatabaseBlobBinaryStorageSvcImpl();
if (HapiProperties.getMaxBinarySize() != null) {
binaryStorageSvc.setMaximumBinarySize(HapiProperties.getMaxBinarySize());
}
return binaryStorageSvc;
} }
@Bean() @Bean()

View File

@@ -19,7 +19,9 @@ import java.util.Properties;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static org.apache.commons.lang3.StringUtils.*; import static org.apache.commons.lang3.StringUtils.defaultString;
import static org.apache.commons.lang3.StringUtils.isNotBlank;
import static org.apache.commons.lang3.StringUtils.trim;
public class HapiProperties { public class HapiProperties {
static final String ENABLE_INDEX_MISSING_FIELDS = "enable_index_missing_fields"; static final String ENABLE_INDEX_MISSING_FIELDS = "enable_index_missing_fields";
@@ -64,12 +66,13 @@ public class HapiProperties {
static final String ALLOW_CONTAINS_SEARCHES = "allow_contains_searches"; static final String ALLOW_CONTAINS_SEARCHES = "allow_contains_searches";
static final String ALLOW_OVERRIDE_DEFAULT_SEARCH_PARAMS = "allow_override_default_search_params"; static final String ALLOW_OVERRIDE_DEFAULT_SEARCH_PARAMS = "allow_override_default_search_params";
static final String EMAIL_FROM = "email.from"; static final String EMAIL_FROM = "email.from";
private static final String VALIDATE_REQUESTS_ENABLED = "validation.requests.enabled"; static final String VALIDATE_REQUESTS_ENABLED = "validation.requests.enabled";
private static final String VALIDATE_RESPONSES_ENABLED = "validation.responses.enabled"; static final String VALIDATE_RESPONSES_ENABLED = "validation.responses.enabled";
private static final String FILTER_SEARCH_ENABLED = "filter_search.enabled"; static final String FILTER_SEARCH_ENABLED = "filter_search.enabled";
private static final String GRAPHQL_ENABLED = "graphql.enabled"; static final String GRAPHQL_ENABLED = "graphql.enabled";
private static final String BULK_EXPORT_ENABLED = "bulk.export.enabled"; static final String BULK_EXPORT_ENABLED = "bulk.export.enabled";
public static final String EXPIRE_SEARCH_RESULTS_AFTER_MINS = "retain_cached_searches_mins"; static final String EXPIRE_SEARCH_RESULTS_AFTER_MINS = "retain_cached_searches_mins";
static final String MAX_BINARY_SIZE = "max_binary_size";
private static Properties ourProperties; private static Properties ourProperties;
public static boolean isElasticSearchEnabled() { public static boolean isElasticSearchEnabled() {
@@ -403,10 +406,21 @@ public class HapiProperties {
} }
// Defaults from https://javaee.github.io/javamail/docs/api/com/sun/mail/smtp/package-summary.html // Defaults from https://javaee.github.io/javamail/docs/api/com/sun/mail/smtp/package-summary.html
public static Boolean getEmailAuth() { return HapiProperties.getBooleanProperty("email.auth", false); } public static Boolean getEmailAuth() {
public static Boolean getEmailStartTlsEnable() { return HapiProperties.getBooleanProperty("email.starttls.enable", false); } return HapiProperties.getBooleanProperty("email.auth", false);
public static Boolean getEmailStartTlsRequired() { return HapiProperties.getBooleanProperty("email.starttls.required", false); } }
public static Boolean getEmailQuitWait() { return HapiProperties.getBooleanProperty("email.quitwait", true); }
public static Boolean getEmailStartTlsEnable() {
return HapiProperties.getBooleanProperty("email.starttls.enable", false);
}
public static Boolean getEmailStartTlsRequired() {
return HapiProperties.getBooleanProperty("email.starttls.required", false);
}
public static Boolean getEmailQuitWait() {
return HapiProperties.getBooleanProperty("email.quitwait", true);
}
public static Long getReuseCachedSearchResultsMillis() { public static Long getReuseCachedSearchResultsMillis() {
String value = HapiProperties.getProperty(REUSE_CACHED_SEARCH_RESULTS_MILLIS, "60000"); String value = HapiProperties.getProperty(REUSE_CACHED_SEARCH_RESULTS_MILLIS, "60000");
@@ -453,6 +467,11 @@ public class HapiProperties {
public static boolean getEnableIndexMissingFields() { public static boolean getEnableIndexMissingFields() {
return HapiProperties.getBooleanProperty(ENABLE_INDEX_MISSING_FIELDS, false); return HapiProperties.getBooleanProperty(ENABLE_INDEX_MISSING_FIELDS, false);
} }
public static Integer getMaxBinarySize() {
return getIntegerProperty(MAX_BINARY_SIZE, null);
}
private static boolean getPropertyBoolean(String thePropertyName, boolean theDefaultValue) { private static boolean getPropertyBoolean(String thePropertyName, boolean theDefaultValue) {
String value = getProperty(thePropertyName, Boolean.toString(theDefaultValue)); String value = getProperty(thePropertyName, Boolean.toString(theDefaultValue));
return Boolean.parseBoolean(value); return Boolean.parseBoolean(value);

View File

@@ -43,6 +43,11 @@ server.name=Local Tester
server.id=home server.id=home
test.port= test.port=
###################################################
# Binary Storage (104857600 = 100mb)
###################################################
max_binary_size=104857600
################################################### ###################################################
# Validation # Validation
################################################### ###################################################

View File

@@ -43,6 +43,8 @@ public class ExampleServerDstu3IT {
HapiProperties.setProperty(HapiProperties.FHIR_VERSION, "DSTU3"); HapiProperties.setProperty(HapiProperties.FHIR_VERSION, "DSTU3");
HapiProperties.setProperty(HapiProperties.DATASOURCE_URL, "jdbc:h2:mem:dbr3"); HapiProperties.setProperty(HapiProperties.DATASOURCE_URL, "jdbc:h2:mem:dbr3");
HapiProperties.setProperty(HapiProperties.SUBSCRIPTION_WEBSOCKET_ENABLED, "true"); HapiProperties.setProperty(HapiProperties.SUBSCRIPTION_WEBSOCKET_ENABLED, "true");
HapiProperties.setProperty(HapiProperties.ALLOW_EXTERNAL_REFERENCES, "true");
HapiProperties.setProperty(HapiProperties.ALLOW_PLACEHOLDER_REFERENCES, "true");
ourCtx = FhirContext.forDstu3(); ourCtx = FhirContext.forDstu3();
} }

View File

@@ -14,12 +14,7 @@ import org.eclipse.jetty.websocket.api.Session;
import org.eclipse.jetty.websocket.client.ClientUpgradeRequest; import org.eclipse.jetty.websocket.client.ClientUpgradeRequest;
import org.eclipse.jetty.websocket.client.WebSocketClient; import org.eclipse.jetty.websocket.client.WebSocketClient;
import org.hl7.fhir.instance.model.api.IIdType; import org.hl7.fhir.instance.model.api.IIdType;
import org.hl7.fhir.r5.model.Bundle; import org.hl7.fhir.r5.model.*;
import org.hl7.fhir.r5.model.Observation;
import org.hl7.fhir.r5.model.Patient;
import org.hl7.fhir.r5.model.Subscription;
import org.hl7.fhir.r5.model.Topic;
import org.hl7.fhir.r5.model.codesystems.SubscriptionChannelType;
import org.junit.AfterClass; import org.junit.AfterClass;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
@@ -80,8 +75,8 @@ public class ExampleServerR5IT {
Subscription.SubscriptionChannelComponent channel = new Subscription.SubscriptionChannelComponent(); Subscription.SubscriptionChannelComponent channel = new Subscription.SubscriptionChannelComponent();
channel.getType().addCoding() channel.getType().addCoding()
.setSystem(SubscriptionChannelType.WEBSOCKET.getSystem()) .setSystem("http://terminology.hl7.org/CodeSystem/subscription-channel-type")
.setCode(SubscriptionChannelType.WEBSOCKET.toCode()); .setCode("websocket");
channel.getPayload().setContentType("application/json"); channel.getPayload().setContentType("application/json");
subscription.setChannel(channel); subscription.setChannel(channel);
@@ -111,7 +106,7 @@ public class ExampleServerR5IT {
* Create a matching resource * Create a matching resource
*/ */
Observation obs = new Observation(); Observation obs = new Observation();
obs.setStatus(Observation.ObservationStatus.FINAL); obs.setStatus(Enumerations.ObservationStatus.FINAL);
ourClient.create().resource(obs).execute(); ourClient.create().resource(obs).execute();
// Give some time for the subscription to deliver // Give some time for the subscription to deliver