Reference implementation for the Connected Diagnostics API (http://dxapi.org/)
-
Clone the repo.
-
Install Docker.
-
Install
gems:$ docker-compose build $ docker-compose run --rm web bundle install -
Setup development db, test db and elasticsearch index template:
$ docker-compose run --rm web rake db:setup db:test:prepare elasticsearch:setup
- Import Loinc Codes
$ docker-compose run --rm web rails r script/loinc_codes/import_csv.rb
- Go to http://localhost:3000
- Create your account
- You won't receive the email. Instead, you can confirm your account by following the steps below
- With the container up, run this command
docker-compose exec web bash - Then run this command
rails c - Then run this command
User.last.confirm!
This will confirm the last user that was created in your local environment. Then you should be able to Login normally.
-
With the container up, run this command
docker-compose exec web bash. -
Then run this command
export PASSWORD=XXXX(defining a password at least 8 characters long) -
Import manifests:
bundle exec rake manifests:load
To create an initial set of tests:
-
Navigate to the application
-
Create a new account and sign in
-
Create a new institution
-
Create a new site
-
Create a new device, choosing Genoscan model
-
Navigate to
/api/playground -
Select your newly created device
-
Copy the contents of
/spec/fixtures/csvs/genoscan_sample.csvinto the Data field -
Run create message and navigate to Tests to verify the tests were successfully imported
$ docker-compose up
# Open a terminal in the web server directory
$ docker-compose exec web bash
# Reload web server container
$ docker-compose restart web
Locations are obtained from the InSTEDD Location Service. You can specify a different path in config/settings/development.yml.local
CDX uses Poirot for additional logging. You need to install zeromq library version 3.2.0 for it to work, or disable it in config/poirot.yml. On Mac OS, run brew install homebrew/versions/zeromq32; if you have other versions of zeromq installed, it may be required to run brew link zeromq32 --force as well.
To run notifiable diseases on development, checkout the project and symlink the custom settings files in /etc/nndd on this project:
$ cd $NOTIFIABLE_DISEASES/conf
$ ln -s $CDP/etc/nndd/overrides.js overrides.js
$ ln -s $CDP/etc/nndd/overrides.css overrides.css
In order to allow synchronization of clients through rsyns - for csv files -, you should use cdx-sync-sshd, which is a dockerized sshd container, with an inbox and outbox directoy for each client. Download and build it before continuing.
You have to mount sshd volumes pointing to the folders where you will store your authorized keys, server keys and sync directory. Although sshd-server runs standalone and independently of the cdx server, the cdx server needs to be aware of such directories:
SYNC_HOME: here is where files from clients wil be sync'ed. The file watcher will monitor inbox files hereSYNC_SSH: here is whereauthorized_keysfile will be stored. The cdx app will write such file on this directory whenever a new ssh keys is added to a device.
By default, the cdx app assumes such directories will point to the tmp directory of the cdp app. Thus, you should start the cdx-sync-sshd docker container this way:
cd <where you have cloned cdx-sync-server>
export CDP_PATH=<where you have cloned this cdp repository>
make testrun SYNC_HOME=$CDP_PATH/tmp/sync \
SYNC_SSH=$CDP_PATH/tmp/.ssh
Now you must start the sync filewatcher. It is based on cdx-sync-server, but already bundled into cdx app. Run the following:
cd $CDX_PATH
rake csv:watch
Now, whenever a new csv file enters the sshd inbox, it will be imported into the cdx platform.
In the client side, you will need to run another filewatcher: cdx-sync-client. It is a Windos App. Install it using its NSI installer, restart your computer, and fill the form that will prompt after first restart. You will be required to provide an activation token - you can generate it form the device manager in the CDP app.
-
Clone the repo.
-
Install dependencies:
bundle install.- ImageMagick for Paperclip
- Install it in mac with:
brew install imagemagick
- Install it in mac with:
- Redis is used by sidekiq. CDX uses sidekiq as ActiveJob backend
- Install it in mac with:
brew install redis - you can start it with
redis-server --daemonize yes
- Install it in mac with:
- Elasticsearch is used as the main index for test results.
- We support elasticsearch versions < 2.x
- Install it in mac with:
brew install elasticsearch17
-
Setup development database:
bundle exec rake db:setup -
Setup test database:
bundle exec rake db:test:prepare -
Setup elasticsearch index template:
bundle exec rake elasticsearch:setup -
Run tests:
bundle exec rake(this will runrspecandcucumber) -
Start development server:
bundle exec rails s