Search in sources :

Example 1 with RQLFieldReferences

use of org.obiba.mica.dataset.rest.entity.rql.RQLFieldReferences in project mica2 by obiba.

the class StudyEntitiesCountQuery method createVariableEntitiesCount.

private MicaSearch.VariableEntitiesCountDto createVariableEntitiesCount(Search.EntitiesResultDto opalResult) {
    MicaSearch.VariableEntitiesCountDto.Builder builder = MicaSearch.VariableEntitiesCountDto.newBuilder();
    RQLCriterionOpalConverter converter = findConverter(opalResult.getQuery());
    RQLFieldReferences references = converter.getVariableReferences();
    builder.setQuery(converter.getMicaQuery()).setCount(opalResult.getTotalHits()).setVariable(documentDigestDtos.asDto(references.getVariable()));
    if (references.hasStudyTableName())
        builder.addAllStudyTableName(localizedStringDtos.asDto(references.getStudyTableName()));
    return builder.build();
}
Also used : RQLFieldReferences(org.obiba.mica.dataset.rest.entity.rql.RQLFieldReferences) RQLCriterionOpalConverter(org.obiba.mica.dataset.rest.entity.rql.RQLCriterionOpalConverter)

Aggregations

RQLCriterionOpalConverter (org.obiba.mica.dataset.rest.entity.rql.RQLCriterionOpalConverter)1 RQLFieldReferences (org.obiba.mica.dataset.rest.entity.rql.RQLFieldReferences)1