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

JeMPI Configuration Update #284

Merged
merged 11 commits into from
Apr 25, 2024
19 changes: 11 additions & 8 deletions client-registry-jempi/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@

# JeMPI Client Registry Component - docker-swarm

This component consists of two services:

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

## Api endpoints

Expand All @@ -15,7 +14,7 @@ This component consists of two services:
via the api (in JeMPI format)

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

{
"candidateThreshold": 0.9,
Expand Down Expand Up @@ -83,14 +82,18 @@ The `candidateThreshold` can optionally be set in the request query. The default
]
}
```

> 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>
POST - http://localhost:50000/JeMPI/expandedGoldenRecord
{
"gid":"<PATIENT_GOLDEN_ID>"
}
```

via the [mapping mediator](https://github.com/jembi/openhim-mediator-mapping) (returns patient in fhir format)
Expand All @@ -104,7 +107,7 @@ GET - http://localhost:3003/fhir/Patient/<PATIENT_GOLDEN_ID>
via the api (in JeMPI format)

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

{
"goldenId": "0x5",
Expand Down Expand Up @@ -167,7 +170,7 @@ PUT - http://localhost:3003/fhir/Patient/<PATIENT_GOLDEN_RECORD>
via the api (returns in JeMPI format)

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

{
"operand": {
Expand Down Expand Up @@ -201,7 +204,7 @@ Query parameters - family, given, telecom, identifier, gender, birthDate, addres
via the api (in JeMPI format)

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

{
"operand": {
Expand Down
11 changes: 9 additions & 2 deletions client-registry-jempi/docker-compose.api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@ services:
LOG4J2_LEVEL: ${LOG4J2_LEVEL}
POSTGRESQL_IP: ${JEMPI_REPMGR_PRIMARY_HOST}
POSTGRESQL_PORT: 5432
POSTGRESQL_DATABASE: ${POSTGRESQL_DATABASE}
POSTGRESQL_USER: ${POSTGRESQL_USERNAME}
POSTGRESQL_PASSWORD: ${POSTGRESQL_PASSWORD}
POSTGRESQL_NOTIFICATIONS_DB: ${POSTGRESQL_NOTIFICATIONS_DB}
POSTGRESQL_AUDIT_DB: ${POSTGRESQL_AUDIT_DB}
KAFKA_BOOTSTRAP_SERVERS: ${KAFKA_HOSTS}
KAFKA_APPLICATION_ID: ${KAFKA_APPLICATION_ID_API}
DGRAPH_HOSTS: ${DGRAPH_HOSTS}
DGRAPH_PORTS: ${DGRAPH_PORTS}
API_HTTP_PORT: 50000
LINKER_IP: jempi-linker
LINKER_HTTP_PORT: 50000
CONTROLLER_IP: jempi-controller
CONTROLLER_HTTP_PORT: 50000
volumes:
- "jempi-shared-data:/app/csv"
deploy:
Expand Down Expand Up @@ -47,16 +50,20 @@ services:
JEMPI_SESSION_DOMAIN_NAME: ${JEMPI_SESSION_DOMAIN_NAME}
POSTGRESQL_IP: ${JEMPI_REPMGR_PRIMARY_HOST}
POSTGRESQL_PORT: 5432
POSTGRESQL_DATABASE: ${POSTGRESQL_DATABASE}
POSTGRESQL_USER: ${POSTGRESQL_USERNAME}
POSTGRESQL_PASSWORD: ${POSTGRESQL_PASSWORD}
POSTGRESQL_USERS_DB: ${POSTGRESQL_USERS_DB}
POSTGRESQL_NOTIFICATIONS_DB: ${POSTGRESQL_NOTIFICATIONS_DB}
POSTGRESQL_AUDIT_DB: ${POSTGRESQL_AUDIT_DB}
KAFKA_BOOTSTRAP_SERVERS: ${KAFKA_HOSTS}
KAFKA_APPLICATION_ID: ${KAFKA_APPLICATION_ID_API}
DGRAPH_HOSTS: ${DGRAPH_HOSTS}
DGRAPH_PORTS: ${DGRAPH_PORTS}
API_KC_HTTP_PORT: 50000
LINKER_IP: jempi-linker
LINKER_HTTP_PORT: 50000
CONTROLLER_IP: jempi-controller
CONTROLLER_HTTP_PORT: 50000
volumes:
- "jempi-shared-data:/app/csv"
deploy:
Expand Down
25 changes: 25 additions & 0 deletions client-registry-jempi/docker-compose.combined.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ services:
POSTGRESQL_DATABASE: ${POSTGRESQL_DATABASE}
POSTGRESQL_USER: ${POSTGRESQL_USERNAME}
POSTGRESQL_PASSWORD: ${POSTGRESQL_PASSWORD}
POSTGRESQL_NOTIFICATIONS_DB: ${POSTGRESQL_NOTIFICATIONS_DB}
POSTGRESQL_AUDIT_DB: ${POSTGRESQL_AUDIT_DB}
DGRAPH_HOSTS: ${DGRAPH_HOSTS}
DGRAPH_PORTS: ${DGRAPH_PORTS}
KAFKA_BOOTSTRAP_SERVERS: ${KAFKA_HOSTS}
KAFKA_APPLICATION_ID: ${KAFKA_APPLICATION_ID_CTRL}
KAFKA_CLIENT_ID: ${KAFKA_CLIENT_ID_CTRL}
Expand Down Expand Up @@ -77,6 +81,8 @@ services:
POSTGRESQL_DATABASE: ${POSTGRESQL_DATABASE}
POSTGRESQL_USER: ${POSTGRESQL_USERNAME}
POSTGRESQL_PASSWORD: ${POSTGRESQL_PASSWORD}
POSTGRESQL_NOTIFICATIONS_DB: ${POSTGRESQL_NOTIFICATIONS_DB}
POSTGRESQL_AUDIT_DB: ${POSTGRESQL_AUDIT_DB}
KAFKA_BOOTSTRAP_SERVERS: ${KAFKA_HOSTS}
KAFKA_APPLICATION_ID_INTERACTIONS: ${KAFKA_APPLICATION_ID_INTERACTIONS}
KAFKA_APPLICATION_ID_MU: ${KAFKA_APPLICATION_ID_MU}
Expand All @@ -99,6 +105,25 @@ services:
kafka:
default:

jempi-bootstrapper:
image: jembi/jempi-bootstrapper:${JEMPI_BOOTSTRAPPER_IMAGE_TAG}
environment:
POSTGRESQL_IP: ${JEMPI_REPMGR_PRIMARY_HOST}
POSTGRESQL_PORT: 5432
POSTGRESQL_USER: ${POSTGRESQL_USERNAME}
POSTGRESQL_PASSWORD: ${POSTGRESQL_PASSWORD}
POSTGRESQL_DATABASE: ${POSTGRESQL_DATABASE}
POSTGRESQL_USERS_DB: ${POSTGRESQL_USERS_DB}
POSTGRESQL_NOTIFICATIONS_DB: ${POSTGRESQL_NOTIFICATIONS_DB}
POSTGRESQL_AUDIT_DB: ${POSTGRESQL_AUDIT_DB}
POSTGRESQL_KC_TEST_DB: ${POSTGRESQL_KC_TEST_DB}
KAFKA_BOOTSTRAP_SERVERS: ${KAFKA_HOSTS}
KAFKA_APPLICATION_ID: ${KAFKA_APPLICATION_ID_BOOTSTRAPPER}
DGRAPH_HOSTS: ${DGRAPH_HOSTS}
DGRAPH_PORTS: ${DGRAPH_PORTS}
networks:
kafka:
default:

jempi-postgresql-01:
image: bitnami/postgresql-repmgr:15.2.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ services:
target: /searchAll.json
- source: mediator-config-patientLinks.json
target: /patientLinks.json
- source: mediator-config-patientLinksInteractionResponse.json
target: /patientLinksInteractionResponse.json
- source: mediator-config-patientLinksResponse.json
target: /patientLinksResponse.json
- source: mediator-config-searchAllResponse.json
Expand Down Expand Up @@ -77,6 +79,11 @@ configs:
name: mediator-config-patientLinks.json-${mediator_config_patientLinks_json_DIGEST:?err}
labels:
name: jempi
mediator-config-patientLinksInteractionResponse.json:
file: ./patientLinksInteractionResponse.json
name: mediator-config-patientLinksInteractionResponse.json-${mediator_config_patientLinksInteractionResponse_json_DIGEST:?err}
labels:
name: jempi
mediator-config-patientLinksResponse.json:
file: ./patientLinksResponse.json
name: mediator-config-patientLinksResponse.json-${mediator_config_patientLinksResponse_json_DIGEST:?err}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "Get patient links interaction response",
"endpoint": {
"pattern": "/response/links/interaction/:patientId",
"method": "GET"
},
"transformation": {
"output": "JSON"
},
"inputMapping": {
"urlParams.patientId": "uidList[]+"
},
"requests": {
"response": {
"id": "jempiSearchInteractionForGoldenId",
"config": {
"method": "post",
"url": "http://jempi-api:50000/JeMPI/expandedInteractionsCsv"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Get patient links response",
"name": "Get interaction links response",
"endpoint": {
"pattern": "/response/links/:patientId",
"method": "GET"
Expand All @@ -11,29 +11,25 @@
"inputTransforms": {
"goldenId": "$exists(lookupRequests.jempiSearchGoldenId.data[0].goldenRecordsWithScore[0].goldenRecord.uid) ? lookupRequests.jempiSearchGoldenId.data[0].goldenRecordsWithScore[0].goldenRecord.uid : ''"
},
"inputMapping": {
"transforms.goldenId": "gid"
},
"requests": {
"response": {
"id": "jempiSearchResponse",
"config": {
"method": "get",
"url": "http://jempi-api:50000/JeMPI/expanded-golden-record/:goldenId",
"params": {
"url": {
"goldenId": {
"path": "transforms.goldenId"
}
}
}
"method": "post",
"url": "http://jempi-api:50000/JeMPI/expandedGoldenRecord"
}
},
"lookup": {
"id": "jempiSearchGoldenId",
"config": {
"method": "get",
"url": "http://jempi-api:50000/JeMPI/expanded-interactions-csv",
"url": "http://openhim-mapping-mediator:3003/response/links/interaction/:patientId",
"params": {
"query": {
"uidList": {
"url": {
"patientId": {
"path": "urlParams.patientId"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"headers": {
"contentType": "application/fhir+json"
},
"url": "http://jempi-api:50000/JeMPI/link-interaction"
"url": "http://jempi-api:50000/JeMPI/crLink"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"id": "jempiSearchAllProbabilisticResponse",
"config": {
"method": "post",
"url": "http://jempi-api:50000/JeMPI/cr-find"
"url": "http://jempi-api:50000/JeMPI/crFind"
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"forwardExistingRequestBody": true,
"config": {
"method": "post",
"url": "http://jempi-api:50000/JeMPI/cr-find"
"url": "http://jempi-api:50000/JeMPI/crFind"
}
}
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
{
"name": "Update Patient Response",
"endpoint": {
"pattern": "/update-patient-response/:patientId",
"method": "POST"
},
"transformation": {
"input": "JSON",
"output": "JSON"
},
"inputTransforms": {
"familyName": "$exists(requestBody.name) and $exists(requestBody.name[0]) and $exists(requestBody.name[0].family) ? {'name': 'familyName', 'value': requestBody.name[0].family} : null",
"givenName": "$exists(requestBody.name) and $exists(requestBody.name[0]) and $exists(requestBody.name[0].given) and $exists(requestBody.name[0].given[0]) ? {'name': 'givenName', 'value': requestBody.name[0].given[0]} : null",
"birthDate": "$exists(requestBody.birthDate) ? {'name': 'dob', 'value': requestBody.birthDate} : null",
"gender": "$exists(requestBody.gender) ? {'name': 'gender', 'value': requestBody.gender} : null",
"city": "$exists(requestBody.address) and $exists(requestBody.address[0]) and $exists(requestBody.address[0].city) ? {'name': 'city', 'value': requestBody.address[0].city} : null",
"phoneNumber": "$exists(requestBody.telecom) and $exists(requestBody.telecom[0]) and $exists(requestBody.telecom[0].value) ? {'name': 'phoneNumber', 'value': requestBody.telecom[0].value} : null",
"nationalId": "$exists(requestBody.identifier) and $exists(requestBody.identifier[0]) and $count($filter(requestBody.identifier, function($v) {$contains($v.system, 'NationalID')})) > 0 ? {'name': 'nationalId', 'value': $filter(requestBody.identifier, function($v) {$contains($v.system, 'NationalID')})[0].value} : null"
},
"inputMapping": {
"urlParams.patientId": "goldenId",
"transforms.familyName": "fields[]+",
"transforms.givenName": "fields[]+",
"transforms.birthDate": "fields[]+",
"transforms.gender": "fields[]+",
"transforms.city": "fields[]+",
"transforms.phoneNumber": "fields[]+",
"transforms.nationalId": "fields[]+"
},
"requests": {
"response": {
"id": "jempiUpdateResponse",
"primary": true,
"config": {
"method": "patch",
"headers": {
"contentType": "application/json"
},
"url": "http://jempi-api:50000/JeMPI/cr-update-fields"
}
"name": "Update Patient Response",
"endpoint": {
"pattern": "/update-patient-response/:patientId",
"method": "POST"
},
"transformation": {
"input": "JSON",
"output": "JSON"
},
"inputTransforms": {
"familyName": "$exists(requestBody.name) and $exists(requestBody.name[0]) and $exists(requestBody.name[0].family) ? {'name': 'familyName', 'value': requestBody.name[0].family} : null",
"givenName": "$exists(requestBody.name) and $exists(requestBody.name[0]) and $exists(requestBody.name[0].given) and $exists(requestBody.name[0].given[0]) ? {'name': 'givenName', 'value': requestBody.name[0].given[0]} : null",
"birthDate": "$exists(requestBody.birthDate) ? {'name': 'dob', 'value': requestBody.birthDate} : null",
"gender": "$exists(requestBody.gender) ? {'name': 'gender', 'value': requestBody.gender} : null",
"city": "$exists(requestBody.address) and $exists(requestBody.address[0]) and $exists(requestBody.address[0].city) ? {'name': 'city', 'value': requestBody.address[0].city} : null",
"phoneNumber": "$exists(requestBody.telecom) and $exists(requestBody.telecom[0]) and $exists(requestBody.telecom[0].value) ? {'name': 'phoneNumber', 'value': requestBody.telecom[0].value} : null",
"nationalId": "$exists(requestBody.identifier) and $exists(requestBody.identifier[0]) and $count($filter(requestBody.identifier, function($v) {$contains($v.system, 'NationalID')})) > 0 ? {'name': 'nationalId', 'value': $filter(requestBody.identifier, function($v) {$contains($v.system, 'NationalID')})[0].value} : null"
},
"inputMapping": {
"urlParams.patientId": "goldenId",
"transforms.familyName": "fields[]+",
"transforms.givenName": "fields[]+",
"transforms.birthDate": "fields[]+",
"transforms.gender": "fields[]+",
"transforms.city": "fields[]+",
"transforms.phoneNumber": "fields[]+",
"transforms.nationalId": "fields[]+"
},
"requests": {
"response": {
"id": "jempiUpdateResponse",
"primary": true,
"config": {
"method": "post",
"headers": {
"contentType": "application/json"
},
"url": "http://jempi-api:50000/JeMPI/crUpdateFields"
}
}
}
}
Loading