Search in sources :

Example 1 with SnomedIdentifier

use of com.b2international.snowowl.snomed.cis.SnomedIdentifier in project snow-owl by b2ihealthcare.

the class SnomedIdentifierTest method whenCreatingBasicConceptIdentifierInShortFormat_ThenItShouldBeCreated.

@Test
public void whenCreatingBasicConceptIdentifierInShortFormat_ThenItShouldBeCreated() throws Exception {
    final SnomedIdentifier id = SnomedIdentifiers.create(Concepts.ROOT_CONCEPT);
    assertEquals(138875L, id.getItemId());
    assertEquals("", id.getNamespace());
    assertEquals(0, id.getFormatIdentifier());
    assertEquals(0, id.getComponentIdentifier());
    assertEquals(5, id.getCheckDigit());
    assertEquals(ComponentCategory.CONCEPT, id.getComponentCategory());
}
Also used : SnomedIdentifier(com.b2international.snowowl.snomed.cis.SnomedIdentifier) Test(org.junit.Test)

Example 2 with SnomedIdentifier

use of com.b2international.snowowl.snomed.cis.SnomedIdentifier in project snow-owl by b2ihealthcare.

the class SnomedIdentifierTest method whenCreatingDescriptionIdentifierInShortFormat_ThenItShouldBeCreated.

@Test
public void whenCreatingDescriptionIdentifierInShortFormat_ThenItShouldBeCreated() throws Exception {
    final SnomedIdentifier id = SnomedIdentifiers.create("1290023401015");
    assertEquals(1290023401L, id.getItemId());
    assertEquals("", id.getNamespace());
    assertEquals(0, id.getFormatIdentifier());
    assertEquals(1, id.getComponentIdentifier());
    assertEquals(5, id.getCheckDigit());
    assertEquals(ComponentCategory.DESCRIPTION, id.getComponentCategory());
}
Also used : SnomedIdentifier(com.b2international.snowowl.snomed.cis.SnomedIdentifier) Test(org.junit.Test)

Example 3 with SnomedIdentifier

use of com.b2international.snowowl.snomed.cis.SnomedIdentifier in project snow-owl by b2ihealthcare.

the class SnomedIdentifierTest method whenCreatingSCTIdentifierInLongFormat_ThenItShouldBeCreated.

@Test
public void whenCreatingSCTIdentifierInLongFormat_ThenItShouldBeCreated() throws Exception {
    final SnomedIdentifier id = SnomedIdentifiers.create("999999990989121104");
    assertEquals(99999999L, id.getItemId());
    assertEquals("0989121", id.getNamespace());
    assertEquals(1, id.getFormatIdentifier());
    assertEquals(0, id.getComponentIdentifier());
    assertEquals(4, id.getCheckDigit());
    assertEquals(ComponentCategory.CONCEPT, id.getComponentCategory());
}
Also used : SnomedIdentifier(com.b2international.snowowl.snomed.cis.SnomedIdentifier) Test(org.junit.Test)

Example 4 with SnomedIdentifier

use of com.b2international.snowowl.snomed.cis.SnomedIdentifier in project snow-owl by b2ihealthcare.

the class SnomedIdentifierTest method whenCreatingShortestConceptIdentifierInShortFormat_ThenItShouldBeCreated.

@Test
public void whenCreatingShortestConceptIdentifierInShortFormat_ThenItShouldBeCreated() throws Exception {
    final SnomedIdentifier id = SnomedIdentifiers.create("100005");
    assertEquals(100L, id.getItemId());
    assertEquals("", id.getNamespace());
    assertEquals(0, id.getFormatIdentifier());
    assertEquals(0, id.getComponentIdentifier());
    assertEquals(5, id.getCheckDigit());
    assertEquals(ComponentCategory.CONCEPT, id.getComponentCategory());
}
Also used : SnomedIdentifier(com.b2international.snowowl.snomed.cis.SnomedIdentifier) Test(org.junit.Test)

Example 5 with SnomedIdentifier

use of com.b2international.snowowl.snomed.cis.SnomedIdentifier in project snow-owl by b2ihealthcare.

the class SnomedIdentifierTest method whenCreatingRelationshipIdentifierInLongFormat_ThenItShouldBeCreated.

@Test
public void whenCreatingRelationshipIdentifierInLongFormat_ThenItShouldBeCreated() throws Exception {
    final SnomedIdentifier id = SnomedIdentifiers.create("9940000001126");
    assertEquals(994L, id.getItemId());
    assertEquals("0000001", id.getNamespace());
    assertEquals(1, id.getFormatIdentifier());
    assertEquals(2, id.getComponentIdentifier());
    assertEquals(6, id.getCheckDigit());
    assertEquals(ComponentCategory.RELATIONSHIP, id.getComponentCategory());
}
Also used : SnomedIdentifier(com.b2international.snowowl.snomed.cis.SnomedIdentifier) Test(org.junit.Test)

Aggregations

SnomedIdentifier (com.b2international.snowowl.snomed.cis.SnomedIdentifier)11 Test (org.junit.Test)10 Reservation (com.b2international.snowowl.snomed.cis.reservations.Reservation)3 Index (com.b2international.index.Index)1 Mappings (com.b2international.index.mapping.Mappings)1 ComponentCategory (com.b2international.snowowl.core.terminology.ComponentCategory)1 ISnomedIdentifierService (com.b2international.snowowl.snomed.cis.ISnomedIdentifierService)1 SnomedIdentifierConfiguration (com.b2international.snowowl.snomed.cis.SnomedIdentifierConfiguration)1 SctId (com.b2international.snowowl.snomed.cis.domain.SctId)1 ItemIdGenerationStrategy (com.b2international.snowowl.snomed.cis.gen.ItemIdGenerationStrategy)1 SnomedIdentifierReservationServiceImpl (com.b2international.snowowl.snomed.cis.internal.reservations.SnomedIdentifierReservationServiceImpl)1 DefaultSnomedIdentifierService (com.b2international.snowowl.snomed.cis.memory.DefaultSnomedIdentifierService)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 ImmutableSet (com.google.common.collect.ImmutableSet)1 Set (java.util.Set)1