Skip to content

Commit 5ba58ca

Browse files
authored
Merge pull request #290 from ItsMurumba/TB-408
Adds Reprocess package (UI + Mediator)
2 parents 44a566b + 3f8693a commit 5ba58ca

File tree

7 files changed

+149
-11
lines changed

7 files changed

+149
-11
lines changed

config.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ packages:
2424
- identity-access-manager-keycloak
2525
- openhim-mapping-mediator
2626
- database-postgres
27+
- reprocess-mediator
2728
- fhir-ig-importer
2829

2930
profiles:
@@ -75,10 +76,3 @@ profiles:
7576
envFiles:
7677
- mpi.env
7778

78-
- name: test-recipe
79-
packages:
80-
- fhir-ig-importer
81-
- kafka-mapper-consumer
82-
envFiles:
83-
- cdr-dw.env
84-
dev: true

documentation/recipes/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1+
12
---
23
description: Pre-defined recipes for common use cases
34
---
45

56
# 📜 Recipes
67

7-
OpenHIM platform comes bundles with a set of generic packages that can be deployed and configured to support a number of different use cases. To help users of OpenHIM Platform get started with something they can make use of immediately, a number of default OpenHIM Platform reciepes are provided. These help you get started with everything you need setup and configured for a particular use case.
8-
9-
We current support the following default recipes:
10-
8+
OpenHIM platform comes bundled with a set of generic packages that can be deployed and configured to support a number of different use cases. To help users of OpenHIM Platform get started with something they can make use of immediately, a number of default OpenHIM Platform recipes are provided. These help you get started with everything you need setup and configured for a particular use case.
119

10+
We currently support the following default recipes:
1211

1312
<table data-view="cards"><thead><tr><th align="center"></th><th></th><th data-hidden></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td align="center"><strong>Central Data Repository with Data Warehouse</strong></td><td>A FHIR-based Shared Health record linked to an MPI for linking and matching patient demographics and a default reporting pipeline to transform and visualise FHIR data.</td><td></td><td><a href="central-data-repository-with-data-warehousing.md">central-data-repository-with-data-warehousing.md</a></td></tr><tr><td align="center"><strong>Central Data Repository</strong></td><td>A FHIR-based Shared Health record linked to an MPI for linking and matching patient demographics. No reporting is include but all FHIR data is pushed to Kafka for external system to use.</td><td></td><td><a href="central-data-repository-no-reporting.md">central-data-repository-no-reporting.md</a></td></tr><tr><td align="center"><strong>Master Patient Index</strong></td><td>A master patient index setup using JeMPI. it also includes OpenHIM as the API gateway providing security, a mapping mediator to allow FHIR-based communication with JeMPI and Keycloak to support user management.</td><td></td><td><a href="master-patient-index.md">master-patient-index.md</a></td></tr></tbody></table>

