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());
}
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);
}
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());
}
Aggregations