Skip to content

Commit

Permalink
update RSV copy (#7088)
Browse files Browse the repository at this point in the history
* fix result header

* Add RSV notes guidance

* Check for multiple results

* Update tests and snapshot

* Update e2e

* Translate RSV to VRS

---------

Co-authored-by: Mike Brown <[email protected]>
  • Loading branch information
fzhao99 and mpbrown authored Dec 18, 2023
1 parent bb974a8 commit cd28e64
Show file tree
Hide file tree
Showing 10 changed files with 150 additions and 59 deletions.
1 change: 0 additions & 1 deletion cypress/e2e/05-get_result_from_patient_link.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ describe("Getting a test result from a patient link", () => {
cy.get("#dob-submit-button").click();
});
it("shows the test result", () => {
cy.contains("Test result: COVID-19");
cy.contains("Test result");
cy.contains("Test date");
cy.contains("Test device");
Expand Down
40 changes: 40 additions & 0 deletions frontend/src/app/commonComponents/MultiplexResultsGuidance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
hasPositiveFluResults,
getResultByDiseaseName,
hasCovidResults,
hasPositiveRsvResults,
} from "../utils/testResults";

type PositiveFluResultInfoProps = {
Expand Down Expand Up @@ -56,6 +57,41 @@ const PositiveFluResultInfo = ({
);
};

type PositiveRsvResultInfoProps = {
needsHeading: boolean;
t: translateFn;
};
const PositiveRsvResultInfo = ({
needsHeading,
t,
}: PositiveRsvResultInfoProps) => {
return (
<>
{needsHeading && (
<p className="text-bold sr-guidance-heading">
{t("testResult.rsvNotes.h1")}
</p>
)}
<p>{t("testResult.rsvNotes.positive.p0")}</p>
<p>{t("testResult.rsvNotes.positive.p1")}</p>
<Trans
parent="p"
i18nKey="testResult.rsvNotes.positive.p2"
components={[
<a
href={t("testResult.rsvNotes.positive.rsvSymptomsLink")}
target="_blank"
rel="noopener noreferrer"
key="rsv-symptoms-link"
>
rsv symptoms link
</a>,
]}
/>
</>
);
};

interface MultiplexResultsGuidanceProps {
results: MultiplexResult[];
isPatientApp: boolean;
Expand All @@ -67,6 +103,7 @@ const MultiplexResultsGuidance: React.FC<MultiplexResultsGuidanceProps> = ({
const { t } = useTranslation();
const needsCovidHeading = hasCovidResults(results);
const needsFluGuidance = hasPositiveFluResults(results);
const needsRsvGuidance = hasPositiveRsvResults(results);
const covidResult = getResultByDiseaseName(results, "COVID-19") as TestResult;

return (
Expand All @@ -85,6 +122,9 @@ const MultiplexResultsGuidance: React.FC<MultiplexResultsGuidanceProps> = ({
{needsFluGuidance && (
<PositiveFluResultInfo needsHeading={needsFluGuidance} t={t} />
)}
{needsRsvGuidance && (
<PositiveRsvResultInfo needsHeading={needsRsvGuidance} t={t} />
)}
</>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ describe("TestResultPrintModal with only COVID results", () => {

it("should render only COVID information", () => {
renderWithUser();
expect(screen.getByText("Test result: COVID-19")).toBeInTheDocument();
expect(screen.getByText("For COVID-19:")).toBeInTheDocument();
});

it("matches screenshot", () => {
Expand Down Expand Up @@ -136,9 +136,7 @@ describe("TestResultPrintModal with multiplex results in SimpleReport App", () =
});

it("should render flu information", () => {
expect(
screen.getByText("Test results: COVID-19 and flu")
).toBeInTheDocument();
expect(screen.getByText("Test results")).toBeInTheDocument();
expect(screen.getByText("For flu A and B:")).toBeInTheDocument();
});

Expand Down Expand Up @@ -185,9 +183,7 @@ describe("TestResultPrintModal with multiplex results in Pxp App", () => {
});

it("should render information", () => {
expect(
screen.getByText("Test results: COVID-19 and flu")
).toBeInTheDocument();
expect(screen.getByText("Test results")).toBeInTheDocument();
expect(screen.getByText("fake npi for pxp")).toBeInTheDocument();
expect(screen.getAllByText("Negative").length).toBe(3);
});
Expand Down Expand Up @@ -231,11 +227,8 @@ describe("TestResultPrintModal with RSV and flu results", () => {
);
});

// this should be changed when we correct our copy to the right header text (#7000)
it("should render flu information", () => {
expect(
screen.getByText("Test results: COVID-19 and flu")
).toBeInTheDocument();
expect(screen.getByText("Test results")).toBeInTheDocument();
expect(screen.getByText("For flu A and B:")).toBeInTheDocument();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ import { displayFullName } from "../../../utils";
import { formatDateWithTimeOption } from "../../../utils/date";
import {
hasCovidResults,
hasMultiplexResults,
hasMultipleResults,
hasPositiveFluResults,
hasPositiveRsvResults,
} from "../../../utils/testResults";
import { setLanguage } from "../../../utils/languages";

Expand Down Expand Up @@ -86,9 +87,9 @@ export const StaticTestResultModal = ({
>
<header className="display-flex flex-align-end flex-justify margin-bottom-1">
<h1>
{hasMultiplexResults(results)
? t("testResult.multiplexResultHeader")
: t("testResult.covidResultHeader")}
{hasMultipleResults(results)
? t("testResult.multipleResultHeader")
: t("testResult.singleResultHeader")}
</h1>
<img
alt="SimpleReport logo"
Expand Down Expand Up @@ -184,7 +185,9 @@ export const StaticTestResultModal = ({
<TestResultsList results={results} isPatientApp={isPatientApp} />
</ul>
</section>
{(hasCovidResults(results) || hasPositiveFluResults(results)) && (
{(hasCovidResults(results) ||
hasPositiveFluResults(results) ||
hasPositiveRsvResults(results)) && (
<section className="sr-result-section sr-result-next-steps">
<h2>{t("testResult.moreInformation")}</h2>
<MultiplexResultsGuidance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Object {
class="display-flex flex-align-end flex-justify margin-bottom-1"
>
<h1>
Test results: COVID-19 and flu
Test results
</h1>
<img
alt="SimpleReport logo"
Expand Down Expand Up @@ -302,6 +302,27 @@ Object {
</a>
(cdc.gov/flu/treatment/takingcare.htm).
</p>
<p
class="text-bold sr-guidance-heading"
>
For RSV:
</p>
<p>
RSV usually causes mild, cold-like symptoms. Most people can recover at home, but RSV can cause serious illness and hospitalization for infants and older adults. You can help prevent the spread of RSV by staying at home when sick, avoiding close contact with others, and washing your hands frequently.
</p>
<p>
You can take steps to relieve symptoms, including managing fever and pain with over-the-counter fever reducers, and drinking enough fluids. If your child has RSV, talk to their healthcare provider before giving them non-prescription cold medicine.
</p>
<p>
Contact your healthcare professional if your symptoms worsen, you are having trouble breathing, or are dehydrated.
<a
href="https://www.cdc.gov/rsv/about/symptoms.html"
rel="noopener noreferrer"
target="_blank"
>
Learn more about RSV symptoms and care on the CDC website.
</a>
</p>
</section>
</main>
<footer>
Expand Down Expand Up @@ -383,7 +404,7 @@ Object {
class="display-flex flex-align-end flex-justify margin-bottom-1"
>
<h1>
Test results: COVID-19 and flu
Test results
</h1>
<img
alt="SimpleReport logo"
Expand Down Expand Up @@ -628,6 +649,27 @@ Object {
</a>
(cdc.gov/flu/treatment/takingcare.htm).
</p>
<p
class="text-bold sr-guidance-heading"
>
For RSV:
</p>
<p>
RSV usually causes mild, cold-like symptoms. Most people can recover at home, but RSV can cause serious illness and hospitalization for infants and older adults. You can help prevent the spread of RSV by staying at home when sick, avoiding close contact with others, and washing your hands frequently.
</p>
<p>
You can take steps to relieve symptoms, including managing fever and pain with over-the-counter fever reducers, and drinking enough fluids. If your child has RSV, talk to their healthcare provider before giving them non-prescription cold medicine.
</p>
<p>
Contact your healthcare professional if your symptoms worsen, you are having trouble breathing, or are dehydrated.
<a
href="https://www.cdc.gov/rsv/about/symptoms.html"
rel="noopener noreferrer"
target="_blank"
>
Learn more about RSV symptoms and care on the CDC website.
</a>
</p>
</section>
</main>
<footer>
Expand Down Expand Up @@ -766,7 +808,7 @@ Object {
class="display-flex flex-align-end flex-justify margin-bottom-1"
>
<h1>
Test results: COVID-19 and flu
Test results
</h1>
<img
alt="SimpleReport logo"
Expand Down Expand Up @@ -1122,7 +1164,7 @@ your local health department.
class="display-flex flex-align-end flex-justify margin-bottom-1"
>
<h1>
Test results: COVID-19 and flu
Test results
</h1>
<img
alt="SimpleReport logo"
Expand Down Expand Up @@ -1535,7 +1577,7 @@ Object {
class="display-flex flex-align-end flex-justify margin-bottom-1"
>
<h1>
Test results: COVID-19 and flu
Test results
</h1>
<img
alt="SimpleReport logo"
Expand Down Expand Up @@ -1941,7 +1983,7 @@ Object {
class="display-flex flex-align-end flex-justify margin-bottom-1"
>
<h1>
Test results: COVID-19 and flu
Test results
</h1>
<img
alt="SimpleReport logo"
Expand Down Expand Up @@ -2401,7 +2443,7 @@ exports[`TestResultPrintModal with only COVID results matches screenshot 1`] = `
class="display-flex flex-align-end flex-justify margin-bottom-1"
>
<h1>
Test result: COVID-19
Test result
</h1>
<img
alt="SimpleReport logo"
Expand Down
14 changes: 14 additions & 0 deletions frontend/src/app/utils/testResults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ export function getSortedResults(results: MultiplexResults): MultiplexResults {
);
}

export function hasMultipleResults(results: MultiplexResults): boolean {
return results?.length > 1;
}

export function hasMultiplexResults(results: MultiplexResults): boolean {
return results?.length > 1
? results.some(
Expand All @@ -59,3 +63,13 @@ export function hasCovidResults(results: MultiplexResults): boolean {
).length > 0
);
}

export function hasPositiveRsvResults(results: MultiplexResults): boolean {
return (
results.filter(
(multiplexResult: MultiplexResult) =>
multiplexResult.disease.name.includes("RSV") &&
getTestResult(multiplexResult) === "POSITIVE"
).length > 0
);
}
13 changes: 11 additions & 2 deletions frontend/src/lang/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,8 @@ export const en = {
title: "Test result",
resultLiteral: "result",
result: "SARS-CoV-2 result",
covidResultHeader: "Test result: COVID-19",
multiplexResultHeader: "Test results: COVID-19 and flu",
singleResultHeader: "Test result",
multipleResultHeader: "Test results",
downloadResult: "Download result",
patient: "Patient",
patientDetails: "Patient details",
Expand Down Expand Up @@ -380,6 +380,15 @@ export const en = {
treatmentLink: "https://www.cdc.gov/flu/treatment/takingcare.htm",
},
},
rsvNotes: {
h1: "For RSV:",
positive: {
p0: "RSV usually causes mild, cold-like symptoms. Most people can recover at home, but RSV can cause serious illness and hospitalization for infants and older adults. You can help prevent the spread of RSV by staying at home when sick, avoiding close contact with others, and washing your hands frequently.",
p1: "You can take steps to relieve symptoms, including managing fever and pain with over-the-counter fever reducers, and drinking enough fluids. If your child has RSV, talk to their healthcare provider before giving them non-prescription cold medicine.",
p2: "Contact your healthcare professional if your symptoms worsen, you are having trouble breathing, or are dehydrated. <0>Learn more about RSV symptoms and care on the CDC website.</0>",
rsvSymptomsLink: "https://www.cdc.gov/rsv/about/symptoms.html",
},
},
tos: {
header: "Terms of service",
title: "Terms of service",
Expand Down
16 changes: 12 additions & 4 deletions frontend/src/lang/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const es: LanguageConfig = {
COVID19: "COVID-19",
FLUA: "Flu A",
FLUB: "Flu B",
RSV: "RSV",
RSV: "VRS",
},
role: {
STAFF: "Personal",
Expand Down Expand Up @@ -283,9 +283,8 @@ export const es: LanguageConfig = {
title: "Resultado de la prueba",
resultLiteral: "resultado",
result: "Resultado de SARS-CoV-2",
covidResultHeader: "Resultado de la prueba: COVID-19",
multiplexResultHeader:
"Resultados de las pruebas: COVID-19 y la influenza",
singleResultHeader: "Resultado de la prueba",
multipleResultHeader: "Resultados de las pruebas",
downloadResult: "Descargar resultado",
patient: "Paciente",
patientDetails: "Detalles del paciente",
Expand Down Expand Up @@ -407,6 +406,15 @@ export const es: LanguageConfig = {
treatmentLink: "https://espanol.cdc.gov/flu/treatment/takingcare.htm",
},
},
rsvNotes: {
h1: "Para VRS:",
positive: {
p0: "Por lo general, el virus respiratorio sincitial (VRS o RSV, por sus siglas en inglés) causa síntomas leves similares a los de un resfriado. La mayoría de las personas pueden recuperarse en casa, pero el VRS puede causar enfermedad grave y hospitalización en bebés y personas mayores. Usted puede ayudar a prevenir la propagación del VRS si se queda en casa cuando esté enfermo, evita el contacto cercano con otras personas y se lava las manos con frecuencia.",
p1: "Puede tomar medidas para aliviar los síntomas, como beber suficientes líquidos y tomar medicamentos de venta sin receta para controlar el dolor y la fiebre. Si su hijo/a tiene el VRS, hable con su proveedor de atención médica antes de darle medicamentos para el resfriado sin receta.",
p2: "Comuníquese con un profesional de atención médica si sus síntomas empeoran, tiene problemas para respirar o está deshidratado. <0>Obtenga más información sobre los síntomas y cuidados de la infección por el VRS en el sitio web de los CDC</0>",
rsvSymptomsLink: "https://espanol.cdc.gov/rsv/about/symptoms.html",
},
},
tos: {
header: "Condiciones del servicio",
title: "Condiciones del servicio",
Expand Down
Loading

0 comments on commit cd28e64

Please sign in to comment.