Giter Club home page Giter Club logo

gist-2.0-js's Introduction

GIST-2.0-JS (Now GIST 3.0)

Documentation:

Installation:

  1. Download GitHub repository
  2. go into each folder and type “npm i” this will download all the packages required for the scripts/servers to run properly.

C2Q Folder - C2Q reads the input table and create an input JSON object for the server: For this script to run as desired, you will need to have a proper sql table in an sql database (One row per eligibility criterion, required columns: nct_id, condition_concept_id, condition_concept_name, criteria_concept_id, criteria_concept_name, include, criteria_domain, min_value, max_value, male_allowed, female_allowed [last two for gender only]).

When you have the data ready you can format the script to your database. You must change the following:

If you are using a mysql database, the index.js file need to change as the mysql package needs to be downloaded instead Postgres. But since the main part of the C2Q program is isolated from the query, it can be easily done.

Now For Postgres, you need to change line 7, 13 with the proper config of your server where the sql input table will be. Change the user property to the user of your database. Change the host to an ip if the server is not on your local machine. Change the password to the password for the user of the account. Change the database where the input table is in. Change the port to where your server is hosted.

Also change line 31 to how you want your data to presented.

IMPORTANT NOTE: The query generator has a slight preference for Postgres. Line 9 of crit2query.js, “on” is only part of the POSTgres sql language. The “on” keyword is meant to grab the latest date of a measurement value. TO combat this, you will need to find a query template that solely grabs the latest/relevant measurement value based on measurement dates.

———

GIST Folder is irrelevant, it is just for reference for data formatting.

————

Server Folder - the server receives beautiful inputs and runs the gist calculations:

Now For Postgres, you need to change line 15, 21 with the proper config of your server where the sql input table will be. Change the user property to the user of your database. Change the host to an ip if the server is not on your local machine. Change the password to the password for the user of the account. Change the database where the input table is in. Change the port to where your server is hosted.

** to start the server, navigate to the server directory, and ensure a NodeJS server is installed in this location (if using Mac, feel free to navigate to this folder in the terminal and install the server using 'brew install node'). Once the server is installed, it can be started using the commandtype “node .” This will start the server!

To send the API request, you can install Postman and establish a get request to http://localhost:3000 (3000 being the power of the nodejs server).

RUNNING THE PROGRAMS

  1. Start the nodejs server in the 'server' folder
  2. Run the criteria2query query generation script by navigating to the 'criteria2query' folder in terminal and running 'node index.js'.
  3. Copy the output of this query into Postman and submit the GetRequest as described above. Console log and errors will appear in the terminal used to start the nodejs server and query output will appear in Postman.

IMPORTANT NOTE: The server accepts the input data in the form of a JSON object in the body of an http request.

gist-2.0-js's People

Contributors

butler925 avatar thisisibrahimd avatar

Watchers

 avatar

Forkers

butler925

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.