Kairsten's notes. TODO: organize with README.
This tutorial assumes you have the following dependencies already installed.
- Git
- Python
- PostgreSQL
- Clone the git repo
git clone [email protected]:seattleflu/id3c.git
-
To fill the
seattleflu
database with the backup db copy, runpg_restore --data-only --single-transaction --schema receiving --table enrollment --dbname seattleflu seattleflu-production-<date>.pgdb
-
To restore the presence/absence data on your local dev instance, you have two options.
-
Restore from a flat file backup, e.g.
pg_restore --dbname seattleflu presence_absence.pgdb
-
Restore from seattleflu-testing First, remove local records via
psql seattleflu <<<"truncate receiving.presence_absence"
Then, run
pg_dump
against the testing database and re-fill your local database with the results.pg_dump --data-only --table receiving.presence_absence --format custom service=seattleflu-testing | pg_restore --single-transaction --dbname seattleflu
-
Set pager environment variable to less
and specify which less
method to use. If there's less than a screen full of information, don't page it.
PAGER=less LESS=SFRXi psql seattleflu
To save these settings, add the following lines to your ~/.psqlrc
.
\setenv PAGER less
\setenv LESS SRFXi
Reset the processing log for all rows to be blank. When the enrollments pipeline is run, it will process all rows with blank processing logs for the current revision. These rows will be marked for update
.
update receiving.enrollment set processing_log = '[]';
From within the id3c
directory, run the following command to test your install.
PGDATABASE=seattleflu pipenv run ./bin/id3c etl enrollments --help
To process enrollments
, run
PGDATABASE=seattleflu pipenv run ./bin/id3c etl enrollments --prompt
To process clinical
run
PGDATABASE=seattleflu pipenv run ./bin/id3c etl clinical --prompt
If you don't have LOG_LEVEL=debug
turned on, your logs should be available on your system via
grep seattleflu /var/log/syslog