Search in sources :

Example 26 with SearchRequest

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

the class CohortBuilderControllerTest method countSubjectsCPTObservation.

@Test
public void countSubjectsCPTObservation() throws Exception {
    SearchParameter cpt = createSearchParameter(cptObservation, "0001Z");
    SearchRequest searchRequest = createSearchRequests(cptObservation.getType(), Arrays.asList(cpt));
    assertParticipants(controller.countParticipants(cdrVersion.getCdrVersionId(), searchRequest), 1);
}
Also used : SearchRequest(org.pmiops.workbench.model.SearchRequest) SearchParameter(org.pmiops.workbench.model.SearchParameter) Test(org.junit.Test)

Example 27 with SearchRequest

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

the class CohortBuilderControllerTest method countSubjectsICD9ConditionOccurrenceChild.

@Test
public void countSubjectsICD9ConditionOccurrenceChild() throws Exception {
    SearchParameter icd9 = createSearchParameter(icd9ConditionChild, "001.1");
    SearchRequest searchRequest = createSearchRequests(icd9ConditionChild.getType(), Arrays.asList(icd9));
    assertParticipants(controller.countParticipants(cdrVersion.getCdrVersionId(), searchRequest), 1);
}
Also used : SearchRequest(org.pmiops.workbench.model.SearchRequest) SearchParameter(org.pmiops.workbench.model.SearchParameter) Test(org.junit.Test)

Example 28 with SearchRequest

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

the class CohortBuilderControllerTest method countSubjectsICD10MeasurementParent.

@Test
public void countSubjectsICD10MeasurementParent() throws Exception {
    SearchParameter icd10 = createSearchParameter(icd10MeasurementParent, "R92");
    SearchRequest searchRequest = createSearchRequests(icd10MeasurementParent.getType(), Arrays.asList(icd10));
    assertParticipants(controller.countParticipants(cdrVersion.getCdrVersionId(), searchRequest), 1);
}
Also used : SearchRequest(org.pmiops.workbench.model.SearchRequest) SearchParameter(org.pmiops.workbench.model.SearchParameter) Test(org.junit.Test)

Example 29 with SearchRequest

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

the class CohortBuilderControllerTest method countSubjectsDemoExcluded.

@Test
public void countSubjectsDemoExcluded() throws Exception {
    Criteria demoGender = createDemoCriteria("DEMO", "GEN", "8507");
    SearchParameter demoGenderSearchParam = createSearchParameter(demoGender, null);
    SearchParameter demoGenderSearchParamExclude = createSearchParameter(demoGender, null);
    SearchGroupItem excludeSearchGroupItem = new SearchGroupItem().type(demoGender.getType()).searchParameters(Arrays.asList(demoGenderSearchParamExclude));
    SearchGroup excludeSearchGroup = new SearchGroup().addItemsItem(excludeSearchGroupItem);
    SearchRequest searchRequests = createSearchRequests(demoGender.getType(), Arrays.asList(demoGenderSearchParam));
    searchRequests.getExcludes().add(excludeSearchGroup);
    assertParticipants(controller.countParticipants(cdrVersion.getCdrVersionId(), searchRequests), 0);
}
Also used : SearchRequest(org.pmiops.workbench.model.SearchRequest) SearchGroup(org.pmiops.workbench.model.SearchGroup) Criteria(org.pmiops.workbench.cdr.model.Criteria) SearchParameter(org.pmiops.workbench.model.SearchParameter) SearchGroupItem(org.pmiops.workbench.model.SearchGroupItem) Test(org.junit.Test)

Example 30 with SearchRequest

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

the class CohortBuilderControllerTest method countSubjectsDemoGender.

@Test
public void countSubjectsDemoGender() throws Exception {
    Criteria demoGender = createDemoCriteria("DEMO", "GEN", "8507");
    SearchParameter demo = createSearchParameter(demoGender, null);
    SearchRequest searchRequest = createSearchRequests(demoGender.getType(), Arrays.asList(demo));
    assertParticipants(controller.countParticipants(cdrVersion.getCdrVersionId(), searchRequest), 1);
}
Also used : SearchRequest(org.pmiops.workbench.model.SearchRequest) Criteria(org.pmiops.workbench.cdr.model.Criteria) SearchParameter(org.pmiops.workbench.model.SearchParameter) Test(org.junit.Test)

Aggregations

SearchRequest (org.pmiops.workbench.model.SearchRequest)31 Test (org.junit.Test)27 SearchParameter (org.pmiops.workbench.model.SearchParameter)27 SearchGroup (org.pmiops.workbench.model.SearchGroup)8 SearchGroupItem (org.pmiops.workbench.model.SearchGroupItem)8 Criteria (org.pmiops.workbench.cdr.model.Criteria)6 QueryJobConfiguration (com.google.cloud.bigquery.QueryJobConfiguration)4 LocalDate (java.time.LocalDate)3 Attribute (org.pmiops.workbench.model.Attribute)3 ArrayList (java.util.ArrayList)2 BadRequestException (org.pmiops.workbench.exceptions.BadRequestException)2 Gson (com.google.gson.Gson)1 JsonSyntaxException (com.google.gson.JsonSyntaxException)1 StringJoiner (java.util.StringJoiner)1 CdrVersion (org.pmiops.workbench.db.model.CdrVersion)1 CohortReview (org.pmiops.workbench.db.model.CohortReview)1 Workspace (org.pmiops.workbench.db.model.Workspace)1 NotFoundException (org.pmiops.workbench.exceptions.NotFoundException)1 MaterializeCohortResponse (org.pmiops.workbench.model.MaterializeCohortResponse)1