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

Add gonorrhea test result guidance #8374

Merged
merged 2 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { render, screen } from "@testing-library/react";

import "../../../i18n";

import GonorrheaResultGuidance from "./GonorrheaResultGuidance";

describe("GonorrheaResultGuidance", () => {
it("displays guidance for a Gonorrhea result", () => {
const { container } = render(<GonorrheaResultGuidance />);
expect(screen.getByText("For Gonorrhea:")).toBeInTheDocument();
expect(container).toMatchSnapshot();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React from "react";
import { Trans, useTranslation } from "react-i18next";

const GonorrheaResultGuidance = () => {
const { t } = useTranslation();

return (
<>
<p className="text-bold sr-guidance-heading">
{t("testResult.gonorrheaNotes.h1")}
</p>
<p>{t("testResult.gonorrheaNotes.positive.p0")}</p>
<Trans
parent="p"
i18nKey="testResult.gonorrheaNotes.positive.p1"
components={[
<a
href={t("testResult.gonorrheaNotes.positive.treatmentLink")}
target="_blank"
rel="noopener noreferrer"
key="gonorrhea-treatment-link"
>
gonorrhea treatment link
</a>,
]}
/>
</>
);
};

export default GonorrheaResultGuidance;
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`GonorrheaResultGuidance displays guidance for a Gonorrhea result 1`] = `
<div>
<p
class="text-bold sr-guidance-heading"
>
For Gonorrhea:
</p>
<p>
If you have a positive result, you will need a follow-up test to confirm your results. The organization that provided your test should be able to answer questions and provide referrals for follow-up testing.
</p>
<p>
<a
href="https://www.cdc.gov/gonorrhea/about/index.html"
rel="noopener noreferrer"
target="_blank"
>
Visit the CDC website to learn more about a positive Gonorrhea result.
</a>
(cdc.gov/gonorrhea/about).
</p>
</div>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,12 @@ export const DetachedTestResultDetailsModal = ({
data?.testResult.results,
MULTIPLEX_DISEASES.HEPATITIS_C
);
const isGonorrheaResult = !!getResultForDisease(
data?.testResult.results,
MULTIPLEX_DISEASES.GONORRHEA
);
const showGenderOfSexualPartners =
isHIVResult || isSyphilisResult || isHepatitisCResult;
isHIVResult || isSyphilisResult || isHepatitisCResult || isGonorrheaResult;

const dateTested = data?.testResult.dateTested;

Expand Down
6 changes: 6 additions & 0 deletions frontend/src/app/utils/testResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import HivResultGuidance from "../commonComponents/TestResultGuidance/HivResultG
import RsvResultGuidance from "../commonComponents/TestResultGuidance/RsvResultGuidance";
import SyphilisResultGuidance from "../commonComponents/TestResultGuidance/SyphilisResultGuidance";
import HepatitisCResultGuidance from "../commonComponents/TestResultGuidance/HepatitisCResultGuidance";
import GonorrheaResultGuidance from "../commonComponents/TestResultGuidance/GonorrheaResultGuidance";

export function getResultByDiseaseName(
results: MultiplexResults,
Expand Down Expand Up @@ -106,5 +107,10 @@ export const getGuidanceForResults = (
guidance.push(<HepatitisCResultGuidance />);
}

match = getResultForDisease(results, MULTIPLEX_DISEASES.GONORRHEA);
if (match) {
guidance.push(<GonorrheaResultGuidance />);
}

return guidance;
};
10 changes: 10 additions & 0 deletions frontend/src/lang/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const en = {
HIV: "HIV",
SYPHILIS: "Syphilis",
HEPATITIS_C: "Hepatitis C",
GONORRHEA: "Gonorrhea",
},
diseaseResultTitle: {
COVID19: "COVID-19 result",
Expand All @@ -51,6 +52,7 @@ export const en = {
HIV: "HIV result",
SYPHILIS: "Syphilis result",
HEPATITIS_C: "Hepatitis C result",
GONORRHEA: "Gonorrhea result",
},
role: {
STAFF: "Staff",
Expand Down Expand Up @@ -431,6 +433,14 @@ export const en = {
"https://www.cdc.gov/hepatitis-c/testing/index.html#cdc_testing_results-testing-results",
},
},
gonorrheaNotes: {
h1: "For Gonorrhea:",
positive: {
p0: "If you have a positive result, you will need a follow-up test to confirm your results. The organization that provided your test should be able to answer questions and provide referrals for follow-up testing.",
p1: "<0>Visit the CDC website to learn more about a positive Gonorrhea result.</0> (cdc.gov/gonorrhea/about).",
treatmentLink: "https://www.cdc.gov/gonorrhea/about/index.html",
},
},
tos: {
header: "Terms of service",
title: "Terms of service",
Expand Down
11 changes: 11 additions & 0 deletions frontend/src/lang/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const es: LanguageConfig = {
HIV: "VIH",
SYPHILIS: "Sífilis",
HEPATITIS_C: "Hepatitis C",
GONORRHEA: "Gonorrea",
},
diseaseResultTitle: {
COVID19: "COVID-19 resultado",
Expand All @@ -54,6 +55,7 @@ export const es: LanguageConfig = {
HIV: "Resultado de la prueba del VIH",
SYPHILIS: "Sífilis resultado",
HEPATITIS_C: "Hepatitis C resultado",
GONORRHEA: "Gonorrea resultado",
},
role: {
STAFF: "Personal",
Expand Down Expand Up @@ -454,6 +456,15 @@ export const es: LanguageConfig = {
"https://www.cdc.gov/hepatitis-c/testing/index.html#cdc_testing_results-testing-results",
},
},
gonorrheaNotes: {
h1: "Para Gonorrea:",
positive: {
p0: "Si obtiene un resultado positivo, deberá hacerse una prueba de seguimiento para confirmarlo. La organización que realizó su prueba debería poder contestar las preguntas que tenga y proporcionarle remisiones para una prueba de seguimiento.",
p1: "<0>Visite el sitio web de los CDC para obtener más información sobre un resultado positivo de gonorrea.</0> (cdc.gov/gonorrhea/es/about/acerca-de-la-gonorrea.html).",
treatmentLink:
"https://www.cdc.gov/gonorrhea/es/about/acerca-de-la-gonorrea.html",
},
},
tos: {
header: "Condiciones del servicio",
title: "Condiciones del servicio",
Expand Down
Loading