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

TB-201 Update JeMPI Docker Images Environment Variables #254

Merged
merged 33 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b168573
TB-205 update api env vars
MatthewErispe Oct 3, 2023
e383c21
TB-204 update linker env vars
MatthewErispe Oct 3, 2023
fa230eb
TB-209 update async-processor env vars
MatthewErispe Oct 3, 2023
e4d3c56
update linker service name
MatthewErispe Oct 4, 2023
b376ba3
TB-204 update config with LINKER_HOST var
MatthewErispe Oct 5, 2023
e952de7
TB-207 update controller env vars
MatthewErispe Oct 5, 2023
2768d9e
TB-210 remove old jempi images and config
MatthewErispe Oct 5, 2023
7a1ea7c
TB-208 create etl image and config
MatthewErispe Oct 5, 2023
dcb6c06
TB-205 create shared volume for csv upload/import
MatthewErispe Oct 6, 2023
e93342f
TB-215 update jempi web config
MatthewErispe Oct 6, 2023
dcefccf
TB-201 update jempi notifications script and jempi kafka topics
MatthewErispe Oct 6, 2023
7d6b505
TB-205 update jempi image tags
MatthewErispe Oct 6, 2023
dd6d401
Add the mapings for search, update and create
bradsawadye Oct 10, 2023
267aaf2
Add the dependencies used by the client registry
bradsawadye Oct 10, 2023
010f03a
Run the importer scripts that add the mappoings to the mapping mediator
bradsawadye Oct 10, 2023
9355229
Add the hapi fhir network to the mapping mediator as well as bump the…
bradsawadye Oct 10, 2023
28bee6b
Fix bugs and typos
bradsawadye Oct 10, 2023
9f82360
Fix bug
bradsawadye Oct 10, 2023
93860ca
Merge branch 'TB-201-update-jempi-config' of github.com:jembi/platfor…
bradsawadye Oct 10, 2023
e189ba0
Bump the platform version
bradsawadye Oct 10, 2023
6a97be8
fix typo
bradsawadye Oct 10, 2023
5050bd6
Add documentation
bradsawadye Oct 11, 2023
33791d8
Merge branch 'TB-201-update-jempi-config' of github.com:jembi/platfor…
bradsawadye Oct 11, 2023
5b58fab
add new user for ansible
MatthewErispe Oct 12, 2023
f2ad800
remove old users
MatthewErispe Oct 12, 2023
e52ca1a
update jempi feature
MatthewErispe Oct 12, 2023
67b967a
Add the keyclock network to the jempi web
bradsawadye Oct 12, 2023
b619dbc
Add mappings for the jempi endpoint for retrieving the patients
bradsawadye Oct 16, 2023
3312c58
Update the readme with instructions for retrieving patients in jempi …
bradsawadye Oct 16, 2023
c0b6245
Increase the timeout for the tests
bradsawadye Oct 16, 2023
7e0f091
Only run tests for one package when the infrastructure files are changed
bradsawadye Oct 16, 2023
3297e95
Merge branch 'TB-201-update-jempi-config' into TB-180-add-mapping-for…
MatthewErispe Oct 17, 2023
f632480
Merge pull request #256 from jembi/TB-180-add-mapping-for-cr-find
MatthewErispe Oct 17, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/ci-cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
run-e2e-tests:
runs-on: ubuntu-20.04
needs: configure-e2e-server
timeout-minutes: 80
timeout-minutes: 120
steps:
- uses: actions/checkout@v3
with:
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ CHANGED_FILES=($@)

cd ../../test/cucumber/ || exit

# This ensures that the openhim and its mediators' tests are run only once when the openhim and its mediators have all been modified
openhimRan="false"

