Search in sources :

Example 1 with SnomedUri

use of com.b2international.snowowl.snomed.fhir.SnomedUri in project snow-owl by b2ihealthcare.

the class SnomedUriParsingTest method testToUriWithQuery_fhir_cm.

@Test
public void testToUriWithQuery_fhir_cm() {
    SnomedUri uri = SnomedUri.builder().conceptMapQuery(Concepts.ROOT_CONCEPT).build();
    assertEquals(SnomedUri.SNOMED_BASE_URI_STRING + "?fhir_cm=" + Concepts.ROOT_CONCEPT, uri.toString());
}
Also used : SnomedUri(com.b2international.snowowl.snomed.fhir.SnomedUri) Test(org.junit.Test)

Example 2 with SnomedUri

use of com.b2international.snowowl.snomed.fhir.SnomedUri in project snow-owl by b2ihealthcare.

the class SnomedUriParsingTest method testToUriWithQuery_fhir_vs_isa.

@Test
public void testToUriWithQuery_fhir_vs_isa() {
    SnomedUri uri = SnomedUri.builder().isAQuery(Concepts.ROOT_CONCEPT).build();
    assertEquals(SnomedUri.SNOMED_BASE_URI_STRING + "?fhir_vs=isa/" + Concepts.ROOT_CONCEPT, uri.toString());
}
Also used : SnomedUri(com.b2international.snowowl.snomed.fhir.SnomedUri) Test(org.junit.Test)

Example 3 with SnomedUri

use of com.b2international.snowowl.snomed.fhir.SnomedUri in project snow-owl by b2ihealthcare.

the class SnomedUriParsingTest method testIntEditionWithModuleUri.

@Test
public void testIntEditionWithModuleUri() {
    String uriString = SnomedUri.SNOMED_BASE_URI_STRING + "/" + Concepts.MODULE_SCT_CORE;
    SnomedUri snomedUri = SnomedUri.fromUriString(uriString, "uri");
    assertEquals(Concepts.MODULE_SCT_CORE, snomedUri.getExtensionModuleId());
    assertNull(snomedUri.getVersionTag());
}
Also used : SnomedUri(com.b2international.snowowl.snomed.fhir.SnomedUri) Test(org.junit.Test)

Example 4 with SnomedUri

use of com.b2international.snowowl.snomed.fhir.SnomedUri in project snow-owl by b2ihealthcare.

the class SnomedUriParsingTest method testComplexUriWithQueryPart.

@Test
public void testComplexUriWithQueryPart() {
    String uriString = SnomedUri.SNOMED_BASE_URI_STRING + "/" + Concepts.MODULE_SCT_CORE + "/version/20170131?fhir_vs=isa/50697003";
    SnomedUri snomedUri = SnomedUri.fromUriString(uriString, "uri");
    assertEquals(Concepts.MODULE_SCT_CORE, snomedUri.getExtensionModuleId());
    assertEquals("20170131", snomedUri.getVersionTag());
    assertEquals("fhir_vs", snomedUri.getQueryPart().getQueryParameter());
    assertEquals(QueryPartDefinition.ISA, snomedUri.getQueryPart().getQueryPartDefinition());
    assertEquals("50697003", snomedUri.getQueryPart().getQueryValue());
}
Also used : SnomedUri(com.b2international.snowowl.snomed.fhir.SnomedUri) Test(org.junit.Test)

Example 5 with SnomedUri

use of com.b2international.snowowl.snomed.fhir.SnomedUri in project snow-owl by b2ihealthcare.

the class SnomedUriParsingTest method testUriWithQuery.

@Test
public void testUriWithQuery() {
    String uriString = "http://snomed.info/sct?fhir_vs";
    SnomedUri snomedUri = SnomedUri.fromUriString(uriString, "uri");
    assertEquals(null, snomedUri.getExtensionModuleId());
    assertEquals(null, snomedUri.getVersionTag());
    assertEquals("fhir_vs", snomedUri.getQueryPart().getQueryParameter());
    assertEquals(QueryPartDefinition.NONE, snomedUri.getQueryPart().getQueryPartDefinition());
    assertEquals(null, snomedUri.getQueryPart().getQueryValue());
    uriString = "http://snomed.info/sct?fhir_vs=isa/50697003";
    snomedUri = SnomedUri.fromUriString(uriString, "uri");
    assertEquals(null, snomedUri.getExtensionModuleId());
    assertEquals(null, snomedUri.getVersionTag());
    assertEquals("fhir_vs", snomedUri.getQueryPart().getQueryParameter());
    assertEquals(QueryPartDefinition.ISA, snomedUri.getQueryPart().getQueryPartDefinition());
    assertEquals("50697003", snomedUri.getQueryPart().getQueryValue());
    uriString = "http://snomed.info/sct?fhir_vs=refset";
    snomedUri = SnomedUri.fromUriString(uriString, "uri");
    assertEquals(null, snomedUri.getExtensionModuleId());
    assertEquals(null, snomedUri.getVersionTag());
    assertEquals("fhir_vs", snomedUri.getQueryPart().getQueryParameter());
    assertEquals(QueryPartDefinition.REFSETS, snomedUri.getQueryPart().getQueryPartDefinition());
    uriString = "http://snomed.info/sct?fhir_vs=refset/50697003";
    snomedUri = SnomedUri.fromUriString(uriString, "uri");
    assertEquals(null, snomedUri.getExtensionModuleId());
    assertEquals(null, snomedUri.getVersionTag());
    assertEquals("fhir_vs", snomedUri.getQueryPart().getQueryParameter());
    assertEquals(QueryPartDefinition.REFSET, snomedUri.getQueryPart().getQueryPartDefinition());
    assertEquals("50697003", snomedUri.getQueryPart().getQueryValue());
    uriString = "http://snomed.info/sct?fhir_cm=50697003";
    snomedUri = SnomedUri.fromUriString(uriString, "uri");
    assertEquals(null, snomedUri.getExtensionModuleId());
    assertEquals(null, snomedUri.getVersionTag());
    assertEquals("fhir_cm", snomedUri.getQueryPart().getQueryParameter());
    assertEquals(QueryPartDefinition.NONE, snomedUri.getQueryPart().getQueryPartDefinition());
    assertEquals("50697003", snomedUri.getQueryPart().getQueryValue());
}
Also used : SnomedUri(com.b2international.snowowl.snomed.fhir.SnomedUri) Test(org.junit.Test)

Aggregations

SnomedUri (com.b2international.snowowl.snomed.fhir.SnomedUri)11 Test (org.junit.Test)11