ERAS Interventions Generator - JU-DEV-Bootcamps/ERAS GitHub Wiki

ERAS Interventions Generator

Warning! This script is intended to be used for testing purposes on local environments only. Proceed with caution if trying to use it on deployed environments.

JavaScript based generator for ERAS Interventions. It uses node-postgres external library to create a connection with the database and run queries to it.

Requirements

Script

The script prompts for user input to determine how many interventions should be created and under which assessments they should be added. After that, creates a client connection to the database, generates a PostgreSQL query, and runs it against the database.

The script has basic validations for user input to ensure correctness in data.

Link to script in SharePoint: eras-interventions-generator.js

How to use it

  • Make sure you have all the requirements in your local environment.
  • Add the database connection configuration data to match your local environment in the script connectionConfig object.
const connectionConfig = {
    user: '', //POSTGRES_USERNAME
    password: '', //POSTGRES_PASSWORD
    host: '', //POSTGRES_HOST
    port: 0, //POSTGRES_PORT
    database: '' //POSTGRES_DATABASE_NAME
}
  • Make the script executable.
  • Run the script and provide the prompted information.