diff --git a/.github/workflows/trivy.yml b/.github/workflows/trivy.yml index ef7467b5d2..bd70e3316c 100644 --- a/.github/workflows/trivy.yml +++ b/.github/workflows/trivy.yml @@ -21,7 +21,7 @@ jobs: - name: Run Trivy vulnerability scanner - uses: aquasecurity/trivy-action@0.24.0 + uses: aquasecurity/trivy-action@0.28.0 with: scan-type: 'fs' scan-ref: 'ops/' diff --git a/backend/src/main/java/gov/cdc/usds/simplereport/service/ApiUserService.java b/backend/src/main/java/gov/cdc/usds/simplereport/service/ApiUserService.java index 37c06330a4..0c7edc2059 100644 --- a/backend/src/main/java/gov/cdc/usds/simplereport/service/ApiUserService.java +++ b/backend/src/main/java/gov/cdc/usds/simplereport/service/ApiUserService.java @@ -576,12 +576,21 @@ private ApiUser getCurrentApiUserNoCache() { return nonOktaUser.orElseGet(() -> getCurrentApiUserFromIdentity(userIdentity)); } + /* + `getCurrentUserInfoForWhoAmI()` can be removed and replaced with `getCurrentUserInfo()` as part of #7602 or whenever we stop migrating users over from Okta + */ public UserInfo getCurrentUserInfoForWhoAmI() { ApiUser currentUser = getCurrentApiUser(); + Optional currentOrgRoles = _orgService.getCurrentOrganizationRoles(); boolean isAdmin = _authService.isSiteAdmin(); - if (!_featureFlagsConfig.isOktaMigrationEnabled() && !isAdmin) { - setRolesAndFacilities(currentOrgRoles, currentUser); + if (!isAdmin) { + if (currentOrgRoles.isPresent()) { + PartialOktaUser oktaUser = _oktaRepo.findUser(currentUser.getLoginEmail()); + return consolidateUser(currentUser, oktaUser); + } else { + log.info("No org roles for User ID: {}", currentUser.getInternalId()); + } } return new UserInfo(currentUser, currentOrgRoles, isAdmin); } diff --git a/backend/src/main/java/gov/cdc/usds/simplereport/service/LoggedInAuthorizationService.java b/backend/src/main/java/gov/cdc/usds/simplereport/service/LoggedInAuthorizationService.java index 60a82be40a..90927ac77a 100644 --- a/backend/src/main/java/gov/cdc/usds/simplereport/service/LoggedInAuthorizationService.java +++ b/backend/src/main/java/gov/cdc/usds/simplereport/service/LoggedInAuthorizationService.java @@ -56,15 +56,9 @@ public List findAllOrganizationRoles() { List oktaOrgRoleClaims = _extractor.convert(currentAuth.getAuthorities()); - if (!isSiteAdmin()) { + if (!isSiteAdmin() && _featureFlagsConfig.isOktaMigrationEnabled()) { String username = currentAuth.getName(); - List dbOrgRoleClaims = - _dbOrgRoleClaimsService.getOrganizationRoleClaims(username); - _dbOrgRoleClaimsService.checkOrgRoleClaimsEquality( - oktaOrgRoleClaims, dbOrgRoleClaims, username); - if (_featureFlagsConfig.isOktaMigrationEnabled()) { - return dbOrgRoleClaims; - } + return _dbOrgRoleClaimsService.getOrganizationRoleClaims(username); } return oktaOrgRoleClaims; } diff --git a/backend/src/main/resources/db/changelog/db.changelog-master.yaml b/backend/src/main/resources/db/changelog/db.changelog-master.yaml index 75934c76a3..6bb5784058 100644 --- a/backend/src/main/resources/db/changelog/db.changelog-master.yaml +++ b/backend/src/main/resources/db/changelog/db.changelog-master.yaml @@ -5660,6 +5660,24 @@ databaseChangeLog: rollback: - sql: sql: DELETE FROM ${database.defaultSchemaName}.supported_disease WHERE name = 'Hepatitis-C'; + - changeSet: + id: update-hepatitis-c-naming-in-supported-disease-table + author: ggs2@cdc.gov + comment: Changes Hepatitis-C to Hepatitis C without a dash + changes: + - tagDatabase: + tag: update-hepatitis-c-naming-in-supported-disease-table + - sql: + sql: | + UPDATE ${database.defaultSchemaName}.supported_disease + SET name = 'Hepatitis C' + WHERE name = 'Hepatitis-C' AND loinc = 'LP14400-3' + rollback: + - sql: + sql: | + UPDATE ${database.defaultSchemaName}.supported_disease + SET name = 'Hepatitis-C' + WHERE name = 'Hepatitis C' AND loinc = 'LP14400-3' - changeSet: id: create-facility_providers-table author: bobby@skylight.digital @@ -5714,4 +5732,4 @@ databaseChangeLog: tableName: facility oldColumnName: ordering_provider_id newColumnName: default_ordering_provider_id - remarks: The default healthcare provider for tests ordered at this facility. \ No newline at end of file + remarks: The default healthcare provider for tests ordered at this facility. diff --git a/frontend/src/app/commonComponents/TestResultGuidance/HepatitisCResultGuidance.test.tsx b/frontend/src/app/commonComponents/TestResultGuidance/HepatitisCResultGuidance.test.tsx new file mode 100644 index 0000000000..109c34718c --- /dev/null +++ b/frontend/src/app/commonComponents/TestResultGuidance/HepatitisCResultGuidance.test.tsx @@ -0,0 +1,13 @@ +import { render, screen } from "@testing-library/react"; + +import "../../../i18n"; + +import HepatitisCResultGuidance from "./HepatitisCResultGuidance"; + +describe("HepatitisCResultGuidance", () => { + it("displays guidance for a Hepatitis C result", () => { + const { container } = render(); + expect(screen.getByText("For Hepatitis C:")).toBeInTheDocument(); + expect(container).toMatchSnapshot(); + }); +}); diff --git a/frontend/src/app/commonComponents/TestResultGuidance/HepatitisCResultGuidance.tsx b/frontend/src/app/commonComponents/TestResultGuidance/HepatitisCResultGuidance.tsx new file mode 100644 index 0000000000..bd06b924da --- /dev/null +++ b/frontend/src/app/commonComponents/TestResultGuidance/HepatitisCResultGuidance.tsx @@ -0,0 +1,31 @@ +import React from "react"; +import { Trans, useTranslation } from "react-i18next"; + +const HepatitisCResultGuidance = () => { + const { t } = useTranslation(); + + return ( + <> +

+ {t("testResult.hepatitisCNotes.h1")} +

+

{t("testResult.hepatitisCNotes.positive.p0")}

+ + hepatitis c treatment link + , + ]} + /> + + ); +}; + +export default HepatitisCResultGuidance; diff --git a/frontend/src/app/commonComponents/TestResultGuidance/__snapshots__/HepatitisCResultGuidance.test.tsx.snap b/frontend/src/app/commonComponents/TestResultGuidance/__snapshots__/HepatitisCResultGuidance.test.tsx.snap new file mode 100644 index 0000000000..57f77adbd2 --- /dev/null +++ b/frontend/src/app/commonComponents/TestResultGuidance/__snapshots__/HepatitisCResultGuidance.test.tsx.snap @@ -0,0 +1,24 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`HepatitisCResultGuidance displays guidance for a Hepatitis C result 1`] = ` +
+

+ For Hepatitis C: +

+

+ 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. +

+

+ + Visit the CDC website to learn more about a positive Hepatitis C result + + (cdc.gov/hepatitis-c/testing/index.html#cdc_testing_results-testing-results). +

+
+`; diff --git a/frontend/src/app/commonComponents/TestResultsList.tsx b/frontend/src/app/commonComponents/TestResultsList.tsx index b23c2d19cd..d05f291edb 100644 --- a/frontend/src/app/commonComponents/TestResultsList.tsx +++ b/frontend/src/app/commonComponents/TestResultsList.tsx @@ -8,51 +8,41 @@ interface TestResultsListProps { results: MultiplexResults; isPatientApp: boolean; } + const setDiseaseResultTitle = ( - diseaseName: MultiplexDisease, + diseaseName: MULTIPLEX_DISEASES, t: translateFn, isPxp: boolean ) => { - const translationKey = setDiseaseResultKey(diseaseName, isPxp); + const translationKey = isPxp + ? diseaseResultTitlePxpMap[diseaseName] + : diseaseResultReportingAppMap[diseaseName]; if (translationKey) { return t(translationKey); } return ""; }; -const setDiseaseResultKey = (diseaseName: MultiplexDisease, isPxp: boolean) => { - switch (diseaseName) { - case MULTIPLEX_DISEASES.COVID_19: - return isPxp - ? "constants.diseaseResultTitle.COVID19" - : "constants.disease.COVID19"; - case MULTIPLEX_DISEASES.FLU_A: - return isPxp - ? "constants.diseaseResultTitle.FLUA" - : "constants.disease.FLUA"; - case MULTIPLEX_DISEASES.FLU_B: - return isPxp - ? "constants.diseaseResultTitle.FLUB" - : "constants.disease.FLUB"; - case MULTIPLEX_DISEASES.FLU_A_AND_B: - return isPxp - ? "constants.diseaseResultTitle.FLUAB" - : "constants.disease.FLUAB"; - case MULTIPLEX_DISEASES.HIV: - return isPxp - ? "constants.diseaseResultTitle.HIV" - : "constants.disease.HIV"; - case MULTIPLEX_DISEASES.RSV: - return isPxp - ? "constants.diseaseResultTitle.RSV" - : "constants.disease.RSV"; - case MULTIPLEX_DISEASES.SYPHILIS: - return isPxp - ? "constants.diseaseResultTitle.SYPHILIS" - : "constants.disease.SYPHILIS"; - default: - return null; - } +const diseaseResultTitlePxpMap: Record = { + [MULTIPLEX_DISEASES.COVID_19]: "constants.diseaseResultTitle.COVID19", + [MULTIPLEX_DISEASES.FLU_A]: "constants.diseaseResultTitle.FLUA", + [MULTIPLEX_DISEASES.FLU_B]: "constants.diseaseResultTitle.FLUB", + [MULTIPLEX_DISEASES.FLU_A_AND_B]: "constants.diseaseResultTitle.FLUAB", + [MULTIPLEX_DISEASES.HIV]: "constants.diseaseResultTitle.HIV", + [MULTIPLEX_DISEASES.RSV]: "constants.diseaseResultTitle.RSV", + [MULTIPLEX_DISEASES.SYPHILIS]: "constants.diseaseResultTitle.SYPHILIS", + [MULTIPLEX_DISEASES.HEPATITIS_C]: "constants.diseaseResultTitle.HEPATITIS_C", +}; + +const diseaseResultReportingAppMap: Record = { + [MULTIPLEX_DISEASES.COVID_19]: "constants.disease.COVID19", + [MULTIPLEX_DISEASES.FLU_A]: "constants.disease.FLUA", + [MULTIPLEX_DISEASES.FLU_B]: "constants.disease.FLUB", + [MULTIPLEX_DISEASES.FLU_A_AND_B]: "constants.disease.FLUAB", + [MULTIPLEX_DISEASES.HIV]: "constants.disease.HIV", + [MULTIPLEX_DISEASES.RSV]: "constants.disease.RSV", + [MULTIPLEX_DISEASES.SYPHILIS]: "constants.disease.SYPHILIS", + [MULTIPLEX_DISEASES.HEPATITIS_C]: "constants.disease.HEPATITIS_C", }; const setResult = (result: string, t: translateFn) => { @@ -78,7 +68,7 @@ const setResultSymbol = (result: string, t: translateFn) => { }; const reportingAppResultListItem = ( - diseaseName: MultiplexDisease, + diseaseName: MULTIPLEX_DISEASES, result: TestResult, t: translateFn ) => { @@ -99,7 +89,7 @@ const reportingAppResultListItem = ( }; const pxpAppResultListItem = ( - diseaseName: MultiplexDisease, + diseaseName: MULTIPLEX_DISEASES, result: TestResult, t: translateFn ) => { diff --git a/frontend/src/app/supportAdmin/DeviceType/mocks/mockSupportedDiseaseTestPerformedHepatitisC.ts b/frontend/src/app/supportAdmin/DeviceType/mocks/mockSupportedDiseaseTestPerformedHepatitisC.ts index 13972dc906..cb9dd00edc 100644 --- a/frontend/src/app/supportAdmin/DeviceType/mocks/mockSupportedDiseaseTestPerformedHepatitisC.ts +++ b/frontend/src/app/supportAdmin/DeviceType/mocks/mockSupportedDiseaseTestPerformedHepatitisC.ts @@ -3,7 +3,7 @@ const mockSupportedDiseaseTestPerformedHepatitisC = [ supportedDisease: { internalId: "82748233-1780-4303-b5fe-05c1d3f34ab7", loinc: "LP14400-3", - name: "Hepatitis-C", + name: "Hepatitis C", }, testPerformedLoincCode: "80389-6", equipmentUid: "HepatitisCEquipmentUid123", diff --git a/frontend/src/app/testQueue/TestCard/TestCard.test.tsx b/frontend/src/app/testQueue/TestCard/TestCard.test.tsx index 6472df94d0..92c87bd575 100644 --- a/frontend/src/app/testQueue/TestCard/TestCard.test.tsx +++ b/frontend/src/app/testQueue/TestCard/TestCard.test.tsx @@ -85,18 +85,11 @@ jest.mock("../../TelemetryService", () => ({ getAppInsights: jest.fn(), })); -const mockDiseaseEnabledFlag = ( - diseaseName: string, - skipLowercase: boolean = false -) => +const mockDiseaseEnabledFlag = (diseaseName: string) => jest .spyOn(flaggedMock, "useFeature") .mockImplementation((flagName: string) => { - // to handle casing of Hepatitis-C as hepatitisC - if (skipLowercase) { - return flagName === `${diseaseName}Enabled`; - } - return flagName === `${diseaseName.toLowerCase()}Enabled`; + return flagName === `${diseaseName}Enabled`; }); const mockNavigate = jest.fn(); @@ -1132,7 +1125,7 @@ describe("TestCard", () => { }); it("shows radio buttons for HIV when an HIV device is chosen", async function () { - mockDiseaseEnabledFlag("HIV"); + mockDiseaseEnabledFlag("hiv"); const mocks = [ generateEditQueueMock(MULTIPLEX_DISEASES.HIV, TEST_RESULTS.POSITIVE), @@ -1152,7 +1145,7 @@ describe("TestCard", () => { }); it("shows required HIV AOE questions when a positive HIV result is present", async function () { - mockDiseaseEnabledFlag("HIV"); + mockDiseaseEnabledFlag("hiv"); const mocks = [ generateEditQueueMock(MULTIPLEX_DISEASES.HIV, TEST_RESULTS.POSITIVE), @@ -1182,7 +1175,7 @@ describe("TestCard", () => { }); it("hides AOE questions when there is no positive HIV result", async function () { - mockDiseaseEnabledFlag("HIV"); + mockDiseaseEnabledFlag("hiv"); const mocks = [ generateEditQueueMock(MULTIPLEX_DISEASES.HIV, TEST_RESULTS.UNKNOWN), @@ -1209,7 +1202,7 @@ describe("TestCard", () => { }); it("shows radio buttons for Syphilis when a syphilis device is chosen", async function () { - mockDiseaseEnabledFlag("Syphilis"); + mockDiseaseEnabledFlag("syphilis"); const mocks = [ generateEditQueueMock( @@ -1229,7 +1222,7 @@ describe("TestCard", () => { }); it("shows required syphilis AOE questions when a positive syphilis result is present", async function () { - mockDiseaseEnabledFlag("Syphilis"); + mockDiseaseEnabledFlag("syphilis"); const mocks = [ generateEditQueueMock( @@ -1269,7 +1262,7 @@ describe("TestCard", () => { }); it("hides AOE questions when there is no positive syphilis result", async function () { - mockDiseaseEnabledFlag("Syphilis"); + mockDiseaseEnabledFlag("syphilis"); const mocks = [ generateEditQueueMock( @@ -1325,7 +1318,7 @@ describe("TestCard", () => { }); it("shows radio buttons for Hepatitis C when a hepatitis c device is chosen", async function () { - mockDiseaseEnabledFlag("hepatitisC", true); + mockDiseaseEnabledFlag("hepatitisC"); const mocks = [ generateEditQueueMock( @@ -1336,16 +1329,16 @@ describe("TestCard", () => { ]; const { user } = await renderQueueItem({ mocks }); - expect(screen.queryByText("Hepatitis-C result")).not.toBeInTheDocument(); + expect(screen.queryByText("Hepatitis C result")).not.toBeInTheDocument(); const deviceDropdown = await getDeviceTypeDropdown(); await user.selectOptions(deviceDropdown, device9Name); - expect(screen.getByText("Hepatitis-C result")).toBeInTheDocument(); + expect(screen.getByText("Hepatitis C result")).toBeInTheDocument(); }); - it("shows required Hepatitis-C AOE questions when a positive Hepatitis-C result is present", async function () { - mockDiseaseEnabledFlag("hepatitisC", true); + it("shows required Hepatitis C AOE questions when a positive Hepatitis C result is present", async function () { + mockDiseaseEnabledFlag("hepatitisC"); const mocks = [ generateEditQueueMock( @@ -1368,7 +1361,7 @@ describe("TestCard", () => { ); await user.selectOptions(deviceDropdown, device9Name); - expect(screen.getByText("Hepatitis-C result")).toBeInTheDocument(); + expect(screen.getByText("Hepatitis C result")).toBeInTheDocument(); await user.click( screen.getByLabelText("Positive", { @@ -1396,8 +1389,8 @@ describe("TestCard", () => { ).toBeInTheDocument(); }); - it("hides AOE questions when there is no positive Hepatitis-C result", async function () { - mockDiseaseEnabledFlag("hepatitisC", true); + it("hides AOE questions when there is no positive Hepatitis C result", async function () { + mockDiseaseEnabledFlag("hepatitisC"); const mocks = [ generateEditQueueMock( @@ -1411,7 +1404,7 @@ describe("TestCard", () => { const deviceDropdown = await getDeviceTypeDropdown(); await user.selectOptions(deviceDropdown, device9Name); - expect(screen.getByText("Hepatitis-C result")).toBeInTheDocument(); + expect(screen.getByText("Hepatitis C result")).toBeInTheDocument(); expect( screen.queryByText("Is the patient pregnant?") ).not.toBeInTheDocument(); @@ -1443,7 +1436,7 @@ describe("TestCard", () => { }); it("checks that Hep C submission only works if AOE questions are valid", async function () { - mockDiseaseEnabledFlag("hepatitisC", true); + mockDiseaseEnabledFlag("hepatitisC"); const { user } = await renderQueueItem({ mocks: updateHepCAoeMocks }); const deviceDropdown = await getDeviceTypeDropdown(); @@ -1494,7 +1487,7 @@ describe("TestCard", () => { }); it("checks that submission only works if AOE questions are valid", async function () { - mockDiseaseEnabledFlag("Syphilis"); + mockDiseaseEnabledFlag("syphilis"); const { user } = await renderQueueItem({ mocks: updateSyphilisAoeMocks }); const deviceDropdown = await getDeviceTypeDropdown(); @@ -1556,7 +1549,7 @@ describe("TestCard", () => { }); it("checks that checking has symptom requires onset date and selection", async () => { - mockDiseaseEnabledFlag("Syphilis"); + mockDiseaseEnabledFlag("syphilis"); const mocks = [...updateSyphilisAoeMocks]; const { user } = await renderQueueItem({ mocks }); diff --git a/frontend/src/app/testQueue/TestCardForm/TestCardForm.test.tsx b/frontend/src/app/testQueue/TestCardForm/TestCardForm.test.tsx index 03c52e302e..ec5aa6b5bd 100644 --- a/frontend/src/app/testQueue/TestCardForm/TestCardForm.test.tsx +++ b/frontend/src/app/testQueue/TestCardForm/TestCardForm.test.tsx @@ -192,7 +192,7 @@ describe("TestCardForm", () => { testOrder: { ...testProps.testOrder, results: [ - { testResult: "POSITIVE", disease: { name: "HEPATITIS-C" } }, + { testResult: "POSITIVE", disease: { name: "HEPATITIS C" } }, ], deviceType: { internalId: hepatitisCDeviceId, diff --git a/frontend/src/app/testQueue/TestCardForm/diseaseSpecificComponents/HIVAoEForm.tsx b/frontend/src/app/testQueue/TestCardForm/diseaseSpecificComponents/HIVAoEForm.tsx index 41bcea8209..630022416e 100644 --- a/frontend/src/app/testQueue/TestCardForm/diseaseSpecificComponents/HIVAoEForm.tsx +++ b/frontend/src/app/testQueue/TestCardForm/diseaseSpecificComponents/HIVAoEForm.tsx @@ -6,6 +6,7 @@ import MultiSelect from "../../../commonComponents/MultiSelect/MultiSelect"; import { AoeQuestionResponses } from "../TestCardFormReducer"; import { QueriedTestOrder } from "../types"; import { useTranslatedConstants } from "../../../constants"; +import { AoeQuestionName } from "../TestCardForm.utils"; import { generateAoeListenerHooks, @@ -78,7 +79,14 @@ export const HIVAoEForm = ({ validationStatus={ showGenderOfSexualPartnersError ? "error" : undefined } - hintText={} + hintText={ + + } hintTextClassName={""} errorMessage={ showGenderOfSexualPartnersError && diff --git a/frontend/src/app/testQueue/TestCardForm/diseaseSpecificComponents/HepatitisCAoeForm.tsx b/frontend/src/app/testQueue/TestCardForm/diseaseSpecificComponents/HepatitisCAoeForm.tsx index f81ab15bfa..134b6d11d0 100644 --- a/frontend/src/app/testQueue/TestCardForm/diseaseSpecificComponents/HepatitisCAoeForm.tsx +++ b/frontend/src/app/testQueue/TestCardForm/diseaseSpecificComponents/HepatitisCAoeForm.tsx @@ -8,6 +8,7 @@ import YesNoRadioGroup from "../../../commonComponents/YesNoRadioGroup"; import Checkboxes from "../../../commonComponents/Checkboxes"; import TextInput from "../../../commonComponents/TextInput"; import { formatDate } from "../../../utils/date"; +import { AoeQuestionName } from "../TestCardForm.utils"; import { generateAoeListenerHooks, @@ -15,6 +16,7 @@ import { } from "./aoeUtils"; import { PregnancyAoe } from "./aoeQuestionComponents/PregnancyAoe"; import { GenderOfSexualPartnersAoe } from "./aoeQuestionComponents/GenderOfSexualPartnersAoe"; +import { SensitiveTopicsTooltipModal } from "./SensitiveTopicsTooltipModal"; interface HepatitisCAoeFormProps { testOrder: QueriedTestOrder; @@ -58,6 +60,14 @@ export const HepatitisCAoeForm = ({ hasAttemptedSubmit={hasAttemptedSubmit} onResponseChange={onResponseChange} required + sensitiveTopicsTooltipModal={ + + } /> diff --git a/frontend/src/app/testQueue/TestCardForm/diseaseSpecificComponents/SensitiveTopicsTooltipModal.tsx b/frontend/src/app/testQueue/TestCardForm/diseaseSpecificComponents/SensitiveTopicsTooltipModal.tsx index 98023166f6..4ed6cb50f4 100644 --- a/frontend/src/app/testQueue/TestCardForm/diseaseSpecificComponents/SensitiveTopicsTooltipModal.tsx +++ b/frontend/src/app/testQueue/TestCardForm/diseaseSpecificComponents/SensitiveTopicsTooltipModal.tsx @@ -3,17 +3,18 @@ import { Button } from "@trussworks/react-uswds"; import { TextWithTooltipButton } from "../../../commonComponents/TextWithTooltipButton"; import Modal from "../../../commonComponents/Modal"; +import { AoeQuestionName } from "../TestCardForm.utils"; interface Props { tooltipText?: string; modalTitle?: string; - showSyphilis?: boolean; + aoeQuestionTopics: AoeQuestionName[]; } export const SensitiveTopicsTooltipModal = ({ tooltipText = "Why SimpleReport asks about sensitive topics like this", modalTitle = "Why we ask for gender of sexual partners and other sensitive topics", - showSyphilis = false, + aoeQuestionTopics, }: Props): React.ReactElement => { const [modalIsOpen, setModalIsOpen] = React.useState(false); @@ -32,21 +33,33 @@ export const SensitiveTopicsTooltipModal = ({ {modalTitle} -

- Gender of sexual partners -

-

- This helps public health departments understand which types of sexual - connections are leading to STI spread and understand which populations - to focus their support on. -

-

Patient pregnancy

-

- If a patient is pregnant, this increases the public health - department's prioritization of the patient's care as STIs can pass - onto the child. -

- {showSyphilis && ( + {aoeQuestionTopics.includes( + AoeQuestionName.GENDER_OF_SEXUAL_PARTNERS + ) && ( + <> +

+ Gender of sexual partners +

+

+ This helps public health departments understand which types of + sexual connections are leading to STI spread and understand which + populations to focus their support on. +

+ + )} + {aoeQuestionTopics.includes(AoeQuestionName.PREGNANCY) && ( + <> +

+ Patient pregnancy +

+

+ If a patient is pregnant, this increases the public health + department's prioritization of the patient's care as STIs can pass + onto the child. +

+ + )} + {aoeQuestionTopics.includes(AoeQuestionName.SYPHILIS_HISTORY) && ( <>

Syphilis symptoms diff --git a/frontend/src/app/testQueue/TestCardForm/diseaseSpecificComponents/SyphilisAoEForm.tsx b/frontend/src/app/testQueue/TestCardForm/diseaseSpecificComponents/SyphilisAoEForm.tsx index 90f5ffeff1..75485c2f9d 100644 --- a/frontend/src/app/testQueue/TestCardForm/diseaseSpecificComponents/SyphilisAoEForm.tsx +++ b/frontend/src/app/testQueue/TestCardForm/diseaseSpecificComponents/SyphilisAoEForm.tsx @@ -15,11 +15,12 @@ import YesNoRadioGroup from "../../../commonComponents/YesNoRadioGroup"; import Checkboxes from "../../../commonComponents/Checkboxes"; import TextInput from "../../../commonComponents/TextInput"; import { formatDate } from "../../../utils/date"; +import { AoeQuestionName } from "../TestCardForm.utils"; import { generateAoeListenerHooks, - generateSymptomAoeConstants, generateSexualActivityAoeConstants, + generateSymptomAoeConstants, } from "./aoeUtils"; import { SensitiveTopicsTooltipModal } from "./SensitiveTopicsTooltipModal"; @@ -90,7 +91,15 @@ export const SyphilisAoEForm = ({ } required - hintText={} + hintText={ + + } hintTextClassName={""} validationStatus={ showGenderOfSexualPartnersError ? "error" : undefined diff --git a/frontend/src/app/testQueue/TestCardForm/diseaseSpecificComponents/aoeQuestionComponents/GenderOfSexualPartnersAoe.tsx b/frontend/src/app/testQueue/TestCardForm/diseaseSpecificComponents/aoeQuestionComponents/GenderOfSexualPartnersAoe.tsx index 50e2a26897..b74305b4dc 100644 --- a/frontend/src/app/testQueue/TestCardForm/diseaseSpecificComponents/aoeQuestionComponents/GenderOfSexualPartnersAoe.tsx +++ b/frontend/src/app/testQueue/TestCardForm/diseaseSpecificComponents/aoeQuestionComponents/GenderOfSexualPartnersAoe.tsx @@ -1,6 +1,5 @@ import React from "react"; -import { SensitiveTopicsTooltipModal } from "../SensitiveTopicsTooltipModal"; import MultiSelect from "../../../../commonComponents/MultiSelect/MultiSelect"; import { GENDER_IDENTITY_VALUES } from "../../../../constants"; import { AoeQuestionProps } from "../aoeUtils"; @@ -11,6 +10,7 @@ export const GenderOfSexualPartnersAoe = ({ hasAttemptedSubmit, onResponseChange, required = false, + sensitiveTopicsTooltipModal, }: AoeQuestionProps) => { const onSexualPartnerGenderChange = (selectedItems: string[]) => { onResponseChange({ @@ -43,7 +43,7 @@ export const GenderOfSexualPartnersAoe = ({ } required={required} - hintText={} + hintText={sensitiveTopicsTooltipModal} hintTextClassName={""} validationStatus={showGenderOfSexualPartnersError ? "error" : undefined} errorMessage={ diff --git a/frontend/src/app/testQueue/TestCardForm/diseaseSpecificComponents/aoeUtils.ts b/frontend/src/app/testQueue/TestCardForm/diseaseSpecificComponents/aoeUtils.ts index cfd4833dd0..44ea014de9 100644 --- a/frontend/src/app/testQueue/TestCardForm/diseaseSpecificComponents/aoeUtils.ts +++ b/frontend/src/app/testQueue/TestCardForm/diseaseSpecificComponents/aoeUtils.ts @@ -22,6 +22,7 @@ export interface AoeQuestionProps { onResponseChange: (responses: AoeQuestionResponses) => void; hasAttemptedSubmit: boolean; required?: boolean; + sensitiveTopicsTooltipModal?: React.ReactNode; } export function generateAoeListenerHooks( diff --git a/frontend/src/app/testQueue/testCardTestConstants.ts b/frontend/src/app/testQueue/testCardTestConstants.ts index c3f373520f..f02dc8fc2f 100644 --- a/frontend/src/app/testQueue/testCardTestConstants.ts +++ b/frontend/src/app/testQueue/testCardTestConstants.ts @@ -30,8 +30,8 @@ export const hivDeviceId = "HIV-DEVICE-ID"; export const FACILITY_INFO_TEST_ID = "f02cfff5-1921-4293-beff-e2a5d03e1fda"; export const syphilisDeviceName = "SYPHILIS"; export const syphilisDeviceId = "SYPHILIS-DEVICE-ID"; -export const hepatitisCDeviceName = "HEPATITIS-C"; -export const hepatitisCDeviceId = "HEPATITIS-C-DEVICE-ID"; +export const hepatitisCDeviceName = "HEPATITIS C"; +export const hepatitisCDeviceId = "HEPATITIS C-DEVICE-ID"; // 6 instead of 7 because HIV devices are filtered out when HIV feature flag is disabled export const DEFAULT_DEVICE_OPTIONS_LENGTH = 6; @@ -44,7 +44,7 @@ export const device5Name = "MultiplexAndCovidOnly"; export const device6Name = "FluOnly"; export const device7Name = "HIV device"; export const device8Name = "Syphilis device"; -export const device9Name = "Hepatitis-C device"; +export const device9Name = "Hepatitis C device"; export const device1Id = "DEVICE-1-ID"; export const device2Id = "DEVICE-2-ID"; diff --git a/frontend/src/app/testResults/constants.ts b/frontend/src/app/testResults/constants.ts index 0b46e4e6dd..745b7f672d 100644 --- a/frontend/src/app/testResults/constants.ts +++ b/frontend/src/app/testResults/constants.ts @@ -6,7 +6,7 @@ export enum MULTIPLEX_DISEASES { HIV = "HIV", SYPHILIS = "Syphilis", FLU_A_AND_B = "Flu A and B", - HEPATITIS_C = "Hepatitis-C", + HEPATITIS_C = "Hepatitis C", } export enum TEST_RESULTS { diff --git a/frontend/src/app/testResults/viewResults/actionMenuModals/TestResultDetailsModal.tsx b/frontend/src/app/testResults/viewResults/actionMenuModals/TestResultDetailsModal.tsx index 7207b1840d..1ed4ce6435 100644 --- a/frontend/src/app/testResults/viewResults/actionMenuModals/TestResultDetailsModal.tsx +++ b/frontend/src/app/testResults/viewResults/actionMenuModals/TestResultDetailsModal.tsx @@ -57,6 +57,12 @@ export const DetachedTestResultDetailsModal = ({ data?.testResult.results, MULTIPLEX_DISEASES.SYPHILIS ); + const isHepatitisCResult = !!getResultForDisease( + data?.testResult.results, + MULTIPLEX_DISEASES.HEPATITIS_C + ); + const showGenderOfSexualPartners = + isHIVResult || isSyphilisResult || isHepatitisCResult; const dateTested = data?.testResult.dateTested; @@ -188,7 +194,7 @@ export const DetachedTestResultDetailsModal = ({ removed={removed} aria-describedby="result-detail-title" /> - {(isHIVResult || isSyphilisResult) && ( + {showGenderOfSexualPartners && ( ); } + match = getResultForDisease(results, MULTIPLEX_DISEASES.HEPATITIS_C); + if (match) { + guidance.push(); + } + return guidance; }; diff --git a/frontend/src/lang/en.ts b/frontend/src/lang/en.ts index f7c5b8b2cb..f60c11b561 100644 --- a/frontend/src/lang/en.ts +++ b/frontend/src/lang/en.ts @@ -40,6 +40,7 @@ export const en = { RSV: "RSV", HIV: "HIV", SYPHILIS: "Syphilis", + HEPATITIS_C: "Hepatitis C", }, diseaseResultTitle: { COVID19: "COVID-19 result", @@ -49,6 +50,7 @@ export const en = { RSV: "RSV result", HIV: "HIV result", SYPHILIS: "Syphilis result", + HEPATITIS_C: "Hepatitis C result", }, role: { STAFF: "Staff", @@ -420,6 +422,15 @@ export const en = { "https://www.cdc.gov/std/treatment-guidelines/syphilis.htm", }, }, + hepatitisCNotes: { + h1: "For Hepatitis C:", + 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 Hepatitis C result (cdc.gov/hepatitis-c/testing/index.html#cdc_testing_results-testing-results).", + treatmentLink: + "https://www.cdc.gov/hepatitis-c/testing/index.html#cdc_testing_results-testing-results", + }, + }, tos: { header: "Terms of service", title: "Terms of service", diff --git a/frontend/src/lang/es.ts b/frontend/src/lang/es.ts index a45f3d676b..75328f2c60 100644 --- a/frontend/src/lang/es.ts +++ b/frontend/src/lang/es.ts @@ -43,6 +43,7 @@ export const es: LanguageConfig = { RSV: "VRS", HIV: "VIH", SYPHILIS: "Sífilis", + HEPATITIS_C: "Hepatitis C", }, diseaseResultTitle: { COVID19: "COVID-19 resultado", @@ -52,6 +53,7 @@ export const es: LanguageConfig = { RSV: "RSV resultado", HIV: "Resultado de la prueba del VIH", SYPHILIS: "Sífilis resultado", + HEPATITIS_C: "Hepatitis C resultado", }, role: { STAFF: "Personal", @@ -443,6 +445,15 @@ export const es: LanguageConfig = { "https://www.cdc.gov/std/treatment-guidelines/syphilis.htm", }, }, + hepatitisCNotes: { + h1: "Para Hepatitis C:", + 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 en la prueba del hepatitis C. (cdc.gov/hepatitis-c/testing/index.html#cdc_testing_results-testing-results).", + treatmentLink: + "https://www.cdc.gov/hepatitis-c/testing/index.html#cdc_testing_results-testing-results", + }, + }, tos: { header: "Condiciones del servicio", title: "Condiciones del servicio", diff --git a/ops/services/frontend/main.tf b/ops/services/frontend/main.tf index a012c9514f..0e289f96b8 100644 --- a/ops/services/frontend/main.tf +++ b/ops/services/frontend/main.tf @@ -12,7 +12,7 @@ resource "azurerm_storage_account" "frontend" { name = "simplereport${var.env}frontend" resource_group_name = var.rg_name enable_https_traffic_only = true - min_tls_version = TLS1_2 + min_tls_version = "TLS1_2" custom_domain { name = local.custom_domain