From 276be28db1792c4f276191e24bbb3b7cbd8f852c Mon Sep 17 00:00:00 2001 From: Torben Brenner Date: Fri, 16 Dec 2022 12:02:49 +0100 Subject: [PATCH] fix: Included Legacy ID-Mapping (Please Complete) --- ccp/modules/id-management-compose.yml | 6 +++--- ccp/modules/id-management-setup.sh | 24 ++++++++++++++++++++++-- ccp/modules/id-management.md | 6 +++--- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/ccp/modules/id-management-compose.yml b/ccp/modules/id-management-compose.yml index d1639af..4baaba7 100644 --- a/ccp/modules/id-management-compose.yml +++ b/ccp/modules/id-management-compose.yml @@ -5,11 +5,11 @@ services: container_name: bridgehead-id-manager environment: TOMCAT_REVERSEPROXY_FQDN: ${HOST} - MAGICPL_SITE: ${SITE_ID} + MAGICPL_SITE: ${IDMANAGEMENT_FRIENDLY_ID} MAGICPL_ALLOWED_ORIGINS: https://${HOST} MAGICPL_LOCAL_PATIENTLIST_APIKEY: ${IDMANAGER_LOCAL_PATIENTLIST_APIKEY} - MAGICPL_CENTRAXX_APIKEY: ${IDMANAGER_CENTRAXX_APIKEY} - MAGICPL_CONNECTOR_APIKEY: ${IDMANAGER_CONNECTOR_APIKEY} + MAGICPL_CENTRAXX_APIKEY: ${IDMANAGER_UPLOAD_APIKEY} + MAGICPL_CONNECTOR_APIKEY: ${IDMANAGER_READ_APIKEY} MAGICPL_CENTRAL_PATIENTLIST_APIKEY: ${IDMANAGER_CENTRAL_PATIENTLIST_APIKEY} MAGICPL_CONTROLNUMBERGENERATOR_APIKEY: ${IDMANAGER_CONTROLNUMBERGENERATOR_APIKEY} MAGICPL_OIDC_CLIENT_ID: ${IDMANAGER_AUTH_CLIENT_ID} diff --git a/ccp/modules/id-management-setup.sh b/ccp/modules/id-management-setup.sh index 790f846..d2449c7 100644 --- a/ccp/modules/id-management-setup.sh +++ b/ccp/modules/id-management-setup.sh @@ -1,7 +1,7 @@ #!/bin/bash function idManagementSetup() { - if [ -n "$IDMANAGER_CENTRAXX_APIKEY" ]; then + if [ -n "$IDMANAGER_UPLOAD_APIKEY" ]; then log INFO "id-management setup detected -- will start id-management (mainzelliste & magicpl)." OVERRIDE+=" -f ./$PROJECT/modules/id-management-compose.yml" @@ -11,7 +11,27 @@ function idManagementSetup() { # Source the ID Generators Configuration source /etc/bridgehead/patientlist-id-generators.env - log INFO "ID-Management Generator 1: ${ML_BK_IDGENERATOR_RANDOM_1}" + + # Ensure old ids are working !!! + legacyIdMapping fi } + +# TODO: Map all old site ids to the new ones +function legacyIdMapping() { + case ${SITE_ID} in + "berlin") + export IDMANAGEMENT_FRIENDLY_ID=Berlin + ;; + "dresden") + export IDMANAGEMENT_FRIENDLY_ID=Dresden + ;; + "frankfurt") + export IDMANAGEMENT_FRIENDLY_ID=Frankfurt + ;; + *) + export IDMANAGEMENT_FRIENDLY_ID=$SITE_ID + ;; + esac +} diff --git a/ccp/modules/id-management.md b/ccp/modules/id-management.md index 8de2f5a..89ff65c 100644 --- a/ccp/modules/id-management.md +++ b/ccp/modules/id-management.md @@ -5,8 +5,8 @@ This module provides integration with the CCP-Pseudonymiziation Service. To lear You must add following configuration variables to your sites-configuration repository: ``` -IDMANAGER_CENTRAXX_APIKEY="" -IDMANAGER_CONNECTOR_APIKEY="" +IDMANAGER_UPLOAD_APIKEY="" +IDMANAGER_READ_APIKEY="" IDMANAGER_CENTRAL_PATIENTLIST_APIKEY="" IDMANAGER_CONTROLNUMBERGENERATOR_APIKEY="" IDMANAGER_AUTH_CLIENT_ID="" @@ -47,7 +47,7 @@ Typically, the sites connect their local data-management for the pseudonym creat On your CentraXX Server, you need to change following settings in the "centraxx-dev.properties" file. ``` dktk.idmanagement.url=https:///id-manager/translator/getId -dktk.idmanagement.apiKey= +dktk.idmanagement.apiKey= ``` They typically already exist, but need to be changed to the new values! #### Sites using ADT2FHIR