Skip to content

Commit

Permalink
fix: move findOneByDicomUID to static
Browse files Browse the repository at this point in the history
  • Loading branch information
Chinlinlee committed Jan 22, 2024
1 parent feb1ed1 commit 46031c9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions models/mongodb/models/instance.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ let dicomSchemaOptions = _.merge(
{
strict: false,
methods: {
findOneByDicomUID: async function ({ studyUID, seriesUID, instanceUID }) {
return await mongoose.model("dicom").findOne({ studyUID, seriesUID, instanceUID }).exec();
},
deleteDicomInstances: async function () {
let instancePath = this.instancePath;
try {
Expand All @@ -54,6 +51,9 @@ let dicomSchemaOptions = _.merge(
}
},
statics: {
findOneByDicomUID: async function ({ studyUID, seriesUID, instanceUID }) {
return await mongoose.model("dicom").findOne({ studyUID, seriesUID, instanceUID }).exec();
},
getAuditInstancesInfoFromStudyUID: async (studyUID) => {
let instances = await mongoose.model("dicom").find({ studyUID }).exec();

Expand Down

0 comments on commit 46031c9

Please sign in to comment.