Getting studyDate from wordlist
This commit is contained in:
parent
a073d03744
commit
2e51b4e41d
@ -2,6 +2,7 @@
|
|||||||
<div id="viewer">
|
<div id="viewer">
|
||||||
{{ >lesionLocationDialog }}
|
{{ >lesionLocationDialog }}
|
||||||
{{ >nonTargetLesionDialog}}
|
{{ >nonTargetLesionDialog}}
|
||||||
|
{{ >studyDateList}}
|
||||||
|
|
||||||
{{ >hidingPanel }}
|
{{ >hidingPanel }}
|
||||||
<div id="viewportAndLesionTable">
|
<div id="viewportAndLesionTable">
|
||||||
|
|||||||
@ -487,4 +487,4 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
})($, cornerstone, cornerstoneMath, cornerstoneTools);
|
})($, cornerstone, cornerstoneMath, cornerstoneTools);
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
<template name="studyDateList">
|
||||||
|
<select id="selectStudyDate">
|
||||||
|
{{#each patientStudies}}
|
||||||
|
<option value="{{studyDate}}">{{studyDate}}</option>
|
||||||
|
{{/each}}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
</template>
|
||||||
@ -0,0 +1,78 @@
|
|||||||
|
|
||||||
|
Template.studyDateList.onCreated(function(){
|
||||||
|
|
||||||
|
// All studies of this patient at different dates
|
||||||
|
this.patientStudies = [];
|
||||||
|
this.selectedDate = "";
|
||||||
|
});
|
||||||
|
|
||||||
|
function cleanTimepoints() {
|
||||||
|
var timepoints = Timepoints.find();
|
||||||
|
timepoints.forEach(function (timepoint) {
|
||||||
|
Timepoints.remove({_id: timepoint._id});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Template.studyDateList.onRendered(function(){
|
||||||
|
//cleanTimepoints();
|
||||||
|
|
||||||
|
// Add Study dates to Timepoints
|
||||||
|
this.patientStudies.forEach(function(study) {
|
||||||
|
Timepoints.insert({
|
||||||
|
timepointID: uuid.v4(),
|
||||||
|
timepointName: study.studyDate
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Selected date option
|
||||||
|
$('#selectStudyDate option[value="'+this.selectedDate+'"]').prop('selected', true);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
Template.studyDateList.helpers({
|
||||||
|
patientStudies: function(){
|
||||||
|
var self = Template.instance();
|
||||||
|
|
||||||
|
var studyData = this.studies[0]; // study which is loaded in tab
|
||||||
|
self.selectedDate = studyData.studyDate;
|
||||||
|
var studies = Studies.find().fetch(); // All studies list
|
||||||
|
var patientStudies = []; // Holds studies of patient
|
||||||
|
|
||||||
|
// Get all studies of patient with patientID
|
||||||
|
studies.forEach(function(study) {
|
||||||
|
if (studyData.patientId === study.patientId) {
|
||||||
|
patientStudies.push(study);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
self.patientStudies = patientStudies;
|
||||||
|
return patientStudies;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
Template.studyDateList.events({
|
||||||
|
'change select#selectStudyDate': function(e, template) {
|
||||||
|
var selector = e.currentTarget;
|
||||||
|
var selectedStudyDate = $(selector).val();
|
||||||
|
var patientStudies = template.patientStudies;
|
||||||
|
var studies = []; // all studies that has the same date and get with studyInstanceUId
|
||||||
|
patientStudies.forEach(function(study) {
|
||||||
|
if(study.studyDate === selectedStudyDate) {
|
||||||
|
studies.push(study);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
studies.forEach(function(studyData) {
|
||||||
|
var studyInstanceUid = studyData.studyInstanceUid;
|
||||||
|
Meteor.call('GetStudyMetadata', studyInstanceUid, function(error, study) {
|
||||||
|
sortStudy(study);
|
||||||
|
// TODO:
|
||||||
|
Session.set('studies', [study]);
|
||||||
|
// TODO: Change thumbnails only
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
@ -39,6 +39,13 @@ Package.onUse(function (api) {
|
|||||||
api.addFiles('components/nonTargetLesionDialog/nonTargetLesionDialog.css', 'client');
|
api.addFiles('components/nonTargetLesionDialog/nonTargetLesionDialog.css', 'client');
|
||||||
api.addFiles('components/nonTargetLesionDialog/nonTargetLesionDialog.js', 'client');
|
api.addFiles('components/nonTargetLesionDialog/nonTargetLesionDialog.js', 'client');
|
||||||
|
|
||||||
|
api.addFiles('components/studyDateList/studyDateList.html', 'client');
|
||||||
|
api.addFiles('components/studyDateList/studyDateList.css', 'client');
|
||||||
|
api.addFiles('components/studyDateList/studyDateList.js', 'client');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Library functions
|
// Library functions
|
||||||
api.addFiles('lib/uuid.js', 'client');
|
api.addFiles('lib/uuid.js', 'client');
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
Template.studyBrowser.helpers({
|
Template.studyBrowser.helpers({
|
||||||
studies : function() {
|
studies : function() {
|
||||||
var studies = Session.get('studies');
|
var studies = Session.get('studies');
|
||||||
|
console.log(studies);
|
||||||
|
|
||||||
var array = [];
|
var array = [];
|
||||||
studies.forEach(function(study, index) {
|
studies.forEach(function(study, index) {
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
// This is a client-side only Collection which
|
// This is a client-side only Collection which
|
||||||
// Stores the list of studies in the Worklist
|
// Stores the list of studies in the Worklist
|
||||||
Studies = new Mongo.Collection(null);
|
Studies = new Mongo.Collection(null);
|
||||||
|
PatientStudies = new Mongo.Collection(null);
|
||||||
|
|
||||||
Template.worklistResult.helpers({
|
Template.worklistResult.helpers({
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -59,5 +59,6 @@ Package.onUse(function (api) {
|
|||||||
|
|
||||||
// Export the WorklistTabs Collection
|
// Export the WorklistTabs Collection
|
||||||
api.export('WorklistTabs', 'client');
|
api.export('WorklistTabs', 'client');
|
||||||
|
api.export('Studies', 'client');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user