Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Record AOD for claimants 75 & Older in Caseflow Database #14637

Closed
3 tasks
araposo-tistatech opened this issue Jul 2, 2020 · 14 comments · Fixed by #14763
Closed
3 tasks

Record AOD for claimants 75 & Older in Caseflow Database #14637

araposo-tistatech opened this issue Jul 2, 2020 · 14 comments · Fixed by #14763
Assignees
Labels
Priority: Medium Blocking issue w/workaround, or "second in" priority for new work. Stakeholder: BVA Functionality associated with the Board of Veterans' Appeals workflows/feature requests Team: Echo 🐬 Type: Metrics or Reporting

Comments

@araposo-tistatech
Copy link

araposo-tistatech commented Jul 2, 2020

User or job story

Job story: When the AOD flag is set in Caseflow for claimants 75 or older, the AOD needs to be captured in the Caseflow database, so that the Board can pull reporting against it.

Acceptance criteria

  • AOD for claimants/Veterans 75 or older is recorded in the Caseflow database
  • Field & Database Table where this is recorded is provided to PM to send to the Board

Technical notes

Per Alisa:

Cases can be AOD for basically 2 reasons:

  • Motion is filed for the Veteran on the case due to extenuating circumstances (terminal illness, severe financial or emotional distress). The motion is processed manually by the board and is recorded in the advance_on_docket_motions database table

  • Veteran/claimant is 75 or older, which is automatically checked by Caseflow whenever the case is displayed. This is never recorded in the database, the age of the Veteran is verified everytime “AOD” shows up in the Caseflow application and if they’re 75 or older, it will say AOD.

