Search in sources :

Example 6 with LocalizedError

use of gov.cms.qpp.conversion.model.error.LocalizedError in project qpp-conversion-tool by CMSgov.

the class CpcQualityMeasureSectionValidatorTest method tooFewGroupAmeasures.

@Test
void tooFewGroupAmeasures() {
    Node node = setupMeasures(new String[] { groupAmeasures[0] });
    LocalizedError message = CpcGroupMinimum.A.makeError(groupAmeasures);
    validator.internalValidateSingleNode(node);
    assertThat(validator.getDetails()).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(message);
}
Also used : Node(gov.cms.qpp.conversion.model.Node) LocalizedError(gov.cms.qpp.conversion.model.error.LocalizedError) Test(org.junit.jupiter.api.Test)

Example 7 with LocalizedError

use of gov.cms.qpp.conversion.model.error.LocalizedError in project qpp-conversion-tool by CMSgov.

the class QualityMeasureIdValidatorTest method testInternalDenexcepMultipleSupPopulationsMissingMeasureId.

@Test
void testInternalDenexcepMultipleSupPopulationsMissingMeasureId() {
    LocalizedError countMessage = ErrorCode.POPULATION_CRITERIA_COUNT_INCORRECT.format("CMS52v5", 2, SubPopulationLabel.DENEXCEP.name(), 1);
    LocalizedError uuidMessage = ErrorCode.QUALITY_MEASURE_ID_INCORRECT_UUID.format("CMS52v5", SubPopulationLabel.DENEXCEP.name(), MULTIPLE_POPULATION_DENOM_EXCEPTION_DENEXCEP1_GUID);
    Node measureReferenceResultsNode = createCorrectMeasureReference(MULTIPLE_POPULATION_DENOM_EXCEPTION_GUID).removeSubPopulationMeasureData(SubPopulationLabel.DENEXCEP.name(), MULTIPLE_POPULATION_DENOM_EXCEPTION_DENEXCEP1_GUID).build();
    Set<Detail> details = objectUnderTest.validateSingleNode(measureReferenceResultsNode);
    assertWithMessage("Incorrect validation error.").that(details).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(countMessage, uuidMessage);
}
Also used : LocalizedError(gov.cms.qpp.conversion.model.error.LocalizedError) Node(gov.cms.qpp.conversion.model.Node) Detail(gov.cms.qpp.conversion.model.error.Detail) Test(org.junit.jupiter.api.Test)

Example 8 with LocalizedError

use of gov.cms.qpp.conversion.model.error.LocalizedError in project qpp-conversion-tool by CMSgov.

the class QualityMeasureIdValidatorTest method testInternalDenexcepMultipleSupPopulationsInvalidMeasureId.

@Test
void testInternalDenexcepMultipleSupPopulationsInvalidMeasureId() {
    LocalizedError message = ErrorCode.QUALITY_MEASURE_ID_INCORRECT_UUID.format("CMS52v5", SubPopulationLabel.DENEXCEP.name(), MULTIPLE_POPULATION_DENOM_EXCEPTION_DENEXCEP1_GUID);
    Node measureReferenceResultsNode = createCorrectMeasureReference(MULTIPLE_POPULATION_DENOM_EXCEPTION_GUID).replaceSubPopulationMeasureData(SubPopulationLabel.DENEXCEP.name(), MULTIPLE_POPULATION_DENOM_EXCEPTION_DENEXCEP1_GUID, SubPopulationLabel.DENEXCEP.name(), MULTIPLE_POPULATION_DENOM_EXCEPTION_DENEXCEP1_GUID + "INVALID").build();
    Set<Detail> details = objectUnderTest.validateSingleNode(measureReferenceResultsNode);
    assertWithMessage("Incorrect validation error.").that(details).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(message);
}
Also used : LocalizedError(gov.cms.qpp.conversion.model.error.LocalizedError) Node(gov.cms.qpp.conversion.model.Node) Detail(gov.cms.qpp.conversion.model.error.Detail) Test(org.junit.jupiter.api.Test)

Example 9 with LocalizedError

use of gov.cms.qpp.conversion.model.error.LocalizedError in project qpp-conversion-tool by CMSgov.

