Added Prior indicator to viewport overlay based on oldest study date
This commit is contained in:
parent
27566c3865
commit
8d6e9b7156
@ -3,7 +3,7 @@
|
|||||||
<div class="topleft dicomTag">
|
<div class="topleft dicomTag">
|
||||||
<div>{{formatPN patientName}}</div>
|
<div>{{formatPN patientName}}</div>
|
||||||
<div>{{patientId}}</div>
|
<div>{{patientId}}</div>
|
||||||
<div></div>
|
<div class='priorIndicator'>{{prior}}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="topright dicomTag">
|
<div class="topright dicomTag">
|
||||||
<div>{{studyDescription}}</div>
|
<div>{{studyDescription}}</div>
|
||||||
|
|||||||
@ -151,5 +151,29 @@ Template.viewportOverlay.helpers({
|
|||||||
},
|
},
|
||||||
numImages : function() {
|
numImages : function() {
|
||||||
return getSeries.call(this, 'numImages');
|
return getSeries.call(this, 'numImages');
|
||||||
|
},
|
||||||
|
prior : function() {
|
||||||
|
// This helper is updated whenever a new image is displayed in the viewport
|
||||||
|
Session.get('CornerstoneNewImage' + this.viewportIndex);
|
||||||
|
if (!this.imageId) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Make sure there are more than two studies loaded in the viewer
|
||||||
|
//
|
||||||
|
// Here we sort the collection in ascending order by study date, so
|
||||||
|
// that we can obtain the oldest study as the first element of the array
|
||||||
|
//
|
||||||
|
// TODO= Find out if we should encode studyDate as a Date in the ViewerStudies Collection
|
||||||
|
var viewportStudies = ViewerStudies.find({}, {sort: {studyDate: 1}});
|
||||||
|
if (viewportStudies.count() < 2) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get study data
|
||||||
|
var study = cornerstoneTools.metaData.get('study', this.imageId);
|
||||||
|
if (study.instanceUid === viewportStudies.fetch()[0].studyInstanceUid) {
|
||||||
|
return 'Prior';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -24,4 +24,8 @@
|
|||||||
.bottomright
|
.bottomright
|
||||||
bottom: 3px
|
bottom: 3px
|
||||||
right: 3px
|
right: 3px
|
||||||
text-align: right
|
text-align: right
|
||||||
|
|
||||||
|
.priorIndicator
|
||||||
|
font-weight: bold
|
||||||
|
color: yellow
|
||||||
Loading…
Reference in New Issue
Block a user