This section documents the processes involved in pushing data from the BHT-EMR-API's database to the Raw Data Store(RDS). The BHT-EMR-API provides two mechanisms for this, namely:
- Push - This is a script that simply polls the database for changes and pushes them to the RDS using CouchDB as a transport layer.
- Dump - This generates data dumps from the database that can be manually loaded into RDS.
- Pending
-
Push
To start the push process run:
bin/rails r bin/rds_push.rb
-
Dump
Dumping is two-fold, incremental and all. The incremental data dump is generated starting off from where either
rds_push
or itself left off when last run. The all dump on the other hand covers all records in the database. NOTE: The dumps generated by the commands described below are saved tolog/rds_dump.sql
.To generate incremental data dumps do:
bin/rails r bin/rds_dump.rb
To generate the all data dump do:
bin/rails r bin/rds_dump.rb --all