This mediator is intended for sending request to sante-mpi mediator
The private-config.json is used to store all the credentials and connection URLs of the mediator. The credentials are currently left out, so the file needs to be renamed with all the required credentials and URLs before installation for the mediator to work.
-
Node.js 12 or later -
npm (version 6 or higher) -
MongoDB -
Docker -
OpenHIM -
Postgress
To run the mediator without connecting it to the OpenHIM server, you can use the following commands if you have Node.js installed:
-
Clone or download the repository.
git clone https://github.com/GP-Namibia/emr-mpi-endpoint-mediator.git -
cd emr-mpi-endpoint-mediator -
Run
npm installto install the dependencies -
Start the development server with
npm start
The mediator can be built and run using the docker-compose.yml file configurations.
-
Clone or download the repository.
git clone https://github.com/GP-Namibia/emr-mpi-endpoint-mediator.git -
Navigate to
odk-central-mediatorfolder where thedocker-compose.ymlis. -
docker-compose build -
docker-compose up -d -
docker network create openHIM
You can run the Unit tests using the following command:
-
cd cd emr-mpi-endpoint-mediator -
npm run test
-
Make a
GETrequest to/localhost:7000/patient?freetext=Peteto perform a free text search for patients on the MPI. -
Make a
GETrequest to/localhost:7000/patient?family=Peter&given=Kento perform a search for patients on the MPI where search fields are specified. -
Make a
POSTrequest to/localhost:7000/patientto create a new patient on the MPI. -
Make a
PUTrequest to/localhost:7000/patient/12WENR6to outlines how an existing patient details will be updated on the MPI. -
Make a
GETrequest to/localhost:7000/Patient/12WENR6to search for a patient where a Health ID is provided. -
Make a
GETrequest to/localhost:7000/similar/12WENR6to retrieve patients that the matching algorithm had classified as possible matches. In other words it performs a linked or chained search on a sub-property. -
Make a
POSTrequest to/localhost:7000/mergeto link patients that are considered to be duplicates i.e. registered more than once. -
Make a
GETrequest to/localhost:7000/QR/12WENR6to search for a patient on the MPI. The response will be used to print the QR Code. -
Make a
GETrequest to/localhost:7000/validate/12WENR6to verify records on the MPI are validated against the NPRS.
The API uses a Beaer Token for authentication. To access the endpoints, you will need to pass a valid token in the Authorization header of your requests.
- Make a
POSTrequest tolocalhost:7000/authendpoint which Generate a token for use when making requests to the MPI
The API uses the following error codes:
-
401Unauthorized: The request could not be authenticated. -
404Not Found: The requested resource could not be found. -
500Internal Server Error: An error occurred on the server.
For more information on the API, please contact the developer.