@Override public DBIterator<Cohort> iterator(String studyStr, Query query, QueryOptions options, String sessionId) throws CatalogException { options = ParamUtils.defaultObject(options, QueryOptions::new); query = ParamUtils.defaultObject(query, Query::new); String userId = userManager.getUserId(sessionId); Study study = studyManager.resolveId(studyStr, userId); fixQueryObject(study, query, sessionId); Query myQuery = new Query(query).append(CohortDBAdaptor.QueryParams.STUDY_UID.key(), study.getUid()); return cohortDBAdaptor.iterator(myQuery, options, userId); }
.append(CohortDBAdaptor.QueryParams.SAMPLE_UIDS.key(), sample.getUid()) .append(CohortDBAdaptor.QueryParams.STUDY_UID.key(), studyId); DBIterator<Cohort> cohortIterator = cohortDBAdaptor.iterator(query, QueryOptions.empty()); List<String> errorCohorts = new ArrayList<>(); boolean associatedToDefaultCohort = false;
private Boolean indexCohort(CatalogSolrManager catalogSolrManager, Study study) throws CatalogException, IOException { Query query = new Query() .append(CohortDBAdaptor.QueryParams.STUDY_UID.key(), study.getUid()) .append(CohortDBAdaptor.QueryParams.STATUS_NAME.key(), Constants.ALL_STATUS); QueryOptions cohortQueryOptions = new QueryOptions() .append(QueryOptions.INCLUDE, Arrays.asList(CohortDBAdaptor.QueryParams.ID.key(), CohortDBAdaptor.QueryParams.NAME.key(), CohortDBAdaptor.QueryParams.CREATION_DATE.key(), CohortDBAdaptor.QueryParams.STATUS.key(), CohortDBAdaptor.QueryParams.RELEASE.key(), CohortDBAdaptor.QueryParams.ANNOTATION_SETS.key(), CohortDBAdaptor.QueryParams.SAMPLE_UIDS.key(), CohortDBAdaptor.QueryParams.TYPE.key())) .append(DBAdaptor.INCLUDE_ACLS, true) .append(Constants.FLATTENED_ANNOTATIONS, true); catalogSolrManager.insertCatalogCollection(this.cohortDBAdaptor.iterator(query, cohortQueryOptions), new CatalogCohortToSolrCohortConverter(study), CatalogSolrManager.COHORT_SOLR_COLLECTION); return true; }
finalQuery.append(CohortDBAdaptor.QueryParams.STUDY_UID.key(), study.getUid()); iterator = cohortDBAdaptor.iterator(finalQuery, QueryOptions.empty(), userId);
.append(CohortDBAdaptor.QueryParams.SAMPLE_UIDS.key(), sample.getUid()) .append(CohortDBAdaptor.QueryParams.STUDY_UID.key(), study.getUid()); DBIterator<Cohort> cohortIterator = cohortDBAdaptor.iterator(auxQuery, QueryOptions.empty()); while (cohortIterator.hasNext()) { Cohort cohort = cohortIterator.next();
DBIterator<Cohort> cohortDBIterator = cohortDBAdaptor.iterator( new Query(CohortDBAdaptor.QueryParams.STUDY_UID.key(), study.getUid()), queryOptions); catalogSolrManager.insertCatalogCollection(cohortDBIterator, new CatalogCohortToSolrCohortConverter(study),