Skip to content

Commit

Permalink
fix: SQ query field incorrect
Browse files Browse the repository at this point in the history
# Problems
- The logic incorrect, that get ggggeeee.gggeeee.Value
- We should get ggggeeee.Value.ggggeee.Value
to fit structure of Mongo

# Solutions
- Use length to check is sequence query
- add ".Value" suffix to every tag
- combine with dot
  • Loading branch information
Chinlinlee committed Aug 11, 2023
1 parent cd1a2ac commit 25d2ea2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions api/dicom-web/controller/QIDO-RS/service/QIDO-RS.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,20 @@ function convertAllQueryToDICOMTag(iParam) {
newKeyNames.push(keyNameSplit[x]);
}
}
let retKeyName;
if (newKeyNames.length === 0) {
throw new DicomWebServiceError(
DicomWebStatusCodes.InvalidArgumentValue,
`Invalid request query: ${keyNameSplit}`,
400
);
};
newKeyNames.push("Value");
let retKeyName = newKeyNames.join(".");
} else if (newKeyNames.length >= 2) {
retKeyName = newKeyNames.map(v => v + ".Value").join(".");
} else {
newKeyNames.push("Value");
retKeyName = newKeyNames.join(".");
}

newQS[retKeyName] = iParam[keyName];
}
return newQS;
Expand Down

0 comments on commit 25d2ea2

Please sign in to comment.