use of gov.cms.qpp.conversion.model.error.AllErrors in project qpp-conversion-tool by CMSgov.
the class QualityMeasureIdRoundTripTest method testMeasureCMS160v5PerformanceRateUuid.
@Test
void testMeasureCMS160v5PerformanceRateUuid() {
Converter converter = new Converter(new PathSource(INVALID_PERFORMANCE_UUID_FILE));
List<Detail> details = new ArrayList<>();
try {
converter.transform();
} catch (TransformException exception) {
AllErrors errors = exception.getDetails();
details.addAll(errors.getErrors().get(0).getDetails());
}
assertThat(details).comparingElementsUsing(DetailsErrorEquals.INSTANCE).contains(ErrorCode.QUALITY_MEASURE_ID_MISSING_SINGLE_PERFORMANCE_RATE);
}
use of gov.cms.qpp.conversion.model.error.AllErrors in project qpp-conversion-tool by CMSgov.
the class QualityMeasureIdRoundTripTest method testMeasureCMS52v5WithInsensitiveTextUuid.
@Test
void testMeasureCMS52v5WithInsensitiveTextUuid() {
Converter converter = new Converter(new PathSource(INSENSITIVE_TEXT_FILE));
List<Detail> details = new ArrayList<>();
try {
converter.transform();
} catch (TransformException exception) {
AllErrors errors = exception.getDetails();
details.addAll(errors.getErrors().get(0).getDetails());
}
assertThat(details).comparingElementsUsing(DetailsErrorEquals.INSTANCE).doesNotContain(ErrorCode.MEASURE_GUID_MISSING);
}
use of gov.cms.qpp.conversion.model.error.AllErrors in project qpp-conversion-tool by CMSgov.
the class MarkupManipulationHandler method executeScenario.
public List<Detail> executeScenario(String xpath, boolean remove) {
InputStream inStream = manipulator.upsetTheNorm(xpath, remove);
Converter converter = new Converter(new InputStreamSupplierSource(xpath, inStream));
try {
converter.transform();
} catch (TransformException exception) {
AllErrors errors = exception.getDetails();
return errors.getErrors().stream().map(Error::getDetails).flatMap(List::stream).collect(Collectors.toList());
}
return Collections.emptyList();
}
use of gov.cms.qpp.conversion.model.error.AllErrors in project qpp-conversion-tool by CMSgov.
the class QrdaServiceImplTest method testConvertQrda3ToQppError.
@Test
void testConvertQrda3ToQppError() {
TransformException exception = assertThrows(TransformException.class, () -> objectUnderTest.convertQrda3ToQpp(MOCK_ERROR_QRDA_SOURCE));
AllErrors allErrors = exception.getDetails();
assertThat(allErrors.getErrors().get(0).getSourceIdentifier()).isSameAs(MOCK_ERROR_SOURCE_IDENTIFIER);
}
use of gov.cms.qpp.conversion.model.error.AllErrors in project qpp-conversion-tool by CMSgov.
the class ConversionFileWriterWrapper method executeConverter.
/**
* Execute the converter and do initial handling of the result.
*
* @param converter The Converter to execute.
*/
private void executeConverter(Converter converter) {
try {
JsonWrapper jsonWrapper = converter.transform();
Path outFile = getOutputFile(source.getName(), true);
DEV_LOG.info("Successful conversion. Writing out QPP to {}", outFile.toString());
writeOutQpp(jsonWrapper, outFile);
} catch (TransformException exception) {
AllErrors allErrors = exception.getDetails();
Path outFile = getOutputFile(source.getName(), false);
DEV_LOG.warn("There were errors during conversion. Writing out errors to " + outFile.toString(), exception);
writeOutErrors(allErrors, outFile);
}
}
Aggregations