Search in sources :

Example 1 with LocalizedError

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

the class QualityMeasureIdMultiRoundTripTest method testRoundTripForQualityMeasureIdWithNoDenomMeasureType.

@Test
void testRoundTripForQualityMeasureIdWithNoDenomMeasureType() {
    LocalizedError error = ErrorCode.POPULATION_CRITERIA_COUNT_INCORRECT.format("CMS52v5", 3, SubPopulationLabel.DENOM.name(), 2);
    String path = "/ClinicalDocument/component/structuredBody/component/section/entry/organizer/" + "component[5]/observation/value/@code";
    List<Detail> details = executeScenario(path, true);
    assertThat(details).comparingElementsUsing(DetailsErrorEquals.INSTANCE).contains(error);
}
Also used : LocalizedError(gov.cms.qpp.conversion.model.error.LocalizedError) Detail(gov.cms.qpp.conversion.model.error.Detail) Test(org.junit.jupiter.api.Test)

Example 2 with LocalizedError

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

the class QualityMeasureIdRoundTripTest method testMeasureCMS52v5InsensitiveMeasureDataUuid.

@Test
void testMeasureCMS52v5InsensitiveMeasureDataUuid() {
    Converter converter = new Converter(new PathSource(INSENSITIVE_TEXT_FILE));
    List<Detail> details = new ArrayList<>();
    LocalizedError error = ErrorCode.QUALITY_MEASURE_ID_INCORRECT_UUID.format("CMS52v5", "DENOM", "04BF53CE-6993-4EA2-BFE5-66E36172B388");
    try {
        converter.transform();
    } catch (TransformException exception) {
        AllErrors errors = exception.getDetails();
        details.addAll(errors.getErrors().get(0).getDetails());
    }
    assertThat(details).comparingElementsUsing(DetailsErrorEquals.INSTANCE).doesNotContain(error);
}
Also used : AllErrors(gov.cms.qpp.conversion.model.error.AllErrors) PathSource(gov.cms.qpp.conversion.PathSource) LocalizedError(gov.cms.qpp.conversion.model.error.LocalizedError) ArrayList(java.util.ArrayList) TransformException(gov.cms.qpp.conversion.model.error.TransformException) Converter(gov.cms.qpp.conversion.Converter) Detail(gov.cms.qpp.conversion.model.error.Detail) Test(org.junit.jupiter.api.Test)

Example 3 with LocalizedError

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

the class QualityMeasureIdValidator method addMeasureConfigurationValidationMessage.

/**
 * Adds a validation error message for a specified measure configuration
 *
 * @param check Current SubPopulation to be validated
 * @param keys Identifiers for the current measures child
 * @param node Contains the current child nodes
 */
protected void addMeasureConfigurationValidationMessage(Supplier<String> check, String[] keys, Node node) {
    LocalizedError error = ErrorCode.QUALITY_MEASURE_ID_INCORRECT_UUID.format(MeasureConfigHelper.getMeasureConfig(node).getElectronicMeasureId(), String.join(",", keys), check.get());
    addValidationError(Detail.forErrorAndNode(error, node));
}
Also used : LocalizedError(gov.cms.qpp.conversion.model.error.LocalizedError)

Example 4 with LocalizedError

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

the class CpcQualityMeasureScopedValidatonTest method validateCms137V5FailMissingMeasure.

@Test
void validateCms137V5FailMissingMeasure() {
    Node result = scopedConversion(QrdaScope.MEASURE_REFERENCE_RESULTS_CMS_V2, "cms137v5_MissingMeasure.xml");
    Set<Detail> details = validateNode(result);
    LocalizedError message = ErrorCode.QUALITY_MEASURE_ID_INCORRECT_UUID.format("CMS137v5", "IPP,IPOP", "EC2C5F63-AF76-4D3C-85F0-5423F8C28541");
    assertWithMessage("Missing CMS137v5 IPOP strata should result in errors").that(details).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(message);
}
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 5 with LocalizedError

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

the class CpcQualityMeasureSectionValidatorTest method missingGroupAmeasures.

@Test
void missingGroupAmeasures() {
    Node node = new Node();
    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)

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