department-of-veterans-affairs / va.gov-team

Public resources for building on and in support of VA.gov. Visit complete Knowledge Hub:
https://depo-platform-documentation.scrollhelp.site/index.html
282 stars 203 forks source link

[Rated Disabilities to Lighthouse] Implement logic for determining if a disability rating is considered Service Connected or not #71281

Closed jerekshoe closed 5 months ago

jerekshoe commented 10 months ago

Background

Currently we are planning on using the decision field returned by Lighthouse to determine if a disability rating is considered 'Service-connected' or not (this is relevant to the way that the FE displays the disability ratings). EVSS had a similar field (decisionCode) that returned one of two values (SVCCONNCTED or NOTSVCCON) to indicate that the disability rating was either Service Connected or not. Lighthouse can return a number of different values (listed under the "Context" section below), not just the two. We need to come up with an implementation that will allow us to properly indicate to the Veteran whether their disability ratings are considered to be Service connected or not by the VA.

We have decided to go with a backend solution approach.

Context

Full list of values Lighthouse can return for decision field:

The two that should be considered equivalent to Service Connected (or SVCCONNCTED) are:

All other values can be considered "Not Service Connected"

Example JSON of disability rating:

{
    "decision": "Service Connected", <-- This is the relevant field
    "diagnosticText": "Sarcoma Soft-Tissue",
    "diagnosticTypeName": "Soft tissue sarcoma (neurogenic origin)",
    "effectiveDate": "2018-08-01",
    "ratingPercentage": 80
}

Possible solutions

Frontend approach

Update the rated disabilities application to evaluate the values 1151 Granted or Service Connected as being service connected Pros:

Cons:

Backend approach ✅

Update the response returned by the controller to include a flag (something like is_service_connected) that has the value true when the decision field has the value1151 Granted or Service Connected to indicate that the disability rating is considered to be service connected Pros:

Cons:

Tasks

FE tasks

BE tasks

Acceptance Criteria

jerekshoe commented 5 months ago

I'm actually going to implement this on the FE first. If we decide that it needs to be on the backend in the future then we can make another ticket