use of gov.cms.qpp.conversion.Converter 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.Converter in project qpp-conversion-tool by CMSgov.
the class QualityMeasureScopedTest method scopedConversion.
private Node scopedConversion(QrdaScope testSection, String path) {
Converter converter = new Converter(new PathSource(Paths.get(path)));
converter.getContext().setScope(Sets.newHashSet(testSection));
converter.transform();
return converter.getReport().getDecoded();
}
use of gov.cms.qpp.conversion.Converter in project qpp-conversion-tool by CMSgov.
the class QrdaServiceImplTest method errorConverter.
private Converter errorConverter() {
Converter mockConverter = mock(Converter.class);
AllErrors allErrors = new AllErrors();
allErrors.addError(new Error(MOCK_ERROR_SOURCE_IDENTIFIER, null));
ConversionReport report = mock(ConversionReport.class);
when(report.getReportDetails()).thenReturn(allErrors);
TransformException transformException = new TransformException("mock problem", new NullPointerException(), report);
when(mockConverter.transform()).thenThrow(transformException);
return mockConverter;
}
use of gov.cms.qpp.conversion.Converter in project qpp-conversion-tool by CMSgov.
the class ValidationServiceImplTest method setup.
@BeforeAll
static void setup() throws IOException {
service = new ValidationServiceImpl(null);
pathToSubmissionError = Paths.get("src/test/resources/submissionErrorFixture.json");
pathToSubmissionDuplicateEntryError = Paths.get("src/test/resources/submissionDuplicateEntryErrorFixture.json");
Path toConvert = Paths.get("../qrda-files/valid-QRDA-III-latest.xml");
qppWrapper = new JsonWrapper(new Converter(new PathSource(toConvert)).transform(), false);
prepAllErrors();
}
use of gov.cms.qpp.conversion.Converter in project qpp-conversion-tool by CMSgov.
the class ExceptionHandlerControllerV1Test method setup.
@BeforeAll
static void setup() {
Path path = Paths.get("../qrda-files/valid-QRDA-III-latest.xml");
report = new Converter(new PathSource(path)).getReport();
report.setReportDetails(allErrors);
}
Aggregations