use of gov.cms.qpp.conversion.Converter in project qpp-conversion-tool by CMSgov.
the class QrdaServiceImpl method convertQrda3ToQpp.
/**
* Converts a given a input stream with to conversion result content
*
* @param source Object to be converted
* @return Results of the conversion
*/
@Override
public ConversionReport convertQrda3ToQpp(Source source) {
Converter converter = initConverter(source);
API_LOG.info("Performing QRDA3 to QPP conversion");
converter.transform();
return converter.getReport();
}
use of gov.cms.qpp.conversion.Converter in project qpp-conversion-tool by CMSgov.
the class AggregateCountFailureTest method testInvalidAggregateCounts.
@Test
void testInvalidAggregateCounts() throws IOException {
// execute
Converter converter = new Converter(new PathSource(Paths.get("src/test/resources/negative/angerTheConverter.xml")));
String errorContent = "";
try {
converter.transform();
Assertions.fail("A transformation exception must have been thrown!");
} catch (TransformException exception) {
AllErrors errors = exception.getDetails();
ObjectWriter jsonObjectWriter = new ObjectMapper().setSerializationInclusion(JsonInclude.Include.NON_NULL).writer().withDefaultPrettyPrinter();
errorContent = jsonObjectWriter.writeValueAsString(errors);
}
// assert
assertWithMessage("The error file flags a aggregate count type error").that(errorContent).contains(ErrorCode.NUMERATOR_DENOMINATOR_MUST_BE_INTEGER.format("Numerator").getMessage());
assertWithMessage("The error file flags a aggregate count value error").that(errorContent).contains(ErrorCode.NUMERATOR_DENOMINATOR_INVALID_VALUE.format("Denominator").getMessage());
}
use of gov.cms.qpp.conversion.Converter in project qpp-conversion-tool by CMSgov.
the class CpcQualityMeasureScopedValidatonTest method scopedConversion.
private Node scopedConversion(QrdaScope testSection, String path) {
Converter converter = new Converter(new PathSource(baseDir.resolve(path)));
converter.getContext().setScope(Sets.newHashSet(testSection));
converter.transform();
return converter.getReport().getDecoded().findFirstNode(TemplateId.MEASURE_REFERENCE_RESULTS_CMS_V2);
}
use of gov.cms.qpp.conversion.Converter 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.Converter in project qpp-conversion-tool by CMSgov.
the class CpcTest method historicalFull.
@Test
void historicalFull() {
Assertions.assertThrows(TransformException.class, () -> {
Converter converter = new Converter(new PathSource(Paths.get(CPC_FILE)));
converter.transform();
});
}
Aggregations