use of gov.cms.qpp.conversion.encode.JsonWrapper in project qpp-conversion-tool by CMSgov.
the class IaSectionRoundTripTest method testIaSectionConvertsIaCategory.
@Test
void testIaSectionConvertsIaCategory() {
Converter converter = new Converter(new PathSource(file));
JsonWrapper qpp = converter.transform();
String iaCategory = JsonHelper.readJsonAtJsonPath(qpp.toString(), "$.measurementSets[2].category", String.class);
assertWithMessage("Must contain a category").that(iaCategory).isEqualTo("ia");
}
use of gov.cms.qpp.conversion.encode.JsonWrapper in project qpp-conversion-tool by CMSgov.
the class IaSectionRoundTripTest method testIaSectionConvertsMeasurePerformed.
@Test
void testIaSectionConvertsMeasurePerformed() {
Converter converter = new Converter(new PathSource(file));
JsonWrapper qpp = converter.transform();
Boolean measurePerformed = JsonHelper.readJsonAtJsonPath(qpp.toString(), "$.measurementSets[2].measurements[0].value", Boolean.class);
assertWithMessage("Must contain a measure performed").that(measurePerformed).isTrue();
}
use of gov.cms.qpp.conversion.encode.JsonWrapper in project qpp-conversion-tool by CMSgov.
the class JsonPathToXpathCoverageTest method testCoverage.
@ParameterizedTest
@MethodSource("paths")
void testCoverage(Path path) throws IOException {
JsonWrapper metaWrapper = new JsonWrapper(false);
helper = new JsonPathToXpathHelper(path, metaWrapper, false);
JsonWrapper wrapper = new JsonWrapper(metaWrapper, true);
JsonNode root = om.readTree(wrapper.toString());
JsonPathAggregator agg = new JsonPathAggregator(root);
agg.getJsonPaths().forEach((key, value) -> helper.executeAttributeTest(key, value));
}
use of gov.cms.qpp.conversion.encode.JsonWrapper in project qpp-conversion-tool by CMSgov.
the class AciMeasurePerformedRoundTripTest method testGarbage.
@Test
void testGarbage() {
Converter converter = new Converter(new PathSource(JUNK_QRDA3_FILE));
JsonWrapper qpp = converter.transform();
List<Map<String, ?>> aciMeasures = JsonHelper.readJsonAtJsonPath(qpp.toString(), "$.measurementSets[?(@.category=='aci')].measurements[?(@.measureId=='TEST_MEASURE_ID')]", List.class);
assertThat(aciMeasures).hasSize(1);
assertThat((aciMeasures.get(0).get("measureId"))).isEqualTo("TEST_MEASURE_ID");
}
Aggregations