Search in sources :

Example 1 with SnomedConceptCreateRequestBuilder

use of com.b2international.snowowl.snomed.datastore.request.SnomedConceptCreateRequestBuilder in project snow-owl by b2ihealthcare.

the class SnomedRefSetRestInput method toRequestBuilder.

public SnomedTransactionalRequestBuilder<String> toRequestBuilder() {
    SnomedRefSetCreateRequestBuilder refsetCreateRequest = SnomedRequests.prepareNewRefSet().setType(type).setReferencedComponentType(referencedComponentType);
    if (!Strings.isNullOrEmpty(conceptRestInput.getId()) && conceptRestInput.getDescriptions().isEmpty()) {
        refsetCreateRequest.setIdentifierId(conceptRestInput.getId());
        return refsetCreateRequest;
    }
    SnomedConceptCreateRequestBuilder conceptRequest = conceptRestInput.toRequestBuilder();
    if (conceptRestInput.getRelationships().isEmpty()) {
        conceptRequest.addParent(SnomedRefSetUtil.getParentConceptId(getType()));
    }
    conceptRequest.setRefSet(refsetCreateRequest);
    return conceptRequest;
}
Also used : SnomedRefSetCreateRequestBuilder(com.b2international.snowowl.snomed.datastore.request.SnomedRefSetCreateRequestBuilder) SnomedConceptCreateRequestBuilder(com.b2international.snowowl.snomed.datastore.request.SnomedConceptCreateRequestBuilder)

Aggregations

SnomedConceptCreateRequestBuilder (com.b2international.snowowl.snomed.datastore.request.SnomedConceptCreateRequestBuilder)1 SnomedRefSetCreateRequestBuilder (com.b2international.snowowl.snomed.datastore.request.SnomedRefSetCreateRequestBuilder)1