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.
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.
- Patient visits a clinic and gets some tests done.
- Clinic hands patient a card with phone number, website, username and password for Private Results.
- Clinic imports patient_data.csv into Private Results (providing visit and test result info).
- Patient calls (or visits website) Private Results and enters the username and password they were provided.
- Private Results looks up the username and password and delivers the results.
Messages are delivered in the following preference order:
- Results with at least one blank status = Technical Error
- Results with at least one come back to clinic = Come back to clinic
- Results with at least one pending - Pending
- 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.
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!
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.
You'll need to run rake import:csv patient_data.csv
in order to import patient data.