diff --git a/src/applications/mhv-medical-records/containers/LandingPage.jsx b/src/applications/mhv-medical-records/containers/LandingPage.jsx index 3a966cfe7279..36fbf0c4b8e0 100644 --- a/src/applications/mhv-medical-records/containers/LandingPage.jsx +++ b/src/applications/mhv-medical-records/containers/LandingPage.jsx @@ -47,6 +47,7 @@ const LandingPage = () => { state => state.featureToggles.mhv_integration_medical_records_to_phase_1, ); const { + isLoading, isAcceleratingAllergies, isAcceleratingVitals, } = useAcceleratedData(); @@ -89,434 +90,451 @@ const LandingPage = () => {

- {displayLabsAndTest && ( + {isLoading && (
-

- Lab and test results -

-

- Get results of your VA medical tests. This includes blood tests, - X-rays, and other imaging tests. -

- {isAcceleratingEnabled ? ( - - View your labs and tests on My VA Health (opens in new tab) - - ) : ( - - Go to your lab and test results - - )} +
)} - {displayNotes && ( -
-

- Care summaries and notes -

-

- Get notes from your VA providers about your health and health care. - This includes summaries of your stays in health facilities (called - admission and discharge summaries). -

- {isAcceleratingEnabled ? ( - <> + + {!isLoading && ( + <> + {displayLabsAndTest && ( +
+

+ Lab and test results +

+

+ Get results of your VA medical tests. This includes blood tests, + X-rays, and other imaging tests. +

+ {isAcceleratingEnabled ? ( + + View your labs and tests on My VA Health (opens in new tab) + + ) : ( + + Go to your lab and test results + + )} +
+ )} + {displayNotes && ( +
+

+ Care summaries and notes +

+

+ Get notes from your VA providers about your health and health + care. This includes summaries of your stays in health facilities + (called admission and discharge summaries). +

+ {isAcceleratingEnabled ? ( + <> + + View your care summaries and notes on My VA Health (opens in + new window) + + + ) : ( + <> + + Go to your care summaries and notes + + + )} +
+ )} + {displayVaccines && ( +
+

+ Vaccines +

+

+ Get a list of all vaccines (immunizations) in your VA medical + records. +

+ {isAcceleratingEnabled ? ( + + View your vaccines on My VA Health (opens in new tab) + + ) : ( + + Go to your vaccines + + )} +
+ )} +
+

+ Allergies and reactions +

+

+ Get a list of all allergies, reactions, and side effects in your + VA medical records. This includes medication side effects (also + called adverse drug reactions). +

+ {isAcceleratingEnabled && !isAcceleratingAllergies ? ( - View your care summaries and notes on My VA Health (opens in new - window) + View your allergies on My VA Health (opens in new tab) - - ) : ( - <> + ) : ( - Go to your care summaries and notes + Go to your allergies and reactions - - )} -
- )} - {displayVaccines && ( -
-

- Vaccines -

-

- Get a list of all vaccines (immunizations) in your VA medical - records. -

- {isAcceleratingEnabled ? ( - + {displayConditions && ( +
+

+ Health conditions +

+

+ Get a list of health conditions your VA providers are helping + you manage. +

+ {isAcceleratingEnabled ? ( +
+ View your health conditions on My VA Health (opens in new tab) + + ) : ( + + Go to your health conditions + )} - target="_blank" - rel="noopener noreferrer" - data-testid="vaccines-oh-landing-page-link" - > - View your vaccines on My VA Health (opens in new tab) - - ) : ( - - Go to your vaccines - +
)} -
- )} -
-

- Allergies and reactions -

-

- Get a list of all allergies, reactions, and side effects in your VA - medical records. This includes medication side effects (also called - adverse drug reactions). -

- {isAcceleratingEnabled && !isAcceleratingAllergies ? ( - - View your allergies on My VA Health (opens in new tab) - - ) : ( - - Go to your allergies and reactions - - )} -
- {displayConditions && ( -
-

- Health conditions -

-

- Get a list of health conditions your VA providers are helping you - manage. -

- {isAcceleratingEnabled ? ( - - View your health conditions on My VA Health (opens in new tab) - - ) : ( - - Go to your health conditions - + {displayVitals && ( +
+

+ Vitals +

+

+ Get records of these basic health numbers your providers check + at appointments: +

+
    +
  • Blood pressure and blood oxygen level
  • +
  • Breathing rate and heart rate
  • +
  • Height and weight
  • +
  • Temperature
  • +
+ {isAcceleratingEnabled && !isAcceleratingVitals ? ( + + View your vitals on My VA Health (opens in new tab) + + ) : ( + + Go to your vitals + + )} +
)} -
- )} - {displayVitals && ( -
-

- Vitals -

-

- Get records of these basic health numbers your providers check at - appointments: -

- - {isAcceleratingEnabled && !isAcceleratingVitals ? ( - - View your vitals on My VA Health (opens in new tab) - - ) : ( - - Go to your vitals - + {displayMedicalRecordsSettings && ( +
+

+ Manage your medical records settings +

+

+ Review and update your medical records sharing and notification + settings. +

+ + Go to your medical records settings + +
)} -
- )} - {displayMedicalRecordsSettings && ( -
-

- Manage your medical records settings -

-

- Review and update your medical records sharing and notification - settings. -

- - Go to your medical records settings - -
- )} -
-

- Download your Blue Button report or health summary -

-

- We’re working on a way to download all your medical records here as a - single file or a summary. -

-

- For now, you can continue to download your VA Blue Button® report or - your VA Health Summary on the previous version of My HealtheVet. -

-

- -

-
-
-

- What to know as you try out this tool -

-

- We’re giving the trusted My HealtheVet medical records tool a new home - here on VA.gov. And we need your feedback to help us keep making this - tool better for you and all Veterans. -

-

- Send us your feedback and questions using the feedback button on this - page. -

-

- Note: You still have - access to your medical records on the My HealtheVet website. You can - go back to that site at any time.{' '} - -

-
-
-

Questions about this medical records tool

- - -

- Where can I find health information I entered myself? -

+
+

+ Download your Blue Button report or health summary +

- Right now, your records on VA.gov only include health information - your VA providers have entered. + We’re working on a way to download all your medical records here + as a single file or a summary.

- To find health information you entered yourself, go to your - medical records on the My HealtheVet website. + For now, you can continue to download your VA Blue Button® report + or your VA Health Summary on the previous version of My + HealtheVet.

-

+

- - -

- How can I tell my care team that my health information has - changed? -

- -

- If you need to add or change health information in your records, - you can tell your provider at your next appointment. -

-

- Or you can send a secure message to your care team and ask them to - update your records. -

-

- {phase0p5Flag ? ( - - ) : ( - - )} -

-
- -

- Will VA protect my personal health information? -

+
+
+

+ What to know as you try out this tool +

- Yes. This is a secure website. We follow strict security policies - and practices to protect your personal health information. Only - you and your VA care team will have access to your records. + We’re giving the trusted My HealtheVet medical records tool a new + home here on VA.gov. And we need your feedback to help us keep + making this tool better for you and all Veterans.

- If you print or download any records, you’ll need to take - responsibility for protecting that information. If you’re on a - public or shared computer, remember that downloading will save a - copy of your records to the computer you’re using. + Send us your feedback and questions using the feedback button on + this page.

- - -

- What if I have more questions? -

- - For questions about health information in your records,{' '} - - send a secure message to your care team. + Note: You still + have access to your medical records on the My HealtheVet website. + You can go back to that site at any time.{' '} +

+
+
+

Questions about this medical records tool

+ + +

+ Where can I find health information I entered myself? +

+

+ Right now, your records on VA.gov only include health + information your VA providers have entered. +

+

+ To find health information you entered yourself, go to your + medical records on the My HealtheVet website. +

+

+ +

+
+ +

+ How can I tell my care team that my health information has + changed? +

-

- {phase0p5Flag ? ( - - ) : ( - + If you need to add or change health information in your + records, you can tell your provider at your next appointment. +

+

+ Or you can send a secure message to your care team and ask + them to update your records. +

+

+ {phase0p5Flag ? ( + + ) : ( + )} - text="Start a new message" - /> - )} -

-

- Only use messages for non-urgent needs. Your care team may take up - to{' '} - 3 business days{' '} - to reply. -

-

- If you need help sooner, use one of these urgent communication - options: -

-
    -
  • - - If you’re in crisis or having thoughts of suicide, - {' '} - connect with our Veterans Crisis Line. We offer confidential - support anytime, day or night. -
    - {} : openCrisisModal} - /> -
    -
  • -
  • - - If you think your life or health is in danger, - {' '} - call 911 or go to the nearest emergency room. -
  • -
- {!killExternalLinks && ( - <> +

+
+ +

+ Will VA protect my personal health information? +

+

+ Yes. This is a secure website. We follow strict security + policies and practices to protect your personal health + information. Only you and your VA care team will have access + to your records. +

+

+ If you print or download any records, you’ll need to take + responsibility for protecting that information. If you’re on a + public or shared computer, remember that downloading will save + a copy of your records to the computer you’re using. +

+
+ +

+ What if I have more questions? +

- For questions about how to use this tool,{' '} + For questions about health information in your records,{' '} + send a secure message to your care team. +

+ +

{phase0p5Flag ? ( - - call us at{' '} - ( - - ). We’re here Monday through Friday, 8:00 a.m. to 8:00 - p.m. ET. - + ) : ( - - email us at . - + )}

- - )} -
-
-
+

+ Only use messages for non-urgent needs. Your care team may + take up to{' '} + + 3 business days + {' '} + to reply. +

+

+ If you need help sooner, use one of these urgent communication + options: +

+
    +
  • + + If you’re in crisis or having thoughts of suicide, + {' '} + connect with our Veterans Crisis Line. We offer confidential + support anytime, day or night. +
    + {} : openCrisisModal} + /> +
    +
  • +
  • + + If you think your life or health is in danger, + {' '} + call 911 or go to the nearest emergency room. +
  • +
+ {!killExternalLinks && ( + <> +

+ + For questions about how to use this tool,{' '} + + {phase0p5Flag ? ( + + call us at{' '} + ( + + ). We’re here Monday through Friday, 8:00 a.m. to 8:00 + p.m. ET. + + ) : ( + + email us at . + + )} +

+ + )} +
+
+
+ + )} ); }; diff --git a/src/applications/mhv-medical-records/hooks/useAcceleratedData.js b/src/applications/mhv-medical-records/hooks/useAcceleratedData.js index 261cf4aa9153..7c0bbb992d9d 100644 --- a/src/applications/mhv-medical-records/hooks/useAcceleratedData.js +++ b/src/applications/mhv-medical-records/hooks/useAcceleratedData.js @@ -1,9 +1,10 @@ import FEATURE_FLAG_NAMES from '@department-of-veterans-affairs/platform-utilities/featureFlagNames'; import { selectIsCernerPatient } from '~/platform/user/cerner-dsot/selectors'; -import { connectDrupalSourceOfTruthCerner } from '~/platform/utilities/cerner/dsot'; import { useSelector, useDispatch } from 'react-redux'; import { useMemo, useEffect } from 'react'; +import { connectDrupalSourceOfTruthCerner } from '~/platform/utilities/cerner/dsot'; + const useAcceleratedData = () => { const dispatch = useDispatch(); @@ -26,14 +27,25 @@ const useAcceleratedData = () => { useEffect( () => { - // use Drupal based Cerner facility data - connectDrupalSourceOfTruthCerner(dispatch); + // TECH DEBT: Do not trigger the connection when uniting tests because + // the connection is not mocked and will cause the test to fail + if (!window.Mocha) { + // use Drupal based Cerner facility data + connectDrupalSourceOfTruthCerner(dispatch); + } }, [dispatch], ); - const isCerner = useSelector(selectIsCernerPatient); + const { featureToggles, drupalStaticData } = useSelector(state => state); + const isLoading = useMemo( + () => { + return featureToggles.loading || drupalStaticData?.vamcEhrData?.loading; + }, + [drupalStaticData, featureToggles], + ); + const isAcceleratingAllergies = useMemo( () => { return ( @@ -55,6 +67,7 @@ const useAcceleratedData = () => { ); return { + isLoading, isAcceleratingAllergies, isAcceleratingVitals, }; diff --git a/src/applications/mhv-medical-records/tests/containers/LandingPage.unit.spec.jsx b/src/applications/mhv-medical-records/tests/containers/LandingPage.unit.spec.jsx index fca1855f48eb..e270c980ad2e 100644 --- a/src/applications/mhv-medical-records/tests/containers/LandingPage.unit.spec.jsx +++ b/src/applications/mhv-medical-records/tests/containers/LandingPage.unit.spec.jsx @@ -44,7 +44,20 @@ describe('Landing Page', () => { }); it('displays a section linking to My HealtheVet classic to download all records', () => { - const screen = renderWithStoreAndRouter(, {}); + const customState = { + featureToggles: { + loading: false, + }, + drupalStaticData: { + vamcEhrData: { + loading: false, + }, + }, + ...initialState, + }; + const screen = renderWithStoreAndRouter(, { + initialState: customState, + }); expect( screen.getByText('Download your Blue Button report or health summary', { selector: 'h2', @@ -70,7 +83,14 @@ describe('Landing Page', () => { it('displays downtimeNotification when downtimeApproaching is true', () => { const customState = { - featureToggles: {}, + featureToggles: { + loading: false, + }, + drupalStaticData: { + vamcEhrData: { + loading: false, + }, + }, scheduledDowntime: { globalDowntime: null, isReady: true, @@ -104,7 +124,13 @@ describe('Landing Page', () => { it('displays features as h2s with links below when feature flags are true', () => { const customState = { + drupalStaticData: { + vamcEhrData: { + loading: false, + }, + }, featureToggles: { + loading: false, // eslint-disable-next-line camelcase mhv_medical_records_display_conditions: true, // eslint-disable-next-line camelcase diff --git a/src/applications/mhv-medical-records/tests/e2e/accelerated/vitals-loading-hook.oracle-health.cypress.spec.js b/src/applications/mhv-medical-records/tests/e2e/accelerated/vitals-loading-hook.oracle-health.cypress.spec.js new file mode 100644 index 000000000000..fd06768d1caf --- /dev/null +++ b/src/applications/mhv-medical-records/tests/e2e/accelerated/vitals-loading-hook.oracle-health.cypress.spec.js @@ -0,0 +1,26 @@ +import MedicalRecordsSite from '../mr_site/MedicalRecordsSite'; +import Vitals from './pages/Vitals'; +import oracleHealthUser from '../fixtures/user/oracle-health.json'; +import vitalsData from '../fixtures/vitals/blood-oxygen.json'; + +describe('Medical Records Loading screen', () => { + const site = new MedicalRecordsSite(); + + beforeEach(() => { + site.login(oracleHealthUser, false); + site.mockFeatureToggles({ + isAcceleratingEnabled: true, + isAcceleratingVitals: true, + }); + Vitals.setIntercepts({ vitalData: vitalsData }); + cy.visit('my-health/medical-records'); + }); + + it('Loading Visits View Vitals List', () => { + // There was a bug that only happen when the redux state was in a loading state, but the page was still shown. + // This caused the experience to be wonky and cause the page to jump and display wrong information. + Vitals.goToVitalPage(); + + cy.injectAxeThenAxeCheck(); + }); +});