ct-eligible-flask describes a web-based API for providing eligibilty criteria suggestions based on previous clustering results (see /data/clusters.json).
There are two options for deployment.
ct-eligible-flask runs using Flask and MongoDB. To install dependencies, we provide a requirements file to be used by pip.
pip install -r requirements
Make sure to download MongoDB before moving on to the following steps.
First, initialize MongoDB daemon:
mongod
Second, add cluster information to the database:
python index.py add_cluster_json data/clusters.json
Third, add ctep information to the database:
python index.py add_ctep_json data/ctep.json
Last, run the server:
python index.py run_server
ct-eligible-flask has been developed with deployment by Docker Compose in mind.
To deploy, use the following commands:
docker-compose build
docker-compose up
HTTP requests can be used to find eligibility criteria suggestions based on a text input. The API calls require the following structure:
HOST:PORT/get-suggestion/<TEXT OR JSON STRING>
Example syntax is as follows:
http://localhost:4000/get-suggestion/platelet
The API returns suggestions in JSON format. The format is as follows:
[{"ctep_suggestion":[<SUGGESTIONS>, ], "data_suggestion":[<SUGGESTIONS>, ], "text":<INPUT TEXT>}, ]