Skip to content

Commit

Permalink
feat: Add AppointmentMedicationWording to InPerson Phone & CC
Browse files Browse the repository at this point in the history
  • Loading branch information
juancstlm-a6 committed Oct 9, 2024
1 parent 234e5f4 commit 5a695a3
Show file tree
Hide file tree
Showing 11 changed files with 114 additions and 0 deletions.
1 change: 1 addition & 0 deletions VAMobile/env/constant.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
WEBVIEW_URL_CHANGE_LEGAL_NAME=https://www.va.gov/resources/how-to-change-your-legal-name-on-file-with-va/
WEBVIEW_URL_CORONA_FAQ=https://www.va.gov/coronavirus-veteran-frequently-asked-questions
WEBVIEW_URL_FACILITY_LOCATOR=https://www.va.gov/find-locations/
WEBVIEW_URL_WHAT_TO_BRING_TO_APPOINTMENTS=https://www.va.gov/resources/what-should-i-bring-to-my-health-care-appointments/
LINK_URL_VA_NOTIFICATIONS=https://www.va.gov/profile/notifications/
LINK_URL_VA_SCHEDULING=https://www.va.gov/health-care/schedule-view-va-appointments/
LINK_URL_IN_APP_RECRUITMENT=https://docs.google.com/forms/d/e/1FAIpQLSfRb0OtW34qKm8tGoQwwwDFs8IqwOMCLTde3DeM-ukKOEZBnA/viewform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ context('CommunityCareAppointment', () => {

expect(screen.getByRole('header', { name: 'Need to reschedule or cancel?' })).toBeTruthy()
expect(screen.getByText('If you need to reschedule or cancel this appointment, call your provider.')).toBeTruthy()

expect(screen.getByRole('header', { name: 'Prepare for your appointment' })).toBeTruthy()
expect(screen.getByRole('link', { name: 'Find a full list of things to bring to your appointment' })).toBeTruthy()
})

it('renders correctly with null data', () => {
Expand Down Expand Up @@ -172,6 +175,9 @@ context('CommunityCareAppointment', () => {
"Takes you to the V-A facility locator page. This page will open in your device's browser",
),
).toBeTruthy()

expect(screen.getByRole('header', { name: 'Prepare for your appointment' })).toBeTruthy()
expect(screen.getByRole('link', { name: 'Find a full list of things to bring to your appointment' })).toBeTruthy()
})
})

Expand Down Expand Up @@ -333,6 +339,9 @@ context('CommunityCareAppointment', () => {

expect(screen.getByRole('link', { name: 'Go to VA.gov to schedule' })).toBeTruthy()
expect(screen.getByLabelText('Go to V-A .gov to schedule')).toBeTruthy()

expect(screen.getByRole('header', { name: 'Prepare for your appointment' })).toBeTruthy()
expect(screen.getByRole('link', { name: 'Find a full list of things to bring to your appointment' })).toBeTruthy()
})

