Search in sources :

Example 1 with MaterializeCohortRequest

use of org.pmiops.workbench.model.MaterializeCohortRequest in project workbench by all-of-us.

the class CohortMaterializationServiceTest method testMaterializeCohortWithReviewNotExcludedFilter.

@Test
public void testMaterializeCohortWithReviewNotExcludedFilter() {
    MaterializeCohortRequest request = makeRequest(2);
    request.setStatusFilter(ImmutableList.of(CohortStatus.NOT_REVIEWED, CohortStatus.INCLUDED, CohortStatus.NEEDS_FURTHER_REVIEW));
    MaterializeCohortResponse response = cohortMaterializationService.materializeCohort(cohortReview, SearchRequests.allGenders(), request);
    // With a not excluded status filter, ID 2 is not returned.
    assertPersonIds(response, 1L, 102246L);
    assertThat(response.getNextPageToken()).isNull();
}
Also used : MaterializeCohortRequest(org.pmiops.workbench.model.MaterializeCohortRequest) MaterializeCohortResponse(org.pmiops.workbench.model.MaterializeCohortResponse) BigQueryBaseTest(org.pmiops.workbench.api.BigQueryBaseTest) Test(org.junit.Test)

Example 2 with MaterializeCohortRequest

use of org.pmiops.workbench.model.MaterializeCohortRequest in project workbench by all-of-us.

the class CohortMaterializationServiceTest method testMaterializeCohortWithReviewJustExcludedFilter.

@Test
public void testMaterializeCohortWithReviewJustExcludedFilter() {
    MaterializeCohortRequest request = makeRequest(2);
    request.setStatusFilter(ImmutableList.of(CohortStatus.EXCLUDED));
    MaterializeCohortResponse response = cohortMaterializationService.materializeCohort(cohortReview, SearchRequests.allGenders(), request);
    assertPersonIds(response, 2L);
    assertThat(response.getNextPageToken()).isNull();
}
Also used : MaterializeCohortRequest(org.pmiops.workbench.model.MaterializeCohortRequest) MaterializeCohortResponse(org.pmiops.workbench.model.MaterializeCohortResponse) BigQueryBaseTest(org.pmiops.workbench.api.BigQueryBaseTest) Test(org.junit.Test)

Example 3 with MaterializeCohortRequest

use of org.pmiops.workbench.model.MaterializeCohortRequest in project workbench by all-of-us.

the class CohortMaterializationServiceTest method makeRequest.

private MaterializeCohortRequest makeRequest(FieldSet fieldSet, int pageSize) {
    MaterializeCohortRequest request = makeRequest(pageSize);
    request.setFieldSet(fieldSet);
    return request;
}
Also used : MaterializeCohortRequest(org.pmiops.workbench.model.MaterializeCohortRequest)

Example 4 with MaterializeCohortRequest

use of org.pmiops.workbench.model.MaterializeCohortRequest in project workbench by all-of-us.

the class CohortMaterializationServiceTest method makeRequest.

private MaterializeCohortRequest makeRequest(int pageSize) {
    MaterializeCohortRequest request = new MaterializeCohortRequest();
    request.setPageSize(pageSize);
    return request;
}
Also used : MaterializeCohortRequest(org.pmiops.workbench.model.MaterializeCohortRequest)

Example 5 with MaterializeCohortRequest

use of org.pmiops.workbench.model.MaterializeCohortRequest in project workbench by all-of-us.

the class CohortMaterializationServiceTest method testMaterializeCohortWithReviewNotReviewedAndNeedsFurtherReviewFilter.

@Test
public void testMaterializeCohortWithReviewNotReviewedAndNeedsFurtherReviewFilter() {
    MaterializeCohortRequest request = makeRequest(2);
    request.setStatusFilter(ImmutableList.of(CohortStatus.NEEDS_FURTHER_REVIEW, CohortStatus.NOT_REVIEWED));
    MaterializeCohortResponse response = cohortMaterializationService.materializeCohort(cohortReview, SearchRequests.allGenders(), request);
    assertPersonIds(response, 102246L);
    assertThat(response.getNextPageToken()).isNull();
}
Also used : MaterializeCohortRequest(org.pmiops.workbench.model.MaterializeCohortRequest) MaterializeCohortResponse(org.pmiops.workbench.model.MaterializeCohortResponse) BigQueryBaseTest(org.pmiops.workbench.api.BigQueryBaseTest) Test(org.junit.Test)

Aggregations

MaterializeCohortRequest (org.pmiops.workbench.model.MaterializeCohortRequest)25 Test (org.junit.Test)21 MaterializeCohortResponse (org.pmiops.workbench.model.MaterializeCohortResponse)17 Cohort (org.pmiops.workbench.model.Cohort)12 BigQueryBaseTest (org.pmiops.workbench.api.BigQueryBaseTest)11 DataJpaTest (org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest)10 CohortReview (org.pmiops.workbench.db.model.CohortReview)1 BadRequestException (org.pmiops.workbench.exceptions.BadRequestException)1 NotFoundException (org.pmiops.workbench.exceptions.NotFoundException)1 CohortStatus (org.pmiops.workbench.model.CohortStatus)1 WorkspaceAccessLevel (org.pmiops.workbench.model.WorkspaceAccessLevel)1 PaginationToken (org.pmiops.workbench.utils.PaginationToken)1