use of org.obiba.magma.NoSuchValueTableException in project mica2 by obiba.
the class PublishedDataschemaDatasetVariableResource method getVariableSummaries.
@GET
@Path("/summary")
@Timed
public List<Math.SummaryStatisticsDto> getVariableSummaries() {
ImmutableList.Builder<Math.SummaryStatisticsDto> builder = ImmutableList.builder();
HarmonizationDataset dataset = getDataset(HarmonizationDataset.class, datasetId);
dataset.getBaseStudyTables().forEach(table -> {
try {
String studyId = table.getStudyId();
builder.add(datasetService.getVariableSummary(dataset, variableName, studyId, table.getProject(), table.getTable()).getWrappedDto());
} catch (NoSuchVariableException | NoSuchValueTableException e) {
// case the study has not implemented this dataschema variable
builder.add(Math.SummaryStatisticsDto.newBuilder().setResource(variableName).build());
}
});
return builder.build();
}
use of org.obiba.magma.NoSuchValueTableException in project mica2 by obiba.
the class DraftDataschemaDatasetVariableResource method getVariableFacets.
@GET
@Path("/facet")
public List<Search.QueryResultDto> getVariableFacets() {
ImmutableList.Builder<Search.QueryResultDto> builder = ImmutableList.builder();
HarmonizationDataset dataset = getDataset();
dataset.getBaseStudyTables().forEach(table -> {
try {
String studyId = table.getStudyId();
builder.add(datasetService.getVariableFacet(dataset, variableName, studyId, table.getProject(), table.getTable()));
} catch (NoSuchVariableException | NoSuchValueTableException e) {
// ignore (case the study has not implemented this dataschema variable)
}
});
return builder.build();
}
use of org.obiba.magma.NoSuchValueTableException in project mica2 by obiba.
the class DraftDataschemaDatasetVariableResource method getVariableSummaries.
@GET
@Path("/summary")
public List<Math.SummaryStatisticsDto> getVariableSummaries() {
ImmutableList.Builder<Math.SummaryStatisticsDto> builder = ImmutableList.builder();
HarmonizationDataset dataset = getDataset();
dataset.getBaseStudyTables().forEach(table -> {
try {
String studyId = table.getStudyId();
builder.add(datasetService.getVariableSummary(dataset, variableName, studyId, table.getProject(), table.getTable()).getWrappedDto());
} catch (NoSuchVariableException | NoSuchValueTableException e) {
// ignore (case the study has not implemented this dataschema variable)
}
});
return builder.build();
}
use of org.obiba.magma.NoSuchValueTableException in project mica2 by obiba.
the class DraftDataschemaDatasetVariableResource method getHarmonizedVariables.
@GET
@Path("/harmonizations")
public List<Mica.DatasetVariableDto> getHarmonizedVariables() {
ImmutableList.Builder<Mica.DatasetVariableDto> builder = ImmutableList.builder();
HarmonizationDataset dataset = getDataset();
dataset.getBaseStudyTables().forEach(table -> {
try {
builder.add(dtos.asDto(datasetService.getDatasetVariable(dataset, variableName, table)));
} catch (NoSuchVariableException | NoSuchValueTableException e) {
// ignore (case the study has not implemented this dataschema variable)
}
});
return builder.build();
}
use of org.obiba.magma.NoSuchValueTableException in project mica2 by obiba.
the class PublishedDataschemaDatasetVariableResource method getVariableFacets.
@GET
@Path("/facet")
@Timed
public List<Search.QueryResultDto> getVariableFacets() {
ImmutableList.Builder<Search.QueryResultDto> builder = ImmutableList.builder();
HarmonizationDataset dataset = getDataset(HarmonizationDataset.class, datasetId);
dataset.getBaseStudyTables().forEach(table -> {
try {
String studyId = table.getStudyId();
builder.add(datasetService.getVariableFacet(dataset, variableName, studyId, table.getProject(), table.getTable()));
} catch (NoSuchVariableException | NoSuchValueTableException e) {
// case the study has not implemented this dataschema variable
builder.add(Search.QueryResultDto.newBuilder().setTotalHits(0).build());
}
});
return builder.build();
}
Aggregations