Skip to content

Commit

Permalink
fix: incorrect result of querying instance in study
Browse files Browse the repository at this point in the history
# Problem
- When search /studies/2.16.840.1.113995.3.110.3.0.10118.2000002.278819.649182/instances
- , it should response 10 result but got 17
- The issues is using left outer join rather than inner join

# Solutions
- Use inner join instead of outer join
- Add required in sequelize query options to do inner join
  • Loading branch information
Chinlinlee committed Aug 10, 2023
1 parent 34103a5 commit 5c9b223
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ class InstanceQueryBuilder extends BaseQueryBuilder {
this.includeQueries.push({
model: sequelize.model("Series"),
attributes: ["x0020000E"],
...seriesQuery
...seriesQuery,
required: true
});

let instanceUidInParams = _.get(this.queryOptions.requestParams, "instanceUID");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class SeriesQueryBuilder extends BaseQueryBuilder {
this.includeQueries.push({
model: sequelize.model("Study"),
attributes: ["x0020000D"],
...studyQuery
...studyQuery,
required: true
});

let seriesInstanceUidInParams = _.get(this.queryOptions.requestParams, "seriesUID");
Expand Down

0 comments on commit 5c9b223

Please sign in to comment.