Search in sources :

Example 1 with SnomedConcept

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

the class TerminologyTreeTest method getProximalPrimitiveParentsOfPrimitiveConcept.

@Ignore("Fix create sibling concept creation to enable this feature in TerminologyTree")
@Test
public void getProximalPrimitiveParentsOfPrimitiveConcept() throws Exception {
    final TerminologyTree tree = new TestTree().addNode(N1, true).build();
    final SnomedConcept n1 = tree.getNode(N1);
    assertThat(tree.getProximalPrimitiveParents(N1)).containsOnly(n1);
}
Also used : SnomedConcept(com.b2international.snowowl.snomed.core.domain.SnomedConcept) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 2 with SnomedConcept

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

the class TerminologyTreeTest method getProximalPrimitiveParentsOfDefiningConceptWithMultiplePrimitiveAncestors.

@Test
public void getProximalPrimitiveParentsOfDefiningConceptWithMultiplePrimitiveAncestors() throws Exception {
    final TerminologyTree tree = new TestTree().addNode(N1, true, null, newHashSet(N2)).addNode(N2, true, newHashSet(N1), newHashSet(N3)).addNode(N3, false, newHashSet(N2)).build();
    final SnomedConcept n2 = tree.getNode(N2);
    assertThat(tree.getProximalPrimitiveParents(N3)).containsOnly(n2);
}
Also used : SnomedConcept(com.b2international.snowowl.snomed.core.domain.SnomedConcept) Test(org.junit.Test)

Example 3 with SnomedConcept

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

the class TerminologyTreeTest method getProximalPrimitiveParentsOfDefiningConceptWithMultiplePrimitiveAncestorsViaLongRoutes.

@Test
public void getProximalPrimitiveParentsOfDefiningConceptWithMultiplePrimitiveAncestorsViaLongRoutes() throws Exception {
    final TerminologyTree tree = new TestTree().addNode(N1, true, null, newHashSet(N2, N4)).addNode(N2, true, newHashSet(N1), newHashSet(N3)).addNode(N3, false, newHashSet(N2), newHashSet(N4)).addNode(N4, false, newHashSet(N3, N1)).build();
    final SnomedConcept n2 = tree.getNode(N2);
    assertThat(tree.getProximalPrimitiveParents(N4)).containsOnly(n2);
}
Also used : SnomedConcept(com.b2international.snowowl.snomed.core.domain.SnomedConcept) Test(org.junit.Test)

Example 4 with SnomedConcept

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

the class TerminologyTreeTest method getProximalPrimitiveWithFixedAncestorSet_ReplacementTest.

@Test
public void getProximalPrimitiveWithFixedAncestorSet_ReplacementTest() throws Exception {
    final TerminologyTree tree = new TestTree().addNode(N1, true, null, newHashSet(N2)).addNode(N2, true, newHashSet(N1), newHashSet(N4)).addNode(N3, true, null, newHashSet(N4)).addNode(N4, false, newHashSet(N3, N2)).build();
    final SnomedConcept n2 = tree.getNode(N2);
    final SnomedConcept n3 = tree.getNode(N3);
    assertThat(tree.getProximalPrimitiveParents(N4)).containsOnly(n3, n2);
    final SnomedConcept n1 = tree.getNode(N1);
    assertThat(tree.getProximalPrimitiveParentIds(newArrayList(n1, n3, n2))).containsOnly(N3, N2);
}
Also used : SnomedConcept(com.b2international.snowowl.snomed.core.domain.SnomedConcept) Test(org.junit.Test)

Example 5 with SnomedConcept

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

the class TerminologyTreeTest method getProximalPrimitiveParentsOfDefiningConceptWithOnePrimitiveParent.

@Test
public void getProximalPrimitiveParentsOfDefiningConceptWithOnePrimitiveParent() throws Exception {
    final TerminologyTree tree = new TestTree().addNode(N1, true, null, newHashSet(N2)).addNode(N2, false, newHashSet(N1)).build();
    final SnomedConcept n1 = tree.getNode(N1);
    assertThat(tree.getProximalPrimitiveParents(N2)).containsOnly(n1);
}
Also used : SnomedConcept(com.b2international.snowowl.snomed.core.domain.SnomedConcept) Test(org.junit.Test)

Aggregations

SnomedConcept (com.b2international.snowowl.snomed.core.domain.SnomedConcept)90 Test (org.junit.Test)42 AbstractSnomedApiTest (com.b2international.snowowl.snomed.core.rest.AbstractSnomedApiTest)17 CodeSystem (com.b2international.snowowl.core.codesystem.CodeSystem)15 SnomedDescription (com.b2international.snowowl.snomed.core.domain.SnomedDescription)15 LocalDate (java.time.LocalDate)15 IBranchPath (com.b2international.snowowl.core.api.IBranchPath)12 SnomedConcepts (com.b2international.snowowl.snomed.core.domain.SnomedConcepts)12 Options (com.b2international.commons.options.Options)10 SnomedRelationship (com.b2international.snowowl.snomed.core.domain.SnomedRelationship)10 Concepts (com.b2international.snowowl.snomed.common.SnomedConstants.Concepts)9 ExtendedLocale (com.b2international.commons.http.ExtendedLocale)8 SnomedReferenceSetMember (com.b2international.snowowl.snomed.core.domain.refset.SnomedReferenceSetMember)8 CodeSystemRestRequests.createCodeSystem (com.b2international.snowowl.test.commons.codesystem.CodeSystemRestRequests.createCodeSystem)8 List (java.util.List)8 Map (java.util.Map)8 Collectors (java.util.stream.Collectors)8 Json (com.b2international.commons.json.Json)7 SnomedRf2Headers (com.b2international.snowowl.snomed.common.SnomedRf2Headers)7 SnomedRequests (com.b2international.snowowl.snomed.datastore.request.SnomedRequests)5