LT-251: Showing the timepoint for the current study even if it's not a key timepoint
This commit is contained in:
parent
4b307598e9
commit
c2dfb0e7ba
@ -4,6 +4,11 @@ Template.studyTimepointBrowser.onCreated(() => {
|
|||||||
// Defines whether to show all key timepoints or only the current one
|
// Defines whether to show all key timepoints or only the current one
|
||||||
instance.showAdditionalTimepoints = new ReactiveVar(true);
|
instance.showAdditionalTimepoints = new ReactiveVar(true);
|
||||||
|
|
||||||
|
// Return the current study if it's defined
|
||||||
|
instance.getCurrentStudy = () => {
|
||||||
|
return instance.data.currentStudy && instance.data.currentStudy.get();
|
||||||
|
};
|
||||||
|
|
||||||
// Get the studies for a specific timepoint
|
// Get the studies for a specific timepoint
|
||||||
instance.getStudies = timepoint => {
|
instance.getStudies = timepoint => {
|
||||||
return timepoint.studyInstanceUids.map(studyInstanceUid => {
|
return timepoint.studyInstanceUids.map(studyInstanceUid => {
|
||||||
@ -83,7 +88,7 @@ Template.studyTimepointBrowser.helpers({
|
|||||||
timepoints() {
|
timepoints() {
|
||||||
const instance = Template.instance();
|
const instance = Template.instance();
|
||||||
// Get the current study
|
// Get the current study
|
||||||
const currentStudy = instance.data.currentStudy && instance.data.currentStudy.get();
|
const currentStudy = instance.getCurrentStudy();
|
||||||
// Build the query
|
// Build the query
|
||||||
const query = {};
|
const query = {};
|
||||||
if (currentStudy && !instance.showAdditionalTimepoints.get()) {
|
if (currentStudy && !instance.showAdditionalTimepoints.get()) {
|
||||||
@ -115,6 +120,12 @@ Template.studyTimepointBrowser.helpers({
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Always Show the timepoint for current study
|
||||||
|
const currentStudy = instance.getCurrentStudy();
|
||||||
|
if (currentStudy && _.contains(timepoint.studyInstanceUids, currentStudy.studyInstanceUid)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// Show only the latest timepoints and baseline
|
// Show only the latest timepoints and baseline
|
||||||
return index < 3 || timepoint.timepointType === 'baseline';
|
return index < 3 || timepoint.timepointType === 'baseline';
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user