Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1922-acquisition-deletion #1937

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ public void deleteById(final Long id) throws ShanoirException, SolrServerExcepti
if (datasetDb == null) {
throw new EntityNotFoundException(Dataset.class, id);
}
repository.deleteById(id);
solrService.deleteFromIndex(id);
this.deleteDatasetFromPacs(datasetDb);
repository.deleteById(id);
shanoirEventService.publishEvent(new ShanoirEvent(ShanoirEventType.DELETE_DATASET_EVENT, id.toString(), KeycloakUtil.getTokenUserId(), "", ShanoirEvent.SUCCESS, datasetDb.getStudyId()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ public void deleteDicomFilesFromPacs(String url) throws ShanoirException {
HttpPost post = new HttpPost(rejectURL);
post.setHeader(HttpHeaders.CONTENT_TYPE, CONTENT_TYPE_JSON);
try (CloseableHttpResponse response = httpClient.execute(post)) {
if (response.getCode() == HttpStatus.NO_CONTENT.value()) {
if (HttpStatus.OK.value() == response.getCode()) {
LOG.info("Rejected from PACS: " + url);
} else {
LOG.error(response.getCode() + ": Could not reject instance from PACS: " + response.getReasonPhrase()
Expand All @@ -304,8 +304,8 @@ public void deleteDicomFilesFromPacs(String url) throws ShanoirException {
+ "for rejectURL: " + rejectURL);
}
} catch (IOException e) {
LOG.error(e.getMessage(), e);
throw new ShanoirException(e.getMessage());
LOG.error("Could not reject instance from PACS: for rejectURL: " + rejectURL, e);
throw new ShanoirException("Could not reject instance from PACS: for rejectURL: " + url, e);
}
// STEP 2: Delete from the PACS
HttpDelete delete = new HttpDelete(deleteUrl);
Expand Down