From 262b9bd62e84571be2d61c21c4a50aed48e99cd2 Mon Sep 17 00:00:00 2001
From: "p.delpy@dkfz-heidelberg.de"
Date: Wed, 11 Oct 2023 08:09:49 +0200
Subject: [PATCH] add adt2fhir-rest service
---
ccp/modules/adt2fhir-rest-compose.yml | 18 ++++++++++++++++++
ccp/modules/adt2fhir-rest-setup.sh | 11 +++++++++++
ccp/modules/id-management-setup.sh | 1 +
ccp/modules/mtba-setup.sh | 17 ++++++++---------
ccp/modules/nngm-setup.sh | 2 +-
ccp/vars | 3 ++-
6 files changed, 41 insertions(+), 11 deletions(-)
create mode 100644 ccp/modules/adt2fhir-rest-compose.yml
create mode 100644 ccp/modules/adt2fhir-rest-setup.sh
diff --git a/ccp/modules/adt2fhir-rest-compose.yml b/ccp/modules/adt2fhir-rest-compose.yml
new file mode 100644
index 0000000..bba8163
--- /dev/null
+++ b/ccp/modules/adt2fhir-rest-compose.yml
@@ -0,0 +1,18 @@
+version: "3.7"
+
+services:
+ adt2fhir-rest:
+ container_name: bridgehead-adt2fhir-rest
+ image: docker.verbis.dkfz.de/ccp/adt2fhir-rest:main
+ environment:
+ IDTYPE: BK_${IDMANAGEMENT_FRIENDLY_ID}_L-ID
+ MAINZELLISTE_APIKEY: ${IDMANAGER_LOCAL_PATIENTLIST_APIKEY}
+ SALT: ${LOCAL_SALT}
+ restart: always
+ labels:
+ - "traefik.enable=true"
+ - "traefik.http.routers.adt2fhir-rest.rule=PathPrefix(`/adt2fhir-rest`)"
+ - "traefik.http.middlewares.adt2fhir-rest_strip.stripprefix.prefixes=/adt2fhir-rest"
+ - "traefik.http.services.adt2fhir-rest.loadbalancer.server.port=8080"
+ - "traefik.http.routers.adt2fhir-rest.tls=true"
+ - "traefik.http.routers.adt2fhir-rest.middlewares=adt2fhir-rest_strip,auth"
\ No newline at end of file
diff --git a/ccp/modules/adt2fhir-rest-setup.sh b/ccp/modules/adt2fhir-rest-setup.sh
new file mode 100644
index 0000000..5003bd3
--- /dev/null
+++ b/ccp/modules/adt2fhir-rest-setup.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+if [ -n "$ENABLE_ADT2FHIR_REST" ]; then
+ log INFO "ADT2FHIR-REST setup detected -- will start adt2fhir-rest API."
+ if [ ! -n "$IDMANAGER_LOCAL_PATIENTLIST_APIKEY" ]; then
+ log ERROR "Missing ID-Management Module! Fix this by setting up ID Management:"
+ exit 1;
+ fi
+ OVERRIDE+=" -f ./$PROJECT/modules/adt2fhir-rest-compose.yml"
+ LOCAL_SALT="$(echo \"local-random-salt\" | openssl pkeyutl -sign -inkey /etc/bridgehead/pki/${SITE_ID}.priv.pem | base64 | head -c 30)"
+fi
diff --git a/ccp/modules/id-management-setup.sh b/ccp/modules/id-management-setup.sh
index 1e24891..1b347e7 100644
--- a/ccp/modules/id-management-setup.sh
+++ b/ccp/modules/id-management-setup.sh
@@ -39,6 +39,7 @@ function applySpecialCases() {
result="$1";
result="${result/Lmu/LMU}";
result="${result/Tum/TUM}";
+ result="${result/Dktk Test/Teststandort}";
echo "$result";
}
diff --git a/ccp/modules/mtba-setup.sh b/ccp/modules/mtba-setup.sh
index c0834b9..ac050e0 100644
--- a/ccp/modules/mtba-setup.sh
+++ b/ccp/modules/mtba-setup.sh
@@ -1,13 +1,12 @@
#!/bin/bash
function mtbaSetup() {
- # TODO: Check if ID-Management Module is activated!
- if [ -n "$ENABLE_MTBA" ];then
- log INFO "MTBA setup detected -- will start MTBA Service and CBioPortal."
- if [ ! -n "$IDMANAGER_UPLOAD_APIKEY" ]; then
- log ERROR "Detected MTBA Module configuration but ID-Management Module seems not to be configured!"
- exit 1;
- fi
- OVERRIDE+=" -f ./$PROJECT/modules/mtba-compose.yml"
- fi
+ if [ -n "$ENABLE_MTBA" ];then
+ log INFO "MTBA setup detected -- will start MTBA Service and CBioPortal."
+ if [ ! -n "$IDMANAGER_UPLOAD_APIKEY" ]; then
+ log ERROR "Missing ID-Management Module! Fix this by setting up ID Management:"
+ exit 1;
+ fi
+ OVERRIDE+=" -f ./$PROJECT/modules/mtba-compose.yml"
+ fi
}
\ No newline at end of file
diff --git a/ccp/modules/nngm-setup.sh b/ccp/modules/nngm-setup.sh
index 3e31f59..3a0432f 100644
--- a/ccp/modules/nngm-setup.sh
+++ b/ccp/modules/nngm-setup.sh
@@ -5,4 +5,4 @@ function nngmSetup() {
log INFO "nNGM setup detected -- will start nNGM Connector."
OVERRIDE+=" -f ./$PROJECT/modules/nngm-compose.yml"
fi
- }
+}
diff --git a/ccp/vars b/ccp/vars
index 0c80e8a..9a0dbeb 100644
--- a/ccp/vars
+++ b/ccp/vars
@@ -17,4 +17,5 @@ done
idManagementSetup
nngmSetup
-mtbaSetup
\ No newline at end of file
+mtbaSetup
+adt2fhirRestSetup
\ No newline at end of file