diff --git a/query-connector/.eslintrc.json b/query-connector/.eslintrc.json index 64d3fa61..0ee79dc8 100644 --- a/query-connector/.eslintrc.json +++ b/query-connector/.eslintrc.json @@ -40,7 +40,6 @@ "publicOnly": true } ] - // "@typescript-eslint/no-explicit-any": "error" }, "overrides": [ { diff --git a/query-connector/e2e/alternate_queries.spec.ts b/query-connector/e2e/alternate_queries.spec.ts index 3601b3fe..fb798a84 100644 --- a/query-connector/e2e/alternate_queries.spec.ts +++ b/query-connector/e2e/alternate_queries.spec.ts @@ -1,7 +1,7 @@ import { test, expect } from "@playwright/test"; import { TEST_URL } from "../playwright-setup"; -import { STEP_TWO_PAGE_TITLE } from "@/app/query/components/patientSearchResults/PatientSearchResultsTable"; -import { STEP_THREE_PAGE_TITLE } from "@/app/query/components/selectQuery/SelectSavedQuery"; +import { PAGE_TITLES } from "@/app/query/stepIndicator/StepIndicator"; + import { TEST_PATIENT, TEST_PATIENT_NAME } from "./constants"; test.describe("alternate queries with the Query Connector", () => { @@ -24,12 +24,13 @@ test.describe("alternate queries with the Query Connector", () => { await page.getByRole("button", { name: "Search for patient" }).click(); await expect(page.getByText("Loading")).toHaveCount(0, { timeout: 10000 }); await expect( - page.getByRole("heading", { name: STEP_TWO_PAGE_TITLE }), + page.getByRole("heading", { name: PAGE_TITLES["patient-results"] }), ).toBeVisible(); await page.getByRole("link", { name: "Select patient" }).click(); await expect( - page.getByRole("heading", { name: STEP_THREE_PAGE_TITLE }), + page.getByRole("heading", { name: PAGE_TITLES["select-query"] }), ).toBeVisible(); + await page.getByTestId("Select").selectOption("chlamydia"); await page.getByRole("button", { name: "Submit" }).click(); await expect(page.getByText("Loading")).toHaveCount(0, { timeout: 10000 }); diff --git a/query-connector/e2e/query_workflow.spec.ts b/query-connector/e2e/query_workflow.spec.ts index e7dc4321..777cee6a 100644 --- a/query-connector/e2e/query_workflow.spec.ts +++ b/query-connector/e2e/query_workflow.spec.ts @@ -2,7 +2,7 @@ import { test, expect } from "@playwright/test"; import { TEST_URL } from "../playwright-setup"; -import { STEP_ONE_PAGE_TITLE } from "@/app/query/components/searchForm/SearchForm"; +import { PAGE_TITLES } from "@/app/query/stepIndicator/StepIndicator"; import { CONTACT_US_DISCLAIMER_EMAIL, CONTACT_US_DISCLAIMER_TEXT, @@ -44,7 +44,7 @@ test.describe("querying with the Query Connector", () => { "This site is for demo purposes only. Please do not enter PII on this website.", ); await expect( - page.getByRole("heading", { name: STEP_ONE_PAGE_TITLE, exact: true }), + page.getByRole("heading", { name: PAGE_TITLES["search"], exact: true }), ).toBeVisible(); await page.getByRole("button", { name: "Fill fields" }).click(); @@ -115,7 +115,7 @@ test.describe("querying with the Query Connector", () => { // Now let's use the return to search to go back to a blank form await page.getByRole("button", { name: "New patient search" }).click(); await expect( - page.getByRole("heading", { name: STEP_ONE_PAGE_TITLE, exact: true }), + page.getByRole("heading", { name: PAGE_TITLES["search"], exact: true }), ).toBeVisible(); }); }); diff --git a/query-connector/src/app/query/components/CustomizeQuery.tsx b/query-connector/src/app/query/components/CustomizeQuery.tsx index ff26755b..c1dc1950 100644 --- a/query-connector/src/app/query/components/CustomizeQuery.tsx +++ b/query-connector/src/app/query/components/CustomizeQuery.tsx @@ -18,6 +18,7 @@ import Accordion from "../designSystem/Accordion"; import CustomizeQueryNav from "./customizeQuery/CustomizeQueryNav"; import { mapValueSetItemsToValueSetTypes } from "./customizeQuery/customizeQueryUtils"; import Backlink from "./backLink/Backlink"; +import { RETURN_LABEL } from "../stepIndicator/StepIndicator"; interface CustomizeQueryProps { useCaseQueryResponse: UseCaseQueryResponse; @@ -159,7 +160,7 @@ const CustomizeQuery: React.FC = ({ return (
- +

