Search in sources :

Example 16 with LocalizedError

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

the class QualityMeasureIdValidatorTest method testTooManyCriteriaExists.

@Test
void testTooManyCriteriaExists() {
    Node measureReferenceResultsNode = createCorrectMeasureReference(MULTIPLE_POPULATION_DENOM_EXCEPTION_GUID).addSubPopulationMeasureDataWithCounts(SubPopulationLabel.NUMER.name(), MULTIPLE_POPULATION_DENOM_EXCEPTION_NUMER1_GUID, ONE_HUNDRED).build();
    Set<Detail> details = objectUnderTest.validateSingleNode(measureReferenceResultsNode);
    LocalizedError expectedErrorMessage = ErrorCode.POPULATION_CRITERIA_COUNT_INCORRECT.format("CMS52v5", 3, SubPopulationLabel.NUMER.name(), 4);
    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 17 with LocalizedError

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

the class QualityMeasureIdValidatorTest method testPerformanceRateMultipleUuidFail.

@Test
void testPerformanceRateMultipleUuidFail() {
    Node measureReferenceResultsNode = createCorrectMeasureReference(MULTIPLE_POPULATION_DENOM_EXCEPTION_GUID).replaceSubPopulationPerformanceRate(MULTIPLE_POPULATION_DENOM_EXCEPTION_NUMER1_GUID, "fail1").build();
    Set<Detail> details = objectUnderTest.validateSingleNode(measureReferenceResultsNode);
    String expectedUuids = StringHelper.join(Lists.newArrayList(MULTIPLE_POPULATION_DENOM_EXCEPTION_NUMER1_GUID, MULTIPLE_POPULATION_DENOM_EXCEPTION_NUMER3_GUID, MULTIPLE_POPULATION_DENOM_EXCEPTION_NUMER2_GUID), ",", "or");
    LocalizedError expectedErrorMessage = ErrorCode.QUALITY_MEASURE_ID_INCORRECT_UUID.format("CMS52v5", PERFORMANCE_RATE_ID, expectedUuids);
    assertWithMessage("Must contain the correct error message.").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 18 with LocalizedError

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

the class QualityMeasureIdValidatorTest method testInternalMissingDenexcepMeasure.

@Test
void testInternalMissingDenexcepMeasure() {
    LocalizedError countMessage = ErrorCode.POPULATION_CRITERIA_COUNT_INCORRECT.format("CMS68v6", 1, SubPopulationLabel.DENEXCEP.name(), 0);
    LocalizedError uuidMessage = ErrorCode.QUALITY_MEASURE_ID_INCORRECT_UUID.format("CMS68v6", SubPopulationLabel.DENEXCEP.name(), REQUIRES_DENOM_EXCEPTION_DENEXCEP_GUID);
    Node measureReferenceResultsNode = createCorrectMeasureReference(REQUIRES_DENOM_EXCEPTION_GUID).removeSubPopulationMeasureData(SubPopulationLabel.DENEXCEP.name(), REQUIRES_DENOM_EXCEPTION_DENEXCEP_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 19 with LocalizedError

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

the class QualityMeasureIdValidatorTest method testTooFewCriteriaExists.

@Test
void testTooFewCriteriaExists() {
    Node measureReferenceResultsNode = createCorrectMeasureReference(MULTIPLE_POPULATION_DENOM_EXCEPTION_GUID).removeSubPopulationMeasureData(SubPopulationLabel.NUMER.name(), MULTIPLE_POPULATION_DENOM_EXCEPTION_NUMER1_GUID).build();
    Set<Detail> details = objectUnderTest.validateSingleNode(measureReferenceResultsNode);
    LocalizedError expectedErrorMessage = ErrorCode.POPULATION_CRITERIA_COUNT_INCORRECT.format("CMS52v5", 3, SubPopulationLabel.NUMER.name(), 2);
    LocalizedError expectedUuidErrorMessage = 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, expectedUuidErrorMessage);
}
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 20 with LocalizedError

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

the class QualityMeasureIdValidatorTest method testDenominatorExclusionMissing.

@Test
void testDenominatorExclusionMissing() {
    LocalizedError incorrectCount = ErrorCode.POPULATION_CRITERIA_COUNT_INCORRECT.format("CMS165v5", 1, SubPopulationLabel.DENEX.name(), 0);
    LocalizedError incorrectUuid = ErrorCode.QUALITY_MEASURE_ID_INCORRECT_UUID.format("CMS165v5", SubPopulationLabel.DENEX.name(), REQUIRES_DENOM_EXCLUSION_DENEX_GUID);
    Node measureReferenceResultsNode = createCorrectMeasureReference(REQUIRES_DENOM_EXCLUSION_GUID).removeSubPopulationMeasureData(SubPopulationLabel.DENEX.name(), REQUIRES_DENOM_EXCLUSION_DENEX_GUID).build();
    Set<Detail> details = objectUnderTest.validateSingleNode(measureReferenceResultsNode);
    assertWithMessage("Incorrect validation error.").that(details).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(incorrectCount, incorrectUuid);
}
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)

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