Skip to content

Commit

Permalink
refactor: rename to storeTo{}Collection
Browse files Browse the repository at this point in the history
- When `collection` present, it is DB
  • Loading branch information
Chinlinlee committed Apr 10, 2023
1 parent 02fd0b8 commit 7a31d28
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions models/DICOM/dicom-json-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,16 @@ class DicomJsonModel {
delete dicomJsonClone.sopInstanceUID;

await Promise.all([
this.storeToDbInstanceCollection(dicomJsonClone),
this.storeToDbStudyCollection(dicomJsonClone),
this.storeToDbSeriesCollection(dicomJsonClone)
this.storeInstanceCollection(dicomJsonClone),
this.storeStudyCollection(dicomJsonClone),
this.storeSeriesCollection(dicomJsonClone)
]);
} catch(e) {
throw e;
}
}

async storeToDbInstanceCollection(dicomJson) {
async storeInstanceCollection(dicomJson) {
let query = {
$and: [
{
Expand All @@ -121,7 +121,7 @@ class DicomJsonModel {
});
}

async storeToDbStudyCollection(dicomJson) {
async storeStudyCollection(dicomJson) {
await mongoose.model("dicomStudy").findOneAndUpdate(
{
studyUID: this.uidObj.studyUID
Expand All @@ -134,7 +134,7 @@ class DicomJsonModel {
);
}

async storeToDbSeriesCollection(dicomJson) {
async storeSeriesCollection(dicomJson) {
await mongoose.model("dicomSeries").findOneAndUpdate(
{
$and: [
Expand Down

0 comments on commit 7a31d28

Please sign in to comment.