it('renders correctly with null data', () => {
Expand Down Expand Up @@ -396,6 +405,9 @@ context('CommunityCareAppointment', () => {

expect(screen.getByRole('link', { name: 'Go to VA.gov to schedule' })).toBeTruthy()
expect(screen.getByLabelText('Go to V-A .gov to schedule')).toBeTruthy()

expect(screen.getByRole('header', { name: 'Prepare for your appointment' })).toBeTruthy()
expect(screen.getByRole('link', { name: 'Find a full list of things to bring to your appointment' })).toBeTruthy()
})
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
AppointmentDateAndTime,
AppointmentDetailsModality,
AppointmentLocation,
AppointmentMedicationWording,
AppointmentPersonalContactInfo,
AppointmentProvider,
AppointmentReasonAndComment,
Expand Down Expand Up @@ -75,6 +76,7 @@ function CommunityCareAppointment({
<AppointmentLocation attributes={attributes} subType={subType} type={type} />
)}
<AppointmentReasonAndComment attributes={attributes} subType={subType} type={type} />
<AppointmentMedicationWording subType={subType} type={type} />
<AppointmentPersonalContactInfo attributes={attributes} subType={subType} />
<AppointmentCancelReschedule
appointmentID={appointmentID}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ context('InPersonVAAppointment', () => {
screen.getByText('Other details: Please arrive 20 minutes before the start of your appointment'),
).toBeTruthy()

expect(screen.getByRole('header', { name: 'Prepare for your appointment' })).toBeTruthy()
expect(screen.getByRole('link', { name: 'Find a full list of things to bring to your appointment' })).toBeTruthy()

expect(screen.getByRole('header', { name: 'Need to reschedule or cancel?' })).toBeTruthy()
expect(
screen.getByText('You can cancel this appointment in the app. But if you need to reschedule, call us.'),
Expand Down Expand Up @@ -176,6 +179,9 @@ context('InPersonVAAppointment', () => {
screen.getByText('Other details: Please arrive 20 minutes before the start of your appointment'),
).toBeTruthy()

expect(screen.getByRole('header', { name: 'Prepare for your appointment' })).toBeTruthy()
expect(screen.getByRole('link', { name: 'Find a full list of things to bring to your appointment' })).toBeTruthy()

expect(screen.getByRole('header', { name: 'Need to reschedule or cancel?' })).toBeTruthy()
expect(screen.getByText('If you need to reschedule or cancel this appointment, call us.')).toBeTruthy()

Expand Down Expand Up @@ -348,6 +354,9 @@ context('InPersonVAAppointment', () => {
screen.getByText('Other details: Please arrive 20 minutes before the start of your appointment'),
).toBeTruthy()

expect(screen.getByRole('header', { name: 'Prepare for your appointment' })).toBeTruthy()
expect(screen.getByRole('link', { name: 'Find a full list of things to bring to your appointment' })).toBeTruthy()

expect(screen.getByRole('header', { name: 'Need to reschedule?' })).toBeTruthy()
expect(
screen.getByText(
Expand Down Expand Up @@ -414,6 +423,9 @@ context('InPersonVAAppointment', () => {
screen.getByText('Other details: Please arrive 20 minutes before the start of your appointment'),
).toBeTruthy()

expect(screen.getByRole('header', { name: 'Prepare for your appointment' })).toBeTruthy()
expect(screen.getByRole('link', { name: 'Find a full list of things to bring to your appointment' })).toBeTruthy()

expect(screen.getByRole('header', { name: 'Need to reschedule?' })).toBeTruthy()
expect(
screen.getByText(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
AppointmentDateAndTime,
AppointmentDetailsModality,
AppointmentLocation,
AppointmentMedicationWording,
AppointmentPersonalContactInfo,
AppointmentPreferredModality,
AppointmentProvider,
Expand Down Expand Up @@ -62,6 +63,7 @@ function InPersonVAAppointment({
<AppointmentProvider attributes={attributes} subType={subType} type={type} />
<AppointmentLocation attributes={attributes} subType={subType} type={type} />
<AppointmentReasonAndComment attributes={attributes} subType={subType} type={type} />
<AppointmentMedicationWording subType={subType} type={type} />
<AppointmentPersonalContactInfo attributes={attributes} subType={subType} />
<AppointmentCancelReschedule
appointmentID={appointmentID}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ context('PhoneAppointment', () => {
screen.getByText('Other details: Please arrive 20 minutes before the start of your appointment'),
).toBeTruthy()

expect(screen.getByRole('header', { name: 'Prepare for your appointment' })).toBeTruthy()
expect(screen.getByRole('link', { name: 'Find a full list of things to bring to your appointment' })).toBeTruthy()

expect(screen.getByRole('header', { name: 'Need to reschedule or cancel?' })).toBeTruthy()
expect(
screen.getByText('You can cancel this appointment in the app. But if you need to reschedule, call us.'),
Expand Down Expand Up @@ -139,6 +142,9 @@ context('PhoneAppointment', () => {
screen.getByText('Other details: Please arrive 20 minutes before the start of your appointment'),
).toBeTruthy()

expect(screen.getByRole('header', { name: 'Prepare for your appointment' })).toBeTruthy()
expect(screen.getByRole('link', { name: 'Find a full list of things to bring to your appointment' })).toBeTruthy()

expect(screen.getByRole('header', { name: 'Need to reschedule or cancel?' })).toBeTruthy()
expect(screen.getByText('If you need to reschedule or cancel this appointment, call us.')).toBeTruthy()

Expand Down Expand Up @@ -260,6 +266,9 @@ context('PhoneAppointment', () => {
screen.getByText('Other details: Please arrive 20 minutes before the start of your appointment'),
).toBeTruthy()

expect(screen.getByRole('header', { name: 'Prepare for your appointment' })).toBeTruthy()
expect(screen.getByRole('link', { name: 'Find a full list of things to bring to your appointment' })).toBeTruthy()

expect(screen.getByRole('header', { name: 'Need to reschedule?' })).toBeTruthy()
expect(
screen.getByText(
Expand Down Expand Up @@ -307,6 +316,9 @@ context('PhoneAppointment', () => {
screen.getByText('Other details: Please arrive 20 minutes before the start of your appointment'),
).toBeTruthy()

expect(screen.getByRole('header', { name: 'Prepare for your appointment' })).toBeTruthy()
expect(screen.getByRole('link', { name: 'Find a full list of things to bring to your appointment' })).toBeTruthy()

expect(screen.getByRole('header', { name: 'Need to reschedule?' })).toBeTruthy()
expect(
screen.getByText(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
AppointmentDateAndTime,
AppointmentDetailsModality,
AppointmentLocation,
AppointmentMedicationWording,
AppointmentPersonalContactInfo,
AppointmentPreferredModality,
AppointmentProvider,
Expand Down Expand Up @@ -56,6 +57,7 @@ function PhoneAppointment({ appointmentID, attributes, subType, goBack, cancelAp
<AppointmentProvider attributes={attributes} subType={subType} type={type} />
<AppointmentLocation attributes={attributes} subType={subType} type={type} />
<AppointmentReasonAndComment attributes={attributes} subType={subType} type={type} />
<AppointmentMedicationWording subType={subType} type={type} />
<AppointmentPersonalContactInfo attributes={attributes} subType={subType} />
<AppointmentCancelReschedule
appointmentID={appointmentID}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import React from 'react'
import { useTranslation } from 'react-i18next'

import { Box, LinkWithAnalytics, TextView } from 'components'
import { NAMESPACE } from 'constants/namespaces'
import {
AppointmentDetailsScreenType,
AppointmentDetailsSubType,
AppointmentDetailsSubTypeConstants,
AppointmentDetailsTypeConstants,
} from 'utils/appointments'
import getEnv from 'utils/env'
import { useRouteNavigation, useTheme } from 'utils/hooks'

type AppointmentMedicationWordingProps = {
subType: AppointmentDetailsSubType
type: AppointmentDetailsScreenType
}

const { WEBVIEW_URL_WHAT_TO_BRING_TO_APPOINTMENTS } = getEnv()

function AppointmentMedicationWording({ subType, type }: AppointmentMedicationWordingProps) {
const theme = useTheme()
const { t } = useTranslation(NAMESPACE.COMMON)
const navigateTo = useRouteNavigation()

switch (subType) {
case AppointmentDetailsSubTypeConstants.Upcoming:
case AppointmentDetailsSubTypeConstants.Canceled:
switch (type) {
case AppointmentDetailsTypeConstants.InPersonVA:
case AppointmentDetailsTypeConstants.Phone:
case AppointmentDetailsTypeConstants.CommunityCare:
const body = t('appointmentsTab.medicationWording.default.body')
return (
<Box mb={theme.dimensions.standardMarginBetween}>
<TextView variant="MobileBodyBold" accessibilityRole="header">
{t('appointmentsTab.medicationWording.title')}
</TextView>
<TextView variant="MobileBody">{body}</TextView>
<LinkWithAnalytics
type="custom"
icon={{ name: 'Launch' }}
onPress={() => {
navigateTo('Webview', {
url: WEBVIEW_URL_WHAT_TO_BRING_TO_APPOINTMENTS,
displayTitle: t('webview.vagov'),
loadingMessage: t('loading'),
})
}}
text={t('appointmentsTab.medicationWording.whatToBringLink')}
/>
</Box>
)
default:
return <></>
}
default:
return <></>
}
}

export default AppointmentMedicationWording
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export { default as AppointmentDetailsModality } from './AppointmentDetailsModal
export * from './AppointmentDetailsModality'
export { default as AppointmentJoinSessionPrepareForVideo } from './AppointmentJoinSessionPrepareForVideo'
export * from './AppointmentJoinSessionPrepareForVideo'
export { default as AppointmentMedicationWording } from './AppointmentMedicationWording'
export * from './AppointmentMedicationWording'
export { default as AppointmentLocation } from './AppointmentLocation'
export * from './AppointmentLocation'
export { default as AppointmentPersonalContactInfo } from './AppointmentPersonalContactInfo'
Expand Down
3 changes: 3 additions & 0 deletions VAMobile/src/translations/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,9 @@
"appointmentsTab.past.a11yHint": "review your past appointments",
"appointmentsTab.upcoming": "Upcoming",
"appointmentsTab.upcoming.a11yHint": "review your upcoming appointments",
"appointmentsTab.medicationWording.title": "Prepare for your appointment",
"appointmentsTab.medicationWording.default.body": "Bring your insurance cards. And bring a list of your medications and other information to share with your provider.",
"appointmentsTab.medicationWording.whatToBringLink": "Find a full list of things to bring to your appointment",
"areYouSure": "Are you sure?",
"askForClaimDecision.alertBtnTitle": "Request evaluation",
"askForClaimDecision.alertTitle": "Request claim evaluation?",
Expand Down
3 changes: 3 additions & 0 deletions VAMobile/src/utils/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
WEBVIEW_URL_CHANGE_LEGAL_NAME,
WEBVIEW_URL_CORONA_FAQ,
WEBVIEW_URL_FACILITY_LOCATOR,
WEBVIEW_URL_WHAT_TO_BRING_TO_APPOINTMENTS,
} from '@env'

export type EnvVars = {
Expand Down Expand Up @@ -79,6 +80,7 @@ export type EnvVars = {
WEBVIEW_URL_CORONA_FAQ: string
WEBVIEW_URL_FACILITY_LOCATOR: string
WEBVIEW_URL_CHANGE_LEGAL_NAME: string
WEBVIEW_URL_WHAT_TO_BRING_TO_APPOINTMENTS: string
}

// need to wrap @env for testing purposes
Expand Down Expand Up @@ -121,4 +123,5 @@ export default (): EnvVars => ({
WEBVIEW_URL_CORONA_FAQ,
WEBVIEW_URL_FACILITY_LOCATOR,
WEBVIEW_URL_CHANGE_LEGAL_NAME,
WEBVIEW_URL_WHAT_TO_BRING_TO_APPOINTMENTS,
})

0 comments on commit 5a695a3

Please sign in to comment.