Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cu 86bzt2p80 enhance fhir ig importer platform package registration json to be configurable #317

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions fhir-ig-importer/importer/docker-compose.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ services:
OPENHIM_API_PASSWORD: ${OPENHIM_PASSWORD}
# Reject unauthorised is only needed if the OpenHIM's SSL is not setup
NODE_TLS_REJECT_UNAUTHORIZED: 0
OPENHIM_CONSOLE_BASE_URL: ${OPENHIM_CONSOLE_BASE_URL}
command: sh -c "node openhimConfig.js"
configs:
- source: fhir-ig-importer-config-importer-openhimConfig.js
Expand Down
2 changes: 1 addition & 1 deletion fhir-ig-importer/importer/volume/ig-importer-app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "FHIR IG microfrontend app",
"category": "HIE Configuration",
"type": "esmodule",
"url": "https://openhimconsole.<domain>/fhir-ig-importer",
"url": "<openhim-console-url>/fhir-ig-importer",
"showInPortal": true,
"showInSideBar": true,
"access_roles": ["admin"],
Expand Down
12 changes: 12 additions & 0 deletions fhir-ig-importer/importer/volume/openhimConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ const appJsonData = JSON.parse(
fs.readFileSync(path.resolve(__dirname, "ig-importer-app.json"))
);

//Substitute the url with environ variable

let url = appJsonData.url;
if (!process.env.OPENHIM_CONSOLE_BASE_URL) {
throw new Error("Environment variable OPENHIM_CONSOLE_BASE_URL is not set");
}
let newUrl = url.replace(
"<openhim-console-url>",
process.env.OPENHIM_CONSOLE_BASE_URL
);

appJsonData.url = newUrl;
const data = JSON.stringify(jsonData);
const appData = JSON.stringify(appJsonData);

Expand Down
1 change: 1 addition & 0 deletions fhir-ig-importer/package-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"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",
"OPENHIM_CONSOLE_BASE_URL": "http://localhost:9000",
"OPENHIM_API_USERNAME": "[email protected]",
"OPENHIM_API_PASSWORD": "instant101"
}
Expand Down
2 changes: 1 addition & 1 deletion kafka-mapper-consumer/consumer-ui-app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Kafka mapper consumer microfrontends app",
"category": "HIE Configuration",
"type": "esmodule",
"url": "http://localhost:8091/jembi-kafka-mapper-consumer-ui.js",
"url": "<openhim-console-url>/kafka-mapper-consumer-ui",
"showInPortal": true,
"showInSideBar": false,
"access_roles": ["admin"],
Expand Down
1 change: 1 addition & 0 deletions kafka-mapper-consumer/docker-compose.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ services:
OPENHIM_API_PASSWORD: ${OPENHIM_PASSWORD}
# Reject unauthorised is only needed if the OpenHIM's SSL is not setup
NODE_TLS_REJECT_UNAUTHORIZED: 0
OPENHIM_CONSOLE_BASE_URL: ${OPENHIM_CONSOLE_BASE_URL}
command: sh -c "node openhimConfig.js"
configs:
- source: kafka-mapper-consumer-openhimConfig.js
Expand Down
14 changes: 14 additions & 0 deletions kafka-mapper-consumer/openhimConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,20 @@ function makeRequest(options, data) {
const appJsonData = JSON.parse(
fs.readFileSync(path.resolve(__dirname, "consumer-ui-app.json"))
);
//Substitute the url with environ variable

let url = appJsonData.url;

if (!process.env.OPENHIM_CONSOLE_BASE_URL) {
throw new Error("Environment variable OPENHIM_CONSOLE_BASE_URL is not set");
}

let newUrl = url.replace(
"<openhim-console-url>",
process.env.OPENHIM_CONSOLE_BASE_URL
);

appJsonData.url = newUrl;
const appData = JSON.stringify(appJsonData);

const options = {
Expand Down
5 changes: 3 additions & 2 deletions kafka-mapper-consumer/package-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"REGISTER_MEDIATOR": "true",
"CLICKHOUSE_HOST": "analytics-datastore-clickhouse",
"CLICKHOUSE_PORT": "8123",
"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"
"KAFKA_CONSUMER_MAPPER_MEDIATOR_VERSION": "jembi/kafka-mapper-consumer:latest",
"KAFKA_CONSUMER_MAPPER_UI_VERSION": "jembi/kafka-mapper-consumer-ui:latest",
"OPENHIM_CONSOLE_BASE_URL": "http://localhost:9000"
}
}
1 change: 1 addition & 0 deletions reprocess-mediator/docker-compose.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ services:
OPENHIM_API_PASSWORD: ${OPENHIM_PASSWORD}
# Reject unauthorised is only needed if the OpenHIM's SSL is not setup
NODE_TLS_REJECT_UNAUTHORIZED: 0
OPENHIM_CONSOLE_BASE_URL: ${OPENHIM_CONSOLE_BASE_URL}
command: sh -c "node openhimConfig.js"
configs:
- source: reprocess-openhimConfig.js
Expand Down
13 changes: 13 additions & 0 deletions reprocess-mediator/openhimConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,19 @@ function makeRequest(options, data) {
const appJsonData = JSON.parse(
fs.readFileSync(path.resolve(__dirname, "reprocess-ui-app.json"))
);
//Substitute the url with environ variable

let url = appJsonData.url;

if (!process.env.OPENHIM_CONSOLE_BASE_URL) {
throw new Error("Environment variable OPENHIM_CONSOLE_BASE_URL is not set");
}
let newUrl = url.replace(
"<openhim-console-url>",
process.env.OPENHIM_CONSOLE_BASE_URL
);

appJsonData.url = newUrl;
const appData = JSON.stringify(appJsonData);

const options = {
Expand Down
8 changes: 4 additions & 4 deletions reprocess-mediator/package-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"OPENHIM_PASSWORD": "instant101",
"REGISTER_MEDIATOR": "true",
"REPROCESSOR_API_BASE_URL": "http://reprocess-mediator:3000",
"REPROCESS_MEDIATOR_VERSION": "jembi/reprocess-mediator:v0.1.0",
"REPROCESS_MEDIATOR_UI_VERSION": "jembi/reprocess-mediator-ui:v0.1.0",
"REPROCESS_MEDIATOR_VERSION": "jembi/reprocess-mediator:latest",
"REPROCESS_MEDIATOR_UI_VERSION": "jembi/reprocess-mediator-ui:latest",
"MONGODB_CONNECTION_STRING": "mongodb://mongo-1:27017/openhim",
"MONGODB_DIRECT_CONNECTION": false

"MONGODB_DIRECT_CONNECTION": false,
"OPENHIM_CONSOLE_BASE_URL": "http://localhost:9000"
}
}
2 changes: 1 addition & 1 deletion reprocess-mediator/reprocess-ui-app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Reprocess microfrontends app",
"category": "HIE Configuration",
"type": "esmodule",
"url": "http://localhost:3030/jembi-reprocessor-mediator-microfrontend.js",
"url": "<openhim-console-url>/reprocess-mediator-ui",
"showInPortal": true,
"showInSideBar": false,
"access_roles": ["admin"],
Expand Down
Loading