use of au.csiro.pathling.aggregate.AggregateResponse.Grouping in project pathling by aehrc.
the class AggregateExecutorTest method runFirstGroupingThroughSearch.
/**
* Test that the drill-down expression from the first grouping from each aggregate result can be
* successfully executed using the FHIRPath search.
*/
@AfterEach
void runFirstGroupingThroughSearch() {
if (response != null) {
final Optional<Grouping> firstGroupingOptional = response.getGroupings().stream().filter(grouping -> grouping.getDrillDown().isPresent()).findFirst();
if (firstGroupingOptional.isPresent()) {
final Grouping firstGrouping = firstGroupingOptional.get();
assertTrue(firstGrouping.getDrillDown().isPresent());
final String drillDown = firstGrouping.getDrillDown().get();
final StringAndListParam filters = new StringAndListParam();
filters.addAnd(new StringParam(drillDown));
final IBundleProvider searchExecutor = new SearchExecutor(configuration, fhirContext, spark, database, Optional.of(terminologyServiceFactory), fhirEncoders, subjectResource, Optional.of(filters));
final List<IBaseResource> resources = searchExecutor.getResources(0, 100);
assertTrue(resources.size() > 0);
}
}
}
Aggregations