interoperability-layer-openhim/docker-compose.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ services:
1111
public:
1212
default:
1313
prometheus:
14+
reprocess:
1415
environment:
1516
- mongo_url=${OPENHIM_MONGO_URL}
1617
- mongo_atnaUrl=${OPENHIM_MONGO_ATNAURL}
@@ -22,6 +23,7 @@ services:
2223
- api_openid_callbackUrl=${KC_OPENHIM_ROOT_URL}
2324
- api_openid_clientId=${KC_OPENHIM_CLIENT_ID}
2425
- api_openid_clientSecret=${KC_OPENHIM_CLIENT_SECRET}
26+
- openhimConsoleBaseUrl=${OPENHIM_CONSOLE_BASE_URL}
2527
deploy:
2628
replicas: ${OPENHIM_CORE_INSTANCES}
2729
placement:
@@ -84,4 +86,7 @@ networks:
8486
prometheus:
8587
name: prometheus_public
8688
external: true
89+
reprocess:
90+
name: reprocess_public
91+
external: true
8792
default:
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: '3.9'
2+
3+
services:
4+
reprocess-mediator:
5+
ports:
6+
- target: 3000
7+
published: 3000
8+
mode: host
9+
10+
reprocess-mediator-ui:
11+
ports:
12+
- target: 80
13+
published: 3030
14+
mode: host
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
version: '3.9'
2+
3+
services:
4+
reprocess-mediator:
5+
image: jembi/reprocess-mediator:${REPROCESS_CORE_VERSION}
6+
networks:
7+
openhim:
8+
reprocess:
9+
environment:
10+
TRUST_SELF_SIGNED: ${TRUST_SELF_SIGNED}
11+
OPENHIM_MEDIATOR_URL: ${OPENHIM_MEDIATOR_URL}
12+
OPENHIM_USERNAME: ${OPENHIM_USERNAME}
13+
OPENHIM_PASSWORD: ${OPENHIM_PASSWORD}
14+
REGISTER_MEDIATOR: ${REGISTER_MEDIATOR}
15+
16+
reprocess-mediator-ui:
17+
image: jembi/reprocess-mediator-ui:${REPROCESS_UI_VERSION}
18+
networks:
19+
openhim:
20+
reprocess:
21+
environment:
22+
REPROCESSOR_API_BASE_URL: ${REPROCESSOR_API_BASE_URL}
23+
24+
networks:
25+
openhim:
26+
name: openhim_public
27+
external: true
28+
reprocess:
29+
name: reprocess_public
30+
external: true
31+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"id": "reprocess-mediator",
3+
"name": "Reprocess Mediator",
4+
"description": "A mediator that allows for configuring and reprocessing of transactions",
5+
"type": "use-case",
6+
"version": "1.4.2",
7+
"dependencies": ["interoperability-layer-openhim"],
8+
"environmentVariables": {
9+
"TRUST_SELF_SIGNED": "true",
10+
"OPENHIM_MEDIATOR_URL": "https://openhim-core:8080",
11+
"OPENHIM_USERNAME": "root@openhim.org",
12+
"OPENHIM_PASSWORD": "instant101",
13+
"REGISTER_MEDIATOR": "true",
14+
"REPROCESSOR_API_BASE_URL": "http://reprocess-mediator:3000",
15+
"REPROCESS_CORE_VERSION": "latest",
16+
"REPROCESS_UI_VERSION": "latest"
17+
}
18+
}

reprocess-mediator/swarm.sh

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
#!/bin/bash
2+
3+
declare ACTION=""
4+
declare COMPOSE_FILE_PATH=""
5+
declare UTILS_PATH=""
6+
declare STACK="reprocess-mediator"
7+
declare MODE=""
8+
9+
function init_vars() {
10+
ACTION=$1
11+
MODE=$2
12+
13+
COMPOSE_FILE_PATH=$(
14+
cd "$(dirname "${BASH_SOURCE[0]}")" || exit
15+
pwd -P
16+
)
17+
18+
UTILS_PATH="${COMPOSE_FILE_PATH}/../utils"
19+
20+
readonly ACTION
21+
readonly COMPOSE_FILE_PATH
22+
readonly UTILS_PATH
23+
readonly STACK
24+
readonly MODE
25+
}
26+
27+
# shellcheck disable=SC1091
28+
function import_sources() {
29+
source "${UTILS_PATH}/docker-utils.sh"
30+
source "${UTILS_PATH}/log.sh"
31+
}
32+
33+
function initialize_package() {
34+
local reprocess_dev_compose_filename=""
35+
36+
if [[ "${MODE}" == "dev" ]]; then
37+
log info "Running package in DEV mode"
38+
reprocess_dev_compose_filename="docker-compose.dev.yml"
39+
else
40+
log info "Running package in PROD mode"
41+
fi
42+
43+
(
44+
docker::deploy_service $STACK "${COMPOSE_FILE_PATH}" "docker-compose.yml" "$reprocess_dev_compose_filename"
45+
) || {
46+
log error "Failed to deploy package"
47+
exit 1
48+
}
49+
}
50+
51+
function destroy_package() {
52+
docker::stack_destroy $STACK
53+
54+
docker::prune_configs "reprocess-mediator"
55+
}
56+
57+
main() {
58+
init_vars "$@"
59+
import_sources
60+
61+
if [[ "${ACTION}" == "init" ]] || [[ "${ACTION}" == "up" ]]; then
62+
log info "Running package"
63+
64+
initialize_package
65+
elif [[ "${ACTION}" == "down" ]]; then
66+
log info "Scaling down package"
67+
68+
docker::scale_services $STACK 0
69+
elif [[ "${ACTION}" == "destroy" ]]; then
70+
log info "Destroying package"
71+
destroy_package
72+
else
73+
log error "Valid options are: init, up, down, or destroy"
74+
fi
75+
}
76+
77+
main "$@"

0 commit comments

Comments
 (0)