Skip to content

Commit

Permalink
CMDCT-3670: Feature Flag Cleanup for MCPAR Updates (#11857)
Browse files Browse the repository at this point in the history
  • Loading branch information
karla-vm authored Sep 13, 2024
1 parent 4a66fa2 commit 70039fa
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 209 deletions.
98 changes: 47 additions & 51 deletions services/app-api/forms/mcpar.json
Original file line number Diff line number Diff line change
Expand Up @@ -1761,68 +1761,64 @@
"props": {
"label": "C1.XII.10b In the last analysis(es) conducted, describe all deficiencies identified."
}
}
]
},
{
"id": "id5YVp8cXSTlUNX3dKXSqxqa",
"label": "No"
}
]
}
},
{
"id": "program_haveTheseDeficienciesBeenResolvedForAllPlans",
"type": "radio",
"validation": {
"type": "radio",
"nested": true,
"parentFieldName": "program_doesThisProgramIncludeMCOs",
"parentOptionId": "A4uFU0YyU9useo3DsWjnH264"
},
"props": {
"label": "C1.XII.11a As of the end of this reporting period, have these deficiencies been resolved for all plans?",
"choices": [
{
"id": "sLd8M1tgf9dpVIZWRYEXvdBe",
"label": "Yes"
},
{
"id": "DCDJH4S1JHF7G5bZUMxOVMTe",
"label": "No",
"children": [
},
{
"id": "reasonsForNoDeficiencyResolutionsForAllPlans",
"type": "checkbox",
"id": "program_haveTheseDeficienciesBeenResolvedForAllPlans",
"type": "radio",
"validation": {
"type": "checkbox",
"type": "radio",
"nested": true,
"parentFieldName": "program_haveTheseDeficienciesBeenResolvedForAllPlans",
"parentOptionId": "DCDJH4S1JHF7G5bZUMxOVMTe"
"parentFieldName": "program_doesThisProgramIncludeMCOs",
"parentOptionId": "A4uFU0YyU9useo3DsWjnH264"
},
"props": {
"label": "C1.XII.11b If deficiencies have not been resolved, select all that apply.",
"label": "C1.XII.11a As of the end of this reporting period, have these deficiencies been resolved for all plans?",
"choices": [
{
"id": "bEJDkUR6l4zwIgj3aLDd7TZ9",
"label": "Noncompliant limits are still being applied in operations, affecting some providers and/or enrollees."
},
{
"id": "E63ZYRXBmOocAEUS9JA1PkNB",
"label": "Non-compliance is related to updated parity documentation not yet submitted to CMS."
"id": "sLd8M1tgf9dpVIZWRYEXvdBe",
"label": "Yes"
},
{
"id": "NXbySoHbH3AvbOIvIUREAPsC",
"label": "Other, specify",
"id": "DCDJH4S1JHF7G5bZUMxOVMTe",
"label": "No",
"children": [
{
"id": "reasonsForNoDeficiencyResolutionsForAllPlans-otherText",
"type": "textarea",
"id": "reasonsForNoDeficiencyResolutionsForAllPlans",
"type": "checkbox",
"validation": {
"type": "text",
"type": "checkbox",
"nested": true,
"parentFieldName": "reasonsForNoDeficiencyResolutionsForAllPlans",
"parentOptionId": "NXbySoHbH3AvbOIvIUREAPsC"
"parentFieldName": "program_haveTheseDeficienciesBeenResolvedForAllPlans",
"parentOptionId": "DCDJH4S1JHF7G5bZUMxOVMTe"
},
"props": {
"label": "C1.XII.11b If deficiencies have not been resolved, select all that apply.",
"choices": [
{
"id": "bEJDkUR6l4zwIgj3aLDd7TZ9",
"label": "Noncompliant limits are still being applied in operations, affecting some providers and/or enrollees."
},
{
"id": "E63ZYRXBmOocAEUS9JA1PkNB",
"label": "Non-compliance is related to updated parity documentation not yet submitted to CMS."
},
{
"id": "NXbySoHbH3AvbOIvIUREAPsC",
"label": "Other, specify",
"children": [
{
"id": "reasonsForNoDeficiencyResolutionsForAllPlans-otherText",
"type": "textarea",
"validation": {
"type": "text",
"nested": true,
"parentFieldName": "reasonsForNoDeficiencyResolutionsForAllPlans",
"parentOptionId": "NXbySoHbH3AvbOIvIUREAPsC"
}
}
]
}
]
}
}
]
Expand All @@ -1833,8 +1829,8 @@
]
},
{
"id": "KPYRWvuNZC7dwfOOCifXdQhw",
"label": "No deficiencies identified"
"id": "id5YVp8cXSTlUNX3dKXSqxqa",
"label": "No"
}
]
}
Expand Down
1 change: 0 additions & 1 deletion services/app-api/handlers/reports/create.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ const createPccmEvent: APIGatewayProxyEvent = {
key: "programIsPCCM-yes_programIsPCCM",
},
],
julyMcparRelease: false,
},
}),
};
Expand Down
7 changes: 1 addition & 6 deletions services/app-api/handlers/reports/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,12 @@ export const createReport = handler(async (event, _context) => {
const isProgramPCCM =
unvalidatedMetadata?.programIsPCCM?.[0]?.value === "Yes";

const julyMcparRelease = unvalidatedMetadata?.julyMcparRelease || false;
const updateTopicXii = unvalidatedMetadata?.updateTopicXii || false;

// eslint-disable-next-line no-useless-catch
try {
({ formTemplate, formTemplateVersion } = await getOrCreateFormTemplate(
reportBucket,
reportType,
isProgramPCCM,
julyMcparRelease,
updateTopicXii
isProgramPCCM
));
} catch (e) {
throw e;
Expand Down
79 changes: 0 additions & 79 deletions services/app-api/utils/formTemplates/formTemplateModifiers.ts

This file was deleted.

32 changes: 8 additions & 24 deletions services/app-api/utils/formTemplates/formTemplates.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ describe("Test getOrCreateFormTemplate MCPAR", () => {
const result = await getOrCreateFormTemplate(
"local-mcpar-reports",
ReportType.MCPAR,
programIsNotPCCM,
true,
false
programIsNotPCCM
);

expect(dynamoPutSpy).toHaveBeenCalled();
Expand Down Expand Up @@ -103,9 +101,7 @@ describe("Test getOrCreateFormTemplate MCPAR", () => {
const result = await getOrCreateFormTemplate(
"local-mcpar-reports",
ReportType.MCPAR,
programIsPCCM,
true,
false
programIsPCCM
);
expect(dynamoPutSpy).toHaveBeenCalled();
expect(s3PutSpy).toHaveBeenCalled();
Expand Down Expand Up @@ -136,9 +132,7 @@ describe("Test getOrCreateFormTemplate MCPAR", () => {
const result = await getOrCreateFormTemplate(
"local-mcpar-reports",
ReportType.MCPAR,
programIsNotPCCM,
true,
false
programIsNotPCCM
);
expect(dynamoPutSpy).not.toHaveBeenCalled();
expect(s3PutSpy).not.toHaveBeenCalled();
Expand Down Expand Up @@ -177,9 +171,7 @@ describe("Test getOrCreateFormTemplate MCPAR", () => {
const result = await getOrCreateFormTemplate(
"local-mcpar-reports",
ReportType.MCPAR,
programIsNotPCCM,
true,
false
programIsNotPCCM
);
expect(dynamoPutSpy).toHaveBeenCalled();
expect(s3PutSpy).toHaveBeenCalled();
Expand All @@ -204,9 +196,7 @@ describe("Test getOrCreateFormTemplate MCPAR", () => {
const result = await getOrCreateFormTemplate(
"local-mcpar-reports",
ReportType.MCPAR,
programIsNotPCCM,
true,
true
programIsNotPCCM
);

expect(dynamoPutSpy).toHaveBeenCalled();
Expand Down Expand Up @@ -246,9 +236,7 @@ describe("Test getOrCreateFormTemplate MLR", () => {
const result = await getOrCreateFormTemplate(
"local-mlr-reports",
ReportType.MLR,
programIsNotPCCM,
false,
false
programIsNotPCCM
);
expect(dynamoPutSpy).toHaveBeenCalled();
expect(s3PutSpy).toHaveBeenCalled();
Expand Down Expand Up @@ -279,9 +267,7 @@ describe("Test getOrCreateFormTemplate MLR", () => {
const result = await getOrCreateFormTemplate(
"local-mlr-reports",
ReportType.MLR,
programIsNotPCCM,
false,
false
programIsNotPCCM
);
expect(dynamoPutSpy).not.toHaveBeenCalled();
expect(s3PutSpy).not.toHaveBeenCalled();
Expand Down Expand Up @@ -320,9 +306,7 @@ describe("Test getOrCreateFormTemplate MLR", () => {
const result = await getOrCreateFormTemplate(
"local-mlr-reports",
ReportType.MLR,
programIsNotPCCM,
false,
false
programIsNotPCCM
);
expect(dynamoPutSpy).toHaveBeenCalled();
expect(s3PutSpy).toHaveBeenCalled();
Expand Down
37 changes: 1 addition & 36 deletions services/app-api/utils/formTemplates/formTemplates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
} from "../types";
// utils
import { getTemplate } from "../../handlers/formTemplates/populateTemplatesTable";
import { handleTemplateForJulyMcparRelease } from "./formTemplateModifiers";

export async function getNewestTemplateVersion(reportType: ReportType) {
const queryParams: QueryCommandInput = {
Expand Down Expand Up @@ -77,26 +76,14 @@ export const formTemplateForReportType = (reportType: ReportType) => {
export async function getOrCreateFormTemplate(
reportBucket: string,
reportType: ReportType,
isProgramPCCM: boolean,
julyMcparRelease: boolean,
updateTopicXii: boolean
isProgramPCCM: boolean
) {
let currentFormTemplate = formTemplateForReportType(reportType);

// if July MCPAR Release is not enabled, remove the fields from form template
if (!julyMcparRelease) {
currentFormTemplate =
handleTemplateForJulyMcparRelease(currentFormTemplate);
}

if (isProgramPCCM) {
currentFormTemplate = generatePCCMTemplate(currentFormTemplate);
}

if (updateTopicXii) {
currentFormTemplate = makeTopicXIIModifications(currentFormTemplate);
}

const stringifiedTemplate = JSON.stringify(currentFormTemplate);
const currentTemplateHash = createHash("md5")
.update(stringifiedTemplate)
Expand Down Expand Up @@ -330,25 +317,3 @@ const makePCCMTemplateModifications = (reportTemplate: ReportJson) => {
}
programTypeQuestion.props!.disabled = true;
};

export const makeTopicXIIModifications = (reportTemplate: ReportJson) => {
/*
* Find Question C1.XII.4, nest 11.a within 10.b
* also remove the response "No deficiencies identified" under question 11
*/
const topicXIIchoices =
reportTemplate.routes[2].children![6].form!.fields[0].props?.choices[1];
const question11 = topicXIIchoices.children.find(
(child: AnyObject) =>
child.id === "program_haveTheseDeficienciesBeenResolvedForAllPlans"
);
question11.props.choices.splice(2, 1);
topicXIIchoices.children[5].props.choices[0].children.splice(
1,
0,
question11
);

topicXIIchoices.children.splice(6, 1);
return reportTemplate;
};
2 changes: 0 additions & 2 deletions services/app-api/utils/types/reportContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ export interface ReportMetadataShape extends ReportKeys {
fieldDataId: string;
copyFieldDataSourceId?: string;
programIsPCCM?: Choice[];
julyMcparRelease?: boolean;
previousRevisions: string[];
updateTopicXii?: boolean;
}

export interface ReportShape extends ReportMetadataShape {
Expand Down
Loading

0 comments on commit 70039fa

Please sign in to comment.