Skip to content

Commit

Permalink
Merge branch 'develop' into feature/QPPSE-2784-Remove_Duplicate_Error…
Browse files Browse the repository at this point in the history
…_Details
  • Loading branch information
sivaksb authored Nov 6, 2024
2 parents 245b7de + 050f4a6 commit 2c9fecd
Show file tree
Hide file tree
Showing 23 changed files with 332 additions and 2,223 deletions.
170 changes: 85 additions & 85 deletions ERROR_MESSAGES.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public enum DocumentationReference {
PRACTICE_SITE_ADDRESS(22),
REPORTING_PARAMETERS_ACT(17),
MEASURE_IDS(43),
MEASURE_REFERENCE(36),
CEHRT(22);

private static final String BASE_PATH = "https://ecqi.healthit.gov/sites/default/files/2024-CMS-QRDA-III-EC-IG-v1.1-508.pdf#page=";
Expand Down
377 changes: 184 additions & 193 deletions commons/src/main/java/gov/cms/qpp/conversion/model/error/ProblemCode.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ protected void performValidation(final Node node) {
String programName = Optional.ofNullable(node.getValue(PROGRAM_NAME)).orElse("<missing>");
String entityType = Optional.ofNullable(node.getValue(ENTITY_TYPE)).orElse("<missing>");

forceCheckErrors(node).valueIn(ProblemCode.CLINICAL_DOCUMENT_INCORRECT_PROGRAM_NAME.format(programName, VALID_PROGRAM_NAMES),
forceCheckErrors(node).valueIn(ProblemCode.CLINICAL_DOCUMENT_INCORRECT_PROGRAM_NAME.format(VALID_PROGRAM_NAMES, programName),
PROGRAM_NAME, MIPS_PROGRAM_NAME, PCF, APP_PROGRAM_NAME);

if (ENTITY_VIRTUAL_GROUP.equals(entityType)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private void validateAggregateCount(Node aggregateCountNode) {
}

private LocalizedProblem format(ProblemCode error) {
return error.format(nodeName, nodeName);
return error.format(nodeName);
}

private LocalizedProblem format(ProblemCode error, String value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ protected void performValidation(Node node) {
}

Checker checker = checkErrors(node)
.hasChildren(ProblemCode.MEASURE_PERFORMED_MISSING_AGGREGATE_COUNT.format(populationId, Context.REPORTING_YEAR))
.childExact(ProblemCode.MEASURE_PERFORMED_MISSING_AGGREGATE_COUNT.format(populationId, Context.REPORTING_YEAR),
.hasChildren(ProblemCode.MEASURE_PERFORMED_MISSING_AGGREGATE_COUNT.format(populationId))
.childExact(ProblemCode.MEASURE_PERFORMED_MISSING_AGGREGATE_COUNT.format(populationId),
1, TemplateId.PI_AGGREGATE_COUNT);

if (!checker.shouldShortcut()) {
Expand All @@ -48,7 +48,7 @@ protected void performValidation(Node node) {
DuplicationCheckHelper.calculateDuplications(child, AGGREGATE_COUNT)),
AGGREGATE_COUNT)
.intValue(ProblemCode.AGGREGATE_COUNT_VALUE_NOT_INTEGER, AGGREGATE_COUNT)
.greaterThan(ProblemCode.MEASURE_DATA_VALUE_NOT_INTEGER.format(populationId, Context.REPORTING_YEAR), -1);
.greaterThan(ProblemCode.MEASURE_DATA_VALUE_NOT_INTEGER.format(populationId), -1);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ private void validateSubmissionDate(Node node) {
String formatted = endDate.format(OUTPUT_END_DATE_FORMAT);
String program = node.getValue(PROGRAM_NAME);
addError(Detail.forProblemAndNode(
ProblemCode.PCF_SUBMISSION_ENDED.format(program, program, formatted, program, program,
ProblemCode.PCF_SUBMISSION_ENDED.format(program, formatted, program, program, program,
EnvironmentHelper.getOrDefault(CPC_PLUS_CONTACT_EMAIL, DEFAULT_CPC_PLUS_CONTACT_EMAIL)),
node));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ private void addSupplementalValidationError(Node node, SupplementalData suppleme
LocalizedProblem error =
ProblemCode.PCF_MISSING_SUPPLEMENTAL_CODE.format(
supplementalData.getType(), supplementalData, supplementalData.getCode(),
measureId, node.getValue(MEASURE_TYPE));
node.getValue(MEASURE_TYPE), measureId);
addError(Detail.forProblemAndNode(error, node));
}

Expand All @@ -128,7 +128,6 @@ private void addSupplementalValidationError(Node node, SupplementalData suppleme
*/
private LocalizedProblem makeIncorrectCountSizeLocalizedError(Node node, String supplementalCode, String measureId) {
return ProblemCode.PCF_SUPPLEMENTAL_DATA_MISSING_COUNT.format(
supplementalCode, node.getValue(MEASURE_TYPE),
measureId);
measureId, supplementalCode, node.getValue(MEASURE_TYPE));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected void performValidation(Node node) {
forceCheckErrors(node)
.childExact(
ProblemCode.PCF_QUALITY_MEASURE_ID_INVALID_PERFORMANCE_RATE_COUNT
.format(requiredPerformanceRateCount, MeasureConfigHelper.getPrioritizedId(node)),
.format(MeasureConfigHelper.getPrioritizedId(node), requiredPerformanceRateCount),
requiredPerformanceRateCount, TemplateId.PERFORMANCE_RATE_PROPORTION_MEASURE);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ private void validateCpcDenominatorCount(Node denomCount, Node ipopCount, String
.incompleteValidation()
.intValue(ProblemCode.AGGREGATE_COUNT_VALUE_NOT_INTEGER,
AGGREGATE_COUNT)
.valueIn(ProblemCode.PCF_DENOMINATOR_COUNT_INVALID.format(program, denominatorUuid, Context.REPORTING_YEAR), AGGREGATE_COUNT,
.valueIn(ProblemCode.PCF_DENOMINATOR_COUNT_INVALID.format(program, denominatorUuid), AGGREGATE_COUNT,
ipopCount.getValue(AGGREGATE_COUNT));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ void testMissingPerfDenomAggregateCount() {

String populationId = "F50E5334-415D-482F-A30D-0623C082B602";

LocalizedProblem error = ProblemCode.MEASURE_PERFORMED_MISSING_AGGREGATE_COUNT.format(populationId, Context.REPORTING_YEAR);
LocalizedProblem error = ProblemCode.MEASURE_PERFORMED_MISSING_AGGREGATE_COUNT.format(populationId);
assertThat(details).comparingElementsUsing(DetailsErrorEquals.INSTANCE)
.contains(error);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,6 @@ void testNoChildEncoder() throws EncodeException {
.hasSize(1);
assertWithMessage("The validation error must be the inability to find an encoder")
.that(objectUnderTest.getErrors().get(0).getMessage())
.isEqualTo(ProblemCode.CT_LABEL + "Failed to find an encoder");
.isEqualTo(ProblemCode.ENCODER_MISSING.getMessage());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ void testInternalEncodeWithNoChildren() {

assertThat(piSectionEncoder.getErrors()).isNotNull();
assertThat(piSectionEncoder.getErrors().get(0).getMessage())
.isEqualTo(ProblemCode.CT_LABEL + "Failed to find an encoder");
.isEqualTo(ProblemCode.ENCODER_MISSING.getMessage());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void noChildrenTest() {
assertWithMessage("No Children Validation Error not issued")
.that(errors).comparingElementsUsing(DetailsErrorEquals.INSTANCE)
.containsExactly(ProblemCode.NUMERATOR_DENOMINATOR_CHILD_EXACT
.format(AciDenominatorValidator.DENOMINATOR_NAME, AciDenominatorValidator.DENOMINATOR_NAME));
.format(AciDenominatorValidator.DENOMINATOR_NAME));
}

@Test
Expand All @@ -67,7 +67,7 @@ void incorrectChildrenTest() {
assertWithMessage("Incorrect child Validation Error not issued")
.that(errors).comparingElementsUsing(DetailsErrorEquals.INSTANCE)
.containsExactly(ProblemCode.NUMERATOR_DENOMINATOR_CHILD_EXACT.format(
AciDenominatorValidator.DENOMINATOR_NAME, AciDenominatorValidator.DENOMINATOR_NAME));
AciDenominatorValidator.DENOMINATOR_NAME));

}

Expand All @@ -89,7 +89,7 @@ void tooManyChildrenTest() {
assertWithMessage("Too many children Validation Error not issued")
.that(errors).comparingElementsUsing(DetailsErrorEquals.INSTANCE)
.containsExactly(ProblemCode.NUMERATOR_DENOMINATOR_CHILD_EXACT.format(
AciDenominatorValidator.DENOMINATOR_NAME, AciDenominatorValidator.DENOMINATOR_NAME));
AciDenominatorValidator.DENOMINATOR_NAME));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void noChildrenTest() {
.that(errors)
.comparingElementsUsing(DetailsErrorEquals.INSTANCE)
.containsExactly(ProblemCode.NUMERATOR_DENOMINATOR_CHILD_EXACT
.format(AciNumeratorValidator.NUMERATOR_NAME, AciNumeratorValidator.NUMERATOR_NAME));
.format(AciNumeratorValidator.NUMERATOR_NAME));
}

@Test
Expand Down Expand Up @@ -90,7 +90,7 @@ void tooManyChildrenTest() {
assertWithMessage("Too many children Validation Error not issued")
.that(errors).comparingElementsUsing(DetailsErrorEquals.INSTANCE)
.containsExactly(ProblemCode.NUMERATOR_DENOMINATOR_CHILD_EXACT.format(
AciNumeratorValidator.NUMERATOR_NAME, AciNumeratorValidator.NUMERATOR_NAME));
AciNumeratorValidator.NUMERATOR_NAME));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ void testInvalidProgramName() {

assertWithMessage("Must contain the error")
.that(errors).comparingElementsUsing(DetailsErrorEquals.INSTANCE)
.containsExactly(ProblemCode.CLINICAL_DOCUMENT_INCORRECT_PROGRAM_NAME.format(invalidProgramName, ClinicalDocumentValidator.VALID_PROGRAM_NAMES));
.containsExactly(ProblemCode.CLINICAL_DOCUMENT_INCORRECT_PROGRAM_NAME.format(ClinicalDocumentValidator.VALID_PROGRAM_NAMES, invalidProgramName));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void missingAggregateCount() {
List<Detail> errors = validator.validateSingleNode(testNode).getErrors();
assertWithMessage("missing error")
.that(errors).comparingElementsUsing(DetailsErrorEquals.INSTANCE)
.containsExactly(ProblemCode.MEASURE_PERFORMED_MISSING_AGGREGATE_COUNT.format(EMPTY_POPULATION_ID, Context.REPORTING_YEAR));
.containsExactly(ProblemCode.MEASURE_PERFORMED_MISSING_AGGREGATE_COUNT.format(EMPTY_POPULATION_ID));
}

@Test
Expand Down Expand Up @@ -86,7 +86,7 @@ void negativeAggregateCountsFails() throws Exception {
List<Detail> errors = validator.validateSingleNode(testNode).getErrors();
assertWithMessage("missing error")
.that(errors).comparingElementsUsing(DetailsErrorEquals.INSTANCE)
.containsExactly(ProblemCode.MEASURE_DATA_VALUE_NOT_INTEGER.format(EMPTY_POPULATION_ID, Context.REPORTING_YEAR));
.containsExactly(ProblemCode.MEASURE_DATA_VALUE_NOT_INTEGER.format(EMPTY_POPULATION_ID));
}

@Test
Expand All @@ -109,7 +109,7 @@ void multipleNegativeMeasureDataTest() {
.that(errors).comparingElementsUsing(DetailsErrorEquals.INSTANCE)
.containsAtLeast(ProblemCode.AGGREGATE_COUNT_VALUE_NOT_INTEGER,
ProblemCode.AGGREGATE_COUNT_VALUE_NOT_SINGULAR.format(TemplateId.MEASURE_DATA_CMS_V4.name(), 2),
ProblemCode.MEASURE_DATA_VALUE_NOT_INTEGER.format("58347456-D1F3-4BBB-9B35-5D42825A0AB3", Context.REPORTING_YEAR));
ProblemCode.MEASURE_DATA_VALUE_NOT_INTEGER.format("58347456-D1F3-4BBB-9B35-5D42825A0AB3"));
}

private List<Detail> getErrors(AllErrors content) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void testFailureSupplementalDataMissingCountTest() throws Exception {
List<Detail> errors = validator.validateSingleNode(underTest).getErrors();

LocalizedProblem expectedError = ProblemCode.PCF_SUPPLEMENTAL_DATA_MISSING_COUNT.format(
SupplementalData.MALE.getCode(), SubPopulationLabel.IPOP.name(), MEASURE_ID);
MEASURE_ID, SupplementalData.MALE.getCode(), SubPopulationLabel.IPOP.name());

assertThat(errors).comparingElementsUsing(DetailsErrorEquals.INSTANCE)
.contains(expectedError);
Expand Down Expand Up @@ -117,7 +117,7 @@ private Consumer<SupplementalData> supplementalDataCheck(final String scenarioFi

LocalizedProblem expectedError = ProblemCode.PCF_MISSING_SUPPLEMENTAL_CODE
.format(supplementalData.getType(), supplementalData, supplementalData.getCode(),
MEASURE_ID, SubPopulationLabel.IPOP.name());
SubPopulationLabel.IPOP.name(), MEASURE_ID);

assertThat(errors).comparingElementsUsing(DetailsErrorEquals.INSTANCE)
.contains(expectedError);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void testPerformanceCountWithNoErrors() {
assertWithMessage("Must contain 0 invalid performance rate count errors")
.that(details).comparingElementsUsing(DetailsErrorEquals.INSTANCE)
.doesNotContain(ProblemCode.PCF_QUALITY_MEASURE_ID_INVALID_PERFORMANCE_RATE_COUNT
.format(2, E_MEASURE_ID));
.format(E_MEASURE_ID, 2));
}

@Test
Expand All @@ -59,7 +59,7 @@ void testPerformanceCountWithIncreasedSizeError() {
assertWithMessage("Must contain 2 invalid performance rate count errors")
.that(details).comparingElementsUsing(DetailsErrorEquals.INSTANCE)
.contains(ProblemCode.PCF_QUALITY_MEASURE_ID_INVALID_PERFORMANCE_RATE_COUNT
.format(2, E_MEASURE_ID));
.format(E_MEASURE_ID, 2));
}

@Test
Expand All @@ -70,7 +70,7 @@ void testPerformanceCountWithDecreasedSizeError() {
assertWithMessage("Must contain 2 invalid performance rate count errors")
.that(details).comparingElementsUsing(DetailsErrorEquals.INSTANCE)
.contains(ProblemCode.PCF_QUALITY_MEASURE_ID_INVALID_PERFORMANCE_RATE_COUNT
.format(2, E_MEASURE_ID));
.format(E_MEASURE_ID, 2));
}

@Test
Expand Down
Loading

0 comments on commit 2c9fecd

Please sign in to comment.