department-of-veterans-affairs/caseflow

Name: caseflow

Owner: Department of Veterans Affairs

Description: Caseflow is a web application that enables the tracking and processing of appealed claims at the Board of Veterans' Appeals.

Created: 2016-02-10 15:20:50.0

Updated: 2018-01-07 19:57:36.0

Pushed: 2018-01-20 14:02:47.0

Homepage:

Size: 47611

Language: Ruby

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Caseflow

Build Status

Clerical errors have the potential to delay the resolution of a veteran's appeal by months. Caseflow Certification uses automated error checking, and user-centered design to greatly reduce the number of clerical errors made when certifying appeals from offices around the nation to the Board of Veteran's Appeals in Washington DC.

You can read more about the project here.

Screenshot of Caseflow Certification (Fake data, No PII here)

View application information on Caseflow Certification.

Setup

Install dependencies via Homebrew:

brew install postgresql redis chromedriver rbenv

Make sure you have rbenv and nvm installed.

Then run the following:

cd caseflow
rbenv install $(cat .ruby-version)
rbenv rehash
gem install bundler

You need to have Redis, Postgres, and Chromedriver running to run Caseflow. (Chromedriver is for the Capybara tests.) Let brew tell you how to do that:

brew info redis

brew info postgresql

brew info chromedriver

Install pdftk

Note this link was found on Stack Overflow and is not the same link that is on the pdftk website. The version on the website does not work on recent versions of OSX (Sierra and El Capitan).

For the frontend, you'll need to install Node and the relevant npm modules. Install yarn. Use the version of Yarn defined in our .travis.yml file.

# Use the version of Node defined in .nvmrc.
nvm use

cd client && yarn
Set up Docker

Install Docker on your machine. After installation is complete, run:

er login -u dsvaappeals

The password is in the DSVA 1Password account. Note you can use your personal account as well, you'll just have to accept the license agreement for this docker image.

Set up Oracle

You'll need to install the libraries required to connect to the VACOLS Oracle database:

OSX

1) Download the “Instant Client Package - Basic” and “Instant Client Package - SDK” for Mac 32 or 64bit.

2) Unzip both packages into /opt/oracle/instantclient_11_2

3) Setup both packages according to the Oracle documentation:

rt OCI_DIR=/opt/oracle/instantclient_12_1
opt/oracle/instantclient_11_2
 ln -s libclntsh.dylib.11.1 libclntsh.dylib

If you prefer to use Homebrew, see the documentation on the appeals-data repo.

Windows

1) Download the “Instant Client Package - Basic” and “Instant Client Package - SDK” for Mac 32 or 64bit.

2) Unzip both packages into [DIR]

3) Add [DIR] to your PATH

Linux

Note: This has only been tested on Debian based OS. However, it should also work for Fedora based OS.

  1. Download the “Instant Client Package - Basic” and “Instant Client Package - SDK” for Linux 32 or 64bit (depending on your Ruby architecture)

  2. Unzip both packages into /opt/oracle/instantclient_11_2

  3. Setup both packages according to the Oracle documentation:

rt LD_LIBRARY_PATH=/opt/oracle/instantclient_11_2 <-- Not sure if this is still valid. It has recently changed for MAC. See above.
opt/oracle/instantclient_11_2
 ln -s libclntsh.so.12.1 libclntsh.so
Start up local VACOLS container

To set up our local copy of VACOLS, run

 local_vacols:setup

To start the container after it's been setup, run

 local_vacols:start

To stop the container, run

 local_vacols:stop

To view the logs, run

 local_vacols:logs
Monitoring

We use NewRelic to monitor the app. By default, it's disabled locally. To enable it, do:

RELIC_LICENSE_KEY='<key as displayed on NewRelic.com>' NEW_RELIC_AGENT_ENABLED=true bundle exec foreman start

You may wish to do this if you are debugging our NewRelic integration, for instance.

Running Caseflow in isolation

To try Caseflow without going through the hastle of connecting to VBMS and VACOLS, just tell bundler to skip production gems when installing.

bundle install --without production staging
rbenv rehash

Set up and seed the DB

rake db:setup

