2017-02-22 14:15:33 +01:00
|
|
|
import { Meteor } from 'meteor/meteor';
|
2016-09-22 20:58:29 +02:00
|
|
|
import { Template } from 'meteor/templating';
|
|
|
|
|
|
|
|
|
|
const getTimepointType = study => {
|
2017-02-22 14:15:33 +01:00
|
|
|
const instance = Template.instance();
|
|
|
|
|
const timepointApi = instance.timepointApi || instance.data.timepointApi;
|
2016-08-15 15:34:36 +02:00
|
|
|
if (!timepointApi) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const timepoint = timepointApi.study(study.studyInstanceUid)[0];
|
|
|
|
|
if (!timepoint) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return timepoint.timepointType;
|
|
|
|
|
};
|
|
|
|
|
|
2017-02-22 14:15:33 +01:00
|
|
|
Meteor.startup(() => {
|
|
|
|
|
HP = HP || false;
|
2016-08-15 15:34:36 +02:00
|
|
|
|
2017-02-22 14:15:33 +01:00
|
|
|
if (HP) {
|
|
|
|
|
HP.addCustomAttribute('timepointType', 'Timepoint Type', getTimepointType);
|
|
|
|
|
}
|
|
|
|
|
});
|