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

[VI-920] updates to MPI add_person_proxy & orchestrated search methods #20221

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

bramleyjl
Copy link
Contributor

@bramleyjl bramleyjl commented Jan 9, 2025

Summary

  • Updates to MPIData add_person_proxy and downstream methods.
    • At the end of the method the mvi_response cache is now deleted instead of being updated, forcing a new call to now-updated MPI endpoint the next time a user's MPI profile data is requested.
    • MPI "orchestrated search" has been updated to query MPI based on a user's ICN instead of identifying attributes such as last name & DOB.

Related issue(s)

Testing done

  • New code is covered by unit tests

Cached Response Destruction Testing

  • Testing can be performed most easily in a Rails console. Obtain the necessary information for your test user identity and use it to construct a UserIdentity object in the console.
first_name = 'John'
last_name = 'Doe'
...
...
identity_payload = { first_name:, last_name:, icn:, edipi:, birth_date:, ssn:, loa: { current: '3', highest: '3' } }
user_identity = UserIdentity.new(identity_payload)

# create MPIData instance and call MPI for a response
mpi_data = MPIData.for_user(user_identity)
mpi_data.status
  => :ok
mpi_data.mpi_response_is_cached?
  => true

# check redis cache directly
redis = Redis.new
redis.get("mpi-profile-response:#{icn}")
  => "<redis response>"

# call add person proxy - deletes cache upon success
mpi_data.add_person_proxy
  => <MPI::Responses::AddPersonResponse:0x00007eaddd2bdf4
        ...
        @status=:ok>
mpi_data.mpi_response_is_cached?
  => false
  
# check redis cache directly
redis.get("mpi-profile-response:#{icn}")
  => nil

MPI Orchestrated Search Changes Testing

  • In order to test the change from using user attributes to user ICN for the orchestrated search request, uncomment the following line in vets-api/lib/mpi/configuration.rb:
      conn.request(:curl, ::Logger.new(STDOUT), :warn) unless Rails.env.production?
  • With this line uncommented the mpi_data.add_person_proxy invocation will log TWO calls to MPI to the console - parse the FIRST call for the following lines
          <parameterList>
          <id root="2.16.840.1.113883.4.349" extension="1012832013V553700"/>
          <otherIDsScopingOrganization>
            <value extension="VBA" root="2.16.840.1.113883.4.349"/>
            <semanticsText>MVI.ORCHESTRATION</semanticsText>
          </otherIDsScopingOrganization>
        </parameterList>
  • Compare this to the master branch add_person_proxy generated XML:
<parameterList>
          <livingSubjectBirthTime>
            <value value="19730526"/>
            <semanticsText>Date of Birth</semanticsText>
          </livingSubjectBirthTime>
          <livingSubjectId>
            <value root="2.16.840.1.113883.4.1" extension="796265005"/>
            <semanticsText>SSN</semanticsText>
          </livingSubjectId>
          <livingSubjectName>
            <value use="L">
              <given>Maurice</given>
              <family>Murphy</family>
            </value>
            <semanticsText>Legal Name</semanticsText>
          </livingSubjectName>
          <otherIDsScopingOrganization>
            <value extension="VBA" root="2.16.840.1.113883.4.349"/>
            <semanticsText>MVI.ORCHESTRATION</semanticsText>
          </otherIDsScopingOrganization>
        </parameterList>

What areas of the site does it impact?

MPI add_person_proxy call and subsequent Redis caching

Acceptance criteria

  • I fixed|updated|added unit tests and integration tests for each feature (if applicable).
  • No error nor warning in the console.
  • If app impacted requires authentication, did you login to a local build and verify all authenticated routes work as expected

@va-vfs-bot va-vfs-bot temporarily deployed to VI-920_mpi_cache_key/main/main January 9, 2025 23:02 Inactive
@bramleyjl bramleyjl force-pushed the VI-920_mpi_cache_key branch from 7b525af to ae1d269 Compare January 13, 2025 21:19
@bramleyjl bramleyjl marked this pull request as ready for review January 13, 2025 21:30
@bramleyjl bramleyjl requested a review from a team as a code owner January 13, 2025 21:30
@va-vfs-bot va-vfs-bot temporarily deployed to VI-920_mpi_cache_key/main/main January 13, 2025 21:51 Inactive
emilykim13
emilykim13 previously approved these changes Jan 13, 2025
Copy link
Contributor

@emilykim13 emilykim13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made an identity_payload and created a new UserIdentity which I passed through an MPI instance and followed your testing steps. I got the expected results. Lgtm!

@bramleyjl bramleyjl force-pushed the VI-920_mpi_cache_key branch from ae1d269 to 2ffea68 Compare January 17, 2025 20:06
@bramleyjl bramleyjl requested a review from a team as a code owner January 17, 2025 20:06
@va-vfs-bot va-vfs-bot temporarily deployed to VI-920_mpi_cache_key/main/main January 17, 2025 20:58 Inactive
@bramleyjl bramleyjl requested review from a team as code owners January 17, 2025 21:11
@bramleyjl bramleyjl changed the title [VI-920] remove MPIData MPI Profile cache response for "add_person_proxy" [VI-920] updates to MPI add_person_proxy & orchestrated search methods Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants