Skip to content

Commit

Permalink
fix: the instance store path is not relative
Browse files Browse the repository at this point in the history
- Original, store the path contains root path
- For flexible path, use the relative path
- Add `SaveDicomFileResult` type def
  • Loading branch information
Chinlinlee committed May 10, 2022
1 parent 4d8b4a1 commit c2c671e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/dicom-web/controller/STOW-RS/storeInstance.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ async function getDICOMJson(filename) {
* @param {import('formidable').File} file
* @param {JSON} dicomJson
* @param {import('../../../../utils/typeDef/dicom').UIDObject} uidObj
* @return {import("../../../../utils/typeDef/STOW-RS/STOW-RS.def").SaveDicomFileResult}
*/
async function saveDICOMFile(file, dicomJson, uidObj) {
try {
Expand Down Expand Up @@ -574,7 +575,7 @@ async function storeDICOMJsonToDB(uidObj, saveDICOMFileResult) {
_.merge(dicomJson, {
studyPath: saveDICOMFileResult.studyPath,
seriesPath: saveDICOMFileResult.seriesPath,
instancePath: saveDICOMFileResult.instancePath
instancePath: saveDICOMFileResult.relativePath
});
let query = {
$and: [
Expand Down
10 changes: 10 additions & 0 deletions utils/typeDef/STOW-RS/STOW-RS.def.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@
*
*/

/**
* @typedef {object} SaveDicomFileResult
* @property {string} fullPath The path of saved file's directory
* @property {string} relativePath The relative path of saved DICOM instance file. e.g. /files/123.dcm
* @property {string} instancePath The full path of saved DICOM instance file. e.g. /home/app/files/123.dcm
* @property {string} seriesPath The relative path of series level directory
* @property {string} studyPath The relative path of study level directory
* @property {Object} dicomJson
*/

const STOW_RS = true;

module.exports.unUse = {};

0 comments on commit c2c671e

Please sign in to comment.