Skip to content

Commit

Permalink
feat: query builder add uid query when params present
Browse files Browse the repository at this point in the history
  • Loading branch information
Chinlinlee committed Aug 10, 2023
1 parent 51c7a0b commit 76e02e0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const _ = require("lodash");
const { dictionary } = require("@models/DICOM/dicom-tags-dic");
const { BaseQueryBuilder, StudyQueryBuilder } = require("./querybuilder");
const { DicomCodeModel } = require("@models/sql/models/dicomCode.model");
Expand Down Expand Up @@ -43,6 +44,13 @@ class InstanceQueryBuilder extends BaseQueryBuilder {
attributes: ["x0020000E"],
...seriesQuery
});

let instanceUidInParams = _.get(this.queryOptions.requestParams, "instanceUID");
if (instanceUidInParams) {
this.query = {
x00080018: instanceUidInParams
};
}
}

/**
Expand Down
7 changes: 7 additions & 0 deletions api-sql/dicom-web/controller/QIDO-RS/service/querybuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,13 @@ class StudyQueryBuilder extends BaseQueryBuilder {
constructor(queryOptions) {
super(queryOptions);
this.query = {};

let studyInstanceUidInParams = _.get(this.queryOptions.requestParams, "studyUID");
if (studyInstanceUidInParams) {
this.query = {
x0020000D: studyInstanceUidInParams
};
}
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ class SeriesQueryBuilder extends BaseQueryBuilder {
attributes: ["x0020000D"],
...studyQuery
});

let seriesInstanceUidInParams = _.get(this.queryOptions.requestParams, "seriesUID");
if (seriesInstanceUidInParams) {
this.query = {
x0020000E: seriesInstanceUidInParams
};
}
}
getSeriesDate(value) {
let q = this.getDateQuery(dictionary.keyword.SeriesDate, value);
Expand Down

0 comments on commit 76e02e0

Please sign in to comment.