use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.
the class IaSectionValidatorTest method testTooManyReportingParameters.
@Test
void testTooManyReportingParameters() {
Node invalidParamActNode = new Node(TemplateId.REPORTING_PARAMETERS_ACT);
iaSectionNode.addChildNodes(iaMeasureNode, reportingParamActNode, invalidParamActNode);
Set<Detail> errors = validatorIaSection();
assertWithMessage("Must contain correct children").that(errors).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(ErrorCode.IA_SECTION_MISSING_REPORTING_PARAM);
}
use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.
the class MeasureDataValidatorTest method missingAggregateCount.
@Test
void missingAggregateCount() throws Exception {
Node testNode = new Node(TemplateId.MEASURE_DATA_CMS_V2);
MeasureDataValidator validator = new MeasureDataValidator();
validator.internalValidateSingleNode(testNode);
Set<Detail> errors = validator.getDetails();
assertWithMessage("missing error").that(errors).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(ErrorCode.MEASURE_PERFORMED_MISSING_AGGREGATE_COUNT);
}
use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.
the class MeasureDataValidatorTest method negativeAggregateCountsFails.
@Test
void negativeAggregateCountsFails() throws Exception {
Node aggregateCount = new Node(TemplateId.ACI_AGGREGATE_COUNT);
aggregateCount.putValue("aggregateCount", "-1");
Node testNode = new Node(TemplateId.MEASURE_DATA_CMS_V2);
testNode.addChildNodes(aggregateCount);
MeasureDataValidator validator = new MeasureDataValidator();
validator.internalValidateSingleNode(testNode);
Set<Detail> errors = validator.getDetails();
assertWithMessage("missing error").that(errors).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsExactly(ErrorCode.MEASURE_DATA_VALUE_NOT_INTEGER);
}
use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.
the class MeasureDataValidatorTest method multipleNegativeMeasureDataTest.
@Test
void multipleNegativeMeasureDataTest() throws Exception {
// setup
Path path = Paths.get("src/test/resources/negative/angerMeasureDataValidations.xml");
// execute
Converter converter = new Converter(new PathSource(path));
AllErrors allErrors = new AllErrors();
try {
converter.transform();
} catch (TransformException exception) {
allErrors = exception.getDetails();
}
List<Detail> errors = getErrors(allErrors);
assertWithMessage("Must contain the error").that(errors).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsAllOf(ErrorCode.AGGREGATE_COUNT_VALUE_NOT_INTEGER, ErrorCode.AGGREGATE_COUNT_VALUE_NOT_SINGULAR, ErrorCode.MEASURE_DATA_VALUE_NOT_INTEGER);
}
use of gov.cms.qpp.conversion.model.error.Detail in project qpp-conversion-tool by CMSgov.
the class MeasureDataValidatorTest method internalValidateSingleNode.
@Test
void internalValidateSingleNode() throws Exception {
String happy = TestHelper.getFixture("measureDataHappy.xml");
Node placeholder = new QrdaDecoderEngine(new Context()).decode(XmlUtils.stringToDom(happy));
MeasureDataValidator validator = new MeasureDataValidator();
Node underTest = placeholder.findFirstNode(TemplateId.MEASURE_DATA_CMS_V2);
validator.internalValidateSingleNode(underTest);
Set<Detail> errors = validator.getDetails();
assertWithMessage("Expect no errors on the happy path").that(errors).isEmpty();
}
Aggregations