Skip to content

Commit

Permalink
refactor: export original function for reusing
Browse files Browse the repository at this point in the history
  • Loading branch information
Chinlinlee committed Aug 14, 2023
1 parent 30e13ae commit 905ff93
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
const _ = require("lodash");
const renderedService = require("../service/rendered.service");
const {
RenderedImageMultipartWriter
} = require("@root/api/dicom-web/controller/WADO-RS/service/rendered.service");
const { InstanceImagePathFactory } = require("../service/WADO-RS.service");
const errorResponse = require("@root/utils/errorResponse/errorResponseMessage");
const { ApiLogger } = require("@root/utils/logs/api-logger");
Expand Down Expand Up @@ -36,7 +33,7 @@ class RetrieveRenderedInstanceFramesController extends Controller {
}

try {
let renderedImageMultipartWriter = new RenderedImageMultipartWriter(
let renderedImageMultipartWriter = new renderedService.RenderedImageMultipartWriter(
this.request,
this.response,
InstanceImagePathFactory,
Expand Down
3 changes: 1 addition & 2 deletions api-sql/dicom-web/controller/WADO-RS/rendered/instances.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const _ = require("lodash");
const { RenderedImageMultipartWriter } = require("@root/api/dicom-web/controller/WADO-RS/service/rendered.service");
const renderedService = require("../service/rendered.service");
const { InstanceImagePathFactory } = require("../service/WADO-RS.service");
const errorResponse = require("@root/utils/errorResponse/errorResponseMessage");
Expand Down Expand Up @@ -28,7 +27,7 @@ class RetrieveRenderedInstancesController extends Controller {
}

try {
let renderedImageMultipartWriter = new RenderedImageMultipartWriter(
let renderedImageMultipartWriter = new renderedService.RenderedImageMultipartWriter(
this.request,
this.response,
InstanceImagePathFactory,
Expand Down
3 changes: 1 addition & 2 deletions api-sql/dicom-web/controller/WADO-RS/rendered/series.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const _ = require("lodash");
const { RenderedImageMultipartWriter } = require("@root/api/dicom-web/controller/WADO-RS/service/rendered.service");
const renderedService = require("../service/rendered.service");
const { SeriesImagePathFactory } = require("../service/WADO-RS.service");
const errorResponse = require("@root/utils/errorResponse/errorResponseMessage");
Expand All @@ -23,7 +22,7 @@ class RetrieveRenderedSeriesController extends Controller {
}

try {
let renderedImageMultipartWriter = new RenderedImageMultipartWriter(
let renderedImageMultipartWriter = new renderedService.RenderedImageMultipartWriter(
this.request,
this.response,
SeriesImagePathFactory,
Expand Down
3 changes: 1 addition & 2 deletions api-sql/dicom-web/controller/WADO-RS/rendered/study.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const _ = require("lodash");
const { RenderedImageMultipartWriter } = require("@root/api/dicom-web/controller/WADO-RS/service/rendered.service");
const renderedService = require("../service/rendered.service");
const {
StudyImagePathFactory
Expand Down Expand Up @@ -30,7 +29,7 @@ class RetrieveRenderedStudyController extends Controller {

try {

let renderedImageMultipartWriter = new RenderedImageMultipartWriter(
let renderedImageMultipartWriter = new renderedService.RenderedImageMultipartWriter(
this.request,
this.response,
StudyImagePathFactory,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const {
postProcessFrameImage,
writeRenderedImages,
writeSpecificFramesRenderedImages
writeSpecificFramesRenderedImages,
RenderedImageMultipartWriter
} = require("@root/api/dicom-web/controller/WADO-RS/service/rendered.service");

const path = require("path");
Expand Down Expand Up @@ -195,7 +196,11 @@ async function getInstanceFrameObj(iParam, otherFields = {}) {
}


module.exports.postProcessFrameImage = postProcessFrameImage;
module.exports.writeRenderedImages = writeRenderedImages;
module.exports.writeSpecificFramesRenderedImages = writeSpecificFramesRenderedImages;
module.exports.getInstanceFrameObj = getInstanceFrameObj;
module.exports.RenderedImageMultipartWriter = RenderedImageMultipartWriter;
module.exports.StudyFramesWriter = StudyFramesWriter;
module.exports.SeriesFramesWriter = SeriesFramesWriter;
module.exports.InstanceFramesWriter = InstanceFramesWriter;
Expand Down

0 comments on commit 905ff93

Please sign in to comment.