-
Notifications
You must be signed in to change notification settings - Fork 19
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
Create job to check for users that cannot be found in VACOLS #15268
Comments
1 | |
2 | ||||||||
3 |
5 |
8 | Make sure the error message is actionable! New job vs stuck appeals checker? if new job and query is quick, daily. Probably StuckAppealsChecker tho Why 1?Why 2?
|
Another issue: legacy_appeal_vacols_ids = LegacyAppeal.pluck(:vacols_id)
demdusr_slogids = legacy_appeal_vacols_ids.in_groups_of(1000, false).flat_map do |batch_vacols_ids|
active_case_vacols_ids = VACOLS::Case.where(bfkey: batch_vacols_ids).where.not(bfmpro: "HIS").pluck(:bfkey)
VACOLS::Decass.where(defolder: active_case_vacols_ids).pluck(:demdusr)
end.uniq
# SLOWWWW, needs refining
assigners_with_no_sdomainid = VACOLS::Staff.where(slogid: demdusr_slogids, sdomainid: nil).pluck(:slogid)
=> ["SDURKIN", "MSABLSKY", "AJMULLEN", "RSULIVAN", "SLWILKNS", "JMCDNALD", "SUSNTOTH", "JJMARTIN", "DWEISS", "MGALGHER", "GEGUIDO", "RPELTIER", "RWSCHOLZ"]
vacols_css_ids = VACOLS::Staff.where(slogid: demdusr_slogids).where.not(sdomainid: nil).pluck(:sdomainid)
assigners_with_no_caseflow_user = vacols_css_ids - User.pluck(:css_id)
=> 0 |
There are no judge_team_atty_css_ids = OrganizationsUser.includes(:user).where(organization: JudgeTeam.active, admin: false).pluck("users.css_id")
vacols_atty_css_ids = VACOLS::Staff.where.not(sattyid: nil).pluck(:sdomainid)
css_ids_not_in_vacols = judge_team_atty_css_ids - vacols_atty_css_ids
=> ["VBASAJVALENN", "VBAPHOTHOMPM"]
# Double check these would throw the error in the sentry alert (User#vacols_uniq_id.nil? is true)
css_ids_not_in_vacols.map { |css_id| User.find_by(css_id: css_id).vacols_uniq_id }.uniq
=> [nil] Note that I also found a few attys on judge teams that were marked inactive # the attorney scope filters out inactive users
vacols_atty_css_ids = VACOLS::Staff.attorney.pluck(:sdomainid)
css_ids_not_in_vacols = judge_team_atty_css_ids - vacols_atty_css_ids
css_ids_not_in_vacols.count
=> 30
VACOLS::Staff.where(sdomainid: css_ids_not_in_vacols).group(:sactive).count
=> {"I"=>19, "A"=>8}
VACOLS::Staff.where(sdomainid: css_ids_not_in_vacols).group(:svlj).count
=> {nil=>18, "J"=>8, "A"=>1} |
@yoomlam What do you think the best format for this is? This all seems like non caseflow errors (teams not up to date, invalid vacols records, etc.) If this is a job, we would need to pass along the bad info to the board to fix. Is a job report the best format for the bad data report? |
@hschallhorn I'm not sure of the kind of answer you want, so here goes... If you can create dashboard items like the "Inactive users" ones at the top of https://query.prod.appeals.va.gov/dashboard/15, then the query results would be more current than a daily job. If the Board makes a fix, the results would should up in the dashboard faster. Plus, the SQL query can be reused in other tools in the future. A job report is acceptable as well. The Rails code would be more widely understandable in case we need to update it. In either case, Ann-Marie could grab the result and send to the Board. The format itself would contain the users and the associated case IDs. |
If you can report on inactive |
Starting a dashboard here: https://query.prod.appeals.va.gov/dashboard/17 EDIT: We don't exactly have access to redshift right now. Will need to make this a job. |
Using Redshift is now and will be acceptable. I don't think you need the "Number of active cases with assigner with no associated caseflow user" 102 count in the dashboard since that is provided at the bottom of the table: |
@araposo-tistatech I created a dashboard for user records that will result in caseflow errors. Number of assigners of active cases with no associated caseflow userThis is the number of vacols staff records that are invalid. For any legacy case these users have created a decision for, if the judge tries to send the case to dispatch, they will receive a "Record is invalid: Attorney can't be blank". This can be rectified by the board updating the demdusr (modifying user) of the associated decass (DAS) record to the uniq vacols id of an attorney that exists in caseflow. The next box in the dashboad provides the cases these invalid user records affect. On occasion, this has been caused by a duplicate vacols staff record. The demdusr is associated with a now retired vacols staff record, even though the real life person is in caseflow and has an updated staff record in vacols. (see below example) Example Batteam Request: https://dsva.slack.com/archives/CHX8FMP28/p1603819414394600 Assigners of active cases with no associated caseflow userThis is the mapping the users above to the cases that will fail if a judge tries to send them to dispatch. The number of rows is the number of cases affected by these user records
Users on a judge team with no corresponding vacols userThese are users that are on judge teams in caseflow that do not have a corresponding vacols staff record. This will result in a This can be rectified by ensuring there is a vacols staff record associated with the caseflow user css_id.
|
ACs met. This can be closed. |
Resulting from #14307 investigation for stuck appeals.
Description
Create job to check for users that cannot be found in VACOLS (possibly due to a change made in VACOLS)?
Something like this:
Occurs rarely but will stall appeal processing.
Acceptance criteria
Background/context/resources
#14307 comment A
Technical notes
The text was updated successfully, but these errors were encountered: