Search in sources :

Example 16 with StudyDataset

use of org.obiba.mica.dataset.domain.StudyDataset in project mica2 by obiba.

the class PublishedCollectedDatasetVariableResource method getContingencyDto.

private Mica.DatasetVariableContingencyDto getContingencyDto(DatasetVariable var, DatasetVariable crossVar) {
    StudyDataset dataset = getDataset(StudyDataset.class, datasetId);
    StudyTable studyTable = dataset.getSafeStudyTable();
    try {
        return dtos.asContingencyDto(studyTable, var, crossVar, datasetService.getContingencyTable(dataset, var, crossVar)).build();
    } catch (Exception e) {
        log.warn("Unable to retrieve contingency table: " + e.getMessage(), e);
        return dtos.asContingencyDto(studyTable, var, crossVar, null).build();
    }
}
Also used : StudyTable(org.obiba.mica.core.domain.StudyTable) StudyDataset(org.obiba.mica.dataset.domain.StudyDataset) BadRequestException(javax.ws.rs.BadRequestException) IOException(java.io.IOException)

Aggregations

StudyDataset (org.obiba.mica.dataset.domain.StudyDataset)16 StudyTable (org.obiba.mica.core.domain.StudyTable)4 IOException (java.io.IOException)3 Dataset (org.obiba.mica.dataset.domain.Dataset)3 DatasetVariable (org.obiba.mica.dataset.domain.DatasetVariable)3 DatasetUpdatedEvent (org.obiba.mica.dataset.event.DatasetUpdatedEvent)3 Timed (com.codahale.metrics.annotation.Timed)2 Strings (com.google.common.base.Strings)2 Lists (com.google.common.collect.Lists)2 List (java.util.List)2 Collectors (java.util.stream.Collectors)2 Inject (javax.inject.Inject)2 NotNull (javax.validation.constraints.NotNull)2 BadRequestException (javax.ws.rs.BadRequestException)2 Path (javax.ws.rs.Path)2 DateTime (org.joda.time.DateTime)2 NoSuchVariableException (org.obiba.magma.NoSuchVariableException)2 HarmonizationDataset (org.obiba.mica.dataset.domain.HarmonizationDataset)2 StudyDatasetState (org.obiba.mica.dataset.domain.StudyDatasetState)2 DatasetDeletedEvent (org.obiba.mica.dataset.event.DatasetDeletedEvent)2