diff --git a/shanoir-ng-datasets/src/main/java/org/shanoir/ng/importer/dto/EquipmentDicom.java b/shanoir-ng-datasets/src/main/java/org/shanoir/ng/importer/dto/EquipmentDicom.java deleted file mode 100644 index 2dccc6fa09..0000000000 --- a/shanoir-ng-datasets/src/main/java/org/shanoir/ng/importer/dto/EquipmentDicom.java +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Shanoir NG - Import, manage and share neuroimaging data - * Copyright (C) 2009-2019 Inria - https://www.inria.fr/ - * Contact us on https://project.inria.fr/shanoir/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see https://www.gnu.org/licenses/gpl-3.0.html - */ - -/** - * - */ -package org.shanoir.ng.importer.dto; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * @author yyao - * - */ -public class EquipmentDicom { - - @JsonProperty("manufacturer") - private String manufacturer; - - @JsonProperty("manufacturerModelName") - private String manufacturerModelName; - - @JsonProperty("deviceSerialNumber") - private String deviceSerialNumber; - - public String getManufacturer() { - return manufacturer; - } - - public void setManufacturer(String manufacturer) { - this.manufacturer = manufacturer; - } - - public String getManufacturerModelName() { - return manufacturerModelName; - } - - public void setManufacturerModelName(String manufacturerModelName) { - this.manufacturerModelName = manufacturerModelName; - } - - public String getDeviceSerialNumber() { - return deviceSerialNumber; - } - - public void setDeviceSerialNumber(String deviceSerialNumber) { - this.deviceSerialNumber = deviceSerialNumber; - } - -} diff --git a/shanoir-ng-datasets/src/main/java/org/shanoir/ng/importer/dto/Serie.java b/shanoir-ng-datasets/src/main/java/org/shanoir/ng/importer/dto/Serie.java index 8447d4c985..2a3da248f4 100644 --- a/shanoir-ng-datasets/src/main/java/org/shanoir/ng/importer/dto/Serie.java +++ b/shanoir-ng-datasets/src/main/java/org/shanoir/ng/importer/dto/Serie.java @@ -18,6 +18,7 @@ import java.util.List; import org.shanoir.ng.shared.dateTime.LocalDateAnnotations; +import org.shanoir.ng.shared.dicom.EquipmentDicom; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/CarminDataApi.java b/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/CarminDataApi.java index ea19a7bcd3..725c4ec15c 100644 --- a/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/CarminDataApi.java +++ b/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/CarminDataApi.java @@ -14,9 +14,7 @@ package org.shanoir.ng.importer; -import com.fasterxml.jackson.core.JsonProcessingException; import org.shanoir.ng.importer.model.carmin.Path; -import org.shanoir.ng.importer.model.carmin.UploadData; import org.shanoir.ng.shared.exception.RestServiceException; import org.springframework.http.ResponseEntity; import org.springframework.security.access.prepost.PreAuthorize; @@ -24,6 +22,8 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; +import com.fasterxml.jackson.core.JsonProcessingException; + import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; diff --git a/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/CarminDataApiController.java b/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/CarminDataApiController.java index e4921b487e..081b4c75a2 100644 --- a/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/CarminDataApiController.java +++ b/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/CarminDataApiController.java @@ -19,17 +19,8 @@ import java.nio.file.Files; import java.util.Date; -import com.fasterxml.jackson.core.JsonFactory; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.StreamReadConstraints; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.json.JsonMapper; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.validation.Valid; - import org.apache.commons.codec.binary.Base64; import org.apache.commons.io.FileUtils; -import org.apache.commons.io.FilenameUtils; import org.shanoir.ng.importer.model.carmin.Path; import org.shanoir.ng.importer.model.carmin.UploadData; import org.shanoir.ng.shared.exception.ErrorModel; @@ -45,7 +36,15 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.util.UriUtils; +import com.fasterxml.jackson.core.JsonFactory; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.StreamReadConstraints; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.json.JsonMapper; + import io.swagger.v3.oas.annotations.Parameter; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.validation.Valid; /** * Carmin data upload results from VIP to tmp folder endpoint diff --git a/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/ImporterApi.java b/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/ImporterApi.java index 995f2826ad..5ee6f3392e 100644 --- a/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/ImporterApi.java +++ b/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/ImporterApi.java @@ -14,10 +14,8 @@ package org.shanoir.ng.importer; -import java.io.FileNotFoundException; import java.io.IOException; -import org.shanoir.ng.exchange.model.Exchange; import org.shanoir.ng.importer.dicom.query.DicomQuery; import org.shanoir.ng.importer.model.EegImportJob; import org.shanoir.ng.importer.model.ImportJob; diff --git a/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/bids/BidsImporterApi.java b/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/bids/BidsImporterApi.java index d3e1269a76..a53e2f5c71 100644 --- a/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/bids/BidsImporterApi.java +++ b/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/bids/BidsImporterApi.java @@ -26,11 +26,11 @@ import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.multipart.MultipartFile; -import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; /** * diff --git a/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/dcm2nii/NIfTIConverter.java b/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/dcm2nii/NIfTIConverter.java index 10024ddedb..bb913d2ab1 100644 --- a/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/dcm2nii/NIfTIConverter.java +++ b/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/dcm2nii/NIfTIConverter.java @@ -14,9 +14,6 @@ package org.shanoir.ng.importer.dcm2nii; -import jakarta.persistence.Column; -import jakarta.persistence.Entity; - import org.hibernate.annotations.GenericGenerator; import org.hibernate.validator.constraints.NotBlank; import org.shanoir.ng.shared.hateoas.HalEntity; @@ -25,6 +22,9 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; + /** * The class NIfTIConverter. * diff --git a/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/dcm2nii/NIfTIConverterApi.java b/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/dcm2nii/NIfTIConverterApi.java index 7072a7b8c8..10f396472d 100644 --- a/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/dcm2nii/NIfTIConverterApi.java +++ b/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/dcm2nii/NIfTIConverterApi.java @@ -24,11 +24,12 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; -import io.swagger.v3.oas.annotations.tags.Tag; + import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; /** * @author yyao diff --git a/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/dicom/DicomSerieAndInstanceAnalyzer.java b/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/dicom/DicomSerieAndInstanceAnalyzer.java index 08434ed447..ad970e88d8 100644 --- a/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/dicom/DicomSerieAndInstanceAnalyzer.java +++ b/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/dicom/DicomSerieAndInstanceAnalyzer.java @@ -8,8 +8,6 @@ import org.shanoir.ng.utils.ImportUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Component; /** * This class is a helper class, that will in the future be used to detect diff --git a/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/dicom/ImagesCreatorAndDicomFileAnalyzerService.java b/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/dicom/ImagesCreatorAndDicomFileAnalyzerService.java index 3e07c9dc98..7ce7fc3cbc 100644 --- a/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/dicom/ImagesCreatorAndDicomFileAnalyzerService.java +++ b/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/dicom/ImagesCreatorAndDicomFileAnalyzerService.java @@ -30,7 +30,6 @@ import org.dcm4che3.emf.MultiframeExtractor; import org.dcm4che3.io.DicomInputStream; import org.shanoir.ng.importer.model.EchoTime; -import org.shanoir.ng.importer.model.EquipmentDicom; import org.shanoir.ng.importer.model.Image; import org.shanoir.ng.importer.model.Instance; import org.shanoir.ng.importer.model.InstitutionDicom; @@ -38,6 +37,7 @@ import org.shanoir.ng.importer.model.Serie; import org.shanoir.ng.importer.model.Study; import org.shanoir.ng.shared.dateTime.DateTimeUtils; +import org.shanoir.ng.shared.dicom.EquipmentDicom; import org.shanoir.ng.shared.event.ShanoirEvent; import org.shanoir.ng.shared.event.ShanoirEventService; import org.slf4j.Logger; diff --git a/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/dicom/query/DicomQuery.java b/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/dicom/query/DicomQuery.java index f055718cb0..2e8301c83c 100644 --- a/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/dicom/query/DicomQuery.java +++ b/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/dicom/query/DicomQuery.java @@ -14,11 +14,11 @@ package org.shanoir.ng.importer.dicom.query; +import com.fasterxml.jackson.annotation.JsonProperty; + import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Size; -import com.fasterxml.jackson.annotation.JsonProperty; - /** * ImportFromPACS: the user can query a PACS to chose * his series to be imported by Shanoir. This class contains diff --git a/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/eeg/brainvision/BrainVisionReader.java b/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/eeg/brainvision/BrainVisionReader.java index 2f9b525fdb..5cfe95d7c7 100644 --- a/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/eeg/brainvision/BrainVisionReader.java +++ b/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/eeg/brainvision/BrainVisionReader.java @@ -36,6 +36,7 @@ import java.util.Collections; import java.util.Date; import java.util.List; + import org.apache.commons.collections4.ListUtils; import org.apache.commons.io.FilenameUtils; import org.shanoir.ng.importer.model.Channel; diff --git a/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/model/InstitutionDicom.java b/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/model/InstitutionDicom.java index 42750eab11..b9ad1a646f 100644 --- a/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/model/InstitutionDicom.java +++ b/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/model/InstitutionDicom.java @@ -46,4 +46,5 @@ public String getInstitutionAddress() { public void setInstitutionAddress(String institutionAddress) { this.institutionAddress = institutionAddress; } + } diff --git a/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/model/Serie.java b/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/model/Serie.java index 17a3638344..6a72587353 100644 --- a/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/model/Serie.java +++ b/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/model/Serie.java @@ -21,6 +21,7 @@ import org.dcm4che3.data.Tag; import org.shanoir.ng.shared.dateTime.DateTimeUtils; import org.shanoir.ng.shared.dateTime.LocalDateAnnotations; +import org.shanoir.ng.shared.dicom.EquipmentDicom; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/model/carmin/Path.java b/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/model/carmin/Path.java index 878f8f6cd3..06c349a0fe 100644 --- a/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/model/carmin/Path.java +++ b/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/model/carmin/Path.java @@ -1,10 +1,12 @@ package org.shanoir.ng.importer.model.carmin; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + import org.springframework.validation.annotation.Validated; +import com.fasterxml.jackson.annotation.JsonProperty; + import jakarta.validation.constraints.NotNull; -import java.util.Objects; /** * Path diff --git a/shanoir-ng-import/src/main/java/org/shanoir/ng/utils/ShanoirExec.java b/shanoir-ng-import/src/main/java/org/shanoir/ng/utils/ShanoirExec.java index d273ad6821..bb0cca46cc 100644 --- a/shanoir-ng-import/src/main/java/org/shanoir/ng/utils/ShanoirExec.java +++ b/shanoir-ng-import/src/main/java/org/shanoir/ng/utils/ShanoirExec.java @@ -18,7 +18,6 @@ import java.util.Map; import java.util.Map.Entry; -import org.apache.commons.lang3.NotImplementedException; import org.shanoir.ng.shared.exception.RestServiceException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/shanoir-ng-import/src/test/java/org/shanoir/ng/importer/ImporterApiControllerTest.java b/shanoir-ng-import/src/test/java/org/shanoir/ng/importer/ImporterApiControllerTest.java index 8d6cd3c1b4..e664960297 100644 --- a/shanoir-ng-import/src/test/java/org/shanoir/ng/importer/ImporterApiControllerTest.java +++ b/shanoir-ng-import/src/test/java/org/shanoir/ng/importer/ImporterApiControllerTest.java @@ -15,7 +15,6 @@ package org.shanoir.ng.importer; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.verify; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @@ -46,8 +45,6 @@ import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; import org.springframework.boot.test.mock.mockito.MockBean; -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpMethod; import org.springframework.http.MediaType; import org.springframework.mock.web.MockMultipartFile; import org.springframework.test.context.ActiveProfiles; diff --git a/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/model/EquipmentDicom.java b/shanoir-ng-ms-common/src/main/java/org/shanoir/ng/shared/dicom/EquipmentDicom.java similarity index 77% rename from shanoir-ng-import/src/main/java/org/shanoir/ng/importer/model/EquipmentDicom.java rename to shanoir-ng-ms-common/src/main/java/org/shanoir/ng/shared/dicom/EquipmentDicom.java index 330cc1f2c7..af6e71cbb0 100644 --- a/shanoir-ng-import/src/main/java/org/shanoir/ng/importer/model/EquipmentDicom.java +++ b/shanoir-ng-ms-common/src/main/java/org/shanoir/ng/shared/dicom/EquipmentDicom.java @@ -1,21 +1,4 @@ -/** - * Shanoir NG - Import, manage and share neuroimaging data - * Copyright (C) 2009-2019 Inria - https://www.inria.fr/ - * Contact us on https://project.inria.fr/shanoir/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see https://www.gnu.org/licenses/gpl-3.0.html - */ - -/** - * - */ -package org.shanoir.ng.importer.model; +package org.shanoir.ng.shared.dicom; import org.apache.commons.lang3.StringUtils; @@ -101,4 +84,4 @@ public boolean isComplete() { && StringUtils.isNotEmpty(this.deviceSerialNumber); } -} +} \ No newline at end of file diff --git a/shanoir-ng-studies/src/main/java/org/shanoir/ng/acquisitionequipment/controler/AcquisitionEquipmentApi.java b/shanoir-ng-studies/src/main/java/org/shanoir/ng/acquisitionequipment/controler/AcquisitionEquipmentApi.java index 611f10b7a7..da0d30a9f4 100644 --- a/shanoir-ng-studies/src/main/java/org/shanoir/ng/acquisitionequipment/controler/AcquisitionEquipmentApi.java +++ b/shanoir-ng-studies/src/main/java/org/shanoir/ng/acquisitionequipment/controler/AcquisitionEquipmentApi.java @@ -18,6 +18,7 @@ import org.shanoir.ng.acquisitionequipment.dto.AcquisitionEquipmentDTO; import org.shanoir.ng.acquisitionequipment.model.AcquisitionEquipment; +import org.shanoir.ng.shared.dicom.EquipmentDicom; import org.shanoir.ng.shared.exception.RestServiceException; import org.springframework.http.ResponseEntity; import org.springframework.security.access.prepost.PreAuthorize; @@ -73,6 +74,19 @@ ResponseEntity findAcquisitionEquipmentById( ResponseEntity> findAcquisitionEquipmentsBySerialNumber( @Parameter(name = "serial number of the acquisition equipment", required = true) @PathVariable("serialNumber") String serialNumber); + @Operation(summary = "", description = "If exists, returns the acquisition equipment(s) corresponding to the equipment dicom or creates a new one") + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "found acquisition equipment(s)"), + @ApiResponse(responseCode = "204", description = "no acquisition equipment found"), + @ApiResponse(responseCode = "401", description = "unauthorized"), + @ApiResponse(responseCode = "403", description = "forbidden"), + @ApiResponse(responseCode = "500", description = "unexpected error") }) + @RequestMapping(value = "/byDicom", produces = { "application/json" }, consumes = {"application/json" }, method = RequestMethod.POST) + @PreAuthorize("hasAnyRole('USER', 'ADMIN', 'EXPERT')") + ResponseEntity> findAcquisitionEquipmentsOrCreateOneByEquipmentDicom( + @Parameter(name = "equipment dicom to find or create equipment", required = true) @RequestBody EquipmentDicom equipmentDicom, + BindingResult result); + @Operation(summary = "", description = "Returns all the acquisition equipments for a center") @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "found acquisition equipments"), diff --git a/shanoir-ng-studies/src/main/java/org/shanoir/ng/acquisitionequipment/controler/AcquisitionEquipmentApiController.java b/shanoir-ng-studies/src/main/java/org/shanoir/ng/acquisitionequipment/controler/AcquisitionEquipmentApiController.java index 433236326b..20fef6fc1e 100644 --- a/shanoir-ng-studies/src/main/java/org/shanoir/ng/acquisitionequipment/controler/AcquisitionEquipmentApiController.java +++ b/shanoir-ng-studies/src/main/java/org/shanoir/ng/acquisitionequipment/controler/AcquisitionEquipmentApiController.java @@ -23,6 +23,7 @@ import org.shanoir.ng.acquisitionequipment.dto.mapper.AcquisitionEquipmentMapper; import org.shanoir.ng.acquisitionequipment.model.AcquisitionEquipment; import org.shanoir.ng.acquisitionequipment.service.AcquisitionEquipmentService; +import org.shanoir.ng.shared.dicom.EquipmentDicom; import org.shanoir.ng.shared.error.FieldError; import org.shanoir.ng.shared.error.FieldErrorMap; import org.shanoir.ng.shared.event.ShanoirEvent; @@ -193,4 +194,11 @@ public ResponseEntity> findAcquisitionEquipmentsBy acquisitionEquipmentMapper.acquisitionEquipmentsToAcquisitionEquipmentDTOs(equipments), HttpStatus.OK); } + @Override + public ResponseEntity> findAcquisitionEquipmentsOrCreateOneByEquipmentDicom( + @Parameter(name = "equipment dicom to find or create equipment", required = true) @RequestBody final EquipmentDicom equipmentDicom, + final BindingResult result) { + return null; + } + } diff --git a/shanoir-uploader/src/main/java/org/shanoir/uploader/dicom/query/SerieTreeNode.java b/shanoir-uploader/src/main/java/org/shanoir/uploader/dicom/query/SerieTreeNode.java index fd42d0d865..17e1e1a13f 100644 --- a/shanoir-uploader/src/main/java/org/shanoir/uploader/dicom/query/SerieTreeNode.java +++ b/shanoir-uploader/src/main/java/org/shanoir/uploader/dicom/query/SerieTreeNode.java @@ -6,9 +6,9 @@ import javax.swing.tree.TreeNode; -import org.shanoir.ng.importer.model.EquipmentDicom; import org.shanoir.ng.importer.model.InstitutionDicom; import org.shanoir.ng.importer.model.Serie; +import org.shanoir.ng.shared.dicom.EquipmentDicom; import org.shanoir.uploader.dicom.DicomTreeNode; import jakarta.xml.bind.annotation.XmlElement; diff --git a/shanoir-uploader/src/main/java/org/shanoir/uploader/model/dto/EquipmentDicom.java b/shanoir-uploader/src/main/java/org/shanoir/uploader/model/dto/EquipmentDicom.java deleted file mode 100644 index 4ad91268e7..0000000000 --- a/shanoir-uploader/src/main/java/org/shanoir/uploader/model/dto/EquipmentDicom.java +++ /dev/null @@ -1,82 +0,0 @@ -package org.shanoir.uploader.model.dto; - -public class EquipmentDicom { - - private String manufacturer; - private String manufacturerModelName; - private String deviceSerialNumber; - - public EquipmentDicom(String manufacturer, String manufacturerModelName, String deviceSerialNumber) { - super(); - this.manufacturer = manufacturer; - this.manufacturerModelName = manufacturerModelName; - this.deviceSerialNumber = deviceSerialNumber; - } - - /** - * @return the deviceSerialNumber - */ - public String getDeviceSerialNumber() { - return deviceSerialNumber; - } - - /** - * @param deviceSerialNumber - * the deviceSerialNumber to set - */ - public void setDeviceSerialNumber(String deviceSerialNumber) { - this.deviceSerialNumber = deviceSerialNumber; - } - - /** - * @return the manufacturer - */ - public String getManufacturer() { - return manufacturer; - } - - /** - * @param manufacturer - * the manufacturer to set - */ - public void setManufacturer(String manufacturer) { - this.manufacturer = manufacturer; - } - - /** - * @return the manufacturerModelName - */ - public String getManufacturerModelName() { - return manufacturerModelName; - } - - /** - * @param manufacturerModelName - * the manufacturerModelName to set - */ - public void setManufacturerModelName(String manufacturerModelName) { - this.manufacturerModelName = manufacturerModelName; - } - - public String payload() { - String payload = ""; - if (getDeviceSerialNumber() != null) { - payload += "{\"deviceSerialNumber\": \"" + getDeviceSerialNumber() + "\","; - } else { - payload += "{\"deviceSerialNumber\": \"\","; - } - - if (getManufacturer() != null) { - payload += "\"manufacturer\": \"" + getManufacturer() + "\","; - } else { - payload += "\"manufacturer\": \"\","; - } - - if (getManufacturerModelName() != null) { - payload += "\"manufacturerModelName\": \"" + getManufacturerModelName() + "\"}"; - } else { - payload += "\"manufacturerModelName\": \"\"}"; - } - return payload; - } -} diff --git a/shanoir-uploader/src/main/java/org/shanoir/uploader/upload/UploadJob.java b/shanoir-uploader/src/main/java/org/shanoir/uploader/upload/UploadJob.java index 4adbf3fac0..48f85f8789 100644 --- a/shanoir-uploader/src/main/java/org/shanoir/uploader/upload/UploadJob.java +++ b/shanoir-uploader/src/main/java/org/shanoir/uploader/upload/UploadJob.java @@ -3,8 +3,6 @@ import java.util.Collection; import java.util.Iterator; -import org.shanoir.ng.importer.model.EquipmentDicom; -import org.shanoir.ng.importer.model.InstitutionDicom; import org.shanoir.uploader.dicom.MRI; import org.shanoir.uploader.dicom.query.SerieTreeNode; diff --git a/shanoir-uploader/src/main/java/org/shanoir/uploader/utils/ImportUtils.java b/shanoir-uploader/src/main/java/org/shanoir/uploader/utils/ImportUtils.java index 0a5e6b4425..9102df7f79 100644 --- a/shanoir-uploader/src/main/java/org/shanoir/uploader/utils/ImportUtils.java +++ b/shanoir-uploader/src/main/java/org/shanoir/uploader/utils/ImportUtils.java @@ -14,12 +14,12 @@ import org.apache.commons.lang.SystemUtils; import org.apache.log4j.Logger; import org.shanoir.ng.importer.dicom.ImagesCreatorAndDicomFileAnalyzerService; -import org.shanoir.ng.importer.model.EquipmentDicom; import org.shanoir.ng.importer.model.ImportJob; import org.shanoir.ng.importer.model.Instance; import org.shanoir.ng.importer.model.InstitutionDicom; import org.shanoir.ng.importer.model.Patient; import org.shanoir.ng.importer.model.Serie; +import org.shanoir.ng.shared.dicom.EquipmentDicom; import org.shanoir.uploader.ShUpConfig; import org.shanoir.uploader.action.DicomDataTransferObject; import org.shanoir.uploader.dicom.IDicomServerClient;