Search in sources :

Example 21 with SnomedConcept

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

the class Rf2QueryRefSetContentType method resolve.

@Override
public void resolve(SnomedReferenceSetMember component, String[] values) {
    component.setType(SnomedRefSetType.QUERY);
    component.setRefsetId(values[4]);
    // XXX actual type is not relevant here
    component.setReferencedComponent(new SnomedConcept(values[5]));
    component.setProperties(ImmutableMap.of(SnomedRf2Headers.FIELD_QUERY, values[6]));
}
Also used : SnomedConcept(com.b2international.snowowl.snomed.core.domain.SnomedConcept)

Example 22 with SnomedConcept

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

the class Rf2SimpleMapWithDescriptionContentType method resolve.

@Override
public void resolve(SnomedReferenceSetMember component, String[] values) {
    component.setType(SnomedRefSetType.SIMPLE_MAP_WITH_DESCRIPTION);
    component.setRefsetId(values[4]);
    // XXX actual type is not relevant here
    component.setReferencedComponent(new SnomedConcept(values[5]));
    component.setProperties(ImmutableMap.of(SnomedRf2Headers.FIELD_MAP_TARGET, values[6], SnomedRf2Headers.FIELD_MAP_TARGET_DESCRIPTION, values[7]));
}
Also used : SnomedConcept(com.b2international.snowowl.snomed.core.domain.SnomedConcept)

Example 23 with SnomedConcept

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

the class Rf2AssociationRefSetContentType method resolve.

@Override
public void resolve(SnomedReferenceSetMember component, String[] values) {
    component.setType(SnomedRefSetType.ASSOCIATION);
    component.setRefsetId(values[4]);
    // XXX actual type is not relevant here
    component.setReferencedComponent(new SnomedConcept(values[5]));
    component.setProperties(ImmutableMap.of(SnomedRf2Headers.FIELD_TARGET_COMPONENT_ID, values[6]));
}
Also used : SnomedConcept(com.b2international.snowowl.snomed.core.domain.SnomedConcept)

Example 24 with SnomedConcept

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

the class Rf2ConcreteDomainRefSetContentType method resolve.

@Override
public void resolve(SnomedReferenceSetMember component, String[] values) {
    component.setType(SnomedRefSetType.CONCRETE_DATA_TYPE);
    component.setRefsetId(values[4]);
    // XXX actual type is not relevant here
    component.setReferencedComponent(new SnomedConcept(values[5]));
    component.setProperties(ImmutableMap.of(SnomedRf2Headers.FIELD_VALUE, values[6], SnomedRf2Headers.FIELD_RELATIONSHIP_GROUP, values[7], SnomedRf2Headers.FIELD_TYPE_ID, values[8], SnomedRf2Headers.FIELD_CHARACTERISTIC_TYPE_ID, values[9]));
}
Also used : SnomedConcept(com.b2international.snowowl.snomed.core.domain.SnomedConcept)

Example 25 with SnomedConcept

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

the class SnomedValueSetMemberSearchRequestEvaluator method toMember.

private ValueSetMember toMember(SnomedReferenceSetMember member, ResourceURI codeSystemURI) {
    final String term;
    final String iconId = member.getReferencedComponent().getIconId();
    String terminologyComponentId = member.getReferencedComponent().getComponentType();
    switch(terminologyComponentId) {
        case SnomedConcept.TYPE:
            SnomedConcept concept = (SnomedConcept) member.getReferencedComponent();
            term = concept.getFsn().getTerm();
            break;
        case SnomedDescription.TYPE:
            SnomedDescription description = (SnomedDescription) member.getReferencedComponent();
            term = description.getTerm();
            break;
        default:
            term = member.getReferencedComponentId();
    }
    return new ValueSetMember(ComponentURI.of(codeSystemURI, terminologyComponentId, member.getReferencedComponentId()), term, iconId);
}
Also used : ValueSetMember(com.b2international.snowowl.core.domain.ValueSetMember) SnomedDescription(com.b2international.snowowl.snomed.core.domain.SnomedDescription) SnomedConcept(com.b2international.snowowl.snomed.core.domain.SnomedConcept)

Aggregations

SnomedConcept (com.b2international.snowowl.snomed.core.domain.SnomedConcept)90 Test (org.junit.Test)42 AbstractSnomedApiTest (com.b2international.snowowl.snomed.core.rest.AbstractSnomedApiTest)17 CodeSystem (com.b2international.snowowl.core.codesystem.CodeSystem)15 SnomedDescription (com.b2international.snowowl.snomed.core.domain.SnomedDescription)15 LocalDate (java.time.LocalDate)15 IBranchPath (com.b2international.snowowl.core.api.IBranchPath)12 SnomedConcepts (com.b2international.snowowl.snomed.core.domain.SnomedConcepts)12 Options (com.b2international.commons.options.Options)10 SnomedRelationship (com.b2international.snowowl.snomed.core.domain.SnomedRelationship)10 Concepts (com.b2international.snowowl.snomed.common.SnomedConstants.Concepts)9 ExtendedLocale (com.b2international.commons.http.ExtendedLocale)8 SnomedReferenceSetMember (com.b2international.snowowl.snomed.core.domain.refset.SnomedReferenceSetMember)8 CodeSystemRestRequests.createCodeSystem (com.b2international.snowowl.test.commons.codesystem.CodeSystemRestRequests.createCodeSystem)8 List (java.util.List)8 Map (java.util.Map)8 Collectors (java.util.stream.Collectors)8 Json (com.b2international.commons.json.Json)7 SnomedRf2Headers (com.b2international.snowowl.snomed.common.SnomedRf2Headers)7 SnomedRequests (com.b2international.snowowl.snomed.datastore.request.SnomedRequests)5