This projet aims to handle patients stored in the lab sync queue. It takes the patients from the queue one at a time and sends an api request to the Ampath and Alupe systems. Its only task is to pick patients from the queue, and sync them at predefined intervals specified in the configuratio file
- Fork the project
- Clone the project
- Create a conf folder in the root directory with config.mjs file with the following configuration
"use strict";
const db = {
mysql: {
connectionLimit: 2,
host: "hostip",
port: "port",
user: "username",
password: "password",
},
};
const server = {
etl: {
lab1: "lab1url",
lab2: "lab2url",
},
amrs: {
auth: "authtoken",
},
};
const queueTables = {
ampath: "queue_table_1",
alupe: "queue_table_2",
};
const syncIntervalSettings = {
ampath: {
peakHrSyncInterval: 10000,
offpeakHrSyncInterval: 5000,
},
alupe: {
peakHrSyncInterval: 30000,
offpeakHrSyncInterval: 5000,
},
};
export { db, server, queueTables, syncIntervalSettings };
auth
this is the base64 encoded string of the username and password for the amrs server.
peakHrSyncInterval
the sync interval during system peak hours.
offpeakHrSyncInterval
the sync interval during system off peak hours.
queueTables
the tables that hold the patients to be synced.
- Node Version 16+
- Docker
npm install
npm start
docker build -f Dockerfile -t ampathke/eid-process-queue:<tag> .
sudo docker run --name eid-process-queue -d --restart unless-stopped --mount type=bind,source="<path to conf folder>",target="/usr/src/app/conf" ampathke/eid-process-queue:<tag> .