Skip to content

Commit

Permalink
Chlamydia Results Page (#8399)
Browse files Browse the repository at this point in the history
* Add test card support for chlamydia

* Move chlamydia consts

* update lang files

* add Chlamydia Result Guidance

* show gender of sexual partners for chlamydia result

* add test

* fix typo

* Update spanish copy

* add snapshot

* push guidance for chlamydia is positive

---------

Co-authored-by: Mike Brown <[email protected]>
  • Loading branch information
bobbywells52 and mpbrown authored Jan 17, 2025
1 parent 5dd51ba commit 74caf63
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { render, screen } from "@testing-library/react";

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

import ChlamydiaResultGuidance from "./ChlamydiaResultGuidance";

describe("ChlamydiaResultGuidance", () => {
it("displays guidance for a Chlamydia result", () => {
const { container } = render(<ChlamydiaResultGuidance />);
expect(screen.getByText("For Chlamydia:")).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 ChlamydiaResultGuidance = () => {
const { t } = useTranslation();

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

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

exports[`ChlamydiaResultGuidance displays guidance for a Chlamydia result 1`] = `
<div>
<p
class="text-bold sr-guidance-heading"
>
For Chlamydia:
</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/chlamydia/about/index.html"
rel="noopener noreferrer"
target="_blank"
>
Visit the CDC website to learn more about a positive Chlamydia result.
</a>
(cdc.gov/chlamydia/about).
</p>
</div>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,16 @@ export const DetachedTestResultDetailsModal = ({
data?.testResult.results,
MULTIPLEX_DISEASES.GONORRHEA
);
const isChlamydiaResult = !!getResultForDisease(
data?.testResult.results,
MULTIPLEX_DISEASES.CHLAMYDIA
);
const showGenderOfSexualPartners =
isHIVResult || isSyphilisResult || isHepatitisCResult || isGonorrheaResult;
isHIVResult ||
isSyphilisResult ||
isHepatitisCResult ||
isGonorrheaResult ||
isChlamydiaResult;

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 @@ -7,6 +7,7 @@ import RsvResultGuidance from "../commonComponents/TestResultGuidance/RsvResultG
import SyphilisResultGuidance from "../commonComponents/TestResultGuidance/SyphilisResultGuidance";
import HepatitisCResultGuidance from "../commonComponents/TestResultGuidance/HepatitisCResultGuidance";
import GonorrheaResultGuidance from "../commonComponents/TestResultGuidance/GonorrheaResultGuidance";
import ChlamydiaResultGuidance from "../commonComponents/TestResultGuidance/ChlamydiaResultGuidance";

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

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

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 @@ -42,6 +42,7 @@ export const en = {
SYPHILIS: "Syphilis",
HEPATITIS_C: "Hepatitis C",
GONORRHEA: "Gonorrhea",
CHLAMYDIA: "Chlamydia",
},
diseaseResultTitle: {
COVID19: "COVID-19 result",
Expand All @@ -53,6 +54,7 @@ export const en = {
SYPHILIS: "Syphilis result",
HEPATITIS_C: "Hepatitis C result",
GONORRHEA: "Gonorrhea result",
CHLAMYDIA: "Chlamydia result",
},
role: {
STAFF: "Staff",
Expand Down Expand Up @@ -441,6 +443,14 @@ export const en = {
treatmentLink: "https://www.cdc.gov/gonorrhea/about/index.html",
},
},
chlamydiaNotes: {
h1: "For Chlamydia:",
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 Chlamydia result.</0> (cdc.gov/chlamydia/about).",
treatmentLink: "https://www.cdc.gov/chlamydia/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 @@ -45,6 +45,7 @@ export const es: LanguageConfig = {
SYPHILIS: "Sífilis",
HEPATITIS_C: "Hepatitis C",
GONORRHEA: "Gonorrea",
CHLAMYDIA: "Clamdia",
},
diseaseResultTitle: {
COVID19: "COVID-19 resultado",
Expand All @@ -56,6 +57,7 @@ export const es: LanguageConfig = {
SYPHILIS: "Sífilis resultado",
HEPATITIS_C: "Hepatitis C resultado",
GONORRHEA: "Gonorrea resultado",
CHLAMYDIA: "Clamdia resultado",
},
role: {
STAFF: "Personal",
Expand Down Expand Up @@ -465,6 +467,15 @@ export const es: LanguageConfig = {
"https://www.cdc.gov/gonorrhea/es/about/acerca-de-la-gonorrea.html",
},
},
chlamydiaNotes: {
h1: "Para Clamidia:",
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 clamidia.</0> (cdc.gov/chlamydia/es/about/acerca-de-las-infecciones-por-clamidia.html).",
treatmentLink:
"https://www.cdc.gov/chlamydia/es/about/acerca-de-las-infecciones-por-clamidia.html",
},
},
tos: {
header: "Condiciones del servicio",
title: "Condiciones del servicio",
Expand Down

0 comments on commit 74caf63

Please sign in to comment.