Skip to content

Commit

Permalink
feat: query image that in recycling status (delete status 1)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chinlinlee committed Jan 6, 2024
1 parent 766fe20 commit 1c7bf4a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
7 changes: 6 additions & 1 deletion api/dicom-web/controller/QIDO-RS/service/QIDO-RS.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ class QidoRsService {

delete this.request.query["includefield"];

/** @private */
this.isRecycle = Boolean(this.request.query?.isRecycle);
delete this.request.query?.isRecycle;

this.initQuery_();
}

Expand Down Expand Up @@ -89,7 +93,8 @@ class QidoRsService {
limit: this.limit_,
includeFields: this.includeFields_,
retrieveBaseUrl: `${dicomWebService.getBasicURL()}/studies`,
requestParams: this.request.params
requestParams: this.request.params,
isRecycle: this.isRecycle
};

queryAudit.onQuery(
Expand Down
3 changes: 2 additions & 1 deletion api/dicom-web/qido-rs.route.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ const queryValidation = {
return convertKeywordToHex(attribute);
}
)
).single()
).single(),
isRecycle: Joi.boolean().default(false)
};

/**
Expand Down
2 changes: 1 addition & 1 deletion models/mongodb/schema/dicom.schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class DicomSchemaOptionsFactory {
let docs = await mongoose.model(DicomModelNames[level]).find({
...queryOptions.query,
deleteStatus: {
$eq: 0
$eq: queryOptions.isRecycle ? 1 : 0
}
}, projection)
.limit(queryOptions.limit)
Expand Down
1 change: 1 addition & 0 deletions utils/typeDef/dicom.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* @property {string} retrieveBaseUrl
* @property {object} requestParams?
* @property {string[]} includeFields
* @property {boolean} [isRecycle]
*/

const DICOM = true;
Expand Down

0 comments on commit 1c7bf4a

Please sign in to comment.