[WIP] Moving ViewerStudies collection to TypeSafeCollection implementation + Fixing sorting bug in findAllBy method in TypeSafeCollection

This commit is contained in:
Emanuel F. Oliveira committed 2017-01-29 22:11:17 -02:00
1 parent a4e7aa86ab
commit d25141f336
18 files changed
+143 -77

No files matched your search

@@ -135,16 +135,22 @@ function getActiveViewportImageId() {
}
function getAbstractPriorValue(imageId) {
const currentStudy = ViewerStudies.findOne({}, {
sort: {
studyDate: -1
},
limit: 1
// @TypeSafeStudies
debugger;
// @TODO: Implement MIN and MAX methods in TypeSafeCollection
// const currentStudy = ViewerStudies.findOne({}, {
// sort: {
// studyDate: -1
// },
// limit: 1
// });
const allStudies = OHIF.viewer.Studies.all({
sort: [ ['studyDate', 'desc'] ]
});
if (!currentStudy) {
if (allStudies.length < 1) {
return;
}
const currentStudy = allStudies[0];
const priorStudy = cornerstoneTools.metaData.get('study', imageId);
if (!priorStudy) {