Skip to content

Commit

Permalink
consolidated
Browse files Browse the repository at this point in the history
  • Loading branch information
ailZhou committed Sep 13, 2024
1 parent 8e2abbf commit e126a80
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 186 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export {
ComplexValidateNDRTotals,
ComplexValidateNDRTotalsOMS,
} from "./ComplexValidations/ComplexValidateNDRTotals";
export { ComplexValidateDualPopInformation } from "./ComplexValidations/ComplexValidateDualPopInformation";
export { ComplexValidateDualPopInformation } from "shared/globalValidations/ComplexValidations/ComplexValidateDualPopInformation";
export {
ComplexValueSameCrossCategory,
ComplexValueSameCrossCategoryOMS,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export {
ComplexValidateNDRTotals,
ComplexValidateNDRTotalsOMS,
} from "./ComplexValidations/ComplexValidateNDRTotals";
export { ComplexValidateDualPopInformation } from "./ComplexValidations/ComplexValidateDualPopInformation";
export { ComplexValidateDualPopInformation } from "shared/globalValidations/ComplexValidations/ComplexValidateDualPopInformation";
export {
ComplexValueSameCrossCategory,
ComplexValueSameCrossCategoryOMS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import * as ComplexAtLeastOneRateComplete from "shared/globalValidations/Complex
import * as ComplexNoNonZeroNumOrDenom from "measures/2022/shared/globalValidations/ComplexValidations/ComplexNoNonZeroNumOrDenom";
import * as ComplexValidateAtLeastOneNDRInDeviationOfMeasureSpec from "measures/2022/shared/globalValidations/ComplexValidations/ComplexValidateAtLeastOneNDRInDeviationOfMeasureSpec"; //pragma: allowlist secret
import * as ComplexValidateNDRTotals from "measures/2022/shared/globalValidations/ComplexValidations/ComplexValidateNDRTotals";
import * as ComplexValidateDualPopInformation from "measures/2022/shared/globalValidations/ComplexValidations/ComplexValidateDualPopInformation";
import * as ComplexValidateDualPopInformation from "shared/globalValidations/ComplexValidations/ComplexValidateDualPopInformation";
import * as ComplexValueSameCrossCategory from "measures/2022/shared/globalValidations/ComplexValidations/ComplexValueSameCrossCategory";
import { DefaultFormDataLegacy as DefaultFormData } from "shared/types/FormData";

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export {
ComplexValidateNDRTotals,
ComplexValidateNDRTotalsOMS,
} from "./ComplexValidations/ComplexValidateNDRTotals";
export { ComplexValidateDualPopInformation } from "./ComplexValidations/ComplexValidateDualPopInformation";
export { ComplexValidateDualPopInformation } from "shared/globalValidations/ComplexValidations/ComplexValidateDualPopInformation";
export {
ComplexValueSameCrossCategory,
ComplexValueSameCrossCategoryOMS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import * as PCRnoNonZeroNumOrDenom from "shared/globalValidations/PCRValidations
import * as ComplexAtLeastOneRateComplete from "shared/globalValidations/ComplexValidations/ComplexAtLeastOneRateComplete";
import * as ComplexNoNonZeroNumOrDenom from "measures/2023/shared/globalValidations/ComplexValidations/ComplexNoNonZeroNumOrDenom";
import * as ComplexValidateNDRTotals from "measures/2023/shared/globalValidations/ComplexValidations/ComplexValidateNDRTotals";
import * as ComplexValidateDualPopInformation from "measures/2023/shared/globalValidations/ComplexValidations/ComplexValidateDualPopInformation";
import * as ComplexValidateDualPopInformation from "shared/globalValidations/ComplexValidations/ComplexValidateDualPopInformation";
import * as ComplexValueSameCrossCategory from "measures/2023/shared/globalValidations/ComplexValidations/ComplexValueSameCrossCategory";
import { DefaultFormData } from "shared/types/FormData";

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export {
ComplexValidateNDRTotals,
ComplexValidateNDRTotalsOMS,
} from "./ComplexValidations/ComplexValidateNDRTotals";
export { ComplexValidateDualPopInformation } from "./ComplexValidations/ComplexValidateDualPopInformation";
export { ComplexValidateDualPopInformation } from "shared/globalValidations/ComplexValidations/ComplexValidateDualPopInformation";
export {
ComplexValueSameCrossCategory,
ComplexValueSameCrossCategoryOMS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import * as PCRnoNonZeroNumOrDenom from "shared/globalValidations/PCRValidations
import * as ComplexAtLeastOneRateComplete from "shared/globalValidations/ComplexValidations/ComplexAtLeastOneRateComplete";
import * as ComplexNoNonZeroNumOrDenom from "measures/2024/shared/globalValidations/ComplexValidations/ComplexNoNonZeroNumOrDenom";
import * as ComplexValidateNDRTotals from "measures/2024/shared/globalValidations/ComplexValidations/ComplexValidateNDRTotals";
import * as ComplexValidateDualPopInformation from "measures/2024/shared/globalValidations/ComplexValidations/ComplexValidateDualPopInformation";
import * as ComplexValidateDualPopInformation from "shared/globalValidations/ComplexValidations/ComplexValidateDualPopInformation";
import * as ComplexValueSameCrossCategory from "measures/2024/shared/globalValidations/ComplexValidations/ComplexValueSameCrossCategory";
import { DefaultFormData } from "shared/types/FormData";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
import * as DC from "dataConstants";
import { FormRateField } from "measures/2021/globalValidations/types";
import { FormRateField } from "shared/types/TypeValidations";
import { getMeasureYear } from "utils/getMeasureYear";

export const getLabels = (year: number, errorReplacementText: string) => {
switch (year) {
case 2021:
case 2022:
case 2023:
return {
checkmarkWarning: `Information has been included in the ${errorReplacementText} Performance Measure but the checkmark for (Denominator Includes Medicare and Medicaid Dually-Eligible population) is missing`,
missingDataWarning: `The checkmark for (Denominator Includes Medicare and Medicaid Dually-Eligible population) is checked but you are missing performance measure data for ${errorReplacementText}`,
};
default:
return {
missingDataWarning: `"Individuals Dually Eligible for Medicare and Medicaid" is selected in the "Definition of Denominator" question but you are missing performance measure data for ${errorReplacementText}`,
};
}
};

export const ComplexValidateDualPopInformation = (
performanceMeasureArray: any,
Expand All @@ -10,7 +27,8 @@ export const ComplexValidateDualPopInformation = (
if (OPM) {
return [];
}

const year = getMeasureYear();
const labels = getLabels(year, errorReplacementText);
const dualEligible = DefinitionOfDenominator
? DefinitionOfDenominator.indexOf(
DC.DENOMINATOR_INC_MEDICAID_DUAL_ELIGIBLE
Expand Down Expand Up @@ -42,17 +60,18 @@ export const ComplexValidateDualPopInformation = (
if (qual && allFieldsComplete(qual)) filledInData.push(qual);
});

if (!dualEligible && filledInData.length > 0) {
if (!dualEligible && filledInData.length > 0 && labels.checkmarkWarning) {
errorArray.push({
errorLocation: "Performance Measure",
errorMessage: `Information has been included in the ${errorReplacementText} Performance Measure but the checkmark for (Denominator Includes Medicare and Medicaid Dually-Eligible population) is missing`,
errorMessage: labels.checkmarkWarning,
errorType: "Warning",
});
}
if (dualEligible && filledInData.length === 0) {

if (dualEligible && filledInData.length === 0 && labels.missingDataWarning) {
errorArray.push({
errorLocation: "Performance Measure",
errorMessage: `The checkmark for (Denominator Includes Medicare and Medicaid Dually-Eligible population) is checked but you are missing performance measure data for ${errorReplacementText}`,
errorMessage: labels.missingDataWarning,
errorType: "Warning",
});
}
Expand Down

0 comments on commit e126a80

Please sign in to comment.