Coder Social home page Coder Social logo

eid-process-queue's Introduction

EID Queue Processor

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

Project set up

  1. Fork the project
  2. Clone the project
  3. 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.

Requirements

  1. Node Version 16+
  2. Docker

Getting started

npm install npm start

Building and deployment

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> .

eid-process-queue's People

Contributors

maikofelix47 avatar drizzentic avatar graycemuthui avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.