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

MHV-58591 MHV-57739 Authentication for MHV Classic radiology endpoint #17381

Merged
merged 15 commits into from
Jul 8, 2024

Conversation

mmoyer-va
Copy link
Contributor

@mmoyer-va mmoyer-va commented Jul 2, 2024

Summary

  • Added a new Radiology controller that communicates to MHV Classic, returning a list of radiology records
  • This work necessitated authenticating to a different MHV session endpoint
  • The session creation also calls a patient endpoint to get the patient ID

Related issue(s)

MHV-58591 - Add containerized authorization endpoint to radiology API calls

Add containerized authentication endpoint to radiology API calls

Handle the reducer in the front end for radiology

Feature Flag Y/N ? N

DataDog/Analytics Y/N ? N

Manual Testing Y/N ? N

Automated Testing Y/N ? N

Accessibility Testing Y/N ? N

UCD Validation Y/N N

Acceptance Criteria:

AC1 Radiology vets api endpoint works fully and returns a list of radiology reports

AC2 Handle the reducer in the front end for radiology

AC3
AC4
AC5

Links to UCD:

Figma Link:

User Flow:

Mobile:

Desktop:

Other Design Notes:

Architectural Notes: Always check for the latest designs in Figma

MHV-57739 - Connect vets-api to MHV radiology API(s)

Connect vets-api to MHV radiology API(s)

Feature Flag Y/N ? N

DataDog/Analytics Y/N ? N

Manual Testing Y/N ? 

Automated Testing Y/N ? N

Accessibility Testing Y/N ? N

UCD Validation Y/N N

Acceptance Criteria:

AC1  Connection of vets-api to MHV radiology API(s) is complete

AC2

AC3
AC4
AC5

Links to UCD:

Figma Link:

User Flow:

Mobile:

Desktop:

Other Design Notes:

Architectural Notes: Always check for the latest designs in Figma

Testing done

  • New tests at the client and controller level
  • Updated existing tests to account for modified mr_controller code

Screenshots

Note: Optional

What areas of the site does it impact?

MHV Medical Records

Acceptance criteria

  • I fixed|updated|added unit tests and integration tests for each feature (if applicable).
  • No error nor warning in the console.
  • Events are being sent to the appropriate logging solution
  • Documentation has been updated (link to documentation)
  • No sensitive information (i.e. PII/credentials/internal URLs/etc.) is captured in logging, hardcoded, or specs
  • Feature/bug has a monitor built into Datadog (if applicable)
  • If app impacted requires authentication, did you login to a local build and verify all authenticated routes work as expected
  • I added a screenshot of the developed feature

Copy link

github-actions bot commented Jul 2, 2024

1 Warning
⚠️ This PR changes 300 LoC (not counting whitespace/newlines).

In order to ensure each PR receives the proper attention it deserves, we recommend not exceeding
200. Expect some delays getting reviews.

File Summary

Files

  • config/locales/exceptions.en.yml (+20/-0)

  • config/redis.yml (+6/-0)

  • lib/medical_records/bb_internal/client.rb (+63/-0)

  • lib/medical_records/bb_internal/client_session.rb (+14/-0)

  • lib/medical_records/bb_internal/configuration.rb (+65/-0)

  • modules/my_health/app/controllers/my_health/mr_controller.rb (+10/-0)

  • modules/my_health/app/controllers/my_health/v1/medical_records/radiology_controller.rb (+14/-0)

  • modules/my_health/config/routes.rb (+7/-4)

  • modules/my_health/spec/request/v1/allergies_request_spec.rb (+2/-0)

  • modules/my_health/spec/request/v1/clinical_notes_request_spec.rb (+2/-0)

  • modules/my_health/spec/request/v1/conditions_request_spec.rb (+2/-0)

  • modules/my_health/spec/request/v1/labs_and_tests_request_spec.rb (+2/-0)

  • modules/my_health/spec/request/v1/medical_records/mr_session_request_spec.rb (+2/-0)

  • modules/my_health/spec/request/v1/medical_records/radiology_request_spec.rb (+50/-0)

  • modules/my_health/spec/request/v1/vaccines_request_spec.rb (+2/-0)

  • modules/my_health/spec/request/v1/vitals_request_spec.rb (+2/-0)

  • spec/lib/medical_records/bb_internal/client_spec.rb (+33/-0)

    Note: We exclude files matching the following when considering PR size:

    *.csv, *.json, *.tsv, *.txt, Gemfile.lock, app/swagger, modules/mobile/docs, spec/fixtures/, spec/support/vcr_cassettes/, modules/mobile/spec/support/vcr_cassettes/, db/seeds, modules/vaos/app/docs, modules/meb_api/app/docs, modules/appeals_api/app/swagger/, *.bru
    

