Search in sources :

Example 41 with Detail

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

the class CpcClinicalDocumentValidatorTest method missingPracticeSiteAddress.

@Test
void missingPracticeSiteAddress() {
    Node clinicalDocumentNode = createValidCpcPlusClinicalDocument();
    clinicalDocumentNode.removeValue(ClinicalDocumentDecoder.PRACTICE_SITE_ADDR);
    cpcValidator.internalValidateSingleNode(clinicalDocumentNode);
    Set<Detail> errors = cpcValidator.getDetails();
    assertWithMessage("Must contain error").that(errors).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(ErrorCode.CPC_CLINICAL_DOCUMENT_MISSING_PRACTICE_SITE_ADDRESS);
}
Also used : Node(gov.cms.qpp.conversion.model.Node) Detail(gov.cms.qpp.conversion.model.error.Detail) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 42 with Detail

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

the class CpcClinicalDocumentValidatorTest method emptyPracticeSiteAddress.

@Test
void emptyPracticeSiteAddress() {
    Node clinicalDocumentNode = createValidCpcPlusClinicalDocument();
    clinicalDocumentNode.removeValue(ClinicalDocumentDecoder.PRACTICE_SITE_ADDR);
    clinicalDocumentNode.putValue(ClinicalDocumentDecoder.PRACTICE_SITE_ADDR, "");
    cpcValidator.internalValidateSingleNode(clinicalDocumentNode);
    Set<Detail> errors = cpcValidator.getDetails();
    assertWithMessage("Must contain error").that(errors).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(ErrorCode.CPC_CLINICAL_DOCUMENT_MISSING_PRACTICE_SITE_ADDRESS);
}
Also used : Node(gov.cms.qpp.conversion.model.Node) Detail(gov.cms.qpp.conversion.model.error.Detail) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 43 with Detail

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

the class CpcClinicalDocumentValidatorTest method validPracticeSiteAddress.

@Test
void validPracticeSiteAddress() {
    Node clinicalDocumentNode = createValidCpcPlusClinicalDocument();
    cpcValidator.internalValidateSingleNode(clinicalDocumentNode);
    Set<Detail> errors = cpcValidator.getDetails();
    assertWithMessage("Must have no errors").that(errors).isEmpty();
}
Also used : Node(gov.cms.qpp.conversion.model.Node) Detail(gov.cms.qpp.conversion.model.error.Detail) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 44 with Detail

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

the class CpcMeasureDataValidatorTest method validateFailureSupplementalDataMissingCountTest.

@Test
void validateFailureSupplementalDataMissingCountTest() throws Exception {
    String failurePayerFile = TestHelper.getFixture("failureSupplementalDataCountFile.xml");
    Node placeholder = new QrdaDecoderEngine(new Context()).decode(XmlUtils.stringToDom(failurePayerFile));
    CpcMeasureDataValidator validator = new CpcMeasureDataValidator();
    Node underTest = placeholder.findFirstNode(TemplateId.MEASURE_DATA_CMS_V2);
    validator.internalValidateSingleNode(underTest);
    LocalizedError expectedError = ErrorCode.CPC_PLUS_SUPPLEMENTAL_DATA_MISSING_COUNT.format(SupplementalData.MALE.getCode(), SubPopulationLabel.IPOP.name(), MEASURE_ID);
    Set<Detail> errors = validator.getDetails();
    assertThat(errors).comparingElementsUsing(DetailsErrorEquals.INSTANCE).contains(expectedError);
}
Also used : Context(gov.cms.qpp.conversion.Context) Node(gov.cms.qpp.conversion.model.Node) LocalizedError(gov.cms.qpp.conversion.model.error.LocalizedError) QrdaDecoderEngine(gov.cms.qpp.conversion.decode.QrdaDecoderEngine) Detail(gov.cms.qpp.conversion.model.error.Detail) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 45 with Detail

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

the class CpcMeasureDataValidatorTest method validateSuccessfulSupplementalDataFieldsTest.

@Test
void validateSuccessfulSupplementalDataFieldsTest() throws Exception {
    String successfulFile = TestHelper.getFixture("successfulSupplementalDataFile.xml");
    Node placeholder = new QrdaDecoderEngine(new Context()).decode(XmlUtils.stringToDom(successfulFile));
    CpcMeasureDataValidator validator = new CpcMeasureDataValidator();
    Node underTest = placeholder.findFirstNode(TemplateId.MEASURE_DATA_CMS_V2);
    validator.internalValidateSingleNode(underTest);
    Set<Detail> errors = validator.getDetails();
    assertThat(errors).isEmpty();
}
Also used : Context(gov.cms.qpp.conversion.Context) Node(gov.cms.qpp.conversion.model.Node) QrdaDecoderEngine(gov.cms.qpp.conversion.decode.QrdaDecoderEngine) Detail(gov.cms.qpp.conversion.model.error.Detail) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

Detail (gov.cms.qpp.conversion.model.error.Detail)123 Test (org.junit.jupiter.api.Test)108 Node (gov.cms.qpp.conversion.model.Node)105 LocalizedError (gov.cms.qpp.conversion.model.error.LocalizedError)16 Converter (gov.cms.qpp.conversion.Converter)9 AllErrors (gov.cms.qpp.conversion.model.error.AllErrors)9 TransformException (gov.cms.qpp.conversion.model.error.TransformException)9 PathSource (gov.cms.qpp.conversion.PathSource)8 ArrayList (java.util.ArrayList)6 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)6 Context (gov.cms.qpp.conversion.Context)4 Test (org.junit.Test)4 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)4 QrdaDecoderEngine (gov.cms.qpp.conversion.decode.QrdaDecoderEngine)3 FormattedErrorCode (gov.cms.qpp.conversion.model.error.FormattedErrorCode)3 Path (java.nio.file.Path)2 LinkedHashSet (java.util.LinkedHashSet)2 InputStreamSupplierSource (gov.cms.qpp.conversion.InputStreamSupplierSource)1 JsonWrapper (gov.cms.qpp.conversion.encode.JsonWrapper)1 TemplateId (gov.cms.qpp.conversion.model.TemplateId)1