Skip to content

Commit

Permalink
validation import fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ailZhou committed Jan 14, 2025
1 parent 4ef9f8d commit 9779771
Show file tree
Hide file tree
Showing 19 changed files with 80 additions and 23 deletions.
5 changes: 4 additions & 1 deletion services/ui-src/src/measures/2022/ADDCH/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import { DefaultFormDataLegacy as FormData } from "shared/types/FormData";

const ADDCHValidation = (data: FormData) => {
const ageGroups = PMD.qualifiers;
const performanceMeasureArray = getPerfMeasureRateArray(data, PMD.data);
const performanceMeasureArray = getPerfMeasureRateArray(
data,
PMD.data.performanceMeasure
);
let errorArray: any[] = [];
const whyNotReporting = data[DC.WHY_ARE_YOU_NOT_REPORTING];
const OPM = data[DC.OPM_RATES];
Expand Down
12 changes: 10 additions & 2 deletions services/ui-src/src/measures/2022/CCPAD/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ const CCPADValidation = (data: FormData) => {
),
...GV.validateBothDatesCompleted(dateRange),
...GV.validateYearFormat(dateRange),
...GV.validateOneQualRateHigherThanOtherQualPM(data, PMD.data, 1, 0),
...GV.validateOneQualRateHigherThanOtherQualPM(
data,
PMD.data.performanceMeasure,
1,
0
),
...GV.validateEqualCategoryDenominatorsPM(data, PMD.categories),
...GV.validateAtLeastOneDataSource(data),
...GV.validateAtLeastOneDeviationFieldFilled(
Expand All @@ -53,7 +58,10 @@ const CCPADValidation = (data: FormData) => {
OPM,
ageGroups
),
...GV.validateOneCatRateHigherThanOtherCatPM(data, PMD.data),
...GV.validateOneCatRateHigherThanOtherCatPM(
data,
PMD.data.performanceMeasure
),
...GV.validateRequiredRadioButtonForCombinedRates(data),

// OMS Specific Validations
Expand Down
12 changes: 10 additions & 2 deletions services/ui-src/src/measures/2022/CCPCH/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,17 @@ const CCPCHValidation = (data: FormData) => {
OPM,
ageGroups
),
...GV.validateOneCatRateHigherThanOtherCatPM(data, PMD.data),
...GV.validateOneCatRateHigherThanOtherCatPM(
data,
PMD.data.performanceMeasure
),
...GV.validateRequiredRadioButtonForCombinedRates(data),
...GV.validateOneQualRateHigherThanOtherQualPM(data, PMD.data, 1, 0),
...GV.validateOneQualRateHigherThanOtherQualPM(
data,
PMD.data.performanceMeasure,
1,
0
),

// OMS Specific Validations
...GV.omsValidations({
Expand Down
2 changes: 1 addition & 1 deletion services/ui-src/src/measures/2022/CCSAD/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const CCSADValidation = (data: FormData) => {
const whyNotReporting = data[DC.WHY_ARE_YOU_NOT_REPORTING];
const OPM = data[DC.OPM_RATES];
const performanceMeasureArray =
GV.getPerfMeasureRateArray(data, PMD.data) ?? [];
GV.getPerfMeasureRateArray(data, PMD.data.performanceMeasure) ?? [];
const dateRange = data[DC.DATE_RANGE];
const deviationArray = GV.getDeviationNDRArray(
data.DeviationOptions,
Expand Down
2 changes: 1 addition & 1 deletion services/ui-src/src/measures/2022/CISCH/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const CISCHValidation = (data: FormData) => {
const whyNotReporting = data[DC.WHY_ARE_YOU_NOT_REPORTING];
const OPM = data[DC.OPM_RATES];
const performanceMeasureArray =
GV.getPerfMeasureRateArray(data, PMD.data) ?? [];
GV.getPerfMeasureRateArray(data, PMD.data.performanceMeasure) ?? [];
const dateRange = data[DC.DATE_RANGE];
const deviationArray = GV.getDeviationNDRArray(
data.DeviationOptions,
Expand Down
5 changes: 4 additions & 1 deletion services/ui-src/src/measures/2022/FUAAD/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ const FUAADValidation = (data: FormData) => {
),
...GV.validateRateNotZeroPM(performanceMeasureArray, OPM, ageGroups),
...GV.validateRateZeroPM(performanceMeasureArray, OPM, ageGroups, data),
...GV.validateOneCatRateHigherThanOtherCatPM(data, PMD.data),
...GV.validateOneCatRateHigherThanOtherCatPM(
data,
PMD.data.performanceMeasure
),
...GV.validateRequiredRadioButtonForCombinedRates(data),
...GV.validateBothDatesCompleted(dateRange),
...GV.validateYearFormat(dateRange),
Expand Down
10 changes: 8 additions & 2 deletions services/ui-src/src/measures/2022/FUACH/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import { DefaultFormDataLegacy as FormData } from "shared/types/FormData";

const FUACHValidation = (data: FormData) => {
const ageGroups = PMD.qualifiers;
const performanceMeasureArray = getPerfMeasureRateArray(data, PMD.data);
const performanceMeasureArray = getPerfMeasureRateArray(
data,
PMD.data.performanceMeasure
);
const whyNotReporting = data[DC.WHY_ARE_YOU_NOT_REPORTING];
const OPM = data[DC.OPM_RATES];
const dateRange = data[DC.DATE_RANGE];
Expand Down Expand Up @@ -52,7 +55,10 @@ const FUACHValidation = (data: FormData) => {
deviationArray,
didCalculationsDeviate
),
...GV.validateOneCatRateHigherThanOtherCatPM(data, PMD.data),
...GV.validateOneCatRateHigherThanOtherCatPM(
data,
PMD.data.performanceMeasure
),

// OMS Validations
...GV.omsValidations({
Expand Down
5 changes: 4 additions & 1 deletion services/ui-src/src/measures/2022/FUAHH/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ const FUAHHValidation = (data: FormData) => {
...GV.validateRateZeroPM(performanceMeasureArray, OPM, ageGroups, data),
...GV.validateRateNotZeroPM(performanceMeasureArray, OPM, ageGroups),
...GV.validateTotalNDR(performanceMeasureArray),
...GV.validateOneCatRateHigherThanOtherCatPM(data, PMD.data),
...GV.validateOneCatRateHigherThanOtherCatPM(
data,
PMD.data.performanceMeasure
),

// OMS Validations
...GV.omsValidations({
Expand Down
5 changes: 4 additions & 1 deletion services/ui-src/src/measures/2022/FUHHH/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ const FUHHHValidation = (data: FormData) => {
...GV.validateRateZeroPM(performanceMeasureArray, OPM, ageGroups, data),
...GV.validateRateNotZeroPM(performanceMeasureArray, OPM, ageGroups),
...GV.validateTotalNDR(performanceMeasureArray),
...GV.validateOneCatRateHigherThanOtherCatPM(data, PMD.data),
...GV.validateOneCatRateHigherThanOtherCatPM(
data,
PMD.data.performanceMeasure
),

// OMS Validations
...GV.omsValidations({
Expand Down
5 changes: 4 additions & 1 deletion services/ui-src/src/measures/2022/FUMAD/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ const FUMADValidation = (data: FormData) => {
...GV.validateAtLeastOneDataSource(data),
...GV.validateBothDatesCompleted(dateRange),
...GV.validateYearFormat(dateRange),
...GV.validateOneCatRateHigherThanOtherCatPM(data, PMD.data),
...GV.validateOneCatRateHigherThanOtherCatPM(
data,
PMD.data.performanceMeasure
),
...GV.validateRequiredRadioButtonForCombinedRates(data),
...GV.validateAtLeastOneDeviationFieldFilled(
performanceMeasureArray,
Expand Down
2 changes: 1 addition & 1 deletion services/ui-src/src/measures/2022/HPCAD/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const HPCADValidation = (data: FormData) => {
const whyNotReporting = data[DC.WHY_ARE_YOU_NOT_REPORTING];
const OPM = data[DC.OPM_RATES];
const performanceMeasureArray =
GV.getPerfMeasureRateArray(data, PMD.data) ?? [];
GV.getPerfMeasureRateArray(data, PMD.data.performanceMeasure) ?? [];
const dateRange = data[DC.DATE_RANGE];
const deviationArray = GV.getDeviationNDRArray(
data.DeviationOptions,
Expand Down
8 changes: 7 additions & 1 deletion services/ui-src/src/measures/2022/IETAD/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,13 @@ const IETValidation = (data: FormData) => {
...filteredSameDenominatorErrors,
...GV.validateRateNotZeroPM(performanceMeasureArray, OPM, ageGroups),
...GV.validateRateZeroPM(performanceMeasureArray, OPM, ageGroups, data),
...GV.validateOneCatRateHigherThanOtherCatPM(data, PMD.data, 0, 1, 2),
...GV.validateOneCatRateHigherThanOtherCatPM(
data,
PMD.data.performanceMeasure,
0,
1,
2
),

// OMS Validations
...GV.omsValidations({
Expand Down
8 changes: 7 additions & 1 deletion services/ui-src/src/measures/2022/IETHH/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,13 @@ const IETValidation = (data: FormData) => {

errorArray = [
...errorArray,
...GV.validateOneCatRateHigherThanOtherCatPM(data, PMD.data, 0, 1, 2),
...GV.validateOneCatRateHigherThanOtherCatPM(
data,
PMD.data.performanceMeasure,
0,
1,
2
),
...GV.validateAtLeastOneRateComplete(
performanceMeasureArray,
OPM,
Expand Down
2 changes: 1 addition & 1 deletion services/ui-src/src/measures/2022/OUDAD/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const OUDValidation = (data: FormData) => {
const OPM = data[DC.OPM_RATES];
const ageGroups = PMD.qualifiers;
const performanceMeasureArray =
GV.getPerfMeasureRateArray(data, PMD.data) ?? [];
GV.getPerfMeasureRateArray(data, PMD.data.performanceMeasure) ?? [];
const dateRange = data[DC.DATE_RANGE];
const whyNotReporting = data[DC.WHY_ARE_YOU_NOT_REPORTING];
const didCalculationsDeviate = data[DC.DID_CALCS_DEVIATE] === DC.YES;
Expand Down
2 changes: 1 addition & 1 deletion services/ui-src/src/measures/2022/OUDHH/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const OUDValidation = (data: FormData) => {
const OPM = data[DC.OPM_RATES];
const ageGroups = PMD.qualifiers;
const performanceMeasureArray =
GV.getPerfMeasureRateArray(data, PMD.data) ?? [];
GV.getPerfMeasureRateArray(data, PMD.data.performanceMeasure) ?? [];
const dateRange = data[DC.DATE_RANGE];
const whyNotReporting = data[DC.WHY_ARE_YOU_NOT_REPORTING];
const didCalculationsDeviate = data[DC.DID_CALCS_DEVIATE] === DC.YES;
Expand Down
2 changes: 1 addition & 1 deletion services/ui-src/src/measures/2022/PPCAD/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const PPCADValidation = (data: FormData) => {
const whyNotReporting = data[DC.WHY_ARE_YOU_NOT_REPORTING];
const OPM = data[DC.OPM_RATES];
const performanceMeasureArray =
GV.getPerfMeasureRateArray(data, PMD.data) ?? [];
GV.getPerfMeasureRateArray(data, PMD.data.performanceMeasure) ?? [];
const dateRange = data[DC.DATE_RANGE];
const deviationArray = GV.getDeviationNDRArray(
data.DeviationOptions,
Expand Down
2 changes: 1 addition & 1 deletion services/ui-src/src/measures/2022/PPCCH/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const PPCCHValidation = (data: FormData) => {
const whyNotReporting = data[DC.WHY_ARE_YOU_NOT_REPORTING];
const OPM = data[DC.OPM_RATES];
const performanceMeasureArray =
GV.getPerfMeasureRateArray(data, PMD.data) ?? [];
GV.getPerfMeasureRateArray(data, PMD.data.performanceMeasure) ?? [];
const dateRange = data[DC.DATE_RANGE];
const deviationArray = GV.getDeviationNDRArray(
data.DeviationOptions,
Expand Down
12 changes: 10 additions & 2 deletions services/ui-src/src/measures/2022/TFLCH/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,17 @@ const TFLCHValidation = (data: FormData) => {
errorArray = [
...errorArray,
// Dental Services rate cannot be larger than the Dental or Oral Health Services rate
...GV.validateOneCatRateHigherThanOtherCatPM(data, PMD.data),
...GV.validateOneCatRateHigherThanOtherCatPM(
data,
PMD.data.performanceMeasure
),
// Oral Health Services rate cannot be larger than the Dental or Oral Health Services rate
...GV.validateOneCatRateHigherThanOtherCatPM(data, PMD.data, 0, 2),
...GV.validateOneCatRateHigherThanOtherCatPM(
data,
PMD.data.performanceMeasure,
0,
2
),
...GV.validateAtLeastOneRateComplete(
performanceMeasureArray,
OPM,
Expand Down
2 changes: 1 addition & 1 deletion services/ui-src/src/measures/2022/WCVCH/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const WCVCHValidation = (data: FormData) => {
const whyNotReporting = data[DC.WHY_ARE_YOU_NOT_REPORTING];
const OPM = data[DC.OPM_RATES];
const performanceMeasureArray =
GV.getPerfMeasureRateArray(data, PMD.data) ?? [];
GV.getPerfMeasureRateArray(data, PMD.data.performanceMeasure) ?? [];
const dateRange = data[DC.DATE_RANGE];
const deviationArray = GV.getDeviationNDRArray(
data.DeviationOptions,
Expand Down

0 comments on commit 9779771

Please sign in to comment.