Search in sources :

Example 11 with ResourceURI

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

the class SnomedExtensionUpgradeTest method upgrade01Nochanges.

@Test
public void upgrade01Nochanges() {
    // create extension on the latest SI VERSION
    CodeSystem extension = createExtension(latestInternationalVersion, branchPath.lastSegment());
    // create a new INT version without any changes
    LocalDate effectiveTime = getNextAvailableEffectiveDate(SNOMEDCT);
    createVersion(SNOMEDCT, effectiveTime).statusCode(201);
    // start upgrade
    final ResourceURI newExtensionOf = CodeSystem.uri(SNOMEDCT, effectiveTime.toString());
    CodeSystem upgradeCodeSystem = createExtensionUpgrade(extension.getResourceURI(), newExtensionOf);
    assertEquals(newExtensionOf, upgradeCodeSystem.getExtensionOf());
}
Also used : ResourceURI(com.b2international.snowowl.core.ResourceURI) CodeSystem(com.b2international.snowowl.core.codesystem.CodeSystem) LocalDate(java.time.LocalDate) Test(org.junit.Test)

Example 12 with ResourceURI

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

the class SnomedExtensionUpgradeTest method upgrade03NewInternationalConceptOnly.

@Test
public void upgrade03NewInternationalConceptOnly() {
    // create extension on the latest SI VERSION
    CodeSystem extension = createExtension(latestInternationalVersion, branchPath.lastSegment());
    // new SI concept
    String newConceptId = createConcept(SnomedContentRule.SNOMEDCT, createConceptRequestBody(Concepts.ROOT_CONCEPT, Concepts.MODULE_SCT_CORE));
    // create a new INT version
    LocalDate effectiveTime = getNextAvailableEffectiveDate(SNOMEDCT);
    createVersion(SNOMEDCT, effectiveTime).statusCode(201);
    ResourceURI upgradeVersion = CodeSystem.uri(SNOMEDCT, effectiveTime.toString());
    // start upgrade to the new available upgrade version
    CodeSystem upgradeCodeSystem = createExtensionUpgrade(extension.getResourceURI(), upgradeVersion);
    assertEquals(upgradeVersion, upgradeCodeSystem.getExtensionOf());
    getComponent(upgradeCodeSystem.getResourceURI(), SnomedComponentType.CONCEPT, newConceptId).statusCode(200);
}
Also used : ResourceURI(com.b2international.snowowl.core.ResourceURI) CodeSystem(com.b2international.snowowl.core.codesystem.CodeSystem) LocalDate(java.time.LocalDate) Test(org.junit.Test)

Example 13 with ResourceURI

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

the class CodeSystemTest method extensionCodeSystemChildBranchToURI.

@Test
public void extensionCodeSystemChildBranchToURI() throws Exception {
    codeSystem.setId("SNOMEDCT-UK");
    codeSystem.setBranchPath("MAIN/SNOMEDCT-UK");
    ResourceURI uri = codeSystem.getResourceURI("MAIN/SNOMEDCT-UK/child");
    assertThat(uri).isEqualTo(CodeSystem.uri("SNOMEDCT-UK/child"));
}
Also used : ResourceURI(com.b2international.snowowl.core.ResourceURI) Test(org.junit.Test)

Example 14 with ResourceURI

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

the class ResourceURITest method explicitVersion.

@Test
public void explicitVersion() throws Exception {
    final ResourceURI uri = CodeSystem.uri("SNOMEDCT/2019-07-31");
    assertEquals("SNOMEDCT", uri.getResourceId());
    assertEquals("2019-07-31", uri.getPath());
}
Also used : ResourceURI(com.b2international.snowowl.core.ResourceURI) Test(org.junit.Test)

Example 15 with ResourceURI

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

the class ResourceURITest method latestReleasedExplicit.

@Test
public void latestReleasedExplicit() throws Exception {
    final ResourceURI uri = CodeSystem.uri("SNOMEDCT/LATEST");
    assertEquals("SNOMEDCT", uri.getResourceId());
    assertEquals(ResourceURI.LATEST, uri.getPath());
}
Also used : ResourceURI(com.b2international.snowowl.core.ResourceURI) Test(org.junit.Test)

Aggregations

ResourceURI (com.b2international.snowowl.core.ResourceURI)49 Test (org.junit.Test)29 CodeSystem (com.b2international.snowowl.core.codesystem.CodeSystem)21 LocalDate (java.time.LocalDate)19 Collectors (java.util.stream.Collectors)11 TerminologyResource (com.b2international.snowowl.core.TerminologyResource)7 List (java.util.List)7 Set (java.util.Set)7 BadRequestException (com.b2international.commons.exceptions.BadRequestException)6 Options (com.b2international.commons.options.Options)6 CodeSystemRequests (com.b2international.snowowl.core.codesystem.CodeSystemRequests)6 IEventBus (com.b2international.snowowl.eventbus.IEventBus)6 IOException (java.io.IOException)6 Map (java.util.Map)6 TimeUnit (java.util.concurrent.TimeUnit)6 RepositoryManager (com.b2international.snowowl.core.RepositoryManager)5 ServiceProvider (com.b2international.snowowl.core.ServiceProvider)5 CodeSystems (com.b2international.snowowl.core.codesystem.CodeSystems)5 Version (com.b2international.snowowl.core.version.Version)5 Strings (com.google.common.base.Strings)5