Search in sources :

Example 1 with SnomedConceptRestUpdate

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

the class SnomedConceptRestService method update.

@Operation(summary = "Update Concept", description = "Updates properties of the specified Concept, also managing inactivation indicator and association reference set " + "membership in case of inactivation." + "<p>The following properties are allowed to change:" + "<p>" + "&bull; module identifier<br>" + "&bull; subclass definition status<br>" + "&bull; definition status<br>" + "&bull; associated Concepts<br>" + "" + "<p>The following properties, when changed, will trigger inactivation:" + "<p>" + "&bull; inactivation indicator<br>")
@ApiResponses({ @ApiResponse(responseCode = "204", description = "No Content"), @ApiResponse(responseCode = "404", description = "Branch or Concept not found") })
@PutMapping(value = "/{conceptId}", consumes = { AbstractRestService.JSON_MEDIA_TYPE })
@ResponseStatus(HttpStatus.NO_CONTENT)
public void update(@Parameter(description = "The resource path", required = true) @PathVariable(value = "path") final String path, @Parameter(description = "The Concept identifier") @PathVariable(value = "conceptId") final String conceptId, @Parameter(description = "Updated Concept parameters") @RequestBody final SnomedResourceRequest<SnomedConceptRestUpdate> body, @Parameter(description = "Force update flag") @RequestParam(defaultValue = "false", required = false) final Boolean force, @RequestHeader(value = X_AUTHOR, required = false) final String author) {
    final SnomedConceptRestUpdate change = body.getChange();
    final String commitComment = body.getCommitComment();
    final String defaultModuleId = body.getDefaultModuleId();
    change.toRequestBuilder(conceptId).force(force).commit().setDefaultModuleId(defaultModuleId).setAuthor(author).setCommitComment(commitComment).build(path).execute(getBus()).getSync(COMMIT_TIMEOUT, TimeUnit.MINUTES);
}
Also used : SnomedConceptRestUpdate(com.b2international.snowowl.snomed.core.rest.domain.SnomedConceptRestUpdate) Operation(io.swagger.v3.oas.annotations.Operation) ApiResponses(io.swagger.v3.oas.annotations.responses.ApiResponses)

Aggregations

SnomedConceptRestUpdate (com.b2international.snowowl.snomed.core.rest.domain.SnomedConceptRestUpdate)1 Operation (io.swagger.v3.oas.annotations.Operation)1 ApiResponses (io.swagger.v3.oas.annotations.responses.ApiResponses)1