Skip to content

Commit

Permalink
fix: missing 404 in retrieve rendered instance
Browse files Browse the repository at this point in the history
  • Loading branch information
Chinlinlee committed May 22, 2022
1 parent 6ad47db commit 8e70d79
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions api/dicom-web/controller/WADO-RS/retrieveRenderedInstance.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ module.exports = async function(req, res) {
}
try {
let instanceFramesObj = await renderedService.getInstanceFrameObj(req.params);
if (!instanceFramesObj) {
res.writeHead(404, {
"Content-Type": "application/dicom+json"
});
let notFoundMessage = errorResponse.getNotFoundErrorMessage(`Not Found Instance, Instance UID: ${
req.params.instanceUID
}, Series UID: ${
req.params.seriesUID
}, Study UID: ${
req.params.studyUID
}`);
return res.end(JSON.stringify(notFoundMessage));
}
let dicomNumberOfFrames = _.get(instanceFramesObj, "00280008.Value.0", 1);
dicomNumberOfFrames = parseInt(dicomNumberOfFrames);
if (req.params.frameNumber > dicomNumberOfFrames) {
Expand Down

0 comments on commit 8e70d79

Please sign in to comment.