Skip to content

Commit

Permalink
CPC-CH Set to Autocomplete + Content update (#2083)
Browse files Browse the repository at this point in the history
  • Loading branch information
ailZhou authored Mar 5, 2024
1 parent 88eed9f commit a17c8c4
Show file tree
Hide file tree
Showing 16 changed files with 29 additions and 652 deletions.
1 change: 1 addition & 0 deletions services/app-api/handlers/dynamoUtils/measureList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1231,6 +1231,7 @@ export const measures: Measure = {
{
type: "C",
measure: "CPC-CH",
autocompleteOnCreation: true,
},
{
type: "C",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useParams } from "react-router-dom";
interface Props {
measureTitle: string;
performanceMeasureText: string;
performanceMeasureSubtext?: string;
performanceMeasureSubtext?: string | string[];
year: string;
}

Expand All @@ -17,6 +17,10 @@ export const AutocompletedMeasureTemplate = ({
year,
}: Props) => {
const { state, coreSetId } = useParams();
const subText: string[] | undefined =
typeof performanceMeasureSubtext === "string"
? [performanceMeasureSubtext]
: performanceMeasureSubtext;

return (
<>
Expand All @@ -41,12 +45,13 @@ export const AutocompletedMeasureTemplate = ({
<CUI.Text>{performanceMeasureText}</CUI.Text>
</CUI.Box>

{performanceMeasureSubtext && (
<CUI.Text>{performanceMeasureSubtext}</CUI.Text>
)}
{subText &&
subText.map(() => {
return <CUI.Text>{subText}</CUI.Text>;
})}
<CUI.Text fontWeight="700">
{`States are not asked to report data for this measure for FFY ${year} Core Set
reporting.`}
{`States are not asked to report data for this measure for FFY ${year} Core Set in the online
reporting system.`}
</CUI.Text>
</CUI.Stack>

Expand Down
68 changes: 0 additions & 68 deletions services/ui-src/src/measures/2024/CPCCH/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,65 +78,6 @@ describe(`Test FFY ${year} ${measureAbbr}`, () => {
});
});

/**
* Render the measure and confirm that all expected components exist.
* */
it("Always shows Did you collect question", async () => {
useApiMock(apiData);
renderWithHookForm(component);
expect(screen.getByText("Did you collect this measure?"));
});

it("shows corresponding questions if yes to reporting then ", async () => {
apiData.useGetMeasureValues.data.Item.data = completedMeasureData;
useApiMock(apiData);
renderWithHookForm(component);
expect(
screen.queryByTestId("measurement-specification")
).toBeInTheDocument();
expect(screen.queryByTestId("data-source")).toBeInTheDocument();
expect(
screen.queryByTestId("definition-of-population")
).toBeInTheDocument();
expect(
screen.getByText(
"Which Supplemental Item Sets were included in the Survey"
)
).toBeInTheDocument();
expect(
screen.getByText(
"Which administrative protocol was used to administer the survey?"
)
).toBeInTheDocument();
});

it("does not show corresponding questions if no to reporting then ", async () => {
apiData.useGetMeasureValues.data.Item.data = notReportingData;
useApiMock(apiData);
renderWithHookForm(component);
expect(screen.queryByTestId("status-of-data")).not.toBeInTheDocument();
expect(
screen.queryByTestId("measurement-specification")
).not.toBeInTheDocument();
expect(screen.queryByTestId("data-source")).not.toBeInTheDocument();
expect(
screen.queryByTestId("definition-of-population")
).not.toBeInTheDocument();
expect(
screen.queryByText(
"Which Supplemental Item Sets were included in the Survey"
)
).not.toBeInTheDocument();
expect(
screen.queryByText(
"Which administrative protocol was used to administer the survey?"
)
).not.toBeInTheDocument();
expect(
screen.getByText("Why did you not collect this measure")
).toBeInTheDocument();
});

jest.setTimeout(15000);
it("should pass a11y tests", async () => {
useApiMock(apiData);
Expand All @@ -147,12 +88,3 @@ describe(`Test FFY ${year} ${measureAbbr}`, () => {
});
});
});

const notReportingData = {
DidCollect: "no",
};

const completedMeasureData = {
MeasurementSpecification: "AHRQ-NCQA",
DidCollect: "yes",
};
52 changes: 14 additions & 38 deletions services/ui-src/src/measures/2024/CPCCH/index.tsx
Original file line number Diff line number Diff line change
@@ -1,44 +1,20 @@
import * as Q from "./questions";
import * as QMR from "components";
import * as CMQ from "measures/2024/shared/CommonQuestions";
import { useParams } from "react-router-dom";
import * as Types from "measures/2024/shared/CommonQuestions/types";
import { useFormContext } from "react-hook-form";
import { validationFunctions } from "./validation";
import { useEffect } from "react";

export const CPCCH = ({
name,
year,
setValidationFunctions,
}: QMR.MeasureWrapperProps) => {
const { watch } = useFormContext<Types.DefaultFormData>();
const { coreSetId } = useParams();
const data = watch();

useEffect(() => {
if (setValidationFunctions) {
setValidationFunctions(validationFunctions);
}
}, [setValidationFunctions]);
interface Props {
name: string;
year: string;
}

export const CPCCH = ({ name, year }: Props) => {
return (
<>
<Q.Reporting
reportingYear={year}
measureName={name}
measureAbbreviation={coreSetId as string}
/>
{data["DidCollect"] !== "no" && (
<>
<Q.HowDidYouReport />
<CMQ.MeasurementSpecification type="AHRQ-NCQA" />
<Q.DataSource />
<Q.DefinitionOfPopulation />
<Q.PerformanceMeasure />
</>
)}
<CMQ.AdditionalNotes />
</>
<QMR.AutocompletedMeasureTemplate
year={year}
measureTitle={`CPC-CH - ${name}`}
performanceMeasureText="The measure provides information on parents' experiences with their child's health care. Results summarize children's experiences through ratings, composites, and individual question summary rates."
performanceMeasureSubtext={[
"The Children with Chronic Conditions Supplemental Items provides information on parents' experience with their child's health care for the population of children with chronic conditions",
"To reduce state burden and streamline reporting, CMS will calculate state-level performance results for this measure using data submitted to the AHRQ CAHPS Health Plan Survey Database",
]}
/>
);
};
86 changes: 0 additions & 86 deletions services/ui-src/src/measures/2024/CPCCH/questions/DataSource.tsx

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit a17c8c4

Please sign in to comment.