Skip to content

Commit

Permalink
CMDCT-4113: NAAAR "Analysis Methods" Page (#11958)
Browse files Browse the repository at this point in the history
  • Loading branch information
karla-vm authored Dec 18, 2024
1 parent be05d1e commit d7285c2
Show file tree
Hide file tree
Showing 15 changed files with 298 additions and 76 deletions.
44 changes: 43 additions & 1 deletion services/app-api/forms/naaar.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"basePath": "/naaar",
"version": "NAAAR_2024-08-06",
"entities": {
"plans": { "required": true }
"plans": { "required": true },
"analysisMethods": { "required": true }
},
"routes": [
{
Expand Down Expand Up @@ -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 <br/> 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": [] }
}
]
},
Expand Down
13 changes: 13 additions & 0 deletions services/app-api/utils/constants/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ export const bucketTopics = {

export const formTemplateTableName = process.env.FORM_TEMPLATE_TABLE_NAME!;

// COPY-OVER

export const McparFieldsToCopy = {
root: [
"state_encounterDataValidationEntity",
Expand Down Expand Up @@ -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",
];
Binary file added services/ui-src/src/assets/icons/icon_add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 11 additions & 11 deletions services/ui-src/src/components/cards/EntityCard/EntityCard.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const UnfinishedAccessMeasuresEntityCardComponent = (
verbiage={mockModalDrawerReportPageJson.verbiage}
openAddEditEntityModal={openAddEditEntityModal}
openDeleteEntityModal={openDeleteEntityModal}
openDrawer={mockOpenDrawer}
openOverlayOrDrawer={mockOpenDrawer}
printVersion={false}
/>
);
Expand All @@ -66,7 +66,7 @@ const UnfinishedAccessMeasuresEntityCardPrintComponent = (
verbiage={mockModalDrawerReportPageJson.verbiage}
openAddEditEntityModal={openAddEditEntityModal}
openDeleteEntityModal={openDeleteEntityModal}
openDrawer={mockOpenDrawer}
openOverlayOrDrawer={mockOpenDrawer}
printVersion={true}
/>
);
Expand All @@ -80,7 +80,7 @@ const AccessMeasuresEntityCardComponent = (
verbiage={mockModalDrawerReportPageJson.verbiage}
openAddEditEntityModal={openAddEditEntityModal}
openDeleteEntityModal={openDeleteEntityModal}
openDrawer={mockOpenDrawer}
openOverlayOrDrawer={mockOpenDrawer}
printVersion={false}
/>
);
Expand All @@ -94,7 +94,7 @@ const AccessMeasuresEntityCardPrintComponent = (
verbiage={mockModalDrawerReportPageJson.verbiage}
openAddEditEntityModal={openAddEditEntityModal}
openDeleteEntityModal={openDeleteEntityModal}
openDrawer={mockOpenDrawer}
openOverlayOrDrawer={mockOpenDrawer}
printVersion={true}
/>
);
Expand Down Expand Up @@ -269,7 +269,7 @@ const UnstartedQualityMeasuresEntityCardComponent = (
verbiage={mockModalDrawerReportPageJson.verbiage}
openAddEditEntityModal={openAddEditEntityModal}
openDeleteEntityModal={openDeleteEntityModal}
openDrawer={mockOpenDrawer}
openOverlayOrDrawer={mockOpenDrawer}
/>
);

Expand All @@ -284,7 +284,7 @@ const QualityMeasuresEntityCardComponentMissingReportingPeriodAndDetails = (
verbiage={mockModalDrawerReportPageJson.verbiage}
openAddEditEntityModal={openAddEditEntityModal}
openDeleteEntityModal={openDeleteEntityModal}
openDrawer={mockOpenDrawer}
openOverlayOrDrawer={mockOpenDrawer}
/>
);

Expand All @@ -299,7 +299,7 @@ const QualityMeasuresEntityCardComponentMissingReportingPeriod = (
verbiage={mockModalDrawerReportPageJson.verbiage}
openAddEditEntityModal={openAddEditEntityModal}
openDeleteEntityModal={openDeleteEntityModal}
openDrawer={mockOpenDrawer}
openOverlayOrDrawer={mockOpenDrawer}
/>
);

Expand All @@ -312,7 +312,7 @@ const QualityMeasuresEntityCardComponentMissingDetails = (
verbiage={mockModalDrawerReportPageJson.verbiage}
openAddEditEntityModal={openAddEditEntityModal}
openDeleteEntityModal={openDeleteEntityModal}
openDrawer={mockOpenDrawer}
openOverlayOrDrawer={mockOpenDrawer}
/>
);

Expand All @@ -325,7 +325,7 @@ const CompletedQualityMeasuresEntityCardComponent = (
verbiage={mockModalDrawerReportPageJson.verbiage}
openAddEditEntityModal={openAddEditEntityModal}
openDeleteEntityModal={openDeleteEntityModal}
openDrawer={mockOpenDrawer}
openOverlayOrDrawer={mockOpenDrawer}
/>
);

Expand Down Expand Up @@ -557,7 +557,7 @@ const UnfinishedSanctionsEntityCardComponent = (
verbiage={mockModalDrawerReportPageJson.verbiage}
openAddEditEntityModal={openAddEditEntityModal}
openDeleteEntityModal={openDeleteEntityModal}
openDrawer={mockOpenDrawer}
openOverlayOrDrawer={mockOpenDrawer}
/>
);

Expand All @@ -570,7 +570,7 @@ const SanctionsEntityCardComponent = (
verbiage={mockModalDrawerReportPageJson.verbiage}
openAddEditEntityModal={openAddEditEntityModal}
openDeleteEntityModal={openDeleteEntityModal}
openDrawer={mockOpenDrawer}
openOverlayOrDrawer={mockOpenDrawer}
/>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const EntityCard = ({
verbiage,
openAddEditEntityModal,
openDeleteEntityModal,
openDrawer,
openOverlayOrDrawer,
printVersion,
...props
}: Props) => {
Expand Down Expand Up @@ -170,12 +170,12 @@ export const EntityCard = ({
{verbiage.entityUnfinishedMessage}
</Text>
)}
{openDrawer && (
{openOverlayOrDrawer && (
<Button
size="sm"
sx={entityCompleted ? sx.editButton : sx.openDrawerButton}
variant={entityCompleted ? "outline" : "primary"}
onClick={() => openDrawer(entity)}
onClick={() => openOverlayOrDrawer(entity)}
data-testid={
entityCompleted ? "edit-details-button" : "enter-details-button"
}
Expand Down Expand Up @@ -203,7 +203,7 @@ interface Props {
verbiage: AnyObject;
openAddEditEntityModal?: Function;
openDeleteEntityModal?: Function;
openDrawer?: Function;
openOverlayOrDrawer?: Function;
printVersion?: boolean;
[key: string]: any;
}
Expand Down
4 changes: 3 additions & 1 deletion services/ui-src/src/components/modals/AddEditReportModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import {
convertDateUtcToEt,
useStore,
} from "utils";
import { States } from "../../constants";
// constants
import { DEFAULT_ANALYSIS_METHODS, States } from "../../constants";

export const AddEditReportModal = ({
activeState,
Expand Down Expand Up @@ -170,6 +171,7 @@ export const AddEditReportModal = ({
},
fieldData: {
programName,
["analysisMethods"]: DEFAULT_ANALYSIS_METHODS,
},
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
mockStateUserStore,
RouterWrappedComponent,
mockMcparReportStore,
mockNaaarReportStore,
} from "utils/testing/setupJest";
// constants
import { saveAndCloseText } from "../../constants";
Expand Down Expand Up @@ -162,6 +163,19 @@ describe("ModalDrawerReportPage drawer form repeats fields if necessary", () =>
});
});

describe("Test ModalDrawerReportPage w/ Entity Table (NAAAR)", () => {
test("Entity table should render for a NAAAR report", async () => {
mockedUseStore.mockReturnValue({
...mockStateUserStore,
...mockNaaarReportStore,
});

render(modalDrawerReportPageComponentWithEntities);
const entityTable = screen.getByTestId("entity-table");
expect(entityTable).toBeVisible();
});
});

describe("Test ModalDrawerReportPage accessibility", () => {
beforeEach(async () => {
mockedUseStore.mockReturnValue({
Expand Down
Loading

0 comments on commit d7285c2

Please sign in to comment.