Search in sources :

Example 6 with SearchParameter

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

the class CohortBuilderControllerTest method countSubjectsCPTProcedureOccurrence.

@Test
public void countSubjectsCPTProcedureOccurrence() throws Exception {
    SearchParameter cpt = createSearchParameter(cptProcedure, "0001T");
    SearchRequest searchRequest = createSearchRequests(cptProcedure.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 7 with SearchParameter

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

the class CohortBuilderControllerTest method countSubjectsICD10ProcedureOccurrenceChild.

@Test
public void countSubjectsICD10ProcedureOccurrenceChild() throws Exception {
    SearchParameter icd10 = createSearchParameter(icd10ProcedureChild, "16070");
    SearchRequest searchRequest = createSearchRequests(icd10ProcedureChild.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 8 with SearchParameter

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

the class CohortBuilderControllerTest method countSubjectsCPTDrugExposure.

@Test
public void countSubjectsCPTDrugExposure() throws Exception {
    SearchParameter cpt = createSearchParameter(cptDrug, "90703");
    SearchRequest searchRequest = createSearchRequests(cptDrug.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 9 with SearchParameter

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

the class CohortBuilderControllerTest method countSubjectsICD9ProcedureOccurrenceChild.

@Test
public void countSubjectsICD9ProcedureOccurrenceChild() throws Exception {
    SearchParameter icd9 = createSearchParameter(icd9ProcedureChild, "002.1");
    SearchRequest searchRequest = createSearchRequests(icd9ProcedureChild.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 10 with SearchParameter

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

the class CohortBuilderControllerTest method countSubjectsDemoAge.

@Test
public void countSubjectsDemoAge() throws Exception {
    LocalDate birthdate = LocalDate.of(1980, 8, 01);
    LocalDate now = LocalDate.now();
    Integer age = Period.between(birthdate, now).getYears();
    Criteria demoAge = createDemoCriteria("DEMO", "AGE", null);
    SearchParameter demo = createSearchParameter(demoAge, null);
    demo.attribute(new Attribute().operator("=").operands(Arrays.asList(age.toString())));
    SearchRequest searchRequests = createSearchRequests(demoAge.getType(), Arrays.asList(demo));
    assertParticipants(controller.countParticipants(cdrVersion.getCdrVersionId(), searchRequests), 1);
}
Also used : SearchRequest(org.pmiops.workbench.model.SearchRequest) Attribute(org.pmiops.workbench.model.Attribute) Criteria(org.pmiops.workbench.cdr.model.Criteria) SearchParameter(org.pmiops.workbench.model.SearchParameter) LocalDate(java.time.LocalDate) Test(org.junit.Test)

Aggregations

SearchParameter (org.pmiops.workbench.model.SearchParameter)39 Test (org.junit.Test)34 SearchRequest (org.pmiops.workbench.model.SearchRequest)27 SearchGroupItem (org.pmiops.workbench.model.SearchGroupItem)10 ArrayList (java.util.ArrayList)9 QueryJobConfiguration (com.google.cloud.bigquery.QueryJobConfiguration)8 SearchGroup (org.pmiops.workbench.model.SearchGroup)7 Criteria (org.pmiops.workbench.cdr.model.Criteria)6 Attribute (org.pmiops.workbench.model.Attribute)5 QueryParameterValue (com.google.cloud.bigquery.QueryParameterValue)4 ListMultimap (com.google.common.collect.ListMultimap)3 LocalDate (java.time.LocalDate)3 ArrayListMultimap (com.google.common.collect.ArrayListMultimap)2 LinkedHashMap (java.util.LinkedHashMap)2 HashMap (java.util.HashMap)1 List (java.util.List)1 CriteriaDao (org.pmiops.workbench.cdr.dao.CriteriaDao)1 Autowired (org.springframework.beans.factory.annotation.Autowired)1 Service (org.springframework.stereotype.Service)1