TsukishirOSan / private_results

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Private Results

Private Results provides a way for patients to get their test results via phone or the web. Currently, this project has hardcoded data (clinic info) for BCHD.

LICENSE

Private Results is copyright © 2014-2015 Sexual Health Innovations. It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.

Workflow

  1. Patient visits a clinic and gets some tests done.
  2. Clinic hands patient a card with phone number, website, username and password for Private Results.
  3. Clinic imports patient_data.csv into Private Results (providing visit and test result info).
  4. Patient calls (or visits website) Private Results and enters the username and password they were provided.
  5. Private Results looks up the username and password and delivers the results.

Messages are delivered in the following preference order:

  1. Results with at least one blank status = Technical Error
  2. Results with at least one come back to clinic = Come back to clinic
  3. Results with at least one pending - Pending
  4. Deliver messages.

This ensures that if any test result is corrupt (has no status) then we report a technical issue and instruct the patient to call the clinic. Similarly, if any result has the status "Come back to clinic", the patient will not receive any of their results and will instead be instructed to come back to the clinic. Lastly, if any test result is still "Pending", then the patient will be told to call back. If none of these cases is true, then we deliver each test result to the patient.

Dependencies

Development

Private Results is well tested, please run rspec spec from the top directory in order to make sure everything is working as it should.

Seed data has been split out into lib/seed_data.rb in order to make unit testing easier. This seed data contains the initial list of:

  • Clinics - name, code, hours
  • Tests - chlamydia, gonorrhea, etc
  • Statuses - Pending, Come back to clinic, etc
  • Scripts - the call-in workflow messages and test result messages

The test suite follows the following templates for model and controller testing:

We use the Twilio test toolkit to help us unit test our twilio views.

To test and develop with twilio, you'll need someway to allow twilio to connect to your local instance at localhost:3000. ngrok is an awesome way to do this!

Deploying & Running

Deployment:

Note: You'll need to run the Private Results rails app on a server that can be accessed by the internet and that has access to a mail server (to send out account information to the administrators of Private Results).

  • Download Private Results and run the rails server:
git clone https://github.com/SexualHealthInnovations/private_results
cd private_results
bundle install
rake db:setup
rake assets::precompile RAILS_ENV=production
rails s -e production
  • Point a domain at your rails server's ip:port
  • Point twilio at your domain.

Running:

You'll need to run rake import:csv patient_data.csv in order to import patient data.

About

License:MIT License


Languages

Language:Ruby 74.5%Language:HTML 22.9%Language:CSS 1.5%Language:JavaScript 1.2%