@@ -218,7 +219,6 @@ const CustomizeQuery: React.FC = ({ }; export default CustomizeQuery; - export const QUERY_CUSTOMIZATION_CONFIRMATION_HEADER = "Query Customization Successful!"; export const QUERY_CUSTOMIZATION_CONFIRMATION_BODY = diff --git a/query-connector/src/app/query/components/DisclaimerAlerts.tsx b/query-connector/src/app/query/components/DisclaimerAlerts.tsx new file mode 100644 index 00000000..43968e9a --- /dev/null +++ b/query-connector/src/app/query/components/DisclaimerAlerts.tsx @@ -0,0 +1,31 @@ +import { Alert } from "@trussworks/react-uswds"; +import { ReactNode } from "react"; + +const PII_DISCLAIMER_BANNER = ( + + This site is for demo purposes only. Please do not enter PII on this + website. + +); +const CONTACT_US_BANNER = ( + + Interested in learning more about using the TEFCA Query Connector for your + jurisdiction? Send us an email at{" "} + + dibbs@cdc.gov + + +); + +export const alertBannerMap: { [mode: string]: ReactNode } = { + search: PII_DISCLAIMER_BANNER, + customize_query: PII_DISCLAIMER_BANNER, + results: CONTACT_US_BANNER, +}; diff --git a/query-connector/src/app/query/components/PatientSearchResults.tsx b/query-connector/src/app/query/components/PatientSearchResults.tsx index 5d01f6e7..5ac19f40 100644 --- a/query-connector/src/app/query/components/PatientSearchResults.tsx +++ b/query-connector/src/app/query/components/PatientSearchResults.tsx @@ -5,6 +5,7 @@ import { Mode } from "@/app/constants"; import Backlink from "./backLink/Backlink"; import PatientSearchResultsTable from "./patientSearchResults/PatientSearchResultsTable"; import NoPatientsFound from "./patientSearchResults/NoPatientsFound"; +import { RETURN_LABEL } from "@/app/query/stepIndicator/StepIndicator"; /** * The props for the PatientSearchResults component. @@ -57,7 +58,7 @@ const PatientSearchResults: React.FC = ({ )} {patients.length > 0 && ( <> - + = ({ }; export default PatientSearchResults; -export const RETURN_TO_STEP_ONE_LABEL = "Return to Enter patient info"; diff --git a/query-connector/src/app/query/components/ResultsView.tsx b/query-connector/src/app/query/components/ResultsView.tsx index 0ddd5741..d0a8b15c 100644 --- a/query-connector/src/app/query/components/ResultsView.tsx +++ b/query-connector/src/app/query/components/ResultsView.tsx @@ -13,6 +13,10 @@ import MedicationRequestTable from "./resultsView/tableComponents/MedicationRequ import ObservationTable from "./resultsView/tableComponents/ObservationTable"; import Backlink from "./backLink/Backlink"; import { USE_CASES, demoQueryValToLabelMap } from "@/app/constants"; +import { + PAGE_TITLES, + RETURN_LABEL, +} from "@/app/query/stepIndicator/StepIndicator"; type ResultsViewProps = { useCaseQueryResponse: UseCaseQueryResponse; @@ -61,10 +65,7 @@ const ResultsView: React.FC = ({ <>
- goBack()} - label={"Return to query selection"} - /> + goBack()} label={RETURN_LABEL["results"]} />

- Patient Record + {PAGE_TITLES["results"]}

Query:{" "} diff --git a/query-connector/src/app/query/components/SelectQuery.tsx b/query-connector/src/app/query/components/SelectQuery.tsx index 8617ef3e..34e5e858 100644 --- a/query-connector/src/app/query/components/SelectQuery.tsx +++ b/query-connector/src/app/query/components/SelectQuery.tsx @@ -120,4 +120,3 @@ const SelectQuery: React.FC = ({ }; export default SelectQuery; -export const RETURN_TO_STEP_ONE_LABEL = "Return to Select patient"; diff --git a/query-connector/src/app/query/components/patientSearchResults/PatientSearchResultsTable.tsx b/query-connector/src/app/query/components/patientSearchResults/PatientSearchResultsTable.tsx index 59bdf38b..96b505d5 100644 --- a/query-connector/src/app/query/components/patientSearchResults/PatientSearchResultsTable.tsx +++ b/query-connector/src/app/query/components/patientSearchResults/PatientSearchResultsTable.tsx @@ -6,6 +6,7 @@ import { formatMRN, formatName, } from "@/app/format-service"; +import { PAGE_TITLES } from "@/app/query/stepIndicator/StepIndicator"; type PatientSeacrchResultsTableProps = { patients: Patient[]; @@ -28,7 +29,7 @@ const PatientSearchResultsTable: React.FC = ({ return ( <>

- {STEP_TWO_PAGE_TITLE} + {PAGE_TITLES["patient-results"]}

The following records match your search. Select a patient to continue. @@ -74,4 +75,3 @@ const PatientSearchResultsTable: React.FC = ({ }; export default PatientSearchResultsTable; -export const STEP_TWO_PAGE_TITLE = "Step 2: Select a patient"; diff --git a/query-connector/src/app/query/components/searchForm/SearchForm.tsx b/query-connector/src/app/query/components/searchForm/SearchForm.tsx index cc12ab40..a3521c0e 100644 --- a/query-connector/src/app/query/components/searchForm/SearchForm.tsx +++ b/query-connector/src/app/query/components/searchForm/SearchForm.tsx @@ -12,12 +12,12 @@ import { demoData, stateOptions, Mode, -} from "../../../constants"; -import { UseCaseQueryResponse, UseCaseQuery } from "../../../query-service"; -import { fhirServers } from "../../../fhir-servers"; +} from "@/app/constants"; +import { UseCaseQueryResponse, UseCaseQuery } from "@/app/query-service"; +import { fhirServers } from "@/app/fhir-servers"; import styles from "./searchForm.module.css"; - import { FormatPhoneAsDigits } from "@/app/format-service"; +import { PAGE_TITLES } from "@/app/query/stepIndicator/StepIndicator"; interface SearchFormProps { useCase: USE_CASES; @@ -55,7 +55,6 @@ const SearchForm: React.FC = ({ //Set the patient options based on the demoOption const [firstName, setFirstName] = useState(""); const [lastName, setLastName] = useState(""); - const [phone, setPhone] = useState(""); const [dob, setDOB] = useState(""); const [mrn, setMRN] = useState(""); @@ -74,7 +73,6 @@ const SearchForm: React.FC = ({ setMRN(data.MRN); setPhone(data.Phone); setFhirServer(data.FhirServer as FHIR_SERVERS); - setUseCase(data.UseCase as USE_CASES); setAutofilled(highlightAutofilled); } }, @@ -83,8 +81,8 @@ const SearchForm: React.FC = ({ async function HandleSubmit(event: React.FormEvent) { event.preventDefault(); - if (!useCase || !fhirServer) { - console.error("Use case and FHIR server are required."); + if (!fhirServer) { + console.error("FHIR server is required."); return; } setLoading(true); @@ -112,7 +110,7 @@ const SearchForm: React.FC = ({ <>

- {STEP_ONE_PAGE_TITLE} + {PAGE_TITLES["search"]}

Enter patient information below to search for a patient. We will query diff --git a/query-connector/src/app/query/components/selectQuery/SelectSavedQuery.tsx b/query-connector/src/app/query/components/selectQuery/SelectSavedQuery.tsx index b92624b1..9daa4cff 100644 --- a/query-connector/src/app/query/components/selectQuery/SelectSavedQuery.tsx +++ b/query-connector/src/app/query/components/selectQuery/SelectSavedQuery.tsx @@ -8,6 +8,10 @@ import { Select, Button } from "@trussworks/react-uswds"; import Backlink from "../backLink/Backlink"; import styles from "./selectQuery.module.css"; import { useState } from "react"; +import { + PAGE_TITLES, + RETURN_LABEL, +} from "@/app/query/stepIndicator/StepIndicator"; type SelectSavedQueryProps = { selectedQuery: string; @@ -51,9 +55,9 @@ const SelectSavedQuery: React.FC = ({ return ( {/* Back button */} - +

- {STEP_THREE_PAGE_TITLE} + {PAGE_TITLES["select-query"]}

= ({ className={`${styles.queryDropDown}`} required > + {demoQueryOptions.map((option) => (