use of org.pmiops.workbench.db.model.CdrVersion in project workbench by all-of-us.
the class ParticipantCohortStatusDaoTest method onSetup.
@Before
public void onSetup() {
page = 0;
pageSize = 25;
CdrVersion cdrVersion = new CdrVersion();
cdrVersion.setCdrDbName("");
CdrVersionContext.setCdrVersion(cdrVersion);
jdbcTemplate.execute("insert into participant_cohort_status" + "(cohort_review_id, participant_id, status, gender_concept_id, birth_date, race_concept_id, ethnicity_concept_id)" + "values (1, 1, 1, 1, sysdate(), 2, 3)");
jdbcTemplate.execute("insert into participant_cohort_status" + "(cohort_review_id, participant_id, status, gender_concept_id, birth_date, race_concept_id, ethnicity_concept_id)" + "values (1, 2, 0, 1, sysdate(), 2, 3)");
jdbcTemplate.execute("insert into concept" + "(concept_id, concept_name, domain_id, vocabulary_id, concept_class_id, standard_concept, concept_code, count_value, prevalence)" + "values (1, 'MALE', 3, 'Gender', 1, 'c', 'c', 1, 1)");
jdbcTemplate.execute("insert into concept" + "(concept_id, concept_name, domain_id, vocabulary_id, concept_class_id, standard_concept, concept_code, count_value, prevalence)" + "values (2, 'Asian', 3, 'Race', 1, 'c', 'c', 1, 1)");
jdbcTemplate.execute("insert into concept" + "(concept_id, concept_name, domain_id, vocabulary_id, concept_class_id, standard_concept, concept_code, count_value, prevalence)" + "values (3, 'Not Hispanic', 3, 'Ethnicity', 1, 'c', 'c', 1, 1)");
}
use of org.pmiops.workbench.db.model.CdrVersion in project workbench by all-of-us.
the class CohortBuilderControllerMockTest method getCriteriaByTypeAndParentIdPhecodes.
@Test
public void getCriteriaByTypeAndParentIdPhecodes() throws Exception {
org.pmiops.workbench.cdr.model.Criteria expectedCriteria = new org.pmiops.workbench.cdr.model.Criteria().id(1L).type("PHECODE").name("Intestinal infection").group(true).selectable(true).count("0").conceptId("0");
when(mockCdrVersionDao.findOne(1L)).thenReturn(new CdrVersion());
when(mockCriteriaDao.findCriteriaByTypeAndParentIdOrderByCodeAsc("PHECODE", 0L)).thenReturn(Arrays.asList(expectedCriteria));
assertCriteria(controller.getCriteriaByTypeAndParentId(1l, "PHECODE", 0L), new Criteria().id(1L).type("PHECODE").name("Intestinal infection").group(true).selectable(true).count(0L).conceptId(0L));
verify(mockCdrVersionDao).findOne(1L);
verify(mockCriteriaDao).findCriteriaByTypeAndParentIdOrderByCodeAsc("PHECODE", 0L);
verifyNoMoreInteractions(mockCriteriaDao, mockCdrVersionDao);
}
use of org.pmiops.workbench.db.model.CdrVersion in project workbench by all-of-us.
the class CohortBuilderControllerMockTest method getCriteriaByTypeAndParentIdDemo.
@Test
public void getCriteriaByTypeAndParentIdDemo() throws Exception {
org.pmiops.workbench.cdr.model.Criteria expectedCriteria = new org.pmiops.workbench.cdr.model.Criteria().id(1L).type("DEMO").name("Age").group(false).selectable(true).count("0").conceptId("12").subtype("AGE");
when(mockCdrVersionDao.findOne(1L)).thenReturn(new CdrVersion());
when(mockCriteriaDao.findCriteriaByTypeAndParentIdOrderByCodeAsc("DEMO", 0L)).thenReturn(Arrays.asList(expectedCriteria));
assertCriteria(controller.getCriteriaByTypeAndParentId(1L, "DEMO", 0L), new Criteria().id(1L).type("DEMO").name("Age").group(false).selectable(true).count(0L).conceptId(12L).subtype("AGE"));
verify(mockCdrVersionDao).findOne(1L);
verify(mockCriteriaDao).findCriteriaByTypeAndParentIdOrderByCodeAsc("DEMO", 0L);
verifyNoMoreInteractions(mockCriteriaDao, mockCdrVersionDao);
}
use of org.pmiops.workbench.db.model.CdrVersion in project workbench by all-of-us.
the class CohortBuilderControllerMockTest method getCriteriaTreeQuickSearch.
@Test
public void getCriteriaTreeQuickSearch() throws Exception {
org.pmiops.workbench.cdr.model.Criteria expectedCriteria = new org.pmiops.workbench.cdr.model.Criteria().id(1L).type("PHECODE").name("Intestinal infection").group(true).selectable(true).count("0").conceptId("0");
when(mockCdrVersionDao.findOne(1L)).thenReturn(new CdrVersion());
when(mockCriteriaDao.findCriteriaByTypeAndNameOrCode("PHECODE", "infect*")).thenReturn(Arrays.asList(expectedCriteria));
assertCriteria(controller.getCriteriaTreeQuickSearch(1L, "PHECODE", "infect"), new Criteria().id(1L).type("PHECODE").name("Intestinal infection").group(true).selectable(true).count(0L).conceptId(0L));
verify(mockCdrVersionDao).findOne(1L);
verify(mockCriteriaDao).findCriteriaByTypeAndNameOrCode("PHECODE", "infect*");
verifyNoMoreInteractions(mockCriteriaDao, mockCdrVersionDao);
}
use of org.pmiops.workbench.db.model.CdrVersion in project workbench by all-of-us.
the class CohortBuilderControllerMockTest method getCriteriaByTypeAndParentIdIcd9.
@Test
public void getCriteriaByTypeAndParentIdIcd9() throws Exception {
org.pmiops.workbench.cdr.model.Criteria expectedCriteria = new org.pmiops.workbench.cdr.model.Criteria().id(1L).type("ICD9").code("001-139.99").name("Infectious and parasitic diseases").group(false).selectable(false).count("0").conceptId("0");
when(mockCdrVersionDao.findOne(1L)).thenReturn(new CdrVersion());
when(mockCriteriaDao.findCriteriaByTypeAndParentIdOrderByCodeAsc("ICD9", 0L)).thenReturn(Arrays.asList(expectedCriteria));
assertCriteria(controller.getCriteriaByTypeAndParentId(1L, "ICD9", 0L), new Criteria().id(1L).type("ICD9").code("001-139.99").name("Infectious and parasitic diseases").group(false).selectable(false).count(0L).conceptId(0L));
verify(mockCdrVersionDao).findOne(1L);
verify(mockCriteriaDao).findCriteriaByTypeAndParentIdOrderByCodeAsc("ICD9", 0L);
verifyNoMoreInteractions(mockCriteriaDao, mockCdrVersionDao);
}
Aggregations