diff --git a/shanoir-ng-datasets/src/main/java/org/shanoir/ng/datasetacquisition/validation/DatasetsModalityTypeCheckValidator.java b/shanoir-ng-datasets/src/main/java/org/shanoir/ng/datasetacquisition/validation/DatasetsModalityTypeCheckValidator.java index c3c1ed1922..140f8b06af 100644 --- a/shanoir-ng-datasets/src/main/java/org/shanoir/ng/datasetacquisition/validation/DatasetsModalityTypeCheckValidator.java +++ b/shanoir-ng-datasets/src/main/java/org/shanoir/ng/datasetacquisition/validation/DatasetsModalityTypeCheckValidator.java @@ -16,10 +16,8 @@ import jakarta.validation.ConstraintValidator; import jakarta.validation.ConstraintValidatorContext; -import org.shanoir.ng.dataset.modality.CtDataset; -import org.shanoir.ng.dataset.modality.MrDataset; -import org.shanoir.ng.dataset.modality.PetDataset; import org.shanoir.ng.dataset.model.Dataset; +import org.shanoir.ng.dataset.model.DatasetType; import org.shanoir.ng.datasetacquisition.model.DatasetAcquisition; import org.shanoir.ng.datasetacquisition.model.ct.CtDatasetAcquisition; import org.shanoir.ng.datasetacquisition.model.mr.MrDatasetAcquisition; @@ -42,22 +40,22 @@ public void initialize(final DatasetsModalityTypeCheck constraintAnnotation) { @Override public boolean isValid(final DatasetAcquisition datasetAcquisition, final ConstraintValidatorContext context) { - if (datasetAcquisition.getDatasets() != null && !datasetAcquisition.getDatasets().isEmpty()) { + if (datasetAcquisition.getDatasets() != null && !datasetAcquisition.getDatasets().isEmpty()) { if (datasetAcquisition instanceof MrDatasetAcquisition) { for (Dataset dataset : datasetAcquisition.getDatasets()) { - if (!(dataset instanceof MrDataset)) { + if (!(dataset.getType().equals(DatasetType.Mr))) { return false; } } } else if (datasetAcquisition instanceof PetDatasetAcquisition) { for (Dataset dataset : datasetAcquisition.getDatasets()) { - if (!(dataset instanceof PetDataset)) { + if (!(dataset.getType().equals(DatasetType.Pet))) { return false; } } } else if (datasetAcquisition instanceof CtDatasetAcquisition) { for (Dataset dataset : datasetAcquisition.getDatasets()) { - if (!(dataset instanceof CtDataset)) { + if (!(dataset.getType().equals(DatasetType.Ct))) { return false; } } diff --git a/shanoir-ng-ms-common/src/main/java/org/shanoir/ng/shared/configuration/RabbitMQConfiguration.java b/shanoir-ng-ms-common/src/main/java/org/shanoir/ng/shared/configuration/RabbitMQConfiguration.java index 152ba628f4..44b4ae88cf 100644 --- a/shanoir-ng-ms-common/src/main/java/org/shanoir/ng/shared/configuration/RabbitMQConfiguration.java +++ b/shanoir-ng-ms-common/src/main/java/org/shanoir/ng/shared/configuration/RabbitMQConfiguration.java @@ -312,13 +312,17 @@ public static Queue subjectStudyQueue() { public static Queue studiesSubjectStudyStudyCardTagQueue() { return new Queue(STUDIES_SUBJECT_STUDY_STUDY_CARD_TAG, true); } - - @Bean - public static Queue deleteSubjectQueue() { return new Queue(DELETE_SUBJECT_QUEUE, true); } @Bean - public static Queue deleteAnimalSubjectQueue() { return new Queue(DELETE_ANIMAL_SUBJECT_QUEUE, true); } + public static Queue deleteSubjectQueue() { + return new Queue(DELETE_SUBJECT_QUEUE, true); + } + @Bean + public static Queue deleteAnimalSubjectQueue() { + return new Queue(DELETE_ANIMAL_SUBJECT_QUEUE, true); + } + @Bean public static Queue importerQueue() { return new Queue(IMPORTER_QUEUE_DATASET, true);