From d7285c2f0e804982b6edfc62d834af1d0a7d921f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karla=20Valc=C3=A1rcel=20Mart=C3=ADnez?= <99458559+karla-vm@users.noreply.github.com> Date: Wed, 18 Dec 2024 10:32:55 -0500 Subject: [PATCH] CMDCT-4113: NAAAR "Analysis Methods" Page (#11958) --- services/app-api/forms/naaar.json | 44 +++++++- services/app-api/utils/constants/constants.ts | 13 +++ services/ui-src/src/assets/icons/icon_add.png | Bin 0 -> 260 bytes .../cards/EntityCard/EntityCard.test.tsx | 22 ++-- .../cards/EntityCard/EntityCard.tsx | 8 +- .../components/modals/AddEditReportModal.tsx | 4 +- .../reports/ModalDrawerReportPage.test.tsx | 14 +++ .../reports/ModalDrawerReportPage.tsx | 89 ++++++++++++++- .../reports/ModalOverlayReportPage.tsx | 4 +- .../src/components/tables/EntityRow.test.tsx | 9 +- .../src/components/tables/EntityRow.tsx | 102 +++++++++++------- .../src/components/tables/MobileEntityRow.tsx | 23 ++-- services/ui-src/src/constants.ts | 39 +++++++ services/ui-src/src/types/reports.ts | 1 + services/ui-src/src/utils/other/rendering.ts | 2 +- 15 files changed, 298 insertions(+), 76 deletions(-) create mode 100644 services/ui-src/src/assets/icons/icon_add.png diff --git a/services/app-api/forms/naaar.json b/services/app-api/forms/naaar.json index 91d6fee0c..e686e6fbe 100644 --- a/services/app-api/forms/naaar.json +++ b/services/app-api/forms/naaar.json @@ -4,7 +4,8 @@ "basePath": "/naaar", "version": "NAAAR_2024-08-06", "entities": { - "plans": { "required": true } + "plans": { "required": true }, + "analysisMethods": { "required": true } }, "routes": [ { @@ -262,6 +263,47 @@ } ] } + }, + { + "name": "Analysis methods", + "path": "/naaar/state-and-program-information/analysis-methods", + "pageType": "modalDrawer", + "entityType": "analysisMethods", + "verbiage": { + "intro": { + "section": "I. State and program information", + "subsection": "Analysis methods", + "info": [ + { + "type": "p", + "content": "States should use this section of the tab to report on the analyses that the state uses to assess plan compliance with the state's 42 C.F.R. § 438.68 and 42 C.F.R. § 438.206 standards." + } + ] + }, + "dashboardTitle": "", + "addEntityButtonText": "Add other analysis method", + "editEntityButtonText": "", + "readOnlyEntityButtonText": "", + "tableHeader": "Analysis method
Frequency and plan utilization", + "addEditModalAddTitle": "Analysis method: Add other", + "addEditModalEditTitle": "Analysis method: Edit other", + "deleteEntityButtonAltText": "Delete other analysis method", + "deleteModalTitle": "Are you sure you want to delete this analysis method?", + "deleteModalConfirmButtonText": "Yes, delete method", + "deleteModalWarning": "Are you sure you want to proceed? You will lose all information entered for this analysis method in the NAAAR. The method will remain in previously submitted NAAAR reports if applicable.", + "entityUnfinishedMessage": "Complete the remaining indicators for this access measure by entering details.", + "enterEntityDetailsButtonText": "Enter", + "readOnlyEntityDetailsButtonText": "View", + "drawerTitle": "Analysis method: ", + "drawerInfo": [ + { + "type": "p", + "content": "Complete all fields and select the “Save & close” button to save this section." + } + ] + }, + "modalForm": { "id": "", "fields": [] }, + "drawerForm": { "id": "", "fields": [] } } ] }, diff --git a/services/app-api/utils/constants/constants.ts b/services/app-api/utils/constants/constants.ts index 2f9ec7661..b6140fe0c 100644 --- a/services/app-api/utils/constants/constants.ts +++ b/services/app-api/utils/constants/constants.ts @@ -57,6 +57,8 @@ export const bucketTopics = { export const formTemplateTableName = process.env.FORM_TEMPLATE_TABLE_NAME!; +// COPY-OVER + export const McparFieldsToCopy = { root: [ "state_encounterDataValidationEntity", @@ -156,3 +158,14 @@ export const McparFieldsToCopy = { ], // sanctions are never copied from year to year. }; + +// ANALYSIS METHODS (NAAAR) +export const DEFAULT_ANALYSIS_METHODS = [ + "Geomapping", + "Plan Provider Directory Review", + "Secret Shopper: Network Participation", + "Secret Shopper: Appointment Availability", + "EVV Data Analysis", + "Review of Grievances Related to Access", + "Encounter Data Analysis", +]; diff --git a/services/ui-src/src/assets/icons/icon_add.png b/services/ui-src/src/assets/icons/icon_add.png new file mode 100644 index 0000000000000000000000000000000000000000..bf97c66cb059ed1ccd1e4c2ce82d2eca79b76394 GIT binary patch literal 260 zcmeAS@N?(olHy`uVBq!ia0vp^3P7yL!3HFEsI3eHQk(@Ik;M!QVyYm_=ozH)0Vv2= z9OUlAuG4LbEGcSnWuag&ZEPBv- ); @@ -66,7 +66,7 @@ const UnfinishedAccessMeasuresEntityCardPrintComponent = ( verbiage={mockModalDrawerReportPageJson.verbiage} openAddEditEntityModal={openAddEditEntityModal} openDeleteEntityModal={openDeleteEntityModal} - openDrawer={mockOpenDrawer} + openOverlayOrDrawer={mockOpenDrawer} printVersion={true} /> ); @@ -80,7 +80,7 @@ const AccessMeasuresEntityCardComponent = ( verbiage={mockModalDrawerReportPageJson.verbiage} openAddEditEntityModal={openAddEditEntityModal} openDeleteEntityModal={openDeleteEntityModal} - openDrawer={mockOpenDrawer} + openOverlayOrDrawer={mockOpenDrawer} printVersion={false} /> ); @@ -94,7 +94,7 @@ const AccessMeasuresEntityCardPrintComponent = ( verbiage={mockModalDrawerReportPageJson.verbiage} openAddEditEntityModal={openAddEditEntityModal} openDeleteEntityModal={openDeleteEntityModal} - openDrawer={mockOpenDrawer} + openOverlayOrDrawer={mockOpenDrawer} printVersion={true} /> ); @@ -269,7 +269,7 @@ const UnstartedQualityMeasuresEntityCardComponent = ( verbiage={mockModalDrawerReportPageJson.verbiage} openAddEditEntityModal={openAddEditEntityModal} openDeleteEntityModal={openDeleteEntityModal} - openDrawer={mockOpenDrawer} + openOverlayOrDrawer={mockOpenDrawer} /> ); @@ -284,7 +284,7 @@ const QualityMeasuresEntityCardComponentMissingReportingPeriodAndDetails = ( verbiage={mockModalDrawerReportPageJson.verbiage} openAddEditEntityModal={openAddEditEntityModal} openDeleteEntityModal={openDeleteEntityModal} - openDrawer={mockOpenDrawer} + openOverlayOrDrawer={mockOpenDrawer} /> ); @@ -299,7 +299,7 @@ const QualityMeasuresEntityCardComponentMissingReportingPeriod = ( verbiage={mockModalDrawerReportPageJson.verbiage} openAddEditEntityModal={openAddEditEntityModal} openDeleteEntityModal={openDeleteEntityModal} - openDrawer={mockOpenDrawer} + openOverlayOrDrawer={mockOpenDrawer} /> ); @@ -312,7 +312,7 @@ const QualityMeasuresEntityCardComponentMissingDetails = ( verbiage={mockModalDrawerReportPageJson.verbiage} openAddEditEntityModal={openAddEditEntityModal} openDeleteEntityModal={openDeleteEntityModal} - openDrawer={mockOpenDrawer} + openOverlayOrDrawer={mockOpenDrawer} /> ); @@ -325,7 +325,7 @@ const CompletedQualityMeasuresEntityCardComponent = ( verbiage={mockModalDrawerReportPageJson.verbiage} openAddEditEntityModal={openAddEditEntityModal} openDeleteEntityModal={openDeleteEntityModal} - openDrawer={mockOpenDrawer} + openOverlayOrDrawer={mockOpenDrawer} /> ); @@ -557,7 +557,7 @@ const UnfinishedSanctionsEntityCardComponent = ( verbiage={mockModalDrawerReportPageJson.verbiage} openAddEditEntityModal={openAddEditEntityModal} openDeleteEntityModal={openDeleteEntityModal} - openDrawer={mockOpenDrawer} + openOverlayOrDrawer={mockOpenDrawer} /> ); @@ -570,7 +570,7 @@ const SanctionsEntityCardComponent = ( verbiage={mockModalDrawerReportPageJson.verbiage} openAddEditEntityModal={openAddEditEntityModal} openDeleteEntityModal={openDeleteEntityModal} - openDrawer={mockOpenDrawer} + openOverlayOrDrawer={mockOpenDrawer} /> ); diff --git a/services/ui-src/src/components/cards/EntityCard/EntityCard.tsx b/services/ui-src/src/components/cards/EntityCard/EntityCard.tsx index 770054040..db5456241 100644 --- a/services/ui-src/src/components/cards/EntityCard/EntityCard.tsx +++ b/services/ui-src/src/components/cards/EntityCard/EntityCard.tsx @@ -24,7 +24,7 @@ export const EntityCard = ({ verbiage, openAddEditEntityModal, openDeleteEntityModal, - openDrawer, + openOverlayOrDrawer, printVersion, ...props }: Props) => { @@ -170,12 +170,12 @@ export const EntityCard = ({ {verbiage.entityUnfinishedMessage} )} - {openDrawer && ( + {openOverlayOrDrawer && ( @@ -278,7 +296,49 @@ interface Props { validateOnRender?: boolean; } +const entityTable = ( + entities: AnyObject, + openAddEditEntityModal: Function, + openDeleteEntityModal: Function, + openOverlayOrDrawer: Function, + verbiage: ModalDrawerReportPageVerbiage +) => { + const { isTablet, isMobile } = useBreakpoint(); + const tableHeaders = () => { + if (isTablet || isMobile) return { headRow: ["", ""] }; + return { headRow: ["", verbiage.tableHeader!, ""] }; + }; + return ( + + {entities.map((entity: EntityShape) => + isMobile || isTablet ? ( + + ) : ( + + ) + )} +
+ ); +}; + const sx = { + buttonIcons: { + height: "1rem", + }, dashboardTitle: { marginBottom: "1.25rem", fontSize: "md", @@ -307,4 +367,25 @@ const sx = { paddingLeft: "1rem", }, }, + table: { + tableLayout: "fixed", + br: { + marginBottom: "0.25rem", + }, + th: { + paddingLeft: "1rem", + paddingRight: "0", + borderBottom: "1px solid", + borderColor: "palette.gray_light", + ".tablet &, .mobile &": { + border: "none", + }, + "&:nth-of-type(1)": { + width: "2.5rem", + }, + "&:nth-of-type(3)": { + width: "260px", + }, + }, + }, }; diff --git a/services/ui-src/src/components/reports/ModalOverlayReportPage.tsx b/services/ui-src/src/components/reports/ModalOverlayReportPage.tsx index a63b78504..200014338 100644 --- a/services/ui-src/src/components/reports/ModalOverlayReportPage.tsx +++ b/services/ui-src/src/components/reports/ModalOverlayReportPage.tsx @@ -218,7 +218,7 @@ export const ModalOverlayReportPage = ({ entering={entering} openAddEditEntityModal={openAddEditEntityModal} openDeleteEntityModal={openDeleteEntityModal} - openEntityDetailsOverlay={openEntityDetailsOverlay} + openOverlayOrDrawer={openEntityDetailsOverlay} /> ) : ( ) )} diff --git a/services/ui-src/src/components/tables/EntityRow.test.tsx b/services/ui-src/src/components/tables/EntityRow.test.tsx index 0a98294d5..83291bfee 100644 --- a/services/ui-src/src/components/tables/EntityRow.test.tsx +++ b/services/ui-src/src/components/tables/EntityRow.test.tsx @@ -7,6 +7,7 @@ import { Table } from "./Table"; // utils import { mockMlrReportContext, + mockMlrReportStore, mockStateUserStore, mockVerbiageIntro, RouterWrappedComponent, @@ -35,7 +36,7 @@ const incompleteRowComponent = ( entering={mockEntering} openAddEditEntityModal={openAddEditEntityModal} openDeleteEntityModal={openDeleteEntityModal} - openEntityDetailsOverlay={mockOpenDrawer} + openOverlayOrDrawer={mockOpenDrawer} > @@ -52,7 +53,7 @@ const completeRowComponent = ( entering={mockEntering} openAddEditEntityModal={openAddEditEntityModal} openDeleteEntityModal={openDeleteEntityModal} - openEntityDetailsOverlay={mockOpenDrawer} + openOverlayOrDrawer={mockOpenDrawer} > @@ -89,6 +90,10 @@ describe("Test EntityRow", () => { }); test("Clicking Enter Details button opens the Drawer", async () => { + mockedUseStore.mockReturnValue({ + ...mockStateUserStore, + ...mockMlrReportStore, + }); await act(async () => { await render(completeRowComponent); }); diff --git a/services/ui-src/src/components/tables/EntityRow.tsx b/services/ui-src/src/components/tables/EntityRow.tsx index fbdaaf4ed..bb0efbfc6 100644 --- a/services/ui-src/src/components/tables/EntityRow.tsx +++ b/services/ui-src/src/components/tables/EntityRow.tsx @@ -3,7 +3,7 @@ import { useMemo } from "react"; import { Button, Flex, Image, Spinner, Td, Text, Tr } from "@chakra-ui/react"; import { EntityStatusIcon } from "components"; // types -import { AnyObject, EntityShape } from "types"; +import { AnyObject, EntityShape, ReportType } from "types"; // utils import { eligibilityGroup, getMlrEntityStatus, useStore } from "utils"; // assets @@ -16,66 +16,90 @@ export const EntityRow = ({ entering, openAddEditEntityModal, openDeleteEntityModal, - openEntityDetailsOverlay, + openOverlayOrDrawer, }: Props) => { - const { report_programName, report_planName } = entity; + const { report_programName, report_planName, name } = entity; const { report } = useStore(); const { userIsEndUser } = useStore().user ?? {}; const reportingPeriod = `${entity.report_reportingPeriodStartDate} to ${entity.report_reportingPeriodEndDate}`; + // TODO: refactor to handle NAAAR analysis methods const entityComplete = useMemo(() => { return report ? getMlrEntityStatus(report, entity) : false; }, [report]); - const programInfo = [ - report_planName, - report_programName, - eligibilityGroup(entity), - reportingPeriod, - ]; + const enterDetailsText = () => { + const enterText = + report?.reportType === ReportType.MLR + ? verbiage.enterReportText + : verbiage.enterEntityDetailsButtonText; + return enterText; + }; + + const entityFields = () => { + const fields: any[] = + report?.reportType === ReportType.MLR + ? [ + report_planName, + report_programName, + eligibilityGroup(entity), + reportingPeriod, + ] + : [name]; + return fields; + }; return ( - +
    - {programInfo.map((field, index) => ( + {entityFields().map((field, index) => (
  • {field}
  • ))}
- {!entityComplete && report?.reportType === "MLR" && ( + {!entityComplete && report && ( - Select “Enter MLR” to complete this report. + {report.reportType === ReportType.MLR && + "Select “Enter MLR” to complete this report."} + {report.reportType === ReportType.NAAAR && + "Select “Enter” to complete response."} )} - - - + {!entity.isRequired && ( + + )} + {openOverlayOrDrawer && ( + + )} + {!entity.isRequired && ( + + )} @@ -86,10 +110,10 @@ interface Props { entity: EntityShape; verbiage: AnyObject; locked?: boolean; - entering: boolean; + entering?: boolean; openAddEditEntityModal: Function; openDeleteEntityModal: Function; - openEntityDetailsOverlay: Function; + openOverlayOrDrawer?: Function; [key: string]: any; } @@ -110,7 +134,7 @@ const sx = { fontSize: "0.75rem", marginBottom: "0.75rem", }, - programInfo: { + entityFields: { maxWidth: "18.75rem", ul: { margin: "0.5rem auto", diff --git a/services/ui-src/src/components/tables/MobileEntityRow.tsx b/services/ui-src/src/components/tables/MobileEntityRow.tsx index 305d54160..e98c81758 100644 --- a/services/ui-src/src/components/tables/MobileEntityRow.tsx +++ b/services/ui-src/src/components/tables/MobileEntityRow.tsx @@ -79,15 +79,16 @@ export const MobileEntityRow = ({ > {editEntityButtonText} - - + {openEntityDetailsOverlay && ( + + )}