Skip to content

Commit

Permalink
fix: retrieving DICOM file is not working properly
Browse files Browse the repository at this point in the history
# 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
  • Loading branch information
Chinlinlee committed May 16, 2024
1 parent a462ad7 commit 10f2df9
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions api/dicom-web/controller/STOW-RS/service/dicom-file-saver.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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}`
Expand Down

0 comments on commit 10f2df9

Please sign in to comment.