diff --git a/frontend-react/public/sitemap.xml b/frontend-react/public/sitemap.xml index 787863c1d6d..d6160779e0d 100644 --- a/frontend-react/public/sitemap.xml +++ b/frontend-react/public/sitemap.xml @@ -69,4 +69,7 @@ https://reportstream.cdc.gov/file-handler/validate + + https://reportstream.cdc.gov/onboarding/code-mapping + diff --git a/frontend-react/src/AppRouter.tsx b/frontend-react/src/AppRouter.tsx index a5d9392bf02..3ded631f8f0 100644 --- a/frontend-react/src/AppRouter.tsx +++ b/frontend-react/src/AppRouter.tsx @@ -92,6 +92,7 @@ const FacilityProviderSubmitterDetailsPage = lazy( () => import("./components/DataDashboard/FacilityProviderSubmitterDetails/FacilityProviderSubmitterDetails"), ); const NewSettingPage = lazy(() => import("./components/Admin/NewSetting")); +const CodeMappingPage = lazy(() => import("./pages/onboarding/CodeMappingPage")); const MainLayout = lazy(() => import("./layouts/Main/MainLayout")); @@ -494,6 +495,20 @@ export const appRoutes: RouteObject[] = [ ), }, + { + path: "onboarding", + element: ( + + + + ), + children: [ + { + path: "code-mapping", + element: , + }, + ], + }, /* Handles any undefined route */ { path: "*", diff --git a/frontend-react/src/components/CodeMapping/CodeMappingForm.tsx b/frontend-react/src/components/CodeMapping/CodeMappingForm.tsx new file mode 100644 index 00000000000..4abe85e9586 --- /dev/null +++ b/frontend-react/src/components/CodeMapping/CodeMappingForm.tsx @@ -0,0 +1,82 @@ +import { Button, ButtonGroup, FileInput } from "@trussworks/react-uswds"; +import { FormEventHandler, MouseEventHandler, type PropsWithChildren, useCallback } from "react"; +import CodeMappingResults from "./CodeMappingResults"; +import site from "../../content/site.json"; +import useCodeMappingFormSubmit from "../../hooks/api/UseCodeMappingFormSubmit/UseCodeMappingFormSubmit"; +import Spinner from "../Spinner"; +import { USLink } from "../USLink"; + +export type CodeMappingFormProps = PropsWithChildren; + +const CodeMappingForm = (props: CodeMappingFormProps) => { + const { data, isPending, mutate } = useCodeMappingFormSubmit(); + /** + * TODO: Implement submit handler + */ + const onSubmitHandler = useCallback>( + (ev) => { + ev.preventDefault(); + mutate(); + return false; + }, + [mutate], + ); + const onBackHandler = useCallback((_ev) => { + window.history.back(); + }, []); + const onCancelHandler = useCallback((_ev) => { + // Don't have a proper mechanism to cancel in-flight requests so refresh page + window.location.reload(); + }, []); + + return ( + <> +

+ Check that your LOINC and SNOMED codes are mapped to conditions so ReportStream can accurately transform + your data +

+

+ Follow these instructions and use{" "} + our template to format your result and organism codes to + LOINC or SNOMED. Note: Local codes cannot be automatically mapped. +

+ {data && } + {isPending && ( + <> + +

+ Checking your file for any unmapped codes that will
prevent data from being reported + successfully +

+ + + )} + {!data && !isPending && ( +
+ + + Make sure your file has a .csv extension + + + + + + + + )} + {props.children} +

+ Questions or feedback? Please email{" "} + reportstream@cdc.gov +

+ + ); +}; + +export default CodeMappingForm; diff --git a/frontend-react/src/components/CodeMapping/CodeMappingResults.tsx b/frontend-react/src/components/CodeMapping/CodeMappingResults.tsx new file mode 100644 index 00000000000..a61595508bb --- /dev/null +++ b/frontend-react/src/components/CodeMapping/CodeMappingResults.tsx @@ -0,0 +1,10 @@ +import type { PropsWithChildren } from "react"; + +export type CodeMappingResultsProps = PropsWithChildren; + +/** + * TODO: Implement result page + */ +const CodeMappingResults = (props: CodeMappingResultsProps) => <>TODO {props.children}; + +export default CodeMappingResults; diff --git a/frontend-react/src/hooks/api/UseCodeMappingFormSubmit/UseCodeMappingFormSubmit.ts b/frontend-react/src/hooks/api/UseCodeMappingFormSubmit/UseCodeMappingFormSubmit.ts new file mode 100644 index 00000000000..61d78969a82 --- /dev/null +++ b/frontend-react/src/hooks/api/UseCodeMappingFormSubmit/UseCodeMappingFormSubmit.ts @@ -0,0 +1,16 @@ +import { useMutation } from "@tanstack/react-query"; + +/** + * TODO: Implement hook + */ +const useCodeMappingFormSubmit = () => { + const fn = async () => { + // Fake request until implementation + await new Promise((resolve) => setTimeout(resolve, 2500)); + }; + return useMutation({ + mutationFn: fn, + }); +}; + +export default useCodeMappingFormSubmit; diff --git a/frontend-react/src/pages/onboarding/CodeMappingPage.tsx b/frontend-react/src/pages/onboarding/CodeMappingPage.tsx new file mode 100644 index 00000000000..9691a5ccc26 --- /dev/null +++ b/frontend-react/src/pages/onboarding/CodeMappingPage.tsx @@ -0,0 +1,16 @@ +import type { PropsWithChildren } from "react"; +import CodeMappingForm from "../../components/CodeMapping/CodeMappingForm"; + +export type CodeMappingPageProps = PropsWithChildren; + +const CodeMappingPage = (props: CodeMappingPageProps) => { + return ( + <> +

Code mapping tool

+ + {props.children} + + ); +}; + +export default CodeMappingPage;