use of gov.cms.qpp.conversion.model.error.AllErrors in project qpp-conversion-tool by CMSgov.
the class ClinicalDocumentValidatorTest method testClinicalDocumentValidationParsesMultipleErrors.
@Test
void testClinicalDocumentValidationParsesMultipleErrors() {
// setup
Path path = Paths.get("src/test/resources/negative/angerClinicalDocumentValidations.xml");
// execute
Context context = new Context();
context.setDoDefaults(true);
Converter converter = new Converter(new PathSource(path), context);
AllErrors allErrors = new AllErrors();
try {
converter.transform();
} catch (TransformException exception) {
allErrors = exception.getDetails();
}
List<Detail> errors = getErrors(allErrors);
assertWithMessage("Must have 4 errors").that(errors).hasSize(4);
assertWithMessage("Must contain the correct errors").that(errors).comparingElementsUsing(DetailsErrorEquals.INSTANCE).containsAllOf(ErrorCode.CLINICAL_DOCUMENT_MISSING_PROGRAM_NAME, ErrorCode.REPORTING_PARAMETERS_MUST_CONTAIN_SINGLE_PERFORMANCE_START);
}
use of gov.cms.qpp.conversion.model.error.AllErrors in project qpp-conversion-tool by CMSgov.
the class ConversionReport method constructErrorHierarchy.
/**
* Constructs an {@link AllErrors} from all the validation errors.
*
* Currently consists of only a single {@link Error}.
*
* @param inputIdentifier An identifier for a source of QRDA3 XML.
* @param details A list of validation errors.
* @return All the errors.
*/
private AllErrors constructErrorHierarchy(final String inputIdentifier, final List<Detail> details) {
AllErrors errors = new AllErrors();
errors.addError(constructErrorSource(inputIdentifier, details));
return errors;
}
use of gov.cms.qpp.conversion.model.error.AllErrors in project qpp-conversion-tool by CMSgov.
the class ConversionReportTest method getErrorStream.
@Test
void getErrorStream() {
Converter converter = new Converter(new PathSource(Paths.get("../qrda-files/valid-QRDA-III-latest.xml")));
ConversionReport badReport = converter.getReport();
Error error = new Error();
error.setMessage("meep");
AllErrors errors = new AllErrors();
errors.addError(error);
badReport.setReportDetails(errors);
AllErrors echo = JsonHelper.readJson(badReport.getValidationErrorsSource().toInputStream(), AllErrors.class);
assertThat(echo.toString()).isEqualTo(errors.toString());
}
use of gov.cms.qpp.conversion.model.error.AllErrors in project qpp-conversion-tool by CMSgov.
the class CpcPlusAcceptanceTest method testCpcPlusFileSuccesses.
@ParameterizedTest
@MethodSource("successData")
void testCpcPlusFileSuccesses(Path entry) {
AllErrors errors = null;
Converter converter = new Converter(new PathSource(entry));
try {
converter.transform();
} catch (TransformException failure) {
errors = failure.getDetails();
}
assertThat(errors).isNull();
}
use of gov.cms.qpp.conversion.model.error.AllErrors 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);
}
Aggregations