From 93b65619b33f03b257ae31a695905a69fa417b7f Mon Sep 17 00:00:00 2001 From: drono Date: Tue, 23 Apr 2024 19:20:53 +0300 Subject: [PATCH 1/5] Add FHIR IG importer to platform --- fhir-ig-importer/docker-compose.dev.yml | 16 ++++ fhir-ig-importer/docker-compose.yml | 36 +++++++++ fhir-ig-importer/package-metadata.json | 19 +++++ fhir-ig-importer/swarm.sh | 77 +++++++++++++++++++ .../docker-compose.yml | 4 +- 5 files changed, 150 insertions(+), 2 deletions(-) create mode 100644 fhir-ig-importer/docker-compose.dev.yml create mode 100644 fhir-ig-importer/docker-compose.yml create mode 100644 fhir-ig-importer/package-metadata.json create mode 100644 fhir-ig-importer/swarm.sh diff --git a/fhir-ig-importer/docker-compose.dev.yml b/fhir-ig-importer/docker-compose.dev.yml new file mode 100644 index 00000000..26193864 --- /dev/null +++ b/fhir-ig-importer/docker-compose.dev.yml @@ -0,0 +1,16 @@ +version: '3.9' + +services: + fhir-ig-importer-mediator: + ports: + - target: 3333 + published: 3333 + mode: host + fhir-ig-importer-ui: + ports: + - target: 8080 + published: 3000 + mode: host + - target: 8081 + published: 3003 + mode: host diff --git a/fhir-ig-importer/docker-compose.yml b/fhir-ig-importer/docker-compose.yml new file mode 100644 index 00000000..48f28bfa --- /dev/null +++ b/fhir-ig-importer/docker-compose.yml @@ -0,0 +1,36 @@ +version: '3.9' + +services: + fhir-ig-importer-mediator: + image: jembi/fhir-ig-importer-mediator:${FHIR_IG_IMPORTER_CORE_VERSION} + networks: + ig-importer-network: + hapi-fhir: + deploy: + replicas: ${FHIR_IG_IMPORTER_CORE_INSTANCES} + placement: + max_replicas_per_node: 1 + environment: + HAPI_FHIR_BASE_URL: ${HAPI_FHIR_BASE_URL} + HAPI_FHIR_INSTANCES: ${HAPI_FHIR_INSTANCES} + FHIR_IG_IMPORTER_CORE_PORT: ${FHIR_IG_IMPORTER_CORE_PORT} + FHIR_IG_IMPORTER_CORE_HOST: ${FHIR_IG_IMPORTER_CORE_HOST} + + fhir-ig-importer-ui: + image: jembi/fhir-ig-importer-ui:${FHIR_IG_IMPORTER_UI_VERSION} + networks: + ig-importer-network: + hapi-fhir: + deploy: + replicas: ${FHIR_IG_IMPORTER_UI_INSTANCES} + placement: + max_replicas_per_node: 1 + environment: + FHIR_IG_IMPORTER_CORE_URL: ${FHIR_IG_IMPORTER_CORE_URL} +networks: + ig-importer-network: + name: ig-importer-network + hapi-fhir: + name: hapi-fhir_public + external: true + diff --git a/fhir-ig-importer/package-metadata.json b/fhir-ig-importer/package-metadata.json new file mode 100644 index 00000000..2561d9b8 --- /dev/null +++ b/fhir-ig-importer/package-metadata.json @@ -0,0 +1,19 @@ +{ + "id": "fhir-ig-importer", + "name": "FHIR IG Importer", + "description": "The package provides mechanism of loading a fhir IG and deploying to the fhir server. The package has a microfrontend and mediator app", + "type": "infrastructure", + "version": "0.0.1", + "dependencies": ["interoperability-layer-openhim"], + "environmentVariables": { + "HAPI_FHIR_BASE_URL": "http://localhost:3447/fhir", + "HAPI_FHIR_INSTANCES": 1, + "FHIR_IG_IMPORTER_CORE_PORT": 3333, + "FHIR_IG_IMPORTER_CORE_HOST": "localhost", + "FHIR_IG_IMPORTER_CORE_URL": "http://localhost:3333/fhir/ig/v1.0", + "FHIR_IG_IMPORTER_UI_VERSION": "latest", + "FHIR_IG_IMPORTER_CORE_VERSION": "latest", + "FHIR_IG_IMPORTER_UI_INSTANCES": 1, + "FHIR_IG_IMPORTER_CORE_INSTANCES": 1 + } +} diff --git a/fhir-ig-importer/swarm.sh b/fhir-ig-importer/swarm.sh new file mode 100644 index 00000000..50f78731 --- /dev/null +++ b/fhir-ig-importer/swarm.sh @@ -0,0 +1,77 @@ +#!/bin/bash + +declare ACTION="" +declare MODE="" +declare COMPOSE_FILE_PATH="" +declare UTILS_PATH="" +declare STACK="fhir-ig-importer" + +function init_vars() { + ACTION=$1 + MODE=$2 + + COMPOSE_FILE_PATH=$( + cd "$(dirname "${BASH_SOURCE[0]}")" || exit + pwd -P + ) + UTILS_PATH="${COMPOSE_FILE_PATH}/../utils" + readonly ACTION + readonly MODE + readonly COMPOSE_FILE_PATH + readonly UTILS_PATH + readonly STACK +} +# shellcheck disable=SC1091 +function import_sources() { + source "${UTILS_PATH}/docker-utils.sh" + source "${UTILS_PATH}/config-utils.sh" + source "${UTILS_PATH}/log.sh" +} + +function initialize_package() { + local fhir_ig_importer_dev_compose_filename="" + + if [[ "${MODE}" == "dev" ]]; then + log info "Running package in DEV mode" + fhir_ig_importer_dev_compose_filename="docker-compose.dev.yml" + else + log info "Running package in PROD mode" + fi + + ( + docker::deploy_service "$STACK" "${COMPOSE_FILE_PATH}" "docker-compose.yml" "$fhir_ig_importer_dev_compose_filename" + ) || { + log error "Failed to deploy package" + exit 1 + } +} + +function destroy_package() { + docker::stack_destroy "$STACK" +} + +main() { + init_vars "$@" + import_sources + + if [[ "${ACTION}" == "init" ]] || [[ "${ACTION}" == "up" ]]; then + if [[ "${CLUSTERED_MODE}" == "true" ]]; then + log info "Running package in Cluster node mode" + else + log info "Running package in Single node mode" + fi + + initialize_package + elif [[ "${ACTION}" == "down" ]]; then + log info "Scaling down package" + + docker::scale_services "$STACK" 0 + elif [[ "${ACTION}" == "destroy" ]]; then + log info "Destroying package" + destroy_package + else + log error "Valid options are: init, up, down, or destroy" + fi +} + +main "$@" diff --git a/interoperability-layer-openhim/docker-compose.yml b/interoperability-layer-openhim/docker-compose.yml index 8fd88c41..7bfe3f6c 100644 --- a/interoperability-layer-openhim/docker-compose.yml +++ b/interoperability-layer-openhim/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.9" services: openhim-core: - image: jembi/openhim-core:v8.4.0 + image: jembi/openhim-core:poc networks: kafka: hapi-fhir: @@ -39,7 +39,7 @@ services: - prometheus-port=8080 openhim-console: - image: ${OPENHIM_CONSOLE_VERSION} + image: drono/openhim-console-mf:test environment: OPENHIM_CORE_MEDIATOR_HOSTNAME: ${OPENHIM_CORE_MEDIATOR_HOSTNAME} OPENHIM_MEDIATOR_API_PORT: ${OPENHIM_MEDIATOR_API_PORT} From 29a814a612afffa00808d9770a5826223131c078 Mon Sep 17 00:00:00 2001 From: drono Date: Thu, 25 Apr 2024 18:07:04 +0300 Subject: [PATCH 2/5] Add configurations to the IG importer package --- config.yaml | 8 + fhir-ig-importer/docker-compose.dev.yml | 5 +- fhir-ig-importer/docker-compose.yml | 12 +- .../importer/docker-compose.config.yml | 41 +++ .../importer/volume/openhim-import.json | 326 ++++++++++++++++++ .../importer/volume/openhimConfig.js | 53 +++ fhir-ig-importer/package-metadata.json | 13 +- fhir-ig-importer/swarm.sh | 2 + .../docker-compose.yml | 8 +- .../package-metadata.json | 2 +- 10 files changed, 455 insertions(+), 15 deletions(-) create mode 100644 fhir-ig-importer/importer/docker-compose.config.yml create mode 100644 fhir-ig-importer/importer/volume/openhim-import.json create mode 100644 fhir-ig-importer/importer/volume/openhimConfig.js diff --git a/config.yaml b/config.yaml index 7478f658..fec362c0 100644 --- a/config.yaml +++ b/config.yaml @@ -24,6 +24,7 @@ packages: - identity-access-manager-keycloak - openhim-mapping-mediator - database-postgres + - fhir-ig-importer profiles: - name: cdr-dw @@ -73,3 +74,10 @@ profiles: - openhim-mapping-mediator envFiles: - mpi.env + + - name: ig-importer + packages: + - fhir-ig-importer + envFiles: + - cdr.env + dev: true diff --git a/fhir-ig-importer/docker-compose.dev.yml b/fhir-ig-importer/docker-compose.dev.yml index 26193864..241c75e7 100644 --- a/fhir-ig-importer/docker-compose.dev.yml +++ b/fhir-ig-importer/docker-compose.dev.yml @@ -3,7 +3,7 @@ version: '3.9' services: fhir-ig-importer-mediator: ports: - - target: 3333 + - target: 3001 published: 3333 mode: host fhir-ig-importer-ui: @@ -11,6 +11,3 @@ services: - target: 8080 published: 3000 mode: host - - target: 8081 - published: 3003 - mode: host diff --git a/fhir-ig-importer/docker-compose.yml b/fhir-ig-importer/docker-compose.yml index 48f28bfa..6f69aa1e 100644 --- a/fhir-ig-importer/docker-compose.yml +++ b/fhir-ig-importer/docker-compose.yml @@ -4,8 +4,9 @@ services: fhir-ig-importer-mediator: image: jembi/fhir-ig-importer-mediator:${FHIR_IG_IMPORTER_CORE_VERSION} networks: - ig-importer-network: + ig-importer: hapi-fhir: + openhim: deploy: replicas: ${FHIR_IG_IMPORTER_CORE_INSTANCES} placement: @@ -19,8 +20,9 @@ services: fhir-ig-importer-ui: image: jembi/fhir-ig-importer-ui:${FHIR_IG_IMPORTER_UI_VERSION} networks: - ig-importer-network: + ig-importer: hapi-fhir: + openhim: deploy: replicas: ${FHIR_IG_IMPORTER_UI_INSTANCES} placement: @@ -28,9 +30,13 @@ services: environment: FHIR_IG_IMPORTER_CORE_URL: ${FHIR_IG_IMPORTER_CORE_URL} networks: - ig-importer-network: + ig-importer: name: ig-importer-network + external: true hapi-fhir: name: hapi-fhir_public external: true + openhim: + name: openhim_public + external: true diff --git a/fhir-ig-importer/importer/docker-compose.config.yml b/fhir-ig-importer/importer/docker-compose.config.yml new file mode 100644 index 00000000..2f47ef17 --- /dev/null +++ b/fhir-ig-importer/importer/docker-compose.config.yml @@ -0,0 +1,41 @@ +version: '3.9' + +services: + # container for executing config import scripts for creating the OpenHIM channels used by the Mediator + fhir-ig-importer-config-importer: + image: node:erbium-alpine + networks: + openhim: + default: + environment: + OPENHIM_API_USERNAME: ${OPENHIM_USERNAME} + OPENHIM_API_PASSWORD: ${OPENHIM_PASSWORD} + # Reject unauthorised is only needed if the OpenHIM's SSL is not setup + NODE_TLS_REJECT_UNAUTHORIZED: 0 + command: sh -c "node openhimConfig.js" + configs: + - source: fhir-ig-importer-config-importer-openhimConfig.js + target: /openhimConfig.js + - source: fhir-ig-importer-config-importer-openhim-import.json + target: /openhim-import.json + deploy: + replicas: 1 + restart_policy: + condition: none + +configs: + fhir-ig-importer-config-importer-openhimConfig.js: + file: ./volume/openhimConfig.js + name: fhir-ig-importer-config-importer-openhimConfig.js-${fhir_ig_importer_config_importer_openhimConfig_js_DIGEST:?err} + labels: + name: fhir-ig-importer + fhir-ig-importer-config-importer-openhim-import.json: + file: ./volume/openhim-import.json + name: fhir-ig-importer-config-importer-openhim-import.json-${fhir_ig_importer_config_importer_openhim_import_js_DIGEST:?err} + labels: + name: fhir-ig-importer + +networks: + openhim: + name: openhim_public + external: true diff --git a/fhir-ig-importer/importer/volume/openhim-import.json b/fhir-ig-importer/importer/volume/openhim-import.json new file mode 100644 index 00000000..ea763a9b --- /dev/null +++ b/fhir-ig-importer/importer/volume/openhim-import.json @@ -0,0 +1,326 @@ +{ + "Users": [ + { + "firstname": "Super", + "surname": "User", + "email": "root@openhim.org", + "provider": "token", + "groups": ["admin"], + "passwordAlgorithm": null, + "passwordHash": null, + "passwordSalt": null, + "expiry": null, + "locked": false, + "token": null, + "tokenType": null + } + ], + "Clients": [ + { + "clientID": "instant-client", + "name": "Instant Client", + "roles": ["instant"], + "customTokenID": "test" + } + ], + "Channels": [ + { + "name": "IG Importer Get", + "urlPattern": "^/ig.*$", + "methods": ["GET", "OPTIONS"], + "type": "http", + "tcpPort": null, + "tcpHost": null, + "pollingSchedule": null, + "requestBody": true, + "responseBody": true, + "allow": [], + "whitelist": [], + "authType": "public", + "routes": [ + { + "type": "http", + "status": "enabled", + "forwardAuthHeader": false, + "name": "get fhir igs", + "secured": false, + "host": "fhir-ig-importer-mediator", + "port": 3001, + "path": "/ig/v1.0/all", + "pathTransform": "", + "primary": true, + "username": "", + "password": "" + } + ], + "matchContentTypes": [], + "matchContentRegex": null, + "matchContentXpath": null, + "matchContentJson": null, + "matchContentValue": null, + "properties": [], + "txViewAcl": [], + "txViewFullAcl": [], + "txRerunAcl": [], + "status": "enabled", + "rewriteUrls": false, + "addAutoRewriteRules": true, + "rewriteUrlsConfig": [], + "autoRetryEnabled": false, + "autoRetryPeriodMinutes": 60, + "updatedBy": { + "id": "6581971ea4e841f92ec4321a", + "name": "Super User" + }, + "alerts": [] + }, + { + "methods": ["POST", "OPTIONS"], + "type": "http", + "allow": [], + "whitelist": [], + "authType": "public", + "matchContentTypes": [], + "properties": [], + "txViewAcl": [], + "txViewFullAcl": [], + "txRerunAcl": [], + "status": "enabled", + "rewriteUrls": false, + "addAutoRewriteRules": true, + "autoRetryEnabled": false, + "autoRetryPeriodMinutes": 60, + "updatedBy": { + "id": "6581971ea4e841f92ec4321a", + "name": "Super User" + }, + "urlPattern": "^/ig.*$", + "tcpPort": null, + "tcpHost": null, + "pollingSchedule": null, + "requestBody": true, + "responseBody": true, + "routes": [ + { + "type": "http", + "status": "enabled", + "forwardAuthHeader": false, + "name": "upload fhir ig", + "secured": false, + "host": "fhir-ig-importer-mediator", + "port": 3001, + "path": "/ig/v1.0/upload", + "pathTransform": "", + "primary": true, + "username": "", + "password": "" + } + ], + "matchContentRegex": null, + "matchContentXpath": null, + "matchContentJson": null, + "matchContentValue": null, + "rewriteUrlsConfig": [], + "alerts": [], + "name": "IG Importer Upload" + }, + { + "methods": ["DELETE", "OPTIONS"], + "type": "http", + "allow": [], + "whitelist": [], + "authType": "public", + "matchContentTypes": [], + "properties": [], + "txViewAcl": [], + "txViewFullAcl": [], + "txRerunAcl": [], + "status": "enabled", + "rewriteUrls": false, + "addAutoRewriteRules": true, + "autoRetryEnabled": false, + "autoRetryPeriodMinutes": 60, + "updatedBy": { + "id": "6581971ea4e841f92ec4321a", + "name": "Super User" + }, + "urlPattern": "^/ig/v1.0/delete.*$", + "tcpPort": null, + "tcpHost": null, + "pollingSchedule": null, + "requestBody": true, + "responseBody": true, + "routes": [ + { + "type": "http", + "status": "enabled", + "forwardAuthHeader": false, + "name": "delete fhir ig", + "secured": false, + "host": "fhir-ig-importer-mediator", + "port": 3001, + "path": "", + "pathTransform": "", + "primary": true, + "username": "", + "password": "" + } + ], + "matchContentRegex": null, + "matchContentXpath": null, + "matchContentJson": null, + "matchContentValue": null, + "rewriteUrlsConfig": [], + "alerts": [], + "name": "IG Importer Delete" + }, + { + "methods": ["PUT", "OPTIONS"], + "type": "http", + "allow": [], + "whitelist": [], + "authType": "public", + "matchContentTypes": [], + "properties": [], + "txViewAcl": [], + "txViewFullAcl": [], + "txRerunAcl": [], + "status": "enabled", + "rewriteUrls": false, + "addAutoRewriteRules": true, + "autoRetryEnabled": false, + "autoRetryPeriodMinutes": 60, + "updatedBy": { + "id": "6581971ea4e841f92ec4321a", + "name": "Super User" + }, + "urlPattern": "^/ig/v1.0/update.*$", + "tcpPort": null, + "tcpHost": null, + "pollingSchedule": null, + "requestBody": true, + "responseBody": true, + "routes": [ + { + "type": "http", + "status": "enabled", + "forwardAuthHeader": false, + "name": "update fhir ig", + "secured": false, + "host": "fhir-ig-importer-mediator", + "port": 3001, + "path": "", + "pathTransform": "", + "primary": true, + "username": "", + "password": "" + } + ], + "matchContentRegex": null, + "matchContentXpath": null, + "matchContentJson": null, + "matchContentValue": null, + "rewriteUrlsConfig": [], + "alerts": [], + "name": "IG Importer Update" + } + ], + "Mediators": [ + { + "urn": "urn:mediator:fhir-ig-importer-mediator", + "version": "1.0.0", + "name": "Fhir IG importer mediator", + "description": "Mediator that upload, delete fhir IG in Fhir server.", + "defaultChannelConfig": [ + { + "methods": ["POST"], + "type": "http", + "allow": ["instant"], + "whitelist": [], + "authType": "private", + "matchContentTypes": [], + "properties": [], + "txViewAcl": [], + "txViewFullAcl": [], + "txRerunAcl": [], + "status": "enabled", + "rewriteUrls": false, + "addAutoRewriteRules": true, + "autoRetryEnabled": false, + "autoRetryPeriodMinutes": 60, + "name": "Fhir IG importer mediator", + "urlPattern": "^/ig", + "routes": [ + { + "type": "http", + "status": "enabled", + "forwardAuthHeader": false, + "name": "mediator main entry", + "host": "fhir-ig-importer-mediator", + "port": 3001, + "primary": true + } + ], + "alerts": [], + "rewriteUrlsConfig": [] + } + ], + "endpoints": [ + { + "type": "http", + "status": "enabled", + "forwardAuthHeader": false, + "name": "upload fhir ig", + "host": "fhir-ig-importer-mediator", + "port": 3001, + "path": "/ig/v1.0/upload", + "primary": true + }, + { + "type": "http", + "status": "enabled", + "forwardAuthHeader": false, + "name": "get fhir igs", + "host": "fhir-ig-importer-mediator", + "port": 3001, + "path": "/ig/v1.0/all", + "primary": true + }, + { + "type": "http", + "status": "enabled", + "forwardAuthHeader": false, + "name": "delete fhir ig", + "host": "fhir-ig-importer-mediator", + "port": 3001, + "path": "/ig/v1.0/delete/:id", + "primary": true + }, + { + "type": "http", + "status": "enabled", + "forwardAuthHeader": false, + "name": "get fhir ig", + "host": "fhir-ig-importer-mediator", + "port": 3001, + "path": "/ig/v1.0/info/:id", + "primary": true + }, + { + "type": "http", + "status": "enabled", + "forwardAuthHeader": false, + "name": "update fhir ig", + "host": "fhir-ig-importer-mediator", + "port": 3001, + "path": "/ig/v1.0/update/:id", + "primary": true + } + ], + "configDefs": [], + "_lastHeartbeat": "2023-12-22T10:52:05.461Z", + "_uptime": 1191.2140364 + } + ], + "ContactGroups": [] +} diff --git a/fhir-ig-importer/importer/volume/openhimConfig.js b/fhir-ig-importer/importer/volume/openhimConfig.js new file mode 100644 index 00000000..182ee887 --- /dev/null +++ b/fhir-ig-importer/importer/volume/openhimConfig.js @@ -0,0 +1,53 @@ +"use strict"; + +const fs = require("fs"); +const https = require("https"); +const path = require("path"); + +const OPENHIM_CORE_SERVICE_NAME = "openhim-core"; +const OPENHIM_MEDIATOR_API_PORT = 8080; +const OPENHIM_API_PASSWORD = process.env.OPENHIM_API_PASSWORD || "instant101"; +const OPENHIM_API_USERNAME = + process.env.OPENHIM_API_USERNAME || "root@openhim.org"; + +const authHeader = new Buffer.from( + `${OPENHIM_API_USERNAME}:${OPENHIM_API_PASSWORD}` +).toString("base64"); + +const jsonData = JSON.parse( + fs.readFileSync(path.resolve(__dirname, "openhim-import.json")) +); + +const data = JSON.stringify(jsonData); + +const options = { + protocol: "https:", + hostname: OPENHIM_CORE_SERVICE_NAME, + port: OPENHIM_MEDIATOR_API_PORT, + path: "/metadata", + method: "POST", + headers: { + "Content-Type": "application/json", + "Content-Length": data.length, + Authorization: `Basic ${authHeader}`, + }, +}; + +const req = https.request(options, (res) => { + if (res.statusCode == 401) { + throw new Error(`Incorrect OpenHIM API credentials`); + } + + if (res.statusCode != 201) { + throw new Error(`Failed to import OpenHIM config: ${res.statusCode}`); + } + + console.log("Successfully Imported OpenHIM Config"); +}); + +req.on("error", (error) => { + throw new Error(`Failed to import OpenHIM config: ${error}`); +}); + +req.write(data); +req.end(); diff --git a/fhir-ig-importer/package-metadata.json b/fhir-ig-importer/package-metadata.json index 2561d9b8..1638ac03 100644 --- a/fhir-ig-importer/package-metadata.json +++ b/fhir-ig-importer/package-metadata.json @@ -4,13 +4,16 @@ "description": "The package provides mechanism of loading a fhir IG and deploying to the fhir server. The package has a microfrontend and mediator app", "type": "infrastructure", "version": "0.0.1", - "dependencies": ["interoperability-layer-openhim"], + "dependencies": [ + "interoperability-layer-openhim", + "fhir-datastore-hapi-fhir" + ], "environmentVariables": { - "HAPI_FHIR_BASE_URL": "http://localhost:3447/fhir", + "HAPI_FHIR_BASE_URL": "http://hapi-fhir:8080/fhir", "HAPI_FHIR_INSTANCES": 1, - "FHIR_IG_IMPORTER_CORE_PORT": 3333, - "FHIR_IG_IMPORTER_CORE_HOST": "localhost", - "FHIR_IG_IMPORTER_CORE_URL": "http://localhost:3333/fhir/ig/v1.0", + "FHIR_IG_IMPORTER_CORE_PORT": 3001, + "FHIR_IG_IMPORTER_CORE_HOST": "0.0.0.0", + "FHIR_IG_IMPORTER_CORE_URL": "http://0.0.0.0:3001/fhir/ig/v1.0", "FHIR_IG_IMPORTER_UI_VERSION": "latest", "FHIR_IG_IMPORTER_CORE_VERSION": "latest", "FHIR_IG_IMPORTER_UI_INSTANCES": 1, diff --git a/fhir-ig-importer/swarm.sh b/fhir-ig-importer/swarm.sh index 50f78731..900b1325 100644 --- a/fhir-ig-importer/swarm.sh +++ b/fhir-ig-importer/swarm.sh @@ -44,6 +44,8 @@ function initialize_package() { log error "Failed to deploy package" exit 1 } + docker::deploy_config_importer $STACK "$COMPOSE_FILE_PATH/importer/docker-compose.config.yml" "fhir-ig-importer-config-importer" "fhir-ig-importer" + } function destroy_package() { diff --git a/interoperability-layer-openhim/docker-compose.yml b/interoperability-layer-openhim/docker-compose.yml index 7bfe3f6c..3682ff06 100644 --- a/interoperability-layer-openhim/docker-compose.yml +++ b/interoperability-layer-openhim/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.9" services: openhim-core: - image: jembi/openhim-core:poc + image: jembi/openhim-core:microfrontends-pre-release networks: kafka: hapi-fhir: @@ -11,6 +11,7 @@ services: public: default: prometheus: + ig: environment: - mongo_url=${OPENHIM_MONGO_URL} - mongo_atnaUrl=${OPENHIM_MONGO_ATNAURL} @@ -39,7 +40,7 @@ services: - prometheus-port=8080 openhim-console: - image: drono/openhim-console-mf:test + image: ${OPENHIM_CONSOLE_VERSION} environment: OPENHIM_CORE_MEDIATOR_HOSTNAME: ${OPENHIM_CORE_MEDIATOR_HOSTNAME} OPENHIM_MEDIATOR_API_PORT: ${OPENHIM_MEDIATOR_API_PORT} @@ -84,4 +85,7 @@ networks: prometheus: name: prometheus_public external: true + ig: + name: ig-importer + external: true default: diff --git a/interoperability-layer-openhim/package-metadata.json b/interoperability-layer-openhim/package-metadata.json index 0d01c755..7ec005d8 100644 --- a/interoperability-layer-openhim/package-metadata.json +++ b/interoperability-layer-openhim/package-metadata.json @@ -26,7 +26,7 @@ "OPENHIM_MONGO_MEMORY_RESERVE": "500M", "OPENHIM_MONGO_URL": "mongodb://mongo-1:27017/openhim", "OPENHIM_MONGO_ATNAURL": "mongodb://mongo-1:27017/openhim", - "OPENHIM_CONSOLE_VERSION": "jembi/openhim-console:v1.18.2", + "OPENHIM_CONSOLE_VERSION": "jembi/openhim-console:poc-microfrontends", "KAFKA_HOSTS": "kafka-01:9092", "KC_REALM_NAME": "platform-realm", "KC_FRONTEND_URL": "http://localhost:9088", From 22f5ff81b896a05759b1e144cb575d906dc3034d Mon Sep 17 00:00:00 2001 From: Drizzentic Date: Mon, 6 May 2024 12:50:35 +0300 Subject: [PATCH 3/5] Update fhir-ig-importer/docker-compose.dev.yml Co-authored-by: bradsawadye --- fhir-ig-importer/docker-compose.dev.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/fhir-ig-importer/docker-compose.dev.yml b/fhir-ig-importer/docker-compose.dev.yml index 241c75e7..25714fbd 100644 --- a/fhir-ig-importer/docker-compose.dev.yml +++ b/fhir-ig-importer/docker-compose.dev.yml @@ -6,6 +6,7 @@ services: - target: 3001 published: 3333 mode: host + fhir-ig-importer-ui: ports: - target: 8080 From 7521c6a5aade542213f216cf7c5ec7d96891e812 Mon Sep 17 00:00:00 2001 From: Drizzentic Date: Mon, 6 May 2024 12:50:47 +0300 Subject: [PATCH 4/5] Update fhir-ig-importer/docker-compose.yml Co-authored-by: bradsawadye --- fhir-ig-importer/docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/fhir-ig-importer/docker-compose.yml b/fhir-ig-importer/docker-compose.yml index 6f69aa1e..be4ef0ce 100644 --- a/fhir-ig-importer/docker-compose.yml +++ b/fhir-ig-importer/docker-compose.yml @@ -29,6 +29,7 @@ services: max_replicas_per_node: 1 environment: FHIR_IG_IMPORTER_CORE_URL: ${FHIR_IG_IMPORTER_CORE_URL} + networks: ig-importer: name: ig-importer-network From dc793d7508885b09972a142994028ad90d9f4514 Mon Sep 17 00:00:00 2001 From: drono Date: Mon, 6 May 2024 16:04:34 +0300 Subject: [PATCH 5/5] PR feedback --- config.yaml | 7 ------- fhir-ig-importer/docker-compose.yml | 15 +-------------- fhir-ig-importer/package-metadata.json | 4 ++-- interoperability-layer-openhim/docker-compose.yml | 6 +----- .../package-metadata.json | 6 ++++-- 5 files changed, 8 insertions(+), 30 deletions(-) diff --git a/config.yaml b/config.yaml index 67bf1f24..e561e5a9 100644 --- a/config.yaml +++ b/config.yaml @@ -74,10 +74,3 @@ profiles: - openhim-mapping-mediator envFiles: - mpi.env - - - name: ig-importer - packages: - - fhir-ig-importer - envFiles: - - cdr.env - dev: true diff --git a/fhir-ig-importer/docker-compose.yml b/fhir-ig-importer/docker-compose.yml index be4ef0ce..43c0be1a 100644 --- a/fhir-ig-importer/docker-compose.yml +++ b/fhir-ig-importer/docker-compose.yml @@ -4,13 +4,8 @@ services: fhir-ig-importer-mediator: image: jembi/fhir-ig-importer-mediator:${FHIR_IG_IMPORTER_CORE_VERSION} networks: - ig-importer: hapi-fhir: openhim: - deploy: - replicas: ${FHIR_IG_IMPORTER_CORE_INSTANCES} - placement: - max_replicas_per_node: 1 environment: HAPI_FHIR_BASE_URL: ${HAPI_FHIR_BASE_URL} HAPI_FHIR_INSTANCES: ${HAPI_FHIR_INSTANCES} @@ -18,22 +13,14 @@ services: FHIR_IG_IMPORTER_CORE_HOST: ${FHIR_IG_IMPORTER_CORE_HOST} fhir-ig-importer-ui: - image: jembi/fhir-ig-importer-ui:${FHIR_IG_IMPORTER_UI_VERSION} + image: jembi/fhir-ig-importer-mediator-ui:${FHIR_IG_IMPORTER_UI_VERSION} networks: - ig-importer: hapi-fhir: openhim: - deploy: - replicas: ${FHIR_IG_IMPORTER_UI_INSTANCES} - placement: - max_replicas_per_node: 1 environment: FHIR_IG_IMPORTER_CORE_URL: ${FHIR_IG_IMPORTER_CORE_URL} networks: - ig-importer: - name: ig-importer-network - external: true hapi-fhir: name: hapi-fhir_public external: true diff --git a/fhir-ig-importer/package-metadata.json b/fhir-ig-importer/package-metadata.json index 1638ac03..bd74ebbf 100644 --- a/fhir-ig-importer/package-metadata.json +++ b/fhir-ig-importer/package-metadata.json @@ -14,8 +14,8 @@ "FHIR_IG_IMPORTER_CORE_PORT": 3001, "FHIR_IG_IMPORTER_CORE_HOST": "0.0.0.0", "FHIR_IG_IMPORTER_CORE_URL": "http://0.0.0.0:3001/fhir/ig/v1.0", - "FHIR_IG_IMPORTER_UI_VERSION": "latest", - "FHIR_IG_IMPORTER_CORE_VERSION": "latest", + "FHIR_IG_IMPORTER_UI_VERSION": "0.1.0", + "FHIR_IG_IMPORTER_CORE_VERSION": "1.0.0", "FHIR_IG_IMPORTER_UI_INSTANCES": 1, "FHIR_IG_IMPORTER_CORE_INSTANCES": 1 } diff --git a/interoperability-layer-openhim/docker-compose.yml b/interoperability-layer-openhim/docker-compose.yml index 3682ff06..0728edc2 100644 --- a/interoperability-layer-openhim/docker-compose.yml +++ b/interoperability-layer-openhim/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.9" services: openhim-core: - image: jembi/openhim-core:microfrontends-pre-release + image: ${OPENHIM_CORE_IMAGE} networks: kafka: hapi-fhir: @@ -11,7 +11,6 @@ services: public: default: prometheus: - ig: environment: - mongo_url=${OPENHIM_MONGO_URL} - mongo_atnaUrl=${OPENHIM_MONGO_ATNAURL} @@ -85,7 +84,4 @@ networks: prometheus: name: prometheus_public external: true - ig: - name: ig-importer - external: true default: diff --git a/interoperability-layer-openhim/package-metadata.json b/interoperability-layer-openhim/package-metadata.json index 7ec005d8..9bfef8e2 100644 --- a/interoperability-layer-openhim/package-metadata.json +++ b/interoperability-layer-openhim/package-metadata.json @@ -6,6 +6,7 @@ "type": "infrastructure", "dependencies": [], "environmentVariables": { + "OPENHIM_CORE_IMAGE": "jembi/openhim-core:microfrontends-pre-release", "MONGO_SET_COUNT": "1", "OPENHIM_CORE_INSTANCES": "1", "OPENHIM_CONSOLE_INSTANCES": "1", @@ -26,7 +27,7 @@ "OPENHIM_MONGO_MEMORY_RESERVE": "500M", "OPENHIM_MONGO_URL": "mongodb://mongo-1:27017/openhim", "OPENHIM_MONGO_ATNAURL": "mongodb://mongo-1:27017/openhim", - "OPENHIM_CONSOLE_VERSION": "jembi/openhim-console:poc-microfrontends", + "OPENHIM_CONSOLE_VERSION": "jembi/openhim-console:microfrontend-poc", "KAFKA_HOSTS": "kafka-01:9092", "KC_REALM_NAME": "platform-realm", "KC_FRONTEND_URL": "http://localhost:9088", @@ -34,6 +35,7 @@ "KC_OPENHIM_CLIENT_ID": "openhim-oauth", "KC_OPENHIM_CLIENT_SECRET": "tZKfEbWf0Ka5HBNZwFrdSyQH2xT1sNMR", "KC_OPENHIM_ROOT_URL": "http://localhost:9000", - "KC_API_URL": "http://identity-access-manager-keycloak:8080" + "KC_API_URL": "http://identity-access-manager-keycloak:8080", + "OPENHIM_CONSOLE_BASE_URL": "http://localhost:9000" } }