Big PRs are difficult to review, often become stale, and cause delays.

Generated by 🚫 Danger

@mmoyer-va mmoyer-va changed the title MHV-57739 Authentication for MHV Classic radiology endpoint MHV-58591 MHV-57739 Authentication for MHV Classic radiology endpoint Jul 2, 2024
@va-vfs-bot va-vfs-bot temporarily deployed to MHV-57739-mhv-radiology-api/main/main July 2, 2024 20:32 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to MHV-57739-mhv-radiology-api/main/main July 3, 2024 19:40 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to MHV-57739-mhv-radiology-api/main/main July 3, 2024 20:06 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to MHV-57739-mhv-radiology-api/main/main July 3, 2024 20:16 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to MHV-57739-mhv-radiology-api/main/main July 3, 2024 20:38 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to MHV-57739-mhv-radiology-api/main/main July 3, 2024 20:53 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to MHV-57739-mhv-radiology-api/main/main July 5, 2024 15:09 Inactive
mattwrightva
mattwrightva previously approved these changes Jul 5, 2024
Copy link
Contributor

@mattwrightva mattwrightva left a comment

Choose a reason for hiding this comment

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

Awesome!

@mmoyer-va mmoyer-va marked this pull request as ready for review July 5, 2024 15:37
@mmoyer-va mmoyer-va requested review from a team as code owners July 5, 2024 15:37
Comment on lines 16 to 25
before do
allow(MedicalRecords::Client).to receive(:new).and_return(authenticated_client)
allow(BBInternal::Client).to receive(:new).and_return(BBInternal::Client.new(
session: { user_id: 15_176_497,
patient_id: '15176498',
expires_at: Time.current + (60 * 60),
token: 'SESSION_TOKEN' }
))
sign_in_as(current_user)
end
Copy link
Contributor

Choose a reason for hiding this comment

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

@mmoyer-va could you refactor line 18 better spacing/readability. For example:

Suggested change
before do
allow(MedicalRecords::Client).to receive(:new).and_return(authenticated_client)
allow(BBInternal::Client).to receive(:new).and_return(BBInternal::Client.new(
session: { user_id: 15_176_497,
patient_id: '15176498',
expires_at: Time.current + (60 * 60),
token: 'SESSION_TOKEN' }
))
sign_in_as(current_user)
end
before do
bb_internal_client = BBInternal::Client.new(
session: {
user_id: 15_176_497,
patient_id: '15176498',
expires_at: Time.current + 1.hour,
token: 'SESSION_TOKEN'
}
)
allow(MedicalRecords::Client).to receive(:new).and_return(authenticated_client)
allow(BBInternal::Client).to receive(:new).and_return(bb_internal_client)
sign_in_as(current_user)
end

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@stevenjcumming thank you for the suggestion -- this is much better.

@va-vfs-bot va-vfs-bot temporarily deployed to MHV-57739-mhv-radiology-api/main/main July 5, 2024 19:40 Inactive
@mmoyer-va mmoyer-va requested a review from stevenjcumming July 8, 2024 16:12
@mmoyer-va mmoyer-va merged commit 7844ab5 into master Jul 8, 2024
19 checks passed
@mmoyer-va mmoyer-va deleted the MHV-57739-mhv-radiology-api branch July 8, 2024 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants