use of com.b2international.snowowl.snomed.core.domain.SnomedConcept in project snow-owl by b2ihealthcare.
the class Rf2ComplexMapRefSetContentType method resolve.
@Override
public void resolve(SnomedReferenceSetMember component, String[] values) {
component.setType(SnomedRefSetType.COMPLEX_MAP);
component.setRefsetId(values[4]);
// XXX actual type is not relevant here
component.setReferencedComponent(new SnomedConcept(values[5]));
component.setProperties(ImmutableMap.<String, Object>builder().put(FIELD_MAP_GROUP, Integer.parseInt(values[6])).put(FIELD_MAP_PRIORITY, Integer.parseInt(values[7])).put(FIELD_MAP_RULE, values[8]).put(FIELD_MAP_ADVICE, values[9]).put(FIELD_MAP_TARGET, values[10]).put(FIELD_CORRELATION_ID, values[11]).build());
}
use of com.b2international.snowowl.snomed.core.domain.SnomedConcept in project snow-owl by b2ihealthcare.
the class Rf2ComplexBlockMapRefSetContentType method resolve.
@Override
public void resolve(SnomedReferenceSetMember component, String[] values) {
component.setType(SnomedRefSetType.COMPLEX_BLOCK_MAP);
component.setRefsetId(values[4]);
// XXX actual type is not relevant here
component.setReferencedComponent(new SnomedConcept(values[5]));
component.setProperties(ImmutableMap.<String, Object>builder().put(FIELD_MAP_GROUP, Integer.parseInt(values[6])).put(FIELD_MAP_PRIORITY, Integer.parseInt(values[7])).put(FIELD_MAP_RULE, values[8]).put(FIELD_MAP_ADVICE, values[9]).put(FIELD_MAP_TARGET, values[10]).put(FIELD_CORRELATION_ID, values[11]).put(FIELD_MAP_BLOCK, Integer.parseInt(values[12])).build());
}
use of com.b2international.snowowl.snomed.core.domain.SnomedConcept in project snow-owl by b2ihealthcare.
the class Rf2DescriptionTypeRefSetContentType method resolve.
@Override
public void resolve(SnomedReferenceSetMember component, String[] values) {
component.setType(SnomedRefSetType.DESCRIPTION_TYPE);
component.setRefsetId(values[4]);
// XXX actual type is not relevant here
component.setReferencedComponent(new SnomedConcept(values[5]));
component.setProperties(ImmutableMap.<String, Object>of(SnomedRf2Headers.FIELD_DESCRIPTION_FORMAT, values[6], SnomedRf2Headers.FIELD_DESCRIPTION_LENGTH, Integer.parseInt(values[7])));
}
use of com.b2international.snowowl.snomed.core.domain.SnomedConcept in project snow-owl by b2ihealthcare.
the class SnomedClassificationApiTest method issue_SO_1830_testInferredEquivalentConceptParents.
@Test
public void issue_SO_1830_testInferredEquivalentConceptParents() throws Exception {
String parentConceptId = createNewConcept(branchPath);
String childConceptId = createNewConcept(branchPath, parentConceptId);
String equivalentConceptId = createNewConcept(branchPath, parentConceptId);
changeToDefining(branchPath, equivalentConceptId);
String classificationId = getClassificationJobId(beginClassification(branchPath));
waitForClassificationJob(branchPath, classificationId).statusCode(200).body("status", equalTo(ClassificationStatus.COMPLETED.name()));
/*
* Expecting that childConceptId will get two inferred IS A-s pointing to parentConceptId and equivalentConceptId, respectively,
* while parentConceptId and equivalentConceptId each will get a single inferred IS A pointing to the root concept.
*/
RelationshipChanges changes = MAPPER.readValue(getRelationshipChanges(branchPath, classificationId).statusCode(200).extract().asInputStream(), RelationshipChanges.class);
FluentIterable<RelationshipChange> changesIterable = FluentIterable.from(changes.getItems());
assertEquals(4, changes.getTotal());
assertTrue("All changes should be inferred.", changesIterable.allMatch(relationshipChange -> ChangeNature.NEW.equals(relationshipChange.getChangeNature())));
assertInferredIsAExists(changesIterable, childConceptId, parentConceptId);
assertInferredIsAExists(changesIterable, childConceptId, equivalentConceptId);
assertInferredIsAExists(changesIterable, parentConceptId, Concepts.ROOT_CONCEPT);
assertInferredIsAExists(changesIterable, equivalentConceptId, Concepts.ROOT_CONCEPT);
EquivalentConceptSets equivalentConceptSets = MAPPER.readValue(getEquivalentConceptSets(branchPath, classificationId).statusCode(200).extract().asInputStream(), EquivalentConceptSets.class);
assertEquals(1, equivalentConceptSets.getItems().size());
SnomedConcepts equivalentConceptsInFirstSet = equivalentConceptSets.first().get().getEquivalentConcepts();
FluentIterable<SnomedConcept> equivalentConceptsIterable = FluentIterable.from(equivalentConceptsInFirstSet);
assertEquals(2, equivalentConceptsInFirstSet.getTotal());
assertEquivalentConceptPresent(equivalentConceptsIterable, parentConceptId);
assertEquivalentConceptPresent(equivalentConceptsIterable, equivalentConceptId);
}
use of com.b2international.snowowl.snomed.core.domain.SnomedConcept in project snow-owl by b2ihealthcare.
the class SnomedExpressionLabelTest method getEcl.
@Test
public void getEcl() throws Exception {
String conceptId = createNewConcept(branchPath);
String shortName = "SNOMEDCT-Test";
createCodeSystem(branchPath, shortName).statusCode(201);
List<String> expressionLabels = getExpressionLabels(branchPath.getPath(), List.of(conceptId));
SnomedConcept concept = getConcept(conceptId, "fsn()");
String validExpression = conceptId + " |" + concept.getFsn().getTerm() + "|";
Assertions.assertThat(expressionLabels).containsOnly(validExpression);
}
Aggregations