Search in sources :

Example 1 with RelationshipValue

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

the class SnomedRelationshipIndexEntrySerializationTest method indexDecimal.

@Test
public void indexDecimal() throws Exception {
    final SnomedRelationshipIndexEntry decimalValue = createBuilder().value(new RelationshipValue(new BigDecimal("3.333"))).build();
    indexRevision(RevisionBranch.MAIN_PATH, decimalValue);
    final SnomedRelationshipIndexEntry actual = assertDocEquals(decimalValue);
    assertEquals(RelationshipValueType.DECIMAL, actual.getValueType());
}
Also used : RelationshipValue(com.b2international.snowowl.snomed.core.domain.RelationshipValue) BigDecimal(java.math.BigDecimal) Test(org.junit.Test) BaseRevisionIndexTest(com.b2international.index.revision.BaseRevisionIndexTest)

Example 2 with RelationshipValue

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

the class SnomedConcreteValueApiTest method createConcreteValue.

@Test
public void createConcreteValue() {
    Json requestBody = createConcreteValueRequestBody(Concepts.ROOT_CONCEPT, Concepts.PART_OF, new RelationshipValue("string value")).with("commitComment", "Created new concrete value");
    createComponent(branchPath, SnomedComponentType.RELATIONSHIP, requestBody).statusCode(201);
}
Also used : Json(com.b2international.commons.json.Json) RelationshipValue(com.b2international.snowowl.snomed.core.domain.RelationshipValue) Test(org.junit.Test) AbstractSnomedApiTest(com.b2international.snowowl.snomed.core.rest.AbstractSnomedApiTest)

Example 3 with RelationshipValue

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

the class SnomedConcreteValueApiTest method createConcreteValueNonExistentBranch.

@Test
public void createConcreteValueNonExistentBranch() {
    Json requestBody = createConcreteValueRequestBody(Concepts.ROOT_CONCEPT, Concepts.PART_OF, new RelationshipValue("Hello world!")).with("commitComment", "Created new concrete value on non-existent branch");
    createComponent(BranchPathUtils.createPath("MAIN/x/y/z"), SnomedComponentType.RELATIONSHIP, requestBody).statusCode(404);
}
Also used : Json(com.b2international.commons.json.Json) RelationshipValue(com.b2international.snowowl.snomed.core.domain.RelationshipValue) Test(org.junit.Test) AbstractSnomedApiTest(com.b2international.snowowl.snomed.core.rest.AbstractSnomedApiTest)

Example 4 with RelationshipValue

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

the class SnomedConcreteValueApiTest method createConcreteValueInferred.

@Test
public void createConcreteValueInferred() {
    Json requestBody = createConcreteValueRequestBody(Concepts.ROOT_CONCEPT, Concepts.PART_OF, new RelationshipValue(7), Concepts.INFERRED_RELATIONSHIP).with("commitComment", "Created new concrete value with inferred characteristic type");
    String relationshipId = assertCreated(createComponent(branchPath, SnomedComponentType.RELATIONSHIP, requestBody));
    getComponent(branchPath, SnomedComponentType.RELATIONSHIP, relationshipId).statusCode(200).body("characteristicTypeId", equalTo(Concepts.INFERRED_RELATIONSHIP));
}
Also used : Json(com.b2international.commons.json.Json) RelationshipValue(com.b2international.snowowl.snomed.core.domain.RelationshipValue) Test(org.junit.Test) AbstractSnomedApiTest(com.b2international.snowowl.snomed.core.rest.AbstractSnomedApiTest)

Example 5 with RelationshipValue

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

the class SnomedConcreteValueApiTest method createConcreteValueInvalidModule.

@Test
public void createConcreteValueInvalidModule() {
    Json requestBody = createConcreteValueRequestBody(Concepts.ROOT_CONCEPT, Concepts.PART_OF, new RelationshipValue(5), Concepts.INFERRED_RELATIONSHIP, 0, "11110000").with("commitComment", "Created new concrete value with invalid moduleId");
    createComponent(branchPath, SnomedComponentType.RELATIONSHIP, requestBody).statusCode(400);
}
Also used : Json(com.b2international.commons.json.Json) RelationshipValue(com.b2international.snowowl.snomed.core.domain.RelationshipValue) Test(org.junit.Test) AbstractSnomedApiTest(com.b2international.snowowl.snomed.core.rest.AbstractSnomedApiTest)

Aggregations

RelationshipValue (com.b2international.snowowl.snomed.core.domain.RelationshipValue)20 Test (org.junit.Test)13 AbstractSnomedApiTest (com.b2international.snowowl.snomed.core.rest.AbstractSnomedApiTest)12 Json (com.b2international.commons.json.Json)11 BigDecimal (java.math.BigDecimal)4 SearchResourceRequest (com.b2international.snowowl.core.request.SearchResourceRequest)3 Expressions (com.b2international.index.query.Expressions)2 ExpressionBuilder (com.b2international.index.query.Expressions.ExpressionBuilder)2 Expressions (com.b2international.snowowl.snomed.datastore.index.entry.SnomedRelationshipIndexEntry.Expressions)2 ArrayList (java.util.ArrayList)2 CompareUtils (com.b2international.commons.CompareUtils)1 BadRequestException (com.b2international.commons.exceptions.BadRequestException)1 NotImplementedException (com.b2international.commons.exceptions.NotImplementedException)1 Options (com.b2international.commons.options.Options)1 Expression (com.b2international.index.query.Expression)1 Query (com.b2international.index.query.Query)1 BaseRevisionIndexTest (com.b2international.index.revision.BaseRevisionIndexTest)1 ID (com.b2international.index.revision.Revision.Fields.ID)1 RevisionSearcher (com.b2international.index.revision.RevisionSearcher)1 com.b2international.snomed.ecl.ecl (com.b2international.snomed.ecl.ecl)1