From 10f2df903f248b00d76abd195deef70cb3a1e73a Mon Sep 17 00:00:00 2001 From: "CHIN\\a5566" Date: Thu, 16 May 2024 11:27:58 +0800 Subject: [PATCH] fix: retrieving DICOM file is not working properly # Problems - When move DICOM file to destination, we modify the file name to ${SOPInstanceUID}.dcm - But, in relative path that store in database, missing apply this rule # Solutions - modify path for `relativePath` in `dicom-file-saver.js` - `this.originalFilename` is unused, remove this variable --- .../controller/STOW-RS/service/dicom-file-saver.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/api/dicom-web/controller/STOW-RS/service/dicom-file-saver.js b/api/dicom-web/controller/STOW-RS/service/dicom-file-saver.js index 54e89db..a2cfe77 100644 --- a/api/dicom-web/controller/STOW-RS/service/dicom-file-saver.js +++ b/api/dicom-web/controller/STOW-RS/service/dicom-file-saver.js @@ -13,10 +13,6 @@ class DicomFileSaver { this.file = file; /** @type {import("../../../../../models/DICOM/dicom-json-model").DicomJsonModel} */ this.dicomJsonModel = dicomJsonModel; - this.originalFilename = path.basename(this.file.originalFilename); - if (this.originalFilename.indexOf(".dcm") < 0) { - this.originalFilename = this.originalFilename + ".dcm"; - } } async saveAndGetSaveInfo() { @@ -46,7 +42,7 @@ class DicomFileSaver { return { fullPath: fullStorePath, - relativePath: path.join(relativeStorePath, this.originalFilename), + relativePath: path.join(relativeStorePath, `${instanceUID}.dcm`), instancePath: instanceStorePath, seriesPath: `files/${year}/${month}/${shortStudyUID}/${shortSeriesUID}`, studyPath: `files/${year}/${month}/${shortStudyUID}`