declare -A changed_packages
for package in "${CHANGED_FILES[@]}"; do
if [[ $package == *"features/cluster-mode"* ]]; then
Expand All @@ -28,12 +31,10 @@ elif [[ "${!changed_packages[*]}" == *"features/single-mode"* ]] && [[ $NODE_MOD
DOCKER_HOST=ssh://ubuntu@$GITHUB_RUN_ID.jembi.cloud yarn test:single
elif [[ "${!changed_packages[*]}" == *"features/cluster-mode"* ]] && [[ $NODE_MODE == "cluster" ]]; then
DOCKER_HOST=ssh://ubuntu@$GITHUB_RUN_ID.jembi.cloud yarn test:cluster
elif [[ "${!changed_packages[*]}" == *"infrastructure"* ]]; then
DOCKER_HOST=ssh://ubuntu@$GITHUB_RUN_ID.jembi.cloud yarn test:"$NODE_MODE"
elif [[ "${!changed_packages[*]}" == *"infrastructure"* ]] && [[ $openhimRan == "false" ]]; then
openhimRan="true"
DOCKER_HOST=ssh://ubuntu@$GITHUB_RUN_ID.jembi.cloud yarn test:"$NODE_MODE":openhim
else
# This ensures that the openhim and its mediators' tests are run only once when the openhim and its mediators have all been modified
openhimRan="false"

for folder_name in "${!changed_packages[@]}"; do
echo "$folder_name was changed"

Expand Down
209 changes: 209 additions & 0 deletions client-registry-jempi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@

# JeMPI Client Registry Component - docker-swarm

This component consists of two services:

* JeMPI Web UI - http://localhost:3033
* JeMPI API - http://localhost:50000/JeMPI

## Api endpoints

> This service uses the openhim mapping mediator to map fhir formated patients into the JeMPI format

### Registering a patient

via the api (in JeMPI format)

```sh
POST - http://localhost:50000/JeMPI/cr-register

{
"candidateThreshold": 0.9,
"sourceId": {
"facility": "fac1",
"patient": "pat1"
},
"uniqueInteractionData": {
"auxDateCreated": "2016-10-30T14:22:25.285",
"auxId" : "1234",
"auxClinicalData" : "SOME DATA"
},
"demographicData": {
"givenName": "XXX",
"familyName": "YYY",
"gender": "female",
"dob": "20000101",
"phoneNumber": "123456789",
"city": "Cape Town",
"nationalId": "1234567890"
}
}
```

via the [mapping mediator](https://github.com/jembi/openhim-mediator-mapping) (in fhir format)

```sh

POST http://localhost:3003/fhir/Patient

{
"resourceType": "Patient",
"gender": "male",
"birthDate": "1968-04-15",
"name": [
{
"family": "cread",
"given": [
"Jacess"
]
}
],
"address": [
{
"city": "Indianapolis"
}
],
"identifier": [
{
"system": "https://instantopenhie.org/client1",
"value": "6b4573e7-f9dc-49ea-9ebb-daaa6b74a534"
},
{
"value": "60934be6-ce88-48af-958e-02d88f77eec9",
"system": "NationalID"
}
],
"telecom": [
{
"value": "899-882-4991",
"system": "phone"
}
]
}
```
> The identifier with the system 'NationalID' maps to the 'nationalId' property in JeMPI

## Querying a patient by id

via the api (returns patient in JeMPI formated)

```sh
GET - http://localhost:50000/JeMPI/expanded-golden-record/<PATIENT_GOLDEN_ID>
```

via the [mapping mediator](https://github.com/jembi/openhim-mediator-mapping) (returns patient in fhir format)

```sh
GET - http://localhost:3003/fhir/Patient/<PATIENT_GOLDEN_ID>
```

## Updating a patient

via the api (in JeMPI format)

```sh
PATCH - http://localhost:50000/JeMPI/cr-update-fields

{
"goldenId": "0x5",
"fields": [
{
"name": "givenName",
"value": "xxx"
},
{
"name": "familyName",
"value": "yyy"
}
]
}
```

via the [mapping mediator](https://github.com/jembi/openhim-mediator-mapping) (in fhir format)

```sh
PUT - http://localhost:3003/fhir/update/Patient/<PATIENT_GOLDEN_RECORD>

{
"resourceType": "Patient",
"gender": "male",
"birthDate": "1968-04-15",
"name": [
{
"family": "cread",
"given": [
"Jacess"
]
}
],
"address": [
{
"city": "Indianapolis"
}
],
"identifier": [
{
"system": "https://instantopenhie.org/client1",
"value": "6b4573e7-f9dc-49ea-9ebb-daaa6b74a534"
},
{
"value": "60934be6-ce88-48af-958e-02d88f77eec9",
"system": "NationalID"
}
],
"telecom": [
{
"value": "899-882-4991",
"system": "phone"
}
]
}
```

## Query all patients deterministic

via the api (returns in JeMPI format)

```sh
POST http://localhost:50000/JeMPI/cr-find

{
"operand": {
"fn": "eq",
"name": "givenName",
"value": "xxx"
},
"operands": [
{
"operator": "and",
"operand": {
"fn": "eq",
"name": "familyName",
"value": "yyy"
}
}
]
}
```

via the [mapping mediator](https://github.com/jembi/openhim-mediator-mapping) (in fhir format)

```sh
POST http://localhost:3003/fhir/Patients

{
"resourceType": "Parameters",
"parameters": [
{
"name": "and", // matches to the operator (options are "and" and "or")
"valueCode": "familyName", // matches to the field name (options are "givenName", "familyName", "dob", "nationalId", "gender", "city" and "phoneNumber")
"valueString": "creexxxeead" // matches to value of the field
},
{
"name": "and",
"valueCode": "city",
"valueString": "Indianapeeolis"
}
]
}
```
29 changes: 14 additions & 15 deletions client-registry-jempi/docker-compose.api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ services:
jempi-api:
image: jembi/jempi-api:${JEMPI_API_IMAGE_TAG}
environment:
KC_REALM_NAME: ${KC_REALM_NAME}
KC_JEMPI_CLIENT_ID: ${KC_JEMPI_CLIENT_ID}
KC_JEMPI_CLIENT_SECRET: ${KC_JEMPI_CLIENT_SECRET}
KC_API_URL: ${KC_API_URL}
KC_JEMPI_ROOT_URL: ${KC_JEMPI_ROOT_URL}
JEMPI_SESSION_SECRET: ${JEMPI_SESSION_SECRET}
kafka.bootstrap.servers: ${KAFKA_HOSTS}
JEMPI_FILE_IMPORT_MAX_SIZE_BYTE: ${JEMPI_FILE_IMPORT_MAX_SIZE_BYTE}
JEMPI_SESSION_SECURE: ${JEMPI_SESSION_SECURE}
JEMPI_SESSION_DOMAIN_NAME: ${DOMAIN_NAME}
postgres.server: ${JEMPI_REPMGR_PARTNER_NODES}
POSTGRESQL_USER: ${POSTGRESQL_USERNAME}
POSTGRESQL_PASSWORD: ${POSTGRESQL_PASSWORD}
POSTGRESQL_DATABASE: ${POSTGRESQL_DATABASE}
KAFKA_BOOTSTRAP_SERVERS: ${KAFKA_HOSTS}
KAFKA_APPLICATION_ID: ${KAFKA_APPLICATION_ID_API}
DGRAPH_HOSTS: ${DGRAPH_HOSTS}
DGRAPH_PORTS: ${DGRAPH_PORTS}
HTTP_SERVER_PORT: ${HTTP_SERVER_PORT}
LOG4J2_LEVEL: ${LOG4J2_LEVEL}
LINKER_HOST: ${LINKER_HOST}
volumes:
- "jempi-shared-data:/app/csv"
deploy:
replicas: ${JEMPI_API_INSTANCES}
resources:
Expand All @@ -24,18 +25,16 @@ services:
memory: ${JEMPI_API_MEMORY_RESERVE}
networks:
reverse-proxy:
keycloak:
kafka:
default:

volumes:
jempi-shared-data:

networks:
reverse-proxy:
name: reverse-proxy_public
external: true
keycloak:
name: keycloak_public
external: true
kafka:
name: kafka_public
external: true
Expand Down
6 changes: 0 additions & 6 deletions client-registry-jempi/docker-compose.combined-dev.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
version: '3.9'

services:
jempi-sync-receiver:
ports:
- published: 50040
target: 50000
protocol: tcp
mode: host

jempi-controller:
ports:
Expand Down
Loading
Loading