use of gov.cms.qpp.conversion.model.error.Detail 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);
}
use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.
the class QualityMeasureIdValidatorTest method testInternalDenomCountEqualToIpopCount.
@Test
void testInternalDenomCountEqualToIpopCount() {
Node measureReferenceResultsNode = createCorrectMeasureReference(REQUIRES_DENOM_EXCEPTION_GUID).build();
Set<Detail> details = objectUnderTest.validateSingleNode(measureReferenceResultsNode);
assertWithMessage("There must not be any validation errors.").that(details).isEmpty();
}
use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.
the class QualityMeasureIdValidatorTest method testInvalidMeasureIdGetsThreeSuggestions.
@Test
void testInvalidMeasureIdGetsThreeSuggestions() {
String measureId = "40280381-51f0-825b-0152-22a639d8NOPE";
List<String> suggestions = Arrays.asList("40280381-51f0-825b-0152-22a639d81762", "40280381-51f0-825b-0152-227617db152e", "40280381-51f0-825b-0152-22a112d2172a");
Node measureReferenceResultsNode = new MeasureReferenceBuilder().addMeasureId(measureId).addSubPopulationMeasureDataWithCounts(SubPopulationLabel.IPOP.name(), REQUIRES_DENOM_EXCLUSION_IPOP_GUID, ONE_HUNDRED).addSubPopulationMeasureDataWithCounts(SubPopulationLabel.DENOM.name(), REQUIRES_DENOM_EXCLUSION_DENOM_GUID, ONE_HUNDRED).addSubPopulationMeasureDataWithCounts(SubPopulationLabel.NUMER.name(), REQUIRES_DENOM_EXCLUSION_NUMER_GUID, ONE_HUNDRED).addSubPopulationMeasureDataWithCounts(SubPopulationLabel.DENEX.name(), REQUIRES_DENOM_EXCLUSION_DENEX_GUID, ONE_HUNDRED).build();
Set<Detail> details = objectUnderTest.validateSingleNode(measureReferenceResultsNode);
assertWithMessage("There must be one validation errors.").that(details).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(ErrorCode.MEASURE_GUID_MISSING.format(measureId, suggestions));
}
use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.
the class QualityMeasureIdValidatorTest method testInternalDenomCountLessThanIpopCount.
@Test
void testInternalDenomCountLessThanIpopCount() {
Node measureReferenceResultsNode = createCorrectMeasureReference(REQUIRES_DENOM_EXCEPTION_GUID).removeSubPopulationMeasureData(SubPopulationLabel.DENOM.name(), REQUIRES_DENOM_EXCEPTION_DENOM_GUID).addSubPopulationMeasureDataWithCounts(SubPopulationLabel.DENOM.name(), REQUIRES_DENOM_EXCEPTION_DENOM_GUID, "50").build();
Set<Detail> details = objectUnderTest.validateSingleNode(measureReferenceResultsNode);
assertWithMessage("There must not be any validation errors.").that(details).isEmpty();
}
use of gov.cms.qpp.conversion.model.error.Detail 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);
}
Aggregations