the class QualityMeasureIdValidatorTest method testIncorrectUuid.

@Test
void testIncorrectUuid() {
    Node measureReferenceResultsNode = createCorrectMeasureReference(MULTIPLE_POPULATION_DENOM_EXCEPTION_GUID).replaceSubPopulationMeasureData(SubPopulationLabel.NUMER.name(), MULTIPLE_POPULATION_DENOM_EXCEPTION_NUMER1_GUID, SubPopulationLabel.NUMER.name(), "incorrectUUID").build();
    Set<Detail> details = objectUnderTest.validateSingleNode(measureReferenceResultsNode);
    LocalizedError expectedErrorMessage = ErrorCode.QUALITY_MEASURE_ID_INCORRECT_UUID.format("CMS52v5", SubPopulationLabel.NUMER.name(), MULTIPLE_POPULATION_DENOM_EXCEPTION_NUMER1_GUID);
    assertWithMessage("Incorrect validation error.").that(details).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(expectedErrorMessage);
}
Also used : Node(gov.cms.qpp.conversion.model.Node) LocalizedError(gov.cms.qpp.conversion.model.error.LocalizedError) Detail(gov.cms.qpp.conversion.model.error.Detail) Test(org.junit.jupiter.api.Test)

Example 10 with LocalizedError

use of gov.cms.qpp.conversion.model.error.LocalizedError in project qpp-conversion-tool by CMSgov.

the class CheckerTest method testHasMeasuresFailure.

@Test
void testHasMeasuresFailure() {
    String measureId = "measureId";
    String expectedMeasure = "DogCow";
    String anotherMeausure1 = "asdf";
    String anotherMeausure2 = "jkl;";
    String anotherMeausure3 = "qwerty";
    LocalizedError validationError = error("measure failure");
    Node section = new Node();
    Node measure1 = new Node();
    measure1.putValue(measureId, anotherMeausure1);
    Node measure2 = new Node();
    measure2.putValue(measureId, anotherMeausure2);
    Node measure3 = new Node();
    measure3.putValue(measureId, anotherMeausure3);
    section.addChildNodes(measure1, measure2, measure3);
    Checker checker = Checker.check(section, details);
    checker.hasMeasures(validationError, expectedMeasure);
    assertWithMessage("The validation error string did not match up.").that(details).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(validationError);
}
Also used : LocalizedError(gov.cms.qpp.conversion.model.error.LocalizedError) Node(gov.cms.qpp.conversion.model.Node) Test(org.junit.jupiter.api.Test)

Aggregations

LocalizedError (gov.cms.qpp.conversion.model.error.LocalizedError)28 Test (org.junit.jupiter.api.Test)21 Node (gov.cms.qpp.conversion.model.Node)20 Detail (gov.cms.qpp.conversion.model.error.Detail)17 AllErrors (gov.cms.qpp.conversion.model.error.AllErrors)3 Converter (gov.cms.qpp.conversion.Converter)2 PathSource (gov.cms.qpp.conversion.PathSource)2 TransformException (gov.cms.qpp.conversion.model.error.TransformException)2 MeasureConfig (gov.cms.qpp.conversion.model.validation.MeasureConfig)2 ArrayList (java.util.ArrayList)2 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)2 EqualsTester (com.google.common.testing.EqualsTester)1 Context (gov.cms.qpp.conversion.Context)1 MeasureDataDecoder (gov.cms.qpp.conversion.decode.MeasureDataDecoder)1 MEASURE_POPULATION (gov.cms.qpp.conversion.decode.MeasureDataDecoder.MEASURE_POPULATION)1 PERFORMANCE_RATE_ID (gov.cms.qpp.conversion.decode.PerformanceRateProportionMeasureDecoder.PERFORMANCE_RATE_ID)1 QrdaDecoderEngine (gov.cms.qpp.conversion.decode.QrdaDecoderEngine)1 StratifierDecoder (gov.cms.qpp.conversion.decode.StratifierDecoder)1 Program (gov.cms.qpp.conversion.model.Program)1 TemplateId (gov.cms.qpp.conversion.model.TemplateId)1