use of com.b2international.snowowl.snomed.reasoner.domain.EquivalentConceptSets in project snow-owl by b2ihealthcare.
the class ClassificationTaskConverter method expandEquivalentConceptSets.
private void expandEquivalentConceptSets(final List<ClassificationTask> results, final Set<String> classificationTaskIds) {
if (!expand().containsKey(ClassificationTask.Expand.EQUIVALENT_CONCEPT_SETS)) {
return;
}
final Options expandOptions = expand().get(ClassificationTask.Expand.EQUIVALENT_CONCEPT_SETS, Options.class);
final EquivalentConceptSets equivalentConceptSets = ClassificationRequests.prepareSearchEquivalentConceptSet().filterByClassificationId(classificationTaskIds).all().setExpand(expandOptions.get("expand", Options.class)).setLocales(locales()).build().execute(context());
final ListMultimap<String, EquivalentConceptSet> setsByTaskId = Multimaps.index(equivalentConceptSets, EquivalentConceptSet::getClassificationId);
for (final ClassificationTask classificationTask : results) {
final List<EquivalentConceptSet> taskSets = setsByTaskId.get(classificationTask.getId());
classificationTask.setEquivalentConceptSets(new EquivalentConceptSets(taskSets, null, taskSets.size(), taskSets.size()));
}
}
use of com.b2international.snowowl.snomed.reasoner.domain.EquivalentConceptSets in project snow-owl by b2ihealthcare.
the class EquivalencyChecker method processResults.
@Override
protected LongKeyLongMap processResults(final String classificationId) {
final Set<String> conceptIdsToCheck = additionalConcepts.stream().map(SnomedConcept::getId).collect(Collectors.toSet());
final LongKeyLongMap equivalentConceptMap = PrimitiveMaps.newLongKeyLongOpenHashMap();
final ClassificationTask classificationTask = ClassificationRequests.prepareGetClassification(classificationId).setExpand("equivalentConceptSets()").build(repositoryId).execute(getEventBus()).getSync();
if (!ClassificationStatus.COMPLETED.equals(classificationTask.getStatus())) {
throw new ReasonerApiException("Selected reasoner could not start or failed to finish its job.");
}
if (!classificationTask.getEquivalentConceptsFound()) {
return equivalentConceptMap;
}
final EquivalentConceptSets equivalentConceptSets = classificationTask.getEquivalentConceptSets();
registerEquivalentConcepts(equivalentConceptSets, conceptIdsToCheck, equivalentConceptMap);
return equivalentConceptMap;
}
Aggregations