Closed mjknight50 closed 3 weeks ago
It looks like the API used by the prefill for military history is currently https://depo-platform-documentation.scrollhelp.site/developer-docs/va-profile under Military Personnel. According to VAProfile::Prefill::MilitaryInformation, the service branch codes returned are the ones returned by https://sandbox-api.va.gov/services/benefits-reference-data/v1/service-branches, specifically:
{"code":"USMA","description":"US Military Academy"},
{"code":"MM","description":"Merchant Marine"},
{"code":"AF","description":"Air Force"},
{"code":"ARMY","description":"Army"},
{"code":"AFR","description":"Air Force Reserves"},
{"code":"PHS","description":"Public Health Service"},
{"code":"AAC","description":"Army Air Corps or Army Air Force"},
{"code":"WAC","description":"Women's Army Corps"},
{"code":"NOAA","description":"National Oceanic & Atmospheric Administration"},
{"code":"SF","description":"Space Force"},
{"code":"NAVY","description":"Navy"},
{"code":"N ACAD","description":"Naval Academy"},
{"code":"OTH","description":"Other"},
{"code":"ARNG","description":"Army National Guard"},
{"code":"CG","description":"Coast Guard"},
{"code":"MC","description":"Marine Corps"},
{"code":"AR","description":"Army Reserves"},
{"code":"CGR","description":"Coast Guard Reserves"},
{"code":"MCR","description":"Marine Corps Reserves"},
{"code":"NR","description":"Navy Reserves"},
{"code":"ANG","description":"Air National Guard"},
{"code":"AF ACAD","description":"Air Force Academy"},
{"code":"CG ACAD","description":"Coast Guard Academy"}
The branches of service listed in Pensions (Army, Navy, Air Force , Coast Guard, Marine Corps, Space Force, USPHS, NOAA) all appear on this list; however, there are also additional branches listed here. If a service period includes a branch NOT available on the Pensions form, should we ignore it when prefilling?
Also, which branches/service periods should qualify as "Active Duty" for the purpose of the first entry and last exit from Active Duty? Currently, I'm including all service periods and selecting the earliest start date and latest end date.
After meeting with the VBA team, it looks like the Date initially entered active duty
is pretty straight forward from their perspective. The Final release date from active duty
should be the last date where service_type = "Active Duty"
I also learned that military service number is always your social security number if you started after 1971.
We just go the go ahead to proceed by prepoulating the current “initial entered” and “final release date” fields on the form with the relevant dates from their last branch of service.
@mjknight50 It looks like the available values for service_type
in the model returned eventually returned by VAProfile::MilitaryPersonnel::ServiceHistoryResponse
are actually 'Military Service' and 'Academy Attendance' (it looks like the value in the response for service_type is ignored). Do we think 'Military Service' would be equivalent to active service, or should I add the service_type to the models as a new field?
Agreed we would add email, telephone number and mobile number to Applicant Information section as part of this ticket. When the fields are available, populate but make editable.
The flipper is on in Staging now. This can be tested with user vets.gov.user+233@gmail.com.
Tested on staging with the noted user vets.gov.user+233@gmail.com. Verified that the email, phone and mobile was prefilled when a starting a new application Verified that email, phone, mobile can edited and saved when returning to an in progress application Verified that the military history is pre-filled Verified that the military history can be edited and saved when returned to an in progress applicaiton
One issue we encountered was when pre filling service number, Veterans who enrolled after 1971 have their SSN as their service number, so that's what we're using for them. The front-end validation for that field is trigged since it doesn't match the expected service number format.
Feedback from our VBA Stakeholder (Derek Uttley) is that we should remove format validation from this field. Any data provided in this field could be useful downstream and will save the Veteran some keystrokes, the VBA team will take whatever the system provides in this field.
Logged a new ticket to remove the field validation https://github.com/department-of-veterans-affairs/va.gov-team/issues/90673.
Closing this ticket as completed. Once we complete #90673, then we can enable on PROD
Overview
Building off this previous ticket, we would like to auto-populate the military history for veterans.
This work should be done behind a flipper. Deletion of the flipper is being tracked in this ticket: https://github.com/department-of-veterans-affairs/va.gov-team/issues/88486
The following fields could be pre-populated. The fields with strikethrough seemed difficult to map to the API so I would suggest skipping them for now unless you see an obvious match that I did not.
(note, there could be an array of service history)
https://developer.va.gov/explore/api/veteran-service-history-and-eligibility/docs?version=current
The values should be available from this function, passing in the ICN: VAProfile::MilitaryPersonnel::ServiceHistoryResponse
/lib/va_profile/military_personnel/service.rb
Sample data from API: