Giter VIP home page Giter VIP logo

cliff-effects's Introduction

cliff-effects TravisCI CodeCov

Cliff effect: You're a person on government benefits, and you get a raise. You're making more money! But now that your income is higher, you don't make the cutoff for some of those benefits. Your benefits drop and some go away completely. Even though you're earning more money, you're taking home less in all and your situation is worse. You've fallen off "the cliff."

The combination of circumstances and interactions between benefits that creates a cliff are complex, tangled, and buried deep in regulatory language. Case managers handle their clients' problems on the ground. They're not responsible for navigating regulations and don't have the time/resources to translate those policies into models.

The Cliff Effects webapp prototypes a tool to help case managers make quantifiable predictions about how their clients' changes in income could affect their benefits.

Status

If you want to see a very broad overview of the code flow and some thoughts for next steps, see our Overview wiki page.

We currently have a ReactJS frontend prototype and have gone through two iterations of beta testing with informative and promising results.

We are working on:

  • Users: We will continue to engage with our users as we develop further.
  • Infrastructure and testing: Strengthening the code we have to make it more robust and maintainable.
  • Regulations: Validate benefit logic with with people familiar with regulation language and create a process for adding new benefits.
  • Translation: Implementing a translation system for non-English readers.

How Can I Contribute?

  1. Familiarize yourself with the frontend.
  2. Decide whether you want to work on - benefit calculations, code quality, data visualization, user experience, or project management.
  3. If you plan to develop code, set up your environment.

We use GitHub Issues to organize our work. Here's some quick reading about how to use issues, and here's the Cliff Effects issues board.

Environment Setup

To follow these instructions, it'd help if you:

  • have mentally prepared for experimentation and learning and/or
  • know how to open your terminal/command prompt
  • know a bit about how to navigate to different folders in your terminal
  • know a bit about installing software for your terminal, like nodejs

Instructions:

  1. If you're new to github look at How to: fork a repo. Otherwise, fork and clone the repo, creating a link (remote branch) to the Code for Boston repo.
  2. In your termainal/command prompt, do git checkout dev. Do not touch the master branch.
  3. If you have nodejs, version 10.13.0 is desired. If you don't, install it. If you don't know, do node --version in your terminal/command prompt. If you don't get a number, you don't have it. You can also install NVM and run nvm use in your terminal to use the correct version (you may have to nvm install if you don't currently have the correct version installed).
  4. In your command prompt/terminal, do npm install. This might take a few minutes. Now you'll be able to try out the current UI or play with the code!
  5. Do npm start in terminal to automatically open a new browser tab and see a local version of the site. Works best in Chrome.
  6. npm bug workaround: please run git checkout . after any instances of running npm install. This is to circumvent a bug affecting the integrity of the package-lock.json file.
  7. Saved changes will automatically be reflected in-browser. If you don't see the changes, refresh the page. If nothing has changed, ask for help!
  8. When you're done, press ctrl + c to stop the local server that you have running. Or leave it running forever!

To get yourself set up to keep up to date with the latest changes to the dev branch, make sure you've gone through Step 3 of the github guide. To keep your branches from getting tangled as you both make changes and keep up to date with our repo, take a look at our wiki page about a possible Github workflow.

If you're interested in more in-depth debugging, we also recommend getting the React Developer Tools extension for Chrome.

If you have questions, feel free to ask.

Testing

We use React-Scripts test command (which wraps the Jest test framework) to run our automated test suite.

To run our test suite, run npm run test. That will run any tests that have changed since the last commit, and boot up an interactive testing session. The interactive session will prompt you with instructions, but the most important commands are a to run all tests, and q to quit the interactive session.

For information on how to write new tests, please refer to the React-Scripts documentation on the subject.

Resources

React

We're building the project with React. The app was set up with the Create React App CLI.

Git

Aren't familiar with Git? Spend ~15 minutes learning with this interactive Git tutorial. Don't use -f or --force with branches that you have used to create a pull request.

More familiar with git, but not as familiar with collaboration? See a possible Github workflow that could help keep things from getting messy.

cliff-effects's People

Contributors

2001zhaozhao avatar adanaher avatar bertch avatar butterwell avatar caitlinvinci avatar donblair30 avatar dylanesque avatar ethanbb avatar ethanstrominger avatar hmtranae avatar jlangevin avatar johnschoeman avatar knod avatar lianilychee avatar manickyoj avatar michaeldimmitt avatar migueldcepeda avatar misspran avatar nicklee100 avatar pporfilio avatar sashamaryl avatar scapp281 avatar shp54 avatar skudbucket avatar snyderc avatar thescribe83 avatar turnerhayes avatar valeriekenyon avatar wacii avatar willmcintosh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cliff-effects's Issues

Type checking

Should we or shouldn't we type check? Implicitly or explicitly? If we type check, what shall we use to do that? For example, Flow can do implicit or explicit type checking.

Add 'Feedback' link to github issues page

A 'Feedback' button seems like a good idea. I'm not sure if/how we want to handle our issue template to be more flexible so it can be for bugs and suggestions both.

Do we want it in the menu bar after the beta warning? Do we want it elsewhere? Also, do we want a survey after the 'Results' page to ask some guided questions about the user's experience? Maybe that should be in a different issue.

Allow chart to show income by other timeframes

(Not for MVP) Right now the result chart/graph's ticks are annual income amounts. Considering clients will probably be putting in weekly amounts, presumably because they're more familiar with them, it might be more useful to the client if we initially show the tick mark values as weekly amounts. We can probably find a way to allow the user to switch to monthly or yearly amounts too.

When using default household size of 1 number of dependents is not bound.

To reproduce:

Open the demo in a browser

  • Hit "intake new client"
  • Hit "submit"
  • Hit "create visit"
  • Hit "next" until on the "Household Size" screen
  • Leave the default value 1 in 'Number of members in the household'
  • Increase value of number of 'Number of dependents' and/or 'Number of children under 12'

Expected behavior

  • 'Number of dependents' and/or 'number of children under 12' should be limited by number of household size, value should stay have 0

Actual behavior:

  • values increase past actual house old value

getStateMedianIncome function

Create this function. Return value might be percent state median income (as a decimal greater than 1?), but may be a bracket, depending on limitations of gov documentation data/requirements.

getFederalPovertyLevel function

Create this function. Return value might be percent federal poverty level (as a decimal greater than 1?), but may be a bracket, depending on limitations of gov documentation data/requirements.

Quick-result details not showing on short messages

Regarding the right-sidebar results elements - the details seem to be not revealing themselves. This seems like it might be happening when the string is below a certain length. The details element is in the DOM, it just remains hidden.

Alec suggest this may be a problem with the React Semantic UI Reveal component, which is what he says that functionality is built from.

Changes needed for tablet use?

This answer is needed fairly urgently. I recall something about clients using tablets to fill out the form. Is that still the case? If so, what browsers will they have access to? If not Chrome, we'll need to really dig into making this compatible with other browsers. Also, do we need the page to be fluid? It could probably be used with a tablet in landscape modes for some sizes of tablets without cutting off part of the page. Not sure about portrait mode.

MOD: Left-align all form copy

Desired Outcome:
image

The longest line is center-justified, and everything else is justified to that.

Pages:

  • Current Benefits
  • Citizenship Status

Custom benefit amount

It might be a good idea to let the client put in a custom benefit amount if they want so that if there are special circumstances around the benefit that we can't account for, there's a way for them to still get accurate results (some benefits can have an effect on the results of other benefits).

I'm not sure how it would translate to the chart at the end, but 1. there may be ways and 2. I think the benefit results are more important than the chart.

Fix or Remove Failing Tests

Context

Currently, we have exactly 5 tests. Of those, 2 pass and 2 fail, and 1 fails to run. As a basis for future tests to be written, we should first fix these tests if they are testing useful logic or remove them if they are not.

Goal

Fix or remove the 3 failing tests.

Citizen Select

Images:

### Replicate: 1. Select any radio button other than the one that is initially default selected.

Result I'd Expect:

  • Selected button would appear 'selected'

Actual Result:

  • None of the buttons can be selected

Environment:

Operating system and version: 2008 macbook running Lubuntu 16.04
Browser type and version: Chromium, 62.0.3202.62 (Official Build)

App version or commit id at the time:

Other Notes

Mass Health benefit calculations

Current apparent breakdown from this doc:

  • Programs
    • Needed for MVP (don't currently know, but going to assume Standard is one)
      • 505.002: MassHealth Standard
      • (130 CMR 505.003 Reserved) (doesn't appear in doc, may not count anymore)
      • 505.004: MassHealth CommonHealth
      • 505.005: MassHealth Family Assistance
      • 505.006: MassHealth Limited
      • 505.007: MassHealth Senior Buy-In and Buy-In
      • 505.008: MassHealth CarePlus
      • 505.009: MassHealth Small Business Employee Premium Assistance
    • Qualifications
      • Pseudo Code
        • 505.002: MassHealth Standard
        • (130 CMR 505.003 Reserved) (doesn't appear in doc, may not count anymore)
        • 505.004: MassHealth CommonHealth
        • 505.005: MassHealth Family Assistance
        • 505.006: MassHealth Limited
        • 505.007: MassHealth Senior Buy-In and Buy-In
        • 505.008: MassHealth CarePlus
        • 505.009: MassHealth Small Business Employee Premium Assistance
      • Real Code
        • 505.002: MassHealth Standard
        • (130 CMR 505.003 Reserved) (doesn't appear in doc, may not count anymore)
        • 505.004: MassHealth CommonHealth
        • 505.005: MassHealth Family Assistance
        • 505.006: MassHealth Limited
        • 505.007: MassHealth Senior Buy-In and Buy-In
        • 505.008: MassHealth CarePlus
        • 505.009: MassHealth Small Business Employee Premium Assistance
    • Benefits for the same programs (currently we don't have a way to quantify benefits)
  • Other data needed
    • Definition of a household As per our client's input, for now we're assuming whatever household the user references will count as a household for all programs
    • Income calculations (possible resource)

The current brainstorming doc I have going on (think this has too many details to work into a spreadsheet):
https://docs.google.com/document/d/1rVL9Wdr5GP_mYwQPuRXrRJOAPu4V3xcE7bFhI9KqYlI/edit#
It contains links to the above resources and more.

MOD: "Household Annual Income" Page Percentages

  • Verify CALC of "% of Federal Poverty Level"
  • Verify SOURCE of "% of Federal Poverty Level"
  • Replace "% of State Median Income" with "Area Median Income"
  • Switch phrasing of title from "% of Federal Poverty Level" -> "Federal Poverty Level Percentage". Do the same for State Med level.
  • Add reference to source of calc. info, incl. year, as clear linked text right underneath associated %ages in comment in codebase

Undefined values in form number fields

Since a form is blank when the user starts working with it, we have a ton of properties that are just undefined. We have to be able to handle that in our functions without throwing errors. I've found it much more useful to have a 0 instead of 'undefined' when calculating using form data.

So far, I've often solved that by adding || 0 to a bunch of stuff and, more recently, made a function that does basically the same thing, calling toCashflow( formValue ) everywhere. Neither of those are great solutions. You have to remember to do them each time. Changing them in each form script isn't ideal either for the same reason. The same for writing out all these properties to give them all an initial value.

Any thoughts for a more uniform and low-maintenance solution? Some process in our setters?

ADD: Page for user to review/confirm client information

  • Mod status bar to account for the added page
  • Build the new page

STATUS BAR MOCKUP
image

NEW PAGE SPEC

The new page should go after the MassHealth Qualifying Conditions Page, and before the Results page. This allows the user to review/confirm inputs with the client, before jumping to the data viz.

image

  • Don't forget commas for household annual income value
  • Copy for MassHealth negative: "No qualifying conditions"

Switch from 'previous' and 'current' to 'current' and 'future'

After a discussion with our client, it looks like there's been a mix-up with time frames, so we need to switch those two up, both in the text of the forms and in the property names. It seems desired for the mvp.

  • Switch form text
  • Switch property names

Set Up Continuous Integration Test Runner

Context

We've recently got some form of testing running. Let's automate it!

Goal

  1. Select an appropriate continuous integration testing platform for this project.
  2. Set it up w/ webhooks to our repo such that new pull requests trigger a run of our automated test suite.

If we require new code to include tests, then we can merge with high confidence that code works as expected. Even if we don't, we can at least be confident it doesn't break our existing code.

Return to React-Scripts Test Runner

Context

A couple weeks ago, we set up Jest as our test-runner. Turns out, React-Scripts already used Jest under the hood. No need to reinvent the wheel here.

Goal

Set up the react-scripts test runner and document the test procedure in the README.

Household size dependent values don't update to stay below full size number

Replicate:

  1. Go to household size page
  2. Change the 'Number of members in the household' value to 5
  3. Change the 'Number of dependents' value to 4
  4. Change the 'Number of members in the household' value to 3

Expected behavior:
'Number of dependents' value to updated to 2.

Actual Behavior:
'Number of dependents' value does not change.

Environment:
Chrome v61.0.3163.100
Commit: f64d563 'Merge pull request #102 from codeforboston/jest-setup'

Change 'About' page target, fix broken link interface

From what was expressed at the last two meetings, it occurs to me that we might want the 'About' page to point to our repo's README instead of at any particular organization's page. Also, somewhere along the way (probably when trying to switch from react-redirect), the 'About' page link got broken. Those can be taken care of in one go.

Like the other similar issues - changing the logo, etc. - I'm going to put this on the MVP milestone. Feel free to remove it if desired.

Individual member data needed? If so, how much?

As we get into TAFDC (MassHealth had similar issues) we may be getting into territory where we need the income data of each household member, as well as information about their relationships with each other. If our clients have thoughts on a different solution, it'd be good to know.

Regardless of TAFDC, because each program's requirements are slightly different, we're may have to get at least a bit of trivial detail about each household member, though we wouldn't need each member to fill out their individual incomes. For example, SNAP wants to know if any members are 60 or older, while Section 8 wants to know if any members are 62 or older.

One possibility is to ask two questions. '1. Is there anyone 60 or older? 2. Is there anyone 62 or older? ' Another possibility is to ask for the age of each household member. We could get some other individual data that way that would be useful. It should be pretty reasonable to cook up as I've already tried out a couple of experiments. Yet a third option is to decide that 60 and 62 are close enough to each other for the beta test to treat them as the same age bracket. It probably partially depends on how many of our beta testers' families have elderly members. Project Hope might have some data on that. In general, it could be good to know the most common configurations of households to help understand the situation we're dealing with.

Section 8 Housing Voucher benefit calculations

#All of these must be in terms of the fields used in the form, even when they're broken up into parts to accommodate other programs' needs.

CALCULATIONS

  • Find documentation for and determine calculations for this benefit program's gross income
    • Gross income earned and unearned income with no deductions (here, I believe)
  • This will be taken care of through the exclusions issue, #207 Find documentation for and determine calculations for this benefit program's income exclusions (to determine net income) (documentation: In section 5.3, Income Exclusions)
  • Find documentation for and determine calculations for this benefit program's values for these income deductions (here, though not as clear as the hud portal pdf, unfortunately):
    • A. Dependent Allowance
    • B. Child Care Expenses
    • C. Handicapped Assistance Allowance
    • D. Medical Expenses
    • E. Elderly Family or Disabled Family Family
  • Adjust forms to match the needs of this program (see the form-question-compling google spreadsheet).

DISPLAY RESULTS - moved to Issue 148
- [ ] Remove graph
- [ ] Put accounting tables in results page, a la this mockup (slides 4-5) this mockup, updated 10/31

Resources (documentation found):

  • Our spreadsheet now contains a decently organized set of summations and resources
  • http://www.tacinc.org/media/58886/S8MS%20Full%20Book.pdf
  • https://portal.hud.gov/hudportal/documents/huddoc?id=DOC_11749.pdf (contains the date 2017) [Edit: link seems to go to the right doc in Firefox, but not Chrome] Apparently not working right now. I've downloaded what I think is a cached version of the document, but we can try this instead for now.
  • https://www.hud.gov/sites/documents/43503C5HSGH.PDF (Chapter 5 of, probably, the current available version of the 11749 pdf from what I can tell. Links to all sections here. If you need to find it again, try going to the HUD site and using their search to look for 4350.3 Rev-1 or 4350.3 Full Version. Secondly, if that doesn't work you can try calling someone at HUD. I looked in the 'Contact Us' section, under 'Toll Free Numbers' and followed the 'Publications, Forms, Issuances' link. Pro tip: offices found through 'Policy and Research' were not able to help.

SNAP benefit calculations

CALCULATIONS

  • What inputs are needed from the user?
  • What environmental inputs do we supply (FPL? etc..)?
  • How is estimated benefit calculated?

New questions that will hopefully answer that last one:

  • What count as medical expenses?
  • If getting a housing subsidy, which rent counts? Rent share, or contract rent? (My guess is rent share, since we're asking about expenses)
  • Does handicapped assistance get put in dependent care as well? That is, does the user need to write it into both places? Or does one count for the other? How best can we ask this question?

DISPLAY RESULTS - moved to Issue 148
- [ ] Remove graph
- [ ] Put accounting tables in results page, a la this mockup (slides 4-5) this mockup, updated 10/31

Entering 'rent' on 'previous expenses' raises an error

To reproduce:

  • Open the demo in a browser
  • Hit "intake new client"
  • Hit "submit"
  • Hit "create visit"
  • Hit "next" until on the "previous expenses" screen
  • Select monthly rent input field
  • Enter '10'

Expected behavior:

  • Input should appear as typed, and be validated as appropriate

Actual behavior:

  • Screen is replaced with "TypeError: inputProps.id is undefined", with further backtraces

DEL: Non-functional UI elements from production

Remove:

  • Save results
  • Existing clients section
  • Login button
  • Alert that occurs after one submits a new client's info

Rationale: Current version shows potential functionality. Moving to production, therefore removing non-functional elements.

How consistent does our math need to be?

[Edit] Rather, how does the government treat numbers? What we really want is to be consistent with governmental calculations that will actually determine the client's benefits. Are there standards or guidelines? Some possible questions: Do number stay as raw as possible, only being rounded when displayed? Are numbers rounded on some occasions and floored on others? Is the emphasis on precision or on consistency? Another situation is described in the second comment on this thread. How is a situation like that handled?

If the government doesn't have such a thing, how consistent does this app want to be? And how precise does it want to be?

[Original below]

See the second comment in this thread for an explanation of the actual, and even more interesting, question.

It's impossible to have accurate math (see below), but we can either be more or less accurate. How accurate do we need to be? It's better if we decide sooner rather than later. So two questions come up in my mind:
1. How big of an error is acceptable?
2. What is order of magnitude of the problem if we use our current, plain javascript, math?

Does anyone have any idea of what order of magnitude these inaccuracies will build up to? Is it going to be a few cents, tens of dollars, or thousands of dollars? Is there a way to know?

More detailed description: When programming, it's impossible to have completely accurate math. First of all, our computers use binary math (base 2) and have to convert to base 10 whenever we want numbers. Secondly, there are always going to be times when a program will have to round an number to some decimal place. Each language decides how many decimal places to allow before rounding. So we get stuff like 0.1 + 0.2 come out as 0.30000000000000004.

(Brought up in the math test PR, #63)

Switch 'Result' page to table

Results page should show table shown by this mockup, updated 10/31. It should include every program for which we're doing calculations.

For now KEEP THE GRAPH on that page too, just to aid in development. Also, we may want to consider keeping the graph, though hiding it, and allowing a user to reveal it if they so desire. The graph really does give a good idea of the progression of a program as income changes.

Return sends you back one page

Images:

None

Replicate:

  1. Place cursor in any entry field on any page. (Does not matter if it has date or not.)
  2. Hit return.

Result I'd Expect:

  • Data would be "entered" and cursor would go to the next field.

Actual Result:

  • User is returned to previous page. (No data is lost in any field.)

Environment:

Operating system and version: 2008 macbook running Lubuntu 16.04
Browser type and version: Chromium, 62.0.3202.62 (Official Build)

App version or commit id at the time:
eb8bd79

Other Notes

MOD: Data visualization

  • Add a "you are here" vertical red line to data viz, showing where the client is on the income axis
  • Add thousandths separator to x- and y-axis numbers

Commas make chart miss second to last tick, likely library problem

Comment at c9e641e, relevant to #40.

Copy of comment from me, since it didn't seem to show up referenced in the relevant issue:

My apologies, I didn't notice that adding commas to the numbers apparently also made the second to last horizontal tick mark on the graph disappear. This is the same whether the largest allowed value is set at 100,000 or 60,000. It currently looks like the problem is with the library, not with the submitted code. No solution yet found.

Relevant to #40, item 2.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.