Study metadata is added on study browser click

This commit is contained in:
Erik Ziegler committed 2016-07-22 11:03:01 +02:00
1 parent 757513906c
commit 521de2fad3
13 files changed
+117 -179

No files matched your search

@@ -3,10 +3,25 @@ Template.studyTimepointBrowser.onCreated(() => {
// Get the studies for a specific timepoint
instance.getStudies = timepoint => {
const query = {
selected: true
};
return ViewerStudies.find(query);
return timepoint.studyInstanceUids.map(studyInstanceUid => {
const query = {
patientId: timepoint.patientId,
timepointId: timepoint.timepointId,
studyInstanceUid: studyInstanceUid
};
var loadedStudy = ViewerStudies.findOne(query);
if (loadedStudy) {
return loadedStudy;
}
var notYetLoaded = Studies.findOne(query);
if (!notYetLoaded) {
throw "No study data available for Study: " + studyInstanceUid;
}
return notYetLoaded;
});
};
});