Closed patrickvinograd closed 3 years ago
Before I read the above, my idea of this was actually the opposite order of events. My objective here is maximize the number of eligible records we return:
For ~all applicant_types~ only self-submitted applicant type == veteran
, use self-submitted first/last/dob/ssn to query MPI. If MPI returns result, record ICN. In all cases, continue.[1]
If application_type == veteran and we have an ICN from step 1, use ICN to query EMIS. Examine last service episode.
If application_type == veteran and we do not have an ICN from step 1, use self-submitted service history values to calculate eligibility based on:
For self-submitted applicant_types != 'veteran', --> eligible = true [go to step 5]
Populate eligibility_info
object with following attributes:
{
eligible: {true|false},
ineligible_reason: {null|self_character_of_service|self_period_of_service|emis_character_of_service},
icn: {null|<icn>}
mpi_query_timestamp: <ts>,
emis_query_timestamp: {null|<ts>},
emis_character_of_service_code: {null|<code>},
}
[1] Unless it is value-add for the VistA team to send records over with ICN appended if we know; in that case, query MPI for ICNs for any applicant type. If it does not add incremental value or detracts for the VistA team, only query MPI for self-submitted applicant type == veteran
. Rationale: the only reason we are querying MPI is to get an ICN to feed to EMIS; we only need that for self-submitted applicant type == veteran
.
That works. Also any EMIS code other than the ones you list basically amount to "unknown" in which case we will assume eligible.
Worth noting again that work related to #2 in my write up is highly likely to not be necessary in by morning light. Same goes for the self-submitted discharge status part of #3, which is highly likely to not be considered for eligibility purposes.
This is obsolete at this point - per product direction, records move straight from received
to enrollment_pending
. I will leave the eligibility calculation logic branch here for posterity: pv-vax-expansion-eligibility-archive
Given a successful submission to the covid_vaccine/v0/expanded_registration endpoint aka KMIv2, we need to move that submission from its initial "sequestered" state to either "eligible" or "ineligible" based on inspecting the data and looking up against VA data sources. This all happens asynchronously from the initial form submission, and nothing about this process is fed back to the user. It is only used to bin submissions into whether they should be submitted on to enrollment service and vetext.
Processing flow
eligibility_info
column of the submission, and save the submission back to the DB withstate = {eligible|ineligible}
as appropriate.References:
Discharge character of service codes available from EMIS: https://github.com/department-of-veterans-affairs/vets-api/blob/master/app/models/emis_redis/military_information_v2.rb#L10
Eligibility calculation
The following represents the eligibility calculation as I have had it verbally described to me. Subject to change:
{Honorable|General|Other than Honorable|Undesirable}
, continue{Dishonorable|Bad Conduct}
, go to step 6, eligible = falseeligibility_info
object with following attributes:eligibility_info
field with above hash and updatestate
to eithereligible
orineligible
.