Skip to content

Commit

Permalink
Remove rabbitmq call for pseudo profile from ImporterManagerService (…
Browse files Browse the repository at this point in the history
…to prepare before on job)
  • Loading branch information
michaelkain committed Oct 20, 2023
1 parent bbbb124 commit 2dbb0e7
Showing 1 changed file with 15 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,23 +171,21 @@ public void manageImportJob(final ImportJob importJob) {
private void pseudonymize(final ImportJob importJob, ShanoirEvent event, final File importJobDir, Patient patient)
throws FileNotFoundException, ShanoirException {
if (importJob.getAnonymisationProfileToUse() == null || !importJob.getAnonymisationProfileToUse().isEmpty()) {
String anonymizationProfile = (String) this.rabbitTemplate.convertSendAndReceive(RabbitMQConfiguration.STUDY_ANONYMISATION_PROFILE_QUEUE, importJob.getStudyId());
importJob.setAnonymisationProfileToUse(anonymizationProfile);
}
ArrayList<File> dicomFiles = getDicomFilesForPatient(importJob, patient, importJobDir.getAbsolutePath());
final Subject subject = patient.getSubject();
if (subject == null) {
LOG.error("Error: subject == null in importJob.");
throw new ShanoirException("Error: subject == null in importJob.");
}
final String subjectName = subject.getName();
event.setMessage("Pseudonymizing DICOM files for subject [" + subjectName + "]...");
eventService.publishEvent(event);
try {
ANONYMIZER.anonymizeForShanoir(dicomFiles, importJob.getAnonymisationProfileToUse(), subjectName, subjectName);
} catch (Exception e) {
LOG.error(e.getMessage(), e);
throw new ShanoirException("Error during pseudonymization.");
ArrayList<File> dicomFiles = getDicomFilesForPatient(importJob, patient, importJobDir.getAbsolutePath());
final Subject subject = patient.getSubject();
if (subject == null) {
LOG.error("Error: subject == null in importJob.");
throw new ShanoirException("Error: subject == null in importJob.");
}
final String subjectName = subject.getName();
event.setMessage("Pseudonymizing DICOM files for subject [" + subjectName + "]...");
eventService.publishEvent(event);
try {
ANONYMIZER.anonymizeForShanoir(dicomFiles, importJob.getAnonymisationProfileToUse(), subjectName, subjectName);
} catch (Exception e) {
LOG.error(e.getMessage(), e);
throw new ShanoirException("Error during pseudonymization.");
}
}
}

Expand Down

0 comments on commit 2dbb0e7

Please sign in to comment.