diff --git a/README.md b/README.md
index 694f1ce..70c67ed 100644
--- a/README.md
+++ b/README.md
@@ -137,3 +137,18 @@ The server may be configured with subscription support by enabling properties in
* `subscription.email.enabled` - Enables email subscriptions. Note that you must also provide the connection details for a usable SMTP server.
* `subscription.websocket.enabled` - Enables websocket subscriptions. With this enabled, your server will accept incoming websocket connections on the following URL (this example uses the default context path and port, you may need to tweak depending on your deployment environment): [ws://localhost:8080/hapi-fhir-jpaserver/websocket](ws://localhost:8080/hapi-fhir-jpaserver/websocket)
+
+# Using ElasticSearch
+
+By default, the server will use embedded lucene indexes for terminology and fulltext indexing purposes. You can switch this to using lucene by editing the properties in [hapi.properties](https://github.com/hapifhir/hapi-fhir-jpaserver-starter/blob/master/src/main/resources/hapi.properties)
+
+For example:
+
+```properties
+elasticsearch.enabled=true
+elasticsearch.rest_url=http://localhost:9200
+elasticsearch.username=SomeUsername
+elasticsearch.password=SomePassword
+elasticsearch.required_index_status=YELLOW
+elasticsearch.schema_management_strategy=CREATE
+```
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 7362f60..b14ae08 100644
--- a/pom.xml
+++ b/pom.xml
@@ -11,10 +11,9 @@
ca.uhn.hapi.fhir
hapi-fhir
- 4.0.3
+ 4.1.0
- ca.uhn.hapi.fhir
hapi-fhir-jpaserver-starter
@@ -73,14 +72,6 @@
org.springframework
spring-jcl
-
-
-
-
- ca.uhn.hapi.fhir
- hapi-fhir-jpaserver-elasticsearch
- ${project.version}
-
commons-logging
commons-logging
@@ -150,6 +141,48 @@
h2
+
+
+ org.webjars
+ bootstrap
+ 3.3.7
+
+
+ org.webjars
+ Eonasdan-bootstrap-datetimepicker
+ 4.17.43
+
+
+ org.webjars
+ font-awesome
+ 5.8.2
+
+
+ org.webjars.bower
+ awesome-bootstrap-checkbox
+ 1.0.1
+
+
+ org.webjars
+ jstimezonedetect
+ 1.0.6
+
+
+ org.webjars
+ select2
+ 4.0.3
+
+
+ org.webjars.bower
+ jquery
+ 3.3.1
+
+
+ org.webjars.bower
+ moment
+ 2.15.1
+
+
org.eclipse.jetty
diff --git a/pom.xml.orig b/pom.xml.orig
index a2e30af..79261e4 100644
--- a/pom.xml.orig
+++ b/pom.xml.orig
@@ -12,27 +12,17 @@
ca.uhn.hapi.fhir
hapi-fhir
<<<<<<< HEAD
- 3.7.0
+ 4.1.0
=======
- 3.7.0-SNAPSHOT
->>>>>>> 18c85900e500863b2b24080da9fe5e11c6d0a434
+ 4.0.3
+>>>>>>> master
- ca.uhn.hapi.fhir.demo
hapi-fhir-jpaserver-starter
- war
- HAPI FHIR JPA Server - Starter Project
-
-
-
- oss-snapshots
-
- true
-
- https://oss.sonatype.org/content/repositories/snapshots/
-
-
+
+ 3.5.0
+
@@ -48,9 +38,27 @@
mysql
mysql-connector-java
- 6.0.5
+ 8.0.11
+
+
+ com.sun.mail
+ javax.mail
+
+
+ javax.activation
+ activation
+
+
+
+
+
ca.uhn.hapi.fhir
@@ -58,24 +66,21 @@
${project.version}
-
-
- ca.uhn.hapi.fhir
- hapi-fhir-structures-dstu3
- ${project.version}
-
-
ca.uhn.hapi.fhir
hapi-fhir-jpaserver-base
${project.version}
-
-
-
- ca.uhn.hapi.fhir
- hapi-fhir-jpaserver-elasticsearch
- ${project.version}
+
+
+ org.springframework
+ spring-jcl
+
+
+ commons-logging
+ commons-logging
+
+
@@ -115,17 +120,6 @@
-
- org.ebaysf.web
- cors-filter
-
-
- servlet-api
- javax.servlet
-
-
-
-
org.springframework
@@ -136,21 +130,61 @@
org.apache.commons
commons-dbcp2
+
+
+ commons-logging
+ commons-logging
+
+
-
- org.apache.derby
- derby
+ com.h2database
+ h2
+
+
+
+
+ org.webjars
+ bootstrap
+ 3.3.7
- org.apache.derby
- derbynet
+ org.webjars
+ Eonasdan-bootstrap-datetimepicker
+ 4.17.43
- org.apache.derby
- derbyclient
+ org.webjars
+ font-awesome
+ 5.8.2
+
+
+ org.webjars.bower
+ awesome-bootstrap-checkbox
+ 1.0.1
+
+
+ org.webjars
+ jstimezonedetect
+ 1.0.6
+
+
+ org.webjars
+ select2
+ 4.0.3
+
+
+ org.webjars.bower
+ jquery
+ 3.3.1
+
+
+ org.webjars.bower
+ moment
+ 2.15.1
@@ -184,6 +218,7 @@
jetty-webapp
test
+
hapi-fhir-jpaserver
-
-
-
-
- org.eclipse.jetty
- jetty-maven-plugin
- 9.4.8.v20180619
-
-
- /hapi-fhir-jpaserver
- true
-
-
-
-
-
-
+
+
+ org.eclipse.jetty
+ jetty-maven-plugin
+ 9.4.8.v20180619
+
+
+ /hapi-fhir-jpaserver
+ true
+
+
+
+
org.apache.maven.plugins
@@ -259,15 +313,6 @@
-
-
- org.apache.maven.plugins
- maven-deploy-plugin
-
- true
-
-
-
org.apache.maven.plugins
@@ -285,6 +330,100 @@
+
+ org.basepom.maven
+ duplicate-finder-maven-plugin
+
+
+ default
+ verify
+
+ check
+
+ true
+
+
+
+ true
+ false
+
+
+
+ .*\.txt$
+ .*\.html$
+
+
+
+
+
diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/FhirServerConfigCommon.java b/src/main/java/ca/uhn/fhir/jpa/starter/FhirServerConfigCommon.java
index 6a0c818..ace86a1 100644
--- a/src/main/java/ca/uhn/fhir/jpa/starter/FhirServerConfigCommon.java
+++ b/src/main/java/ca/uhn/fhir/jpa/starter/FhirServerConfigCommon.java
@@ -4,7 +4,7 @@ import ca.uhn.fhir.jpa.binstore.DatabaseBlobBinaryStorageSvcImpl;
import ca.uhn.fhir.jpa.binstore.IBinaryStorageSvc;
import ca.uhn.fhir.jpa.dao.DaoConfig;
import ca.uhn.fhir.jpa.model.entity.ModelConfig;
-import ca.uhn.fhir.jpa.subscription.module.cache.SubscriptionDeliveryHandlerFactory;
+import ca.uhn.fhir.jpa.subscription.module.channel.SubscriptionDeliveryHandlerFactory;
import ca.uhn.fhir.jpa.subscription.module.subscriber.email.IEmailSender;
import ca.uhn.fhir.jpa.subscription.module.subscriber.email.JavaMailEmailSender;
import org.apache.commons.dbcp2.BasicDataSource;
diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/FhirServerConfigDstu2.java b/src/main/java/ca/uhn/fhir/jpa/starter/FhirServerConfigDstu2.java
index 3255de7..dc91099 100644
--- a/src/main/java/ca/uhn/fhir/jpa/starter/FhirServerConfigDstu2.java
+++ b/src/main/java/ca/uhn/fhir/jpa/starter/FhirServerConfigDstu2.java
@@ -43,7 +43,7 @@ public class FhirServerConfigDstu2 extends BaseJavaConfigDstu2 {
throw new ConfigurationException("Could not set the data source due to a configuration issue", e);
}
- retVal.setJpaProperties(HapiProperties.getProperties());
+ retVal.setJpaProperties(HapiProperties.getJpaProperties());
return retVal;
}
diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/FhirServerConfigDstu3.java b/src/main/java/ca/uhn/fhir/jpa/starter/FhirServerConfigDstu3.java
index 7cf6996..3344952 100644
--- a/src/main/java/ca/uhn/fhir/jpa/starter/FhirServerConfigDstu3.java
+++ b/src/main/java/ca/uhn/fhir/jpa/starter/FhirServerConfigDstu3.java
@@ -43,7 +43,7 @@ public class FhirServerConfigDstu3 extends BaseJavaConfigDstu3 {
throw new ConfigurationException("Could not set the data source due to a configuration issue", e);
}
- retVal.setJpaProperties(HapiProperties.getProperties());
+ retVal.setJpaProperties(HapiProperties.getJpaProperties());
return retVal;
}
diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/FhirServerConfigR4.java b/src/main/java/ca/uhn/fhir/jpa/starter/FhirServerConfigR4.java
index abf6938..77a798e 100644
--- a/src/main/java/ca/uhn/fhir/jpa/starter/FhirServerConfigR4.java
+++ b/src/main/java/ca/uhn/fhir/jpa/starter/FhirServerConfigR4.java
@@ -43,7 +43,7 @@ public class FhirServerConfigR4 extends BaseJavaConfigR4 {
throw new ConfigurationException("Could not set the data source due to a configuration issue", e);
}
- retVal.setJpaProperties(HapiProperties.getProperties());
+ retVal.setJpaProperties(HapiProperties.getJpaProperties());
return retVal;
}
diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/FhirServerConfigR5.java b/src/main/java/ca/uhn/fhir/jpa/starter/FhirServerConfigR5.java
index e176080..6d9e45b 100644
--- a/src/main/java/ca/uhn/fhir/jpa/starter/FhirServerConfigR5.java
+++ b/src/main/java/ca/uhn/fhir/jpa/starter/FhirServerConfigR5.java
@@ -1,7 +1,6 @@
package ca.uhn.fhir.jpa.starter;
import ca.uhn.fhir.context.ConfigurationException;
-import ca.uhn.fhir.jpa.config.BaseJavaConfigR4;
import ca.uhn.fhir.jpa.config.BaseJavaConfigR5;
import ca.uhn.fhir.jpa.search.DatabaseBackedPagingProvider;
import org.springframework.beans.factory.annotation.Autowired;
@@ -44,7 +43,7 @@ public class FhirServerConfigR5 extends BaseJavaConfigR5 {
throw new ConfigurationException("Could not set the data source due to a configuration issue", e);
}
- retVal.setJpaProperties(HapiProperties.getProperties());
+ retVal.setJpaProperties(HapiProperties.getJpaProperties());
return retVal;
}
diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/HapiProperties.java b/src/main/java/ca/uhn/fhir/jpa/starter/HapiProperties.java
index 02f6581..4ee0e48 100644
--- a/src/main/java/ca/uhn/fhir/jpa/starter/HapiProperties.java
+++ b/src/main/java/ca/uhn/fhir/jpa/starter/HapiProperties.java
@@ -2,9 +2,13 @@ package ca.uhn.fhir.jpa.starter;
import ca.uhn.fhir.context.ConfigurationException;
import ca.uhn.fhir.context.FhirVersionEnum;
+import ca.uhn.fhir.jpa.search.elastic.ElasticsearchHibernatePropertiesBuilder;
import ca.uhn.fhir.rest.api.EncodingEnum;
import ca.uhn.fhir.rest.server.ETagSupportEnum;
import com.google.common.annotations.VisibleForTesting;
+import org.hibernate.search.elasticsearch.cfg.ElasticsearchIndexStatus;
+import org.hibernate.search.elasticsearch.cfg.IndexSchemaManagementStrategy;
+import org.jetbrains.annotations.NotNull;
import java.io.FileInputStream;
import java.io.InputStream;
@@ -62,13 +66,18 @@ public class HapiProperties {
private static final String VALIDATE_RESPONSES_ENABLED = "validation.responses.enabled";
private static final String FILTER_SEARCH_ENABLED = "filter_search.enabled";
private static final String GRAPHQL_ENABLED = "graphql.enabled";
- private static Properties properties;
+ private static final String BULK_EXPORT_ENABLED = "bulk.export.enabled";
+ private static Properties ourProperties;
+
+ public static boolean isElasticSearchEnabled() {
+ return HapiProperties.getPropertyBoolean("elasticsearch.enabled", false);
+ }
/*
* Force the configuration to be reloaded
*/
public static void forceReload() {
- properties = null;
+ ourProperties = null;
getProperties();
}
@@ -81,12 +90,40 @@ public class HapiProperties {
getProperties().setProperty(theKey, theValue);
}
- public static Properties getProperties() {
- if (properties == null) {
+ public static Properties getJpaProperties() {
+ Properties retVal = loadProperties();
+
+ if (isElasticSearchEnabled()) {
+ ElasticsearchHibernatePropertiesBuilder builder = new ElasticsearchHibernatePropertiesBuilder();
+ builder.setRequiredIndexStatus(getPropertyEnum("elasticsearch.required_index_status", ElasticsearchIndexStatus.class, ElasticsearchIndexStatus.YELLOW));
+ builder.setRestUrl(getProperty("elasticsearch.rest_url"));
+ builder.setUsername(getProperty("elasticsearch.username"));
+ builder.setPassword(getProperty("elasticsearch.password"));
+ builder.setIndexSchemaManagementStrategy(getPropertyEnum("elasticsearch.schema_management_strateg", IndexSchemaManagementStrategy.class, IndexSchemaManagementStrategy.CREATE));
+ builder.setDebugRefreshAfterWrite(getPropertyBoolean("elasticsearch.debug.refresh_after_write", false));
+ builder.setDebugPrettyPrintJsonLog(getPropertyBoolean("elasticsearch.debug.pretty_print_json_log", false));
+ builder.apply(retVal);
+ }
+
+ return retVal;
+ }
+
+ private static Properties getProperties() {
+ if (ourProperties == null) {
+ Properties properties = loadProperties();
+ HapiProperties.ourProperties = properties;
+ }
+
+ return ourProperties;
+ }
+
+ @NotNull
+ private static Properties loadProperties() {
// Load the configurable properties file
+ Properties properties;
try (InputStream in = HapiProperties.class.getClassLoader().getResourceAsStream(HAPI_PROPERTIES)) {
- HapiProperties.properties = new Properties();
- HapiProperties.properties.load(in);
+ properties = new Properties();
+ properties.load(in);
} catch (Exception e) {
throw new ConfigurationException("Could not load HAPI properties", e);
}
@@ -95,8 +132,6 @@ public class HapiProperties {
if (overrideProps != null) {
properties.putAll(overrideProps);
}
- }
-
return properties;
}
@@ -399,5 +434,18 @@ public class HapiProperties {
public static boolean getEnableIndexMissingFields() {
return HapiProperties.getBooleanProperty(ENABLE_INDEX_MISSING_FIELDS, false);
}
+ private static boolean getPropertyBoolean(String thePropertyName, boolean theDefaultValue) {
+ String value = getProperty(thePropertyName, Boolean.toString(theDefaultValue));
+ return Boolean.parseBoolean(value);
+ }
+
+ private static T getPropertyEnum(String thePropertyName, Class theEnumType, T theDefaultValue) {
+ String value = getProperty(thePropertyName, theDefaultValue.name());
+ return (T) Enum.valueOf(theEnumType, value);
+ }
+
+ public static boolean getBulkExportEnabled() {
+ return HapiProperties.getBooleanProperty(BULK_EXPORT_ENABLED, true);
+ }
}
diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/JpaRestfulServer.java b/src/main/java/ca/uhn/fhir/jpa/starter/JpaRestfulServer.java
index 7cad07c..625ac13 100644
--- a/src/main/java/ca/uhn/fhir/jpa/starter/JpaRestfulServer.java
+++ b/src/main/java/ca/uhn/fhir/jpa/starter/JpaRestfulServer.java
@@ -5,11 +5,16 @@ import ca.uhn.fhir.context.FhirVersionEnum;
import ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster;
import ca.uhn.fhir.interceptor.api.IInterceptorService;
import ca.uhn.fhir.jpa.binstore.BinaryStorageInterceptor;
+import ca.uhn.fhir.jpa.bulk.BulkDataExportProvider;
import ca.uhn.fhir.jpa.dao.DaoConfig;
import ca.uhn.fhir.jpa.dao.DaoRegistry;
import ca.uhn.fhir.jpa.dao.IFhirSystemDao;
import ca.uhn.fhir.jpa.interceptor.CascadingDeleteInterceptor;
-import ca.uhn.fhir.jpa.provider.*;
+import ca.uhn.fhir.jpa.provider.GraphQLProvider;
+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.JpaSystemProviderDstu3;
import ca.uhn.fhir.jpa.provider.r4.JpaConformanceProviderR4;
@@ -24,7 +29,11 @@ import ca.uhn.fhir.model.dstu2.composite.MetaDt;
import ca.uhn.fhir.narrative.DefaultThymeleafNarrativeGenerator;
import ca.uhn.fhir.rest.server.HardcodedServerAddressStrategy;
import ca.uhn.fhir.rest.server.RestfulServer;
-import ca.uhn.fhir.rest.server.interceptor.*;
+import ca.uhn.fhir.rest.server.interceptor.CorsInterceptor;
+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.validation.IValidatorModule;
import ca.uhn.fhir.validation.ResultSeverityEnum;
import java.util.HashSet;
@@ -273,6 +282,9 @@ public class JpaRestfulServer extends RestfulServer {
// Validation
IValidatorModule validatorModule;
switch (fhirVersion) {
+ case DSTU2:
+ validatorModule = appCtx.getBean("myInstanceValidatorDstu2", IValidatorModule.class);
+ break;
case DSTU3:
validatorModule = appCtx.getBean("myInstanceValidatorDstu3", IValidatorModule.class);
break;
@@ -282,6 +294,9 @@ public class JpaRestfulServer extends RestfulServer {
case R5:
validatorModule = appCtx.getBean("myInstanceValidatorR5", IValidatorModule.class);
break;
+ // These versions are not supported by HAPI FHIR JPA
+ case DSTU2_HL7ORG:
+ case DSTU2_1:
default:
validatorModule = null;
break;
@@ -319,5 +334,12 @@ public class JpaRestfulServer extends RestfulServer {
config.setBundleTypesAllowedForStorage(
Collections.unmodifiableSet(new TreeSet<>(allowedBundleTypes)));
}
- }
+
+ // Bulk Export
+ if (HapiProperties.getBulkExportEnabled()) {
+ registerProvider(appCtx.getBean(BulkDataExportProvider.class));
+ }
+
+ }
+
}
diff --git a/src/main/resources/hapi.properties b/src/main/resources/hapi.properties
index 9f51ca4..4702ca3 100644
--- a/src/main/resources/hapi.properties
+++ b/src/main/resources/hapi.properties
@@ -82,11 +82,34 @@ hibernate.search.default.indexBase=target/lucenefiles
hibernate.search.lucene_version=LUCENE_CURRENT
tester.config.refuse_to_fetch_third_party_urls=false
+##################################################
+# ElasticSearch
+# Note that using ElasticSearch is disabled by
+# default and the server will use Lucene instead.
+##################################################
+elasticsearch.enabled=false
+elasticsearch.rest_url=http://localhost:9200
+elasticsearch.username=SomeUsername
+elasticsearch.password=SomePassword
+elasticsearch.rest_url=http://localhost:9200
+elasticsearch.required_index_status=YELLOW
+elasticsearch.schema_management_strategy=CREATE
+# Immediately refresh indexes after every write. This is very bad for
+# performance, but can be helpful for testing.
+elasticsearch.debug.refresh_after_write=false
+elasticsearch.debug.pretty_print_json_log=false
+
+
##################################################
# Binary Storage Operations
##################################################
binary_storage.enabled=true
+##################################################
+# Bulk Data Specification
+##################################################
+bulk.export.enabled=true
+
##################################################
# CORS Settings
##################################################
diff --git a/src/main/webapp/WEB-INF/templates/tmpl-head.html b/src/main/webapp/WEB-INF/templates/tmpl-head.html
deleted file mode 100644
index 3d7bb4e..0000000
--- a/src/main/webapp/WEB-INF/templates/tmpl-head.html
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerR5IT.java b/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerR5IT.java
index 04aee05..7eff8b0 100644
--- a/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerR5IT.java
+++ b/src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerR5IT.java
@@ -14,10 +14,12 @@ import org.eclipse.jetty.websocket.api.Session;
import org.eclipse.jetty.websocket.client.ClientUpgradeRequest;
import org.eclipse.jetty.websocket.client.WebSocketClient;
import org.hl7.fhir.instance.model.api.IIdType;
-import org.hl7.fhir.r4.model.Bundle;
-import org.hl7.fhir.r4.model.Observation;
-import org.hl7.fhir.r4.model.Patient;
-import org.hl7.fhir.r4.model.Subscription;
+import org.hl7.fhir.r5.model.Bundle;
+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.BeforeClass;
import org.junit.Test;
@@ -43,7 +45,7 @@ public class ExampleServerR5IT {
HapiProperties.setProperty(HapiProperties.DATASOURCE_URL, "jdbc:h2:mem:dbr5");
HapiProperties.setProperty(HapiProperties.FHIR_VERSION, "R5");
HapiProperties.setProperty(HapiProperties.SUBSCRIPTION_WEBSOCKET_ENABLED, "true");
- ourCtx = FhirContext.forR4();
+ ourCtx = FhirContext.forR5();
}
@Test
@@ -61,17 +63,26 @@ public class ExampleServerR5IT {
@Test
public void testWebsocketSubscription() throws Exception {
+
+ /*
+ * Create topic
+ */
+ Topic topic = new Topic();
+ topic.getResourceTrigger().getQueryCriteria().setCurrent("Observation?status=final");
+
/*
* Create subscription
*/
Subscription subscription = new Subscription();
+ subscription.getTopic().setResource(topic);
subscription.setReason("Monitor new neonatal function (note, age will be determined by the monitor)");
subscription.setStatus(Subscription.SubscriptionStatus.REQUESTED);
- subscription.setCriteria("Observation?status=final");
Subscription.SubscriptionChannelComponent channel = new Subscription.SubscriptionChannelComponent();
- channel.setType(Subscription.SubscriptionChannelType.WEBSOCKET);
- channel.setPayload("application/json");
+ channel.getType().addCoding()
+ .setSystem(SubscriptionChannelType.WEBSOCKET.getSystem())
+ .setCode(SubscriptionChannelType.WEBSOCKET.toCode());
+ channel.getPayload().setContentType("application/json");
subscription.setChannel(channel);
MethodOutcome methodOutcome = ourClient.create().resource(subscription).execute();