diff --git a/README.md b/README.md
index 3693f3c..df6a13f 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@ Details about the actual mapping can be found [here](docs/mappings.md).
## Command
```sh
-docker run **VOLUMES** ghcr.io/num-codex/odm2fhir **ARGUMENTS**
+docker run **ENVIRONMENTS** **VOLUMES** ghcr.io/num-codex/odm2fhir **ARGUMENTS**
```
### Arguments
@@ -23,9 +23,11 @@ docker run **VOLUMES** ghcr.io/num-codex/odm2fhir **ARGUMENTS**
* `--fhir.identifier.assigner=**IDENTIFIER_ASSIGNER**` Add an identifier assigner.
-* `--fhir.updateascreate.enabled=true` Enable update-as-create (see [here](https://www.hl7.org/fhir/http.html#upsert)).
+* `--fhir.encounters.enabled=true` Enable encounters (enabled by default).
-* `--fhir.validation.enabled=true` Enable FHIR resource validation (see [here](#validation)).
+* `--fhir.updateascreate.enabled=true` Enable update-as-create (see [here](https://www.hl7.org/fhir/http.html#upsert), disabled by default).
+
+* `--fhir.validation.enabled=true` Enable FHIR resource validation (see [here](#validation), disabled by default).
* `--cron="**CRON_PATTERN**"` Enable timed execution (see [here](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/scheduling/support/CronSequenceGenerator.html)).
@@ -44,6 +46,12 @@ docker run **VOLUMES** ghcr.io/num-codex/odm2fhir **ARGUMENTS**
--odm.redcap.api.token=**ODM_REDCAP_API_TOKEN**
```
+#### HTTP(S) Proxy
+Enable HTTP(S) proxy by adding the environment to `**ENVIRONMENTS**`:
+```sh
+-e JAVA_TOOL_OPTIONS="-Dhttp.proxyHost=**HTTP_PROXY_HOST** -Dhttp.proxyPort=**HTTP_PROXY_PORT** -Dhttp.nonProxyHosts=**HTTP_NON_PROXY_HOSTS** -Dhttps.proxyHost=**HTTPS_PROXY_HOST** -Dhttps.proxyPort=**HTTPS_PROXY_PORT** -Dhttps.nonProxyHosts=**HTTPS_NON_PROXY_HOSTS**"
+```
+
#### PKCS12 Certificate
```sh
--odm.redcap.api.key.file.path=**ODM_REDCAP_API_KEY_FILE_PATH**
@@ -71,6 +79,9 @@ By default, all subjects within an ODM are processed. To process only subjects w
--odm.dis.rest.password=**ODM_DIS_REST_PASSWORD**
```
+#### HTTP(S) Proxy
+(see [here](#https-proxy))
+
#### PKCS12 Certificate
```sh
--odm.dis.rest.key.file.path=**ODM_DIS_REST_KEY_FILE_PATH**
@@ -91,6 +102,9 @@ By default, all subjects within an ODM are processed. To process only subjects w
--fhir.server.url=**FHIR_SERVER_URL**
```
+#### HTTP(S) Proxy
+(see [here](#https-proxy))
+
#### BasicAuth
```sh
--fhir.server.basicauth.username=**FHIR_SERVER_BASICAUTH_USERNAME**
@@ -120,6 +134,9 @@ Enable the use of an external terminology server by adding the argument(s) below
--fhir.terminologyserver.url=**FHIR_TERMINOLOGYSERVER_URL**
```
+#### HTTP(S) Proxy
+(see [here](#https-proxy))
+
#### BasicAuth
```sh
--fhir.terminologyserver.basicauth.username=**FHIR_TERMINOLOGYSERVER_BASICAUTH_USERNAME**
diff --git a/docs/index.md b/docs/index.md
index f8b9787..8f3108e 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -6,7 +6,7 @@ Details about the actual mapping can be found [here](mappings.md).
## Command
```sh
-docker run **VOLUMES** ghcr.io/num-codex/odm2fhir **ARGUMENTS**
+docker run **ENVIRONMENTS** **VOLUMES** ghcr.io/num-codex/odm2fhir **ARGUMENTS**
```
### Arguments
@@ -23,9 +23,11 @@ docker run **VOLUMES** ghcr.io/num-codex/odm2fhir **ARGUMENTS**
* `--fhir.identifier.assigner=**IDENTIFIER_ASSIGNER**` Add an identifier assigner.
-* `--fhir.updateascreate.enabled=true` Enable update-as-create (see [here](https://www.hl7.org/fhir/http.html#upsert)).
+* `--fhir.encounters.enabled=true` Enable encounters (enabled by default).
-* `--fhir.validation.enabled=true` Enable FHIR resource validation (see [here](#validation)).
+* `--fhir.updateascreate.enabled=true` Enable update-as-create (see [here](https://www.hl7.org/fhir/http.html#upsert), disabled by default).
+
+* `--fhir.validation.enabled=true` Enable FHIR resource validation (see [here](#validation), disabled by default).
* `--cron="**CRON_PATTERN**"` Enable timed execution (see [here](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/scheduling/support/CronSequenceGenerator.html)).
@@ -44,6 +46,12 @@ docker run **VOLUMES** ghcr.io/num-codex/odm2fhir **ARGUMENTS**
--odm.redcap.api.token=**ODM_REDCAP_API_TOKEN**
```
+#### HTTP(S) Proxy
+Enable HTTP(S) proxy by adding the environment to `**ENVIRONMENTS**`:
+```sh
+-e JAVA_TOOL_OPTIONS="-Dhttp.proxyHost=**HTTP_PROXY_HOST** -Dhttp.proxyPort=**HTTP_PROXY_PORT** -Dhttp.nonProxyHosts=**HTTP_NON_PROXY_HOSTS** -Dhttps.proxyHost=**HTTPS_PROXY_HOST** -Dhttps.proxyPort=**HTTPS_PROXY_PORT** -Dhttps.nonProxyHosts=**HTTPS_NON_PROXY_HOSTS**"
+```
+
#### PKCS12 Certificate
```sh
--odm.redcap.api.key.file.path=**ODM_REDCAP_API_KEY_FILE_PATH**
@@ -71,6 +79,9 @@ By default, all subjects within an ODM are processed. To process only subjects w
--odm.dis.rest.password=**ODM_DIS_REST_PASSWORD**
```
+#### HTTP(S) Proxy
+(see [here](#https-proxy))
+
#### PKCS12 Certificate
```sh
--odm.dis.rest.key.file.path=**ODM_DIS_REST_KEY_FILE_PATH**
@@ -91,6 +102,9 @@ By default, all subjects within an ODM are processed. To process only subjects w
--fhir.server.url=**FHIR_SERVER_URL**
```
+#### HTTP(S) Proxy
+(see [here](#https-proxy))
+
#### BasicAuth
```sh
--fhir.server.basicauth.username=**FHIR_SERVER_BASICAUTH_USERNAME**
@@ -120,6 +134,9 @@ Enable the use of an external terminology server by adding the argument(s) below
--fhir.terminologyserver.url=**FHIR_TERMINOLOGYSERVER_URL**
```
+#### HTTP(S) Proxy
+(see [here](#https-proxy))
+
#### BasicAuth
```sh
--fhir.terminologyserver.basicauth.username=**FHIR_TERMINOLOGYSERVER_BASICAUTH_USERNAME**
diff --git a/pom.xml b/pom.xml
index 98f89c4..c20ea88 100644
--- a/pom.xml
+++ b/pom.xml
@@ -8,7 +8,7 @@
de.difuture.uds
odm2fhir
- 0.7.1
+ 0.7.2
ODM2FHIR
Mapper for GECCO based study/patient data in CDISC ODM to HL7 FHIR
@@ -16,7 +16,7 @@
org.springframework.boot
spring-boot-starter-parent
- 2.5.6
+ 2.6.0
@@ -25,7 +25,7 @@
UTF-8
UTF-8
- 5.5.3
+ 5.6.0
2.13.0
1.18.22
${project.parent.version}
@@ -74,6 +74,11 @@
jackson-dataformat-xml
${jackson.version}
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-csv
+ ${jackson.version}
+
com.fasterxml.woodstox
woodstox-core
@@ -111,6 +116,9 @@
${GITHUB_CONTAINER_REGISTRY_URL}/${project.artifactId}:${project.version}
true
+
+ ${GITHUB_CONTAINER_REGISTRY_URL}/${project.artifactId}:latest
+
-XX:MaxDirectMemorySize=265m
diff --git a/src/main/java/de/difuture/uds/odm2fhir/fhir/mapper/StudyEvent.java b/src/main/java/de/difuture/uds/odm2fhir/fhir/mapper/StudyEvent.java
index 96c9182..9976778 100644
--- a/src/main/java/de/difuture/uds/odm2fhir/fhir/mapper/StudyEvent.java
+++ b/src/main/java/de/difuture/uds/odm2fhir/fhir/mapper/StudyEvent.java
@@ -91,7 +91,8 @@ public Stream map(Subject subject, StudyEventData studyEventData
var encounter = new Encounter();
- if (containsAny(studyEventData.getStudyEventOID(), "GECCOVISIT", "fall")) {
+ if (ENVIRONMENT.getProperty("fhir.encounters.enabled", Boolean.class, true) &&
+ containsAny(studyEventData.getStudyEventOID(), "GECCOVISIT", "fall")) {
var value = format("%s-%s.%s",
studyEventData.getSubjectData().getSubjectKey(),
studyEventData.getStudyEventOID(), studyEventData.getStudyEventRepeatKey());
diff --git a/src/main/java/de/difuture/uds/odm2fhir/util/HTTPHelper.java b/src/main/java/de/difuture/uds/odm2fhir/util/HTTPHelper.java
index 0d015cb..e9d7840 100644
--- a/src/main/java/de/difuture/uds/odm2fhir/util/HTTPHelper.java
+++ b/src/main/java/de/difuture/uds/odm2fhir/util/HTTPHelper.java
@@ -63,6 +63,9 @@ public void setHttpClient(Environment environment) throws Exception {
}));
HTTP_CLIENT = HttpClientBuilder.create()
+ .useSystemProperties()
+ .setMaxConnTotal(100)
+ .setMaxConnPerRoute(100)
.setSSLContext(sslContextBuilder.build())
.setSSLHostnameVerifier(new NoopHostnameVerifier())
.build();
@@ -74,12 +77,11 @@ public static IClientInterceptor createAuthInterceptor(String basicauthUsername,
IClientInterceptor clientInterceptor = new BasicAuthInterceptor(basicauthUsername, basicauthPassword);
if (isNoneBlank(oauth2TokenURL, oauth2ClientId, oauth2ClientSecret)) {
- var httpPost = RequestBuilder
- .post(oauth2TokenURL)
- .addParameter("grant_type", "client_credentials")
- .addParameter("client_id", oauth2ClientId)
- .addParameter("client_secret", oauth2ClientSecret)
- .build();
+ var httpPost = RequestBuilder.post(oauth2TokenURL)
+ .addParameter("grant_type", "client_credentials")
+ .addParameter("client_id", oauth2ClientId)
+ .addParameter("client_secret", oauth2ClientSecret)
+ .build();
var content = HTTP_CLIENT.execute(httpPost).getEntity().getContent();
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index 687cdaf..c82bb12 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -8,13 +8,20 @@ odm:
# url: http://redcap/api/
# token: 12345ABCDE67890ABCDE12345ABCDEF0
# patientspercall: 1
+# key:
+# file.path: /some/path/client_certificate.p12
+# password: change-password
# dis.rest:
# url: http://dis/m4export/resteasy/export
# studyname: COVID_GECCO
# username: gecco
# password: gecco
+# key:
+# file.path: /some/path/client_certificate.p12
+# password: change-password
fhir:
+# encounters.enabled: true
# updateascreate.enabled: true
# validation:
# enabled: true
@@ -31,6 +38,9 @@ fhir:
# client:
# id: fhir
# secret: 1234567890
+# key:
+# file.path: /some/path/client_certificate.p12
+# password: change-password
# terminologyserver:
# url: https://fhir-server:9443/fhir-server/api/v4/
# basicauth:
@@ -41,6 +51,9 @@ fhir:
# client:
# id: fhir
# secret: 1234567890
+# key:
+# file.path: /some/path/client_certificate.p12
+# password: change-password
# identifier:
# assigner: Mein Krankenhaus
# system: