From 4c8a0897bd98fdd1d9bb9380001f9344559e646e Mon Sep 17 00:00:00 2001 From: drono Date: Wed, 15 May 2024 17:19:41 +0300 Subject: [PATCH] Platform beta release --- config.yaml | 3 +- fhir-ig-importer/docker-compose.dev.yml | 2 +- .../importer/volume/ig-importer-app.json | 2 +- fhir-ig-importer/package-metadata.json | 4 +- .../package-metadata.json | 4 +- kafka-mapper-consumer/package-metadata.json | 4 +- mpi-mediator/docker-compose.yml | 2 +- .../importer/volume/openhim-import.json | 31 ++---- reprocess-mediator/package-metadata.json | 32 +++--- test/cucumber/features/steps/recipesSteps.js | 105 +++++++++++------- 10 files changed, 102 insertions(+), 87 deletions(-) diff --git a/config.yaml b/config.yaml index 54977b16..862a5df6 100644 --- a/config.yaml +++ b/config.yaml @@ -44,6 +44,8 @@ profiles: - openhim-mapping-mediator - kafka-mapper-consumer - kafka-unbundler-consumer + - fhir-ig-importer + - reprocess-mediator envFiles: - cdr-dw.env @@ -75,4 +77,3 @@ profiles: - openhim-mapping-mediator envFiles: - mpi.env - diff --git a/fhir-ig-importer/docker-compose.dev.yml b/fhir-ig-importer/docker-compose.dev.yml index 25714fbd..c33a9169 100644 --- a/fhir-ig-importer/docker-compose.dev.yml +++ b/fhir-ig-importer/docker-compose.dev.yml @@ -10,5 +10,5 @@ services: fhir-ig-importer-ui: ports: - target: 8080 - published: 3000 + published: 3334 mode: host diff --git a/fhir-ig-importer/importer/volume/ig-importer-app.json b/fhir-ig-importer/importer/volume/ig-importer-app.json index a86b0cc8..102b6eac 100644 --- a/fhir-ig-importer/importer/volume/ig-importer-app.json +++ b/fhir-ig-importer/importer/volume/ig-importer-app.json @@ -3,7 +3,7 @@ "description": "FHIR IG microfrontend app", "category": "HIE Configuration", "type": "esmodule", - "url": "http://localhost:3000/jembi-fhir-ig-importer.js", + "url": "http://localhost:3334/jembi-fhir-ig-importer.js", "showInPortal": true, "showInSideBar": true, "access_roles": ["admin"], diff --git a/fhir-ig-importer/package-metadata.json b/fhir-ig-importer/package-metadata.json index 1db85f0a..27f4de82 100644 --- a/fhir-ig-importer/package-metadata.json +++ b/fhir-ig-importer/package-metadata.json @@ -14,7 +14,7 @@ "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": "0.1.0", - "FHIR_IG_IMPORTER_CORE_VERSION": "1.0.0" + "FHIR_IG_IMPORTER_UI_VERSION": "v1.0.0", + "FHIR_IG_IMPORTER_CORE_VERSION": "v1.0.0" } } diff --git a/interoperability-layer-openhim/package-metadata.json b/interoperability-layer-openhim/package-metadata.json index 1d8974b1..4feb86ab 100644 --- a/interoperability-layer-openhim/package-metadata.json +++ b/interoperability-layer-openhim/package-metadata.json @@ -6,7 +6,7 @@ "type": "infrastructure", "dependencies": [], "environmentVariables": { - "OPENHIM_CORE_IMAGE": "jembi/openhim-core:microfrontends-3.0.0-beta", + "OPENHIM_CORE_IMAGE": "jembi/openhim-core:v8.4.3", "MONGO_SET_COUNT": "1", "OPENHIM_CORE_INSTANCES": "1", "OPENHIM_CONSOLE_INSTANCES": "1", @@ -27,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:microfrontend-poc", + "OPENHIM_CONSOLE_VERSION": "jembi/openhim-console:poc-microfrontend", "KAFKA_HOSTS": "kafka-01:9092", "KC_REALM_NAME": "platform-realm", "KC_FRONTEND_URL": "http://localhost:9088", diff --git a/kafka-mapper-consumer/package-metadata.json b/kafka-mapper-consumer/package-metadata.json index a28cd5da..0c0b17a9 100644 --- a/kafka-mapper-consumer/package-metadata.json +++ b/kafka-mapper-consumer/package-metadata.json @@ -17,7 +17,7 @@ "REGISTER_MEDIATOR": "true", "CLICKHOUSE_HOST": "analytics-datastore-clickhouse", "CLICKHOUSE_PORT": "8123", - "KAFKA_CONSUMER_MAPPER_MEDIATOR_VERSION": "jembi/kafka-mapper-consumer:0.1.0", - "KAFKA_CONSUMER_MAPPER_UI_VERSION": "jembi/kafka-mapper-consumer-ui:0.1.1-alpha" + "KAFKA_CONSUMER_MAPPER_MEDIATOR_VERSION": "jembi/kafka-mapper-consumer:v0.0.1", + "KAFKA_CONSUMER_MAPPER_UI_VERSION": "jembi/kafka-mapper-consumer-ui:v0.0.1" } } diff --git a/mpi-mediator/docker-compose.yml b/mpi-mediator/docker-compose.yml index 084d7e39..8f39f082 100644 --- a/mpi-mediator/docker-compose.yml +++ b/mpi-mediator/docker-compose.yml @@ -2,7 +2,7 @@ version: '3.9' services: mpi-mediator: - image: jembi/mpi-mediator:v2.1.1 + image: jembi/mpi-mediator:v2.2.0 networks: openhim: kafka: diff --git a/mpi-mediator/importer/volume/openhim-import.json b/mpi-mediator/importer/volume/openhim-import.json index 5a1b11b9..cb40af5d 100644 --- a/mpi-mediator/importer/volume/openhim-import.json +++ b/mpi-mediator/importer/volume/openhim-import.json @@ -5,9 +5,7 @@ "surname": "User", "email": "root@openhim.org", "provider": "token", - "groups": [ - "admin" - ], + "groups": ["admin"], "passwordAlgorithm": "sha512", "passwordHash": "ea3824f17cf1379eb118a36bc7c8cf0f45712e2af7748567fca5313dec6fa66d61064e82a5e5cb88e998486ee3c7d0dac235bbeda8c341d6edc1c77406be2ab6", "passwordSalt": "d4f622c0404f09bd959bfb263efa3452", @@ -21,9 +19,7 @@ { "clientID": "test", "name": "Test Client", - "roles": [ - "instant" - ], + "roles": ["instant"], "customTokenID": "test" } ], @@ -98,7 +94,7 @@ "urlPattern": "^/fhir.*$", "methods": ["GET", "POST"], "type": "http", - "priority": null, + "priority": 2, "tcpPort": null, "tcpHost": null, "pollingSchedule": null, @@ -147,9 +143,7 @@ { "name": "MPI Orchestration for fhir bundles - Asynchronous flow", "urlPattern": "^/async/fhir/?$", - "methods": [ - "POST" - ], + "methods": ["POST"], "type": "http", "priority": null, "tcpPort": null, @@ -157,9 +151,7 @@ "pollingSchedule": null, "requestBody": true, "responseBody": true, - "allow": [ - "instant" - ], + "allow": ["instant"], "whitelist": [], "authType": "private", "routes": [ @@ -240,9 +232,7 @@ "pollingSchedule": null, "requestBody": true, "responseBody": true, - "allow": [ - "instant" - ], + "allow": ["instant"], "whitelist": [], "authType": "private", "routes": [ @@ -328,14 +318,9 @@ { "name": "MPI mediator", "urlPattern": "^(/async)?/fhir.*$", - "methods": [ - "POST", - "GET" - ], + "methods": ["POST", "GET"], "type": "http", - "allow": [ - "instant" - ], + "allow": ["instant"], "whitelist": [], "authType": "private", "routes": [ diff --git a/reprocess-mediator/package-metadata.json b/reprocess-mediator/package-metadata.json index 4393bc6e..97ca4643 100644 --- a/reprocess-mediator/package-metadata.json +++ b/reprocess-mediator/package-metadata.json @@ -1,18 +1,18 @@ { - "id": "reprocess-mediator", - "name": "Reprocess Mediator", - "description": "A mediator that allows for configuring and reprocessing of transactions", - "type": "use-case", - "version": "1.4.2", - "dependencies": ["interoperability-layer-openhim"], - "environmentVariables": { - "TRUST_SELF_SIGNED": "true", - "OPENHIM_MEDIATOR_URL": "https://openhim-core:8080", - "OPENHIM_USERNAME": "root@openhim.org", - "OPENHIM_PASSWORD": "instant101", - "REGISTER_MEDIATOR": "true", - "REPROCESSOR_API_BASE_URL": "http://reprocess-mediator:3000", - "REPROCESS_CORE_VERSION": "latest", - "REPROCESS_UI_VERSION": "latest" - } + "id": "reprocess-mediator", + "name": "Reprocess Mediator", + "description": "A mediator that allows for configuring and reprocessing of transactions", + "type": "use-case", + "version": "1.4.2", + "dependencies": ["interoperability-layer-openhim"], + "environmentVariables": { + "TRUST_SELF_SIGNED": "true", + "OPENHIM_MEDIATOR_URL": "https://openhim-core:8080", + "OPENHIM_USERNAME": "root@openhim.org", + "OPENHIM_PASSWORD": "instant101", + "REGISTER_MEDIATOR": "true", + "REPROCESSOR_API_BASE_URL": "http://reprocess-mediator:3000", + "REPROCESS_CORE_VERSION": "v0.1.0", + "REPROCESS_UI_VERSION": "v0.1.0" } +} diff --git a/test/cucumber/features/steps/recipesSteps.js b/test/cucumber/features/steps/recipesSteps.js index 9c119150..8d24c0b3 100644 --- a/test/cucumber/features/steps/recipesSteps.js +++ b/test/cucumber/features/steps/recipesSteps.js @@ -1,16 +1,15 @@ -"use strict" +"use strict"; const axios = require("axios"); const fs = require("fs"); -const path = require('path'); +const path = require("path"); const chai = require("chai"); -const { ClickHouse } = require('clickhouse'); +const { ClickHouse } = require("clickhouse"); const { Given, When, Then, setDefaultTimeout } = require("@cucumber/cucumber"); setDefaultTimeout(30 * 60 * 1000); -const HOST = - process.env.HOST || 'localhost'; -const CLICKHOUSE_PORT = parseInt(process.env.CLICKHOUSE_PORT || '8124'); +const HOST = process.env.HOST || "localhost"; +const CLICKHOUSE_PORT = parseInt(process.env.CLICKHOUSE_PORT || "8124"); const CLICKHOUSE_DEBUG = Boolean(process.env.CLICKHOUSE_DEBUG || false); const { expect } = chai; @@ -22,69 +21,99 @@ const clickhouse = new ClickHouse({ raw: true, }); -const query = table => `SELECT * FROM ${table}`; +const query = (table) => `SELECT * FROM ${table}`; -const sendRequest = (url, method='POST', data={}) => { +const sendRequest = (url, method = "POST", data = {}) => { return axios({ url, headers: { - 'Content-Type': 'application/fhir+json', - Authorization: `Custom test` + "Content-Type": "application/fhir+json", + Authorization: `Custom test`, }, data, - method - }) + method, + }); }; let PatientID; Given("I have configured the cdr", async function () { await new Promise((resolve) => { - setTimeout(() => resolve(), 300000) + setTimeout(() => resolve(), 300000); }); const organization = JSON.parse( - fs.readFileSync(path.resolve(__dirname, '..' , 'resources', 'organization.json')) + fs.readFileSync( + path.resolve(__dirname, "..", "resources", "organization.json") + ) ); - this.cdrConfigResult = await sendRequest(`http://${HOST}:5001/fhir`, 'POST', organization); + this.cdrConfigResult = await sendRequest( + `http://${HOST}:5001/fhir`, + "POST", + organization + ); }); When("I send a fhir patient bundle", async function () { const fhirBundle = JSON.parse( - fs.readFileSync(path.resolve(__dirname, '..' , 'resources', 'fhirBundle.json')) + fs.readFileSync( + path.resolve(__dirname, "..", "resources", "fhirBundle.json") + ) ); - this.fhirBundleSentResult = await sendRequest(`http://${HOST}:5001/fhir`, 'POST', fhirBundle); + this.fhirBundleSentResult = await sendRequest( + `http://${HOST}:5001/fhir`, + "POST", + fhirBundle + ); }); When("I then send a fhir patient summary request", async function () { - this.IPSResult = await sendRequest(`http://${HOST}:5001/fhir/Patient/${PatientID}/$summary`, 'GET'); -}); - -When("I then send a request for all the patient's clinical data", async function () { - this.EverythingResult = await sendRequest(`http://${HOST}:5001/fhir/Patient/${PatientID}/$everything?_mdm=true`, 'GET'); + this.IPSResult = await sendRequest( + `http://${HOST}:5001/fhir/Patient/${PatientID}/$summary`, + "GET" + ); }); -When("I wait for the services to start up", async function() { +When( + "I then send a request for all the patient's clinical data", + async function () { + this.EverythingResult = await sendRequest( + `http://${HOST}:5001/fhir/Patient/${PatientID}/$everything?_mdm=true`, + "GET" + ); + } +); + +When("I wait for the services to start up", async function () { await new Promise((resolve) => { setTimeout(() => resolve(), 1500000); }); }); Then("the clinical data should be stored in hapi fhir", async function () { - this.fhirBundleSentResult.data.entry.forEach(rec => { + this.fhirBundleSentResult.data.entry.forEach((rec) => { expect(rec.response.status).to.match(/201|200/); }); }); Then("the patient data in the Jempi client registry", async function () { - const patientResource = this.fhirBundleSentResult.data.entry.filter(rec => rec.response.location.match('Patient'))[0]; + const patientResource = this.fhirBundleSentResult.data.entry.filter((rec) => + rec.response.location.match("Patient") + )[0]; - PatientID = patientResource.response.location.split('/')[1]; + PatientID = patientResource.response.location.split("/")[1]; - const patient = await sendRequest(`http://${HOST}:5001/fhir/links/Patient/${PatientID}`, 'GET'); + const patient = await sendRequest( + `http://${HOST}:5001/fhir/Patient/${PatientID}`, + "GET" + ); - expect(patient.data.link.filter(pat => pat.other.reference.match(`Patient/${PatientID}`)).length).to.equal(1); + expect( + patient.data.link.filter((pat) => + pat.other.reference.match(`Patient/${PatientID}`) + ).length + ).to.equal(1); }); Then("I should get a successful summary response", function () { @@ -96,22 +125,22 @@ Then("I should get a successful everything response", function () { }); Then("a request to fetch data from the cdr should fail", async function () { - await sendRequest(`http://${HOST}:5001/fhir/links/Patient/${PatientID}`).catch(err => { - expect(err.message).to.match(/ECONNREFUSED|socket hang up|ETIMEDOUT/); - }); + await sendRequest(`http://${HOST}:5001/fhir/Patient/${PatientID}`).catch( + (err) => { + expect(err.message).to.match(/ECONNREFUSED|socket hang up|ETIMEDOUT/); + } + ); }); Then("the data should be stored in clickhouse", async function () { await new Promise((resolve) => { - setTimeout(() => resolve(), 20000) + setTimeout(() => resolve(), 20000); }); - const patient = await clickhouse.query( - query("patient_example"), - ).toPromise(); - const observation = await clickhouse.query( - query("observation_example") - ).toPromise(); + const patient = await clickhouse.query(query("patient_example")).toPromise(); + const observation = await clickhouse + .query(query("observation_example")) + .toPromise(); expect(JSON.parse(patient).rows).to.be.greaterThan(0); expect(JSON.parse(observation).rows).to.be.greaterThan(0);