Search in sources :

Example 11 with ConceptMapMappings

use of com.b2international.snowowl.core.domain.ConceptMapMappings in project snow-owl by b2ihealthcare.

the class ConceptMapSearchMappingRequestSnomedMapTypeReferenceSetTest method filterByActive.

@Test
public void filterByActive() {
    final String refSetId = createSimpleMapTypeRefSet();
    createInactiveSimpleMapTypeRefSetMember(refSetId, REFERENCED_COMPONENT, MAP_TARGET_1);
    createSimpleMapTypeRefSetMember(refSetId, REFERENCED_COMPONENT, MAP_TARGET_2);
    final ConceptMapMappings conceptMaps = ConceptMapRequests.prepareSearchConceptMapMappings().all().filterByConceptMap(ComponentURI.of(CODESYSTEM, SnomedConcept.REFSET_TYPE, refSetId).toString()).filterByActive(true).setLocales("en").buildAsync().execute(Services.bus()).getSync(1, TimeUnit.MINUTES);
    assertEquals(1, conceptMaps.getTotal());
}
Also used : ConceptMapMappings(com.b2international.snowowl.core.domain.ConceptMapMappings) Test(org.junit.Test)

Example 12 with ConceptMapMappings

use of com.b2international.snowowl.core.domain.ConceptMapMappings in project snow-owl by b2ihealthcare.

the class ConceptMapSearchMappingRequestSnomedMapTypeReferenceSetTest method filterByComponentUris.

@Test
public void filterByComponentUris() {
    final String refSetId = createSimpleMapTypeRefSet();
    final ComponentURI uri = ComponentURI.of(CODESYSTEM, SnomedConcept.TYPE, "12345");
    final ComponentURI uri2 = ComponentURI.of(CODESYSTEM, SnomedConcept.TYPE, "54321");
    final ComponentURI sourceUri = ComponentURI.of(CODESYSTEM, SnomedConcept.TYPE, REFERENCED_COMPONENT);
    createSimpleMapTypeRefSetMember(refSetId, REFERENCED_COMPONENT, uri.toString());
    createSimpleMapTypeRefSetMember(refSetId, REFERENCED_COMPONENT, uri2.toString());
    createSimpleMapTypeRefSetMember(refSetId, REFERENCED_COMPONENT, "Random map target");
    final ConceptMapMappings conceptMaps = ConceptMapRequests.prepareSearchConceptMapMappings().all().filterByComponentIds(Set.of(uri.toString(), uri2.toString())).filterByConceptMap(ComponentURI.of(CODESYSTEM, SnomedConcept.REFSET_TYPE, refSetId).toString()).setLocales("en").buildAsync().execute(Services.bus()).getSync(1, TimeUnit.MINUTES);
    assertEquals(2, conceptMaps.getTotal());
    Set<ComponentURI> componentUris = getComponentUris(conceptMaps);
    assertThat(componentUris).containsOnly(sourceUri, uri, uri2);
}
Also used : ComponentURI(com.b2international.snowowl.core.uri.ComponentURI) ConceptMapMappings(com.b2international.snowowl.core.domain.ConceptMapMappings) Test(org.junit.Test)

Example 13 with ConceptMapMappings

use of com.b2international.snowowl.core.domain.ConceptMapMappings in project snow-owl by b2ihealthcare.

the class ConceptMapSearchMappingRequestSnomedMapTypeReferenceSetTest method filterByActiveInactiveConcepts.

@Test
public void filterByActiveInactiveConcepts() {
    final String refSetId = createSimpleMapTypeRefSet();
    createInactiveSimpleMapTypeRefSetMember(refSetId, REFERENCED_COMPONENT, MAP_TARGET_1);
    createSimpleMapTypeRefSetMember(refSetId, REFERENCED_COMPONENT, MAP_TARGET_2);
    final ConceptMapMappings conceptMaps = ConceptMapRequests.prepareSearchConceptMapMappings().all().filterByConceptMap(ComponentURI.of(CODESYSTEM, SnomedConcept.REFSET_TYPE, refSetId).toString()).filterByActive(false).setLocales("en").buildAsync().execute(Services.bus()).getSync(1, TimeUnit.MINUTES);
    assertEquals(1, conceptMaps.getTotal());
}
Also used : ConceptMapMappings(com.b2international.snowowl.core.domain.ConceptMapMappings) Test(org.junit.Test)

Aggregations

ConceptMapMappings (com.b2international.snowowl.core.domain.ConceptMapMappings)13 Test (org.junit.Test)11 ConceptMapMapping (com.b2international.snowowl.core.domain.ConceptMapMapping)4 ComponentURI (com.b2international.snowowl.core.uri.ComponentURI)3 Options (com.b2international.commons.options.Options)2 ResourceURI (com.b2international.snowowl.core.ResourceURI)2 ServiceProvider (com.b2international.snowowl.core.ServiceProvider)2 List (java.util.List)2 Set (java.util.Set)2 Collectors (java.util.stream.Collectors)2 ExtendedLocale (com.b2international.commons.http.ExtendedLocale)1 OptionsBuilder (com.b2international.commons.options.OptionsBuilder)1 RepositoryManager (com.b2international.snowowl.core.RepositoryManager)1 CodeSystem (com.b2international.snowowl.core.codesystem.CodeSystem)1 CodeSystemRequests (com.b2international.snowowl.core.codesystem.CodeSystemRequests)1 Concept (com.b2international.snowowl.core.domain.Concept)1 Builder (com.b2international.snowowl.core.domain.ConceptMapMapping.Builder)1 ResourceDocument (com.b2international.snowowl.core.internal.ResourceDocument)1 ConceptMapMappingSearchRequestEvaluator (com.b2international.snowowl.core.request.ConceptMapMappingSearchRequestEvaluator)1 MappingCorrelation (com.b2international.snowowl.core.request.MappingCorrelation)1