Skip to content

Commit 0882027

Browse files
authored
Merge pull request #317 from jembi/CU-86bzt2p80_Enhance-FHIR-IG-importer-platform-package-registration-json-to-be-configurable
Cu 86bzt2p80 enhance fhir ig importer platform package registration json to be configurable
2 parents c135dd3 + 9613320 commit 0882027

File tree

12 files changed

+53
-9
lines changed

12 files changed

+53
-9
lines changed

fhir-ig-importer/importer/docker-compose.config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ services:
1212
OPENHIM_API_PASSWORD: ${OPENHIM_PASSWORD}
1313
# Reject unauthorised is only needed if the OpenHIM's SSL is not setup
1414
NODE_TLS_REJECT_UNAUTHORIZED: 0
15+
OPENHIM_CONSOLE_BASE_URL: ${OPENHIM_CONSOLE_BASE_URL}
1516
command: sh -c "node openhimConfig.js"
1617
configs:
1718
- source: fhir-ig-importer-config-importer-openhimConfig.js

fhir-ig-importer/importer/volume/ig-importer-app.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "FHIR IG microfrontend app",
44
"category": "HIE Configuration",
55
"type": "esmodule",
6-
"url": "https://openhimconsole.<domain>/fhir-ig-importer",
6+
"url": "<openhim-console-url>/fhir-ig-importer",
77
"showInPortal": true,
88
"showInSideBar": true,
99
"access_roles": ["admin"],

fhir-ig-importer/importer/volume/openhimConfig.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,18 @@ const appJsonData = JSON.parse(
4343
fs.readFileSync(path.resolve(__dirname, "ig-importer-app.json"))
4444
);
4545

46+
//Substitute the url with environ variable
47+
48+
let url = appJsonData.url;
49+
if (!process.env.OPENHIM_CONSOLE_BASE_URL) {
50+
throw new Error("Environment variable OPENHIM_CONSOLE_BASE_URL is not set");
51+
}
52+
let newUrl = url.replace(
53+
"<openhim-console-url>",
54+
process.env.OPENHIM_CONSOLE_BASE_URL
55+
);
56+
57+
appJsonData.url = newUrl;
4658
const data = JSON.stringify(jsonData);
4759
const appData = JSON.stringify(appJsonData);
4860

fhir-ig-importer/package-metadata.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"FHIR_IG_IMPORTER_CORE_URL": "http://0.0.0.0:3001/fhir/ig/v1.0",
1717
"FHIR_IG_IMPORTER_UI_VERSION": "latest",
1818
"FHIR_IG_IMPORTER_CORE_VERSION": "latest",
19+
"OPENHIM_CONSOLE_BASE_URL": "http://localhost:9000",
1920
"OPENHIM_API_USERNAME": "root@openhim.org",
2021
"OPENHIM_API_PASSWORD": "instant101"
2122
}

kafka-mapper-consumer/consumer-ui-app.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Kafka mapper consumer microfrontends app",
44
"category": "HIE Configuration",
55
"type": "esmodule",
6-
"url": "http://localhost:8091/jembi-kafka-mapper-consumer-ui.js",
6+
"url": "<openhim-console-url>/kafka-mapper-consumer-ui",
77
"showInPortal": true,
88
"showInSideBar": false,
99
"access_roles": ["admin"],

kafka-mapper-consumer/docker-compose.config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ services:
1212
OPENHIM_API_PASSWORD: ${OPENHIM_PASSWORD}
1313
# Reject unauthorised is only needed if the OpenHIM's SSL is not setup
1414
NODE_TLS_REJECT_UNAUTHORIZED: 0
15+
OPENHIM_CONSOLE_BASE_URL: ${OPENHIM_CONSOLE_BASE_URL}
1516
command: sh -c "node openhimConfig.js"
1617
configs:
1718
- source: kafka-mapper-consumer-openhimConfig.js

kafka-mapper-consumer/openhimConfig.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,20 @@ function makeRequest(options, data) {
3737
const appJsonData = JSON.parse(
3838
fs.readFileSync(path.resolve(__dirname, "consumer-ui-app.json"))
3939
);
40+
//Substitute the url with environ variable
41+
42+
let url = appJsonData.url;
43+
44+
if (!process.env.OPENHIM_CONSOLE_BASE_URL) {
45+
throw new Error("Environment variable OPENHIM_CONSOLE_BASE_URL is not set");
46+
}
47+
48+
let newUrl = url.replace(
49+
"<openhim-console-url>",
50+
process.env.OPENHIM_CONSOLE_BASE_URL
51+
);
52+
53+
appJsonData.url = newUrl;
4054
const appData = JSON.stringify(appJsonData);
4155

4256
const options = {

kafka-mapper-consumer/package-metadata.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"REGISTER_MEDIATOR": "true",
1818
"CLICKHOUSE_HOST": "analytics-datastore-clickhouse",
1919
"CLICKHOUSE_PORT": "8123",
20-
"KAFKA_CONSUMER_MAPPER_MEDIATOR_VERSION": "jembi/kafka-mapper-consumer:v0.0.1",
21-
"KAFKA_CONSUMER_MAPPER_UI_VERSION": "jembi/kafka-mapper-consumer-ui:v0.0.1"
20+
"KAFKA_CONSUMER_MAPPER_MEDIATOR_VERSION": "jembi/kafka-mapper-consumer:latest",
21+
"KAFKA_CONSUMER_MAPPER_UI_VERSION": "jembi/kafka-mapper-consumer-ui:latest",
22+
"OPENHIM_CONSOLE_BASE_URL": "http://localhost:9000"
2223
}
2324
}

reprocess-mediator/docker-compose.config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ services:
1212
OPENHIM_API_PASSWORD: ${OPENHIM_PASSWORD}
1313
# Reject unauthorised is only needed if the OpenHIM's SSL is not setup
1414
NODE_TLS_REJECT_UNAUTHORIZED: 0
15+
OPENHIM_CONSOLE_BASE_URL: ${OPENHIM_CONSOLE_BASE_URL}
1516
command: sh -c "node openhimConfig.js"
1617
configs:
1718
- source: reprocess-openhimConfig.js

reprocess-mediator/openhimConfig.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,19 @@ function makeRequest(options, data) {
3737
const appJsonData = JSON.parse(
3838
fs.readFileSync(path.resolve(__dirname, "reprocess-ui-app.json"))
3939
);
40+
//Substitute the url with environ variable
41+
42+
let url = appJsonData.url;
43+
44+
if (!process.env.OPENHIM_CONSOLE_BASE_URL) {
45+
throw new Error("Environment variable OPENHIM_CONSOLE_BASE_URL is not set");
46+
}
47+
let newUrl = url.replace(
48+
"<openhim-console-url>",
49+
process.env.OPENHIM_CONSOLE_BASE_URL
50+
);
51+
52+
appJsonData.url = newUrl;
4053
const appData = JSON.stringify(appJsonData);
4154

4255
const options = {

0 commit comments

Comments
 (0)