- "Watch" files
- FileWatcher recognize a new file inside the target folder.
- The ParserManager "choose" the right parser according to the file name.
- "FileChanged" event is invoked in case there is a parser for the file.
- Parsing the files
- "General" CSV parser, parse the file and extract all the rows from the file in the form of key-value paires.
- The relevant parser, convert the rows into Patient/Treatment objects.
- Save the data in the DB
- FileWatcher - get updates about new files in the "csvs" folder
- File Handler (Child process):
- ParserManager - a singleton class that contain:
- Hospital(s) parser(s) - each parser "knows" what data it should get and parse/convert it to object in the DB
- DB Connection and (Patient / Treatment) Models
logs messages are printed to the console and to a file in .logs/trace.log
- Run
yarn install
ornpm install
to install all the dependencies for the project - Start the docker containers by running
docker-compose up -d
command
This will start 2 containers:- MongoDB - to save the data
- Redis - to save events for the Queue
- Run the watcher, and the handlers
by runningyarn start
ornpm start