use of org.pmiops.workbench.model.MaterializeCohortResponse in project workbench by all-of-us.
the class CohortMaterializationServiceTest method testMaterializeCohortWithReviewJustNotReviewedFilter.
@Test
public void testMaterializeCohortWithReviewJustNotReviewedFilter() {
MaterializeCohortRequest request = makeRequest(2);
request.setStatusFilter(ImmutableList.of(CohortStatus.NOT_REVIEWED));
MaterializeCohortResponse response = cohortMaterializationService.materializeCohort(cohortReview, SearchRequests.allGenders(), request);
assertPersonIds(response, 102246L);
assertThat(response.getNextPageToken()).isNull();
}
use of org.pmiops.workbench.model.MaterializeCohortResponse in project workbench by all-of-us.
the class CohortMaterializationServiceTest method testMaterializeCohortWithReviewNotReviewedAndIncludedFilter.
@Test
public void testMaterializeCohortWithReviewNotReviewedAndIncludedFilter() {
MaterializeCohortRequest request = makeRequest(2);
request.setStatusFilter(ImmutableList.of(CohortStatus.INCLUDED, CohortStatus.NOT_REVIEWED));
MaterializeCohortResponse response = cohortMaterializationService.materializeCohort(cohortReview, SearchRequests.allGenders(), request);
assertPersonIds(response, 1L, 102246L);
assertThat(response.getNextPageToken()).isNull();
}
use of org.pmiops.workbench.model.MaterializeCohortResponse in project workbench by all-of-us.
the class CohortMaterializationServiceTest method testMaterializeCohortPersonFieldSetPersonIdWithNumberGreaterThanOrEqualToFilter.
@Test
public void testMaterializeCohortPersonFieldSetPersonIdWithNumberGreaterThanOrEqualToFilter() {
TableQuery tableQuery = new TableQuery();
tableQuery.setTableName("person");
tableQuery.setColumns(ImmutableList.of("person_id"));
ColumnFilter filter = new ColumnFilter();
filter.setColumnName("person_id");
filter.setOperator(Operator.GREATER_THAN_OR_EQUAL_TO);
filter.setValueNumber(new BigDecimal(2L));
tableQuery.addFiltersItem(ImmutableList.of(filter));
FieldSet fieldSet = new FieldSet();
fieldSet.setTableQuery(tableQuery);
MaterializeCohortResponse response = cohortMaterializationService.materializeCohort(null, SearchRequests.allGenders(), makeRequest(fieldSet, 1000));
assertPersonIds(response, 2L, 102246L);
assertThat(response.getNextPageToken()).isNull();
}
use of org.pmiops.workbench.model.MaterializeCohortResponse in project workbench by all-of-us.
the class CohortMaterializationServiceTest method testMaterializeCohortPersonFieldSetPersonIdWithStringFilterNullNonMatch.
@Test
public void testMaterializeCohortPersonFieldSetPersonIdWithStringFilterNullNonMatch() {
TableQuery tableQuery = new TableQuery();
tableQuery.setTableName("person");
tableQuery.setColumns(ImmutableList.of("person_id"));
ColumnFilter filter = new ColumnFilter();
filter.setColumnName("ethnicity_source_value");
filter.setValue("esv");
tableQuery.addFiltersItem(ImmutableList.of(filter));
FieldSet fieldSet = new FieldSet();
fieldSet.setTableQuery(tableQuery);
MaterializeCohortResponse response = cohortMaterializationService.materializeCohort(null, SearchRequests.allGenders(), makeRequest(fieldSet, 1000));
assertPersonIds(response, 1L, 2L);
assertThat(response.getNextPageToken()).isNull();
}
use of org.pmiops.workbench.model.MaterializeCohortResponse in project workbench by all-of-us.
the class CohortMaterializationServiceTest method testMaterializeCohortPersonFieldSetPersonIdWithStringIsNull.
@Test
public void testMaterializeCohortPersonFieldSetPersonIdWithStringIsNull() {
TableQuery tableQuery = new TableQuery();
tableQuery.setTableName("person");
tableQuery.setColumns(ImmutableList.of("person_id"));
ColumnFilter filter = new ColumnFilter();
filter.setColumnName("ethnicity_source_value");
filter.setOperator(Operator.EQUAL);
filter.setValueNull(true);
tableQuery.addFiltersItem(ImmutableList.of(filter));
FieldSet fieldSet = new FieldSet();
fieldSet.setTableQuery(tableQuery);
MaterializeCohortResponse response = cohortMaterializationService.materializeCohort(null, SearchRequests.allGenders(), makeRequest(fieldSet, 1000));
assertPersonIds(response, 102246L);
assertThat(response.getNextPageToken()).isNull();
}
Aggregations