Running the seed_terminology_db.py script will create and populate tables in the application's PostgreSQL database with data. These tables will then be queried to fetch condition and concept information used by the Refiner.
Before you can run the seed script, you'll need to acquire a TES API key. Make a TES account here and the API-KEY menu will be available to you once you log in.
- Get set up to run the Refiner locally (see here)
- Ensure dependencies have been installed (
pip install -r requirements.txt -r requirements-dev.txt) - Update (or create) your
scripts/.envfile to include your TES API key. Ex:TES_API_KEY=xxxx..... You'll also need to ensure the scripts can access your local database by addingDB_URL=postgresql://postgres:refiner@localhost:5432/refinerto the file - Navigate into the
/scriptsdirectory (cd /scripts) and run theseed_terminology_db.pyscript withpython seed_terminology_db.py - You should see the output from the script and newly created
filtersandgrouperstables in your database - You should run the
check_terminology_db.pyfile to ensure both the schema and data are in the correct shape. This script will validate that the schema is correct and will run through some sample queries so you can inspect the output and verify that the data is structured correctly.
Tip
Each time you run check_terminology_db.py a random sample will select new data from the database for you to inspect. You can run it as many times as you like.