The first one is recorded in the Caseflow database right now, the second isn’t. However, the second is recorded in the ETL database that Peter created that the Board refuses to use (https://github.com/department-of-veterans-affairs/caseflow/blob/master/app/models/etl/appeal.rb#L37)
app/models/etl/appeal.rb:37
target.aod_due_to_dob = person&.advanced_on_docket_based_on_age? || false

@araposo-tistatech araposo-tistatech added Type: Metrics or Reporting Stakeholder: BVA Functionality associated with the Board of Veterans' Appeals workflows/feature requests Team: Echo 🐬 Priority: Medium Blocking issue w/workaround, or "second in" priority for new work. labels Jul 2, 2020
@mikesanford
Copy link

@araposo-tistatech Just a small point, the appeal is AOD'd when the claimant/Veteran is 75 or older, the technical notes says that the Veteran must be over 75.

@araposo-tistatech
Copy link
Author

Thank you @mikesanford! I've updated the notes.

@yoomlam
Copy link
Contributor

yoomlam commented Jul 2, 2020

what is this chart?

1 | 
2 | |
3 | ||||||||
5 | 
8 | 

Why 2?

  • Code is mostly there; just need to encapsulate into a job.
  • Schema change

Why 3?

  • creating a new job, but with a known process & scope
  • vacols

@HelimaBass
Copy link

There are AOD motions with a reason of "Age" that have been recorded in the Advance_On_Docket_Motions table, some of which are associated to AMA appeals.

@hschallhorn
Copy link
Contributor

relatedish #14085

@yoomlam
Copy link
Contributor

yoomlam commented Jul 17, 2020

@araposo-tistatech Some questions:

I am assuming a "motion" is filed by an attorney (ref), so there is some paperwork. (Update: this comment suggests there is a possibility for motion paperwork in VBMS, esp. considering LP's response.)

Is there a difference between automatically identifying a Veteran as "AOD" applicable (no paperwork) and filing an age-related AOD motion (with paperwork)? Do we want to model automatic identification (no paperwork) as if a motion was filed (paperwork)?

  • If there is a difference and we model both as an AOD motion in the DB, then the user associated with the automatically identified AOD motion will be "Caseflow". This implies that Caseflow filed the AOD motion and granted it. Is that acceptable?
  • Based on Alisa's statements above, age-related AOD may not be a "motion" per se. However, Caseflow currently includes age in the AdvanceOnDocketMotion class (added in 2018 for ticket Editing AMA appeal data | Editing AOD status #6257):
    enum reason: {
    Constants.AOD_REASONS.financial_distress.to_sym => Constants.AOD_REASONS.financial_distress,
    Constants.AOD_REASONS.age.to_sym => Constants.AOD_REASONS.age,
    Constants.AOD_REASONS.serious_illness.to_sym => Constants.AOD_REASONS.serious_illness,
    Constants.AOD_REASONS.other.to_sym => Constants.AOD_REASONS.other
    }
    • Do we want to rename AdvanceOnDocketMotion to AdvanceOnDocketRequest where a "request" encompasses "motions" and automatic identification by Caseflow? If not, we can just add some code comments to clarify that an age-related AOD may not have been initiated as a formal motion.
  • Is the motion-to-appeal a 1-to-1, 1-to-n, n-to-1, or n-to-n relationship?
    • According to AOD Docket for Subsequent Appeals #14085, non-age-related AOD "should only apply to the current appeal/claim and not any subsequent" -- a 1-to-1 or n-to-1 relationship (many motions may apply to the same appeal).
    • Age-related AOD applies to currently open and subsequent cases. Do not update AOD motions if they do not apply to the appeal #14087 states "age related aod motions should apply at the claimant level and be granted for all subsequent appeals" -- a 1-to-n relationship.
    • It seems age-related AOD is not a motion at all, except that age-related AOD motions DB records do exists (but was there paperwork involved -- was there a workflow? or were they created informally?).

Other info for reference if needed: There are 596 age-related AOD motions.

> AdvanceOnDocketMotion.count
=> 1550
> AdvanceOnDocketMotion.group(:reason).count
=> {nil=>8, "financial_distress"=>535, "other"=>133, "age"=>596, "serious_illness"=>278}

While there are age-related AOD motions (being set by app/controllers/hearings_controller.rb:136 for example), it may not be used since we currently check the age first: If 75 or older, then advanced_on_docket? returns true and doesn’t check AOD motions:

def advanced_on_docket?(appeal_receipt_date)
advanced_on_docket_based_on_age? || AdvanceOnDocketMotion.granted_for_person?(id, appeal_receipt_date)
end

If Caseflow automatically creates granted age-related motions for all eligible Veterans, then we can remove the advanced_on_docket_based_on_age? call. Was there a reason we didn't do this to begin with? Because we were being lazy (in a good way).

@araposo-tistatech
Copy link
Author

@yoomlam I received the following explanation on AOD motions from Mike S. at the Board:

"Sometimes an AOD motion can be granted due to age. Say a Veteran submits an AOD based on financial hardship, but the VLJ realizes the Veteran is 75, and simply grants it due to age.

But, typically, age-based AODs are not motions. The Board is required, by law, to AOD the case once the claimant turns 75. I think in VACOLS, there was no mechanism to automatically flip the appeal to AOD based on the claimant turning 75, so VLJs would manually AOD the appeal themselves at a hearing upon realizing the claimant was 75."

Based on the response I think we should talk through this one as VACOLS inability to automatically AOD for age may be the reason the code appears as it does.

@hschallhorn
Copy link
Contributor

@araposo-tistatech Can w find out if there would be any issue with caseflow automatically creating and granting age based motions in our database for vets that hit 75? Or should there only be age based motions in our database for veterans that have filed a motion for other reasons?

@araposo-tistatech
Copy link
Author

@hschallhorn, @yoomlam, please correct me if I am wrong, but the issue is that automatically creating and granting the age related AOD motion would only currently grant it on appeal and not on the Veteran (which is where it should live) as motions have a 1 to 1 relationship.

I discussed this again with Mike and he feels we should keep the age related motion as an option (even though it is inconsistent with the way motions work) but also automatically identify a Veteran as AOD for age in its own separate process. I believe if we try to lump this process together with the motions it will cause confusion down the line for the Board.

@hschallhorn
Copy link
Contributor

We do not treat age related motions as 1 to 1 with appeals. We currently follow what is stipulated in #14085, where any age related motion applies to all appeals for the claimant the motion is associated with.

@yoomlam
Copy link
Contributor

yoomlam commented Jul 23, 2020

Responding to @araposo-tistatech below.

the issue is that automatically creating and granting the age related AOD motion would only currently grant it on appeal and not on the Veteran (which is where it should live) as motions have a 1 to 1 relationship.

Currently an AOD motion is associated with a person, not an appeal:

caseflow/db/schema.rb

Lines 19 to 22 in ee10037

create_table "advance_on_docket_motions", force: :cascade do |t|
t.datetime "created_at", null: false
t.boolean "granted", comment: "Whether VLJ has determined that there is sufficient cause to fast-track an appeal, i.e. grant or deny the motion to AOD."
t.bigint "person_id", comment: "Appellant ID"

One solution to address #14085 is to add an appeal_id column to advance_on_docket_motions (which will allow many motions to be associated to a single appeal, an n-to-1 relationship). The exception will be age-related AOD motions, where the appeal_id will likely be null since age-related AOD motions are applicable to all open and subsequent appeals (setting the appeal_id to a single non-null value will be misleading since age-related AOD motions can apply to many appeals).

[Mike] feels we should keep the age related motion as an option (even though it is inconsistent with the way motions work) but also automatically identify a Veteran as AOD for age in its own separate process.

@hschallhorn Here's my plan for the PR:
We'll keep age as a possible value for advance_on_docket_motions.reason. Since we're keeping that and keeping 2 separate processes for deciding age-related AODs, I'll create a new aod_reason column on appeals to fulfill this ticket, along with a job that populates this aod_reason field for open appeals. The current possible values for aod_reason will be:

  • nil - appeal is not AOD; appeal may have AOD motions but they are all denied
  • 'age' - appeal is age-related AOD; set by nightly async job
  • 'motion' - appeal is AOD due to one or more motions; to identify the granted motions, we'll have to look in the advance_on_docket_motions table; one of these motions may have reason=='age'

Other non-motion reasons can be added as needed.
Given this new column, it will be easier (and faster) to check if an appeal is AOD, as well as satisfy DSVA-VACOLS ticket #128.

The following code will change to check for the new aod_reason column before checking for AOD motions or VACOLS:

def advanced_on_docket?
claimant&.advanced_on_docket?(receipt_date)
end

def aod?
aod
end
def advanced_on_docket?
aod
end

When a new appeal is created, we should check if age-related AOD applies and set the aod_reason field.
Also when the Person.date_of_birth or associated AOD motion is set/updated, we should check and, if appropriate, set this field for all open appeals.

@yoomlam
Copy link
Contributor

yoomlam commented Jul 23, 2020

For this ticket, I'm creating a nightly job that updates the AOD status of AMA appeals (by checking the claimant's age) and records it in the DB.

  • Question: Do I need to check the claimant's age for Legacy appeals?
  • Why I ask: this is not as straightforward since the info is in VACOLS.
  • What I am doing for Legacy appeals is recording the AOD status as reported by VACOLS -- this fulfills the AC for the ticket.
  • Crux of the question: Should Caseflow be updating the AOD status of Legacy appeals in VACOLS if the claimant is 75 or older?

@araposo-tistatech responded:

Since we know this is a manual action in VACOLS (not automated) I agree we should create a separate ticket to update the AOD status for legacy appeals
we should do the job, but it should be its own ticket.

Putting the task of "updating the AOD status of Legacy appeals in VACOLS if the claimant is 75 or older" in a separate ticket: #14756.

@yoomlam
Copy link
Contributor

yoomlam commented Jul 24, 2020

Possible deficiency but does not impact too many claimants:
Person attributes will not be updated if the field already has a value -- discussed here:

There are 32 Persons with DOB 1801-1-1:
Person.where("date_of_birth = '1801-1-1'").count
=> 32
Person.where("date_of_birth < '1900-1-1'").count
=> 47
Their DOB won't be updated even if BGS has the correct DOB.

appeals=Appeal.active.joins(claimants: :person).where("people.date_of_birth <= '1900-1-1'").pluck(:id)
=> [28781, 30686, 33830, 46351, 47674, 58801, 58862, 59336, 59339, 70512, 72754, 74760, 76383, 78186, 80491, 82294, 83611, 85010]
appeals.count
=> 18
appeals.map(&:aod?)
=> [true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true]

@yoomlam
Copy link
Contributor

yoomlam commented Jul 24, 2020

Descoping my original solution that tried to solve too many problems in favor of a simpler solution that addresses only the requirement of this ticket, i.e. reporting age-related AOD.

va-bot pushed a commit that referenced this issue Jul 31, 2020
Connects https://github.com/department-of-veterans-affairs/appeals-lambdas/pull/72
Verification that PR for #14637 works.

### Description
Quick fix for `Aws::SQS::Errors::NonExistentQueue: The specified queue does not exist for this wsdl version` error when calling `SetAppealAgeAodJob.perform_later`.

I should have followed [Step 1](https://github.com/department-of-veterans-affairs/appeals-deployment/wiki/Caseflow-Cron-Jobs#step-1-implement-your-active-job) (if I knew about it at the time).

### Acceptance Criteria
- [ ] Code compiles correctly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Medium Blocking issue w/workaround, or "second in" priority for new work. Stakeholder: BVA Functionality associated with the Board of Veterans' Appeals workflows/feature requests Team: Echo 🐬 Type: Metrics or Reporting
Projects
None yet
5 participants