chore(reorganization) Moving longitudinal feature to Lesiontracker package (#208)

This commit is contained in:
Gustavo André Lelis authored and Erik Ziegler committed 2018-06-18 18:03:34 +02:00
1 parent 1643e9f7d6
commit 9f73ae0153
11 files changed
+2 -1

No files matched your search

@@ -0,0 +1,28 @@
<template name="longitudinalStudyListStudy">
<tr class="studylistStudy noselect {{#if this.selected}}active{{/if}}">
<td>
{{#if reviewerTip}}
<i class="fa fa-exclamation-circle reviewerTip" data-toggle="tooltip" data-placement="bottom" title="{{reviewerTip}}"></i>
{{/if}}
{{formatPN patientName}}
</td>
<td>
{{patientId}}
</td>
<td>
{{accessionNumber}}
</td>
<td>
{{formatDA studyDate}} {{ #if timepointName }}({{timepointName}}){{ /if }}
</td>
<td>
{{modalities}}
</td>
<td>
{{studyDescription}}
</td>
<td>
{{numberOfStudyRelatedInstances}}
</td>
</tr>
</template>
@@ -0,0 +1,80 @@
import { Meteor } from 'meteor/meteor';
import { Template } from 'meteor/templating';
import { OHIF } from 'meteor/ohif:core';
// Use Aldeed's meteor-template-extension package to replace the
// default StudyListStudy template.
// See https://github.com/aldeed/meteor-template-extension
const defaultTemplate = 'studylistStudy';
if (OHIF.studylist) {
Template.longitudinalStudyListStudy.replaces(defaultTemplate);
// Add the TimepointName helper to the default template. The
// HTML of this template is replaced with that of longitudinalStudyListStudy
Template[defaultTemplate].helpers({
timepointName() {
const instance = Template.instance();
const timepointApi = OHIF.studylist.timepointApi;
if (!timepointApi) {
return;
}
const timepoint = timepointApi.study(instance.data.studyInstanceUid)[0];
if (!timepoint) {
return;
}
return timepointApi.name(timepoint);
},
reviewerTip() {
const instance = Template.instance();
const timepointApi = OHIF.studylist.timepointApi;
if (!timepointApi || !window.Reviewers) {
return;
}
const timepoint = timepointApi.study(instance.data.studyInstanceUid);
if (!timepoint) {
return;
}
const timepointReviewers = window.Reviewers.findOne({ timepointId: timepoint.timepointId });
if (!timepointReviewers) {
return;
}
return getReviewerTipText(timepointReviewers.reviewers);
}
});
function getReviewerTipText(reviewers) {
if (!reviewers || !reviewers.length) {
return;
}
const newReviewers = reviewers.filter(function(reviewer) {
return reviewer.userId !== Meteor.userId();
});
if (!newReviewers.length) {
return;
}
let tipText = 'The study is being reviewed by ';
newReviewers.forEach(function(reviewer, index) {
if (reviewer.userId === Meteor.userId()) {
return;
}
if (index > 0) {
tipText += ',';
}
tipText += reviewer.userName;
});
return tipText;
}
}
@@ -0,0 +1,5 @@
.studylistStudy
cursor: pointer
.reviewerTip
color: darkred