Skip to content

Commit

Permalink
Merge pull request #254 from jembi/TB-201-update-jempi-config
Browse files Browse the repository at this point in the history
TB-201 Update JeMPI Docker Images Environment Variables
  • Loading branch information
MatthewErispe authored Oct 17, 2023
2 parents c6f479e + f632480 commit 7e241fb
Show file tree
Hide file tree
Showing 24 changed files with 857 additions and 145 deletions.
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

0 comments on commit 7e241fb

Please sign in to comment.