And by default, Rails will run in the development environment, which will mock out data. For an improved development experience with faster iteration, the application by default runs in “hot mode”. This will cause Javascript changes to immediately show up on the page on save, without having to reload the page. You can start the application via:

foreman start

If you want to run the Rails server and frontend webpack server separately, look at the Procfile to figure out what commands to run.

You can access the site at http://localhost:3000/test/users.

Roles

When a VA employee logs in through the VA's unified login system (CSS) a session begins with the user. Within this session the user gets a set of roles. These roles determine what pages a user has access to. In dev mode, we don't log in with CSS and instead take on the identity of a user in the database.

Dispatch (Dev Mode)

To view the dispatch pages head to http://localhost:3000/dispatch.

To see the manager view, you need the following roles: [Establish Claim, Manage Claim Establishment]. The database is seeded with a number of tasks, users, and appeals.

To see the worker view, you need the following role: [Establish Claim]. From this view you can start a new task and go through the flow of establishing a claim.

Running Caseflow connected to external depedencies

To test the app connected to external dependencies, you'll need to set up Oracle, decrypt the environment variables, install staging gems, and run the app.

Environment variables

We'll need to obtain the Ansible vault password using credstash:

rt VAULT_PASSWORD=$(credstash -t appeals-credstash get devops.vault_pass)

Clone the appeals-deployment repo, and run:

crypt.sh $VAULT_PASSWORD

In order to load these environment variables, run:

ce /path/to/appeals-deployment/decrypted/uat/env.sh
Install staging gems

Install the gems required to run the app connected to VBMS and VACOLS:

le install --with staging
Run the app
s s -e staging
Changing between test users

Select 'Switch User' from the dropdown or navigate to http://localhost:3000/dev/users. You can use this page to switch to any user that is currently in the database. The users' names specify what roles they have and therefore what pages they can access. To add new users with new roles, you should seed them in the database via the seeds.rb file. The css_id of the user should be a comma separated list of roles you want that user to have.

This page also contains links to different parts of the site to make dev-ing faster. Please add more links and users as needed.

Running tests

To run the test suite:

rake
Parallelized tests

You'll be able to get through the tests a lot faster if you put all your CPUs to work. Parallel test categories are split up by category:

To set your environment up for parallel testing run:

rake spec:parallel:setup

To run the test suite in parallel:

rake spec:parallel

You can run any one of the parallel categories on its own via (where CATEGORY is unit, certification, etc):

rake spec:parallel:CATEGORY
Feature Toggle and Functions

See Caseflow Commons

Out of Service

To enable and disable 'Out of Service' feature using rails c. Example usage:

able globally
s.cache.write("out_of_service", true)

able for certification only
s.cache.write("certification_out_of_service", true)

able for dispatch only
s.cache.write("dispatch_out_of_service", true)

able for hearings only
s.cache.write("hearing_prep_out_of_service", true)

able for reader only
s.cache.write("reader_out_of_service", true)

 disable, e.g.
s.cache.write("certification_out_of_service", false)
Degraded Service

We show a “Degraded Service” banner across all Caseflow applications automatically when Caseflow Monitor detects that our dependencies may be down. To enable this banner manually, overriding our automatic checks, run the following code from the Rails console:

s.cache.write(:degraded_service_banner, :always_show)

When the dependencies have recovered, switch the banner back to automatic mode:

s.cache.write(:degraded_service_banner, :auto)

DANGER: If Caseflow Monitor is incorrectly reporting a dependency issue, you can disable the “Degraded Service” banner with the following code:

s.cache.write(:degraded_service_banner, :never_show)

When Caseflow Monitor starts working again, switch the banner back to automatic mode:

s.cache.write(:degraded_service_banner, :auto)

Other Caseflow Products

| Product | GitHub Repository | Travis CI | | — | — | —| | Caseflow | caseflow | Travis CI - Caseflow | | eFolder Express | caseflow-efolder | Travis CI - eFolder | | Caseflow Feedback | caseflow-feedback | Travis CI - Caseflow Feedback | | Commons | caseflow-commons | Travis CI - Commons |

Support

BrowserStack logo

Thanks to BrowserStack for providing free support to this open-source project.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.