Search in sources :

Example 1 with ConcreteDomainChanges

use of com.b2international.snowowl.snomed.reasoner.domain.ConcreteDomainChanges in project snow-owl by b2ihealthcare.

the class ClassificationTaskConverter method expandConcreteDomainChanges.

private void expandConcreteDomainChanges(final List<ClassificationTask> results, final Set<String> classificationTaskIds) {
    if (!expand().containsKey(ClassificationTask.Expand.CONCRETE_DOMAIN_CHANGES)) {
        return;
    }
    final Options expandOptions = expand().get(ClassificationTask.Expand.CONCRETE_DOMAIN_CHANGES, Options.class);
    final ConcreteDomainChanges concreteDomainChanges = ClassificationRequests.prepareSearchConcreteDomainChange().filterByClassificationId(classificationTaskIds).all().setExpand(expandOptions.get("expand", Options.class)).setLocales(locales()).build().execute(context());
    final ListMultimap<String, ConcreteDomainChange> concreteDomainChangesByTaskId = Multimaps.index(concreteDomainChanges, ConcreteDomainChange::getClassificationId);
    for (final ClassificationTask classificationTask : results) {
        final List<ConcreteDomainChange> taskChanges = concreteDomainChangesByTaskId.get(classificationTask.getId());
        classificationTask.setConcreteDomainChanges(new ConcreteDomainChanges(taskChanges, null, taskChanges.size(), taskChanges.size()));
    }
}
Also used : Options(com.b2international.commons.options.Options) ClassificationTask(com.b2international.snowowl.snomed.reasoner.domain.ClassificationTask) ConcreteDomainChange(com.b2international.snowowl.snomed.reasoner.domain.ConcreteDomainChange) ConcreteDomainChanges(com.b2international.snowowl.snomed.reasoner.domain.ConcreteDomainChanges)

Aggregations

Options (com.b2international.commons.options.Options)1 ClassificationTask (com.b2international.snowowl.snomed.reasoner.domain.ClassificationTask)1 ConcreteDomainChange (com.b2international.snowowl.snomed.reasoner.domain.ConcreteDomainChange)1 ConcreteDomainChanges (com.b2international.snowowl.snomed.reasoner.domain.ConcreteDomainChanges)1