Added data persistence for lesion measurements and timepoints
This commit is contained in:
1 parent
1facbfb0b1
commit
0af0069d69
15 files changed
+157
-73
No files matched your search
@@ -16,7 +16,6 @@ standard-minifiers # JS/CSS minifiers run for production mode
|
||||
es5-shim # ECMAScript 5 compatibility for older browsers.
|
||||
ecmascript # Enable ECMAScript2015+ syntax in app code
|
||||
|
||||
autopublish # Publish all data to the clients (for prototyping)
|
||||
insecure # Allow all DB writes from clients (for prototyping)
|
||||
cornerstone
|
||||
worklist
|
||||
|
||||
@@ -2,7 +2,6 @@ accounts-base@1.2.2
|
||||
accounts-password@1.1.4
|
||||
anti:i18n@0.4.3
|
||||
arsnebula:reactive-promise@0.9.1
|
||||
autopublish@1.0.4
|
||||
autoupdate@1.2.4
|
||||
babel-compiler@5.8.24_1
|
||||
babel-runtime@0.1.4
|
||||
|
||||
@@ -16,12 +16,8 @@ function resizeViewports() {
|
||||
}, 1);
|
||||
}
|
||||
|
||||
Template.viewer.helpers({
|
||||
'studyDateIsShown':function(){
|
||||
return {studyDateIsShown: true};
|
||||
}
|
||||
});
|
||||
Template.viewer.onCreated(function() {
|
||||
var self = this;
|
||||
log.info("viewer onCreated");
|
||||
|
||||
OHIF = {
|
||||
@@ -88,6 +84,7 @@ Template.viewer.onCreated(function() {
|
||||
|
||||
Session.set('activeViewport', ViewerData[contentId].activeViewport || 0);
|
||||
|
||||
|
||||
// Update the ViewerStudies collection with the loaded studies
|
||||
ViewerStudies = new Meteor.Collection(null);
|
||||
this.data.studies.forEach(function(study) {
|
||||
@@ -95,9 +92,53 @@ Template.viewer.onCreated(function() {
|
||||
ViewerStudies.insert(study);
|
||||
});
|
||||
|
||||
var patientId = this.data.studies[0].patientId;
|
||||
Session.set('patientId', patientId);
|
||||
|
||||
timepointsAdded = false;
|
||||
self.autorun(function() {
|
||||
var patientId = Session.get('patientId');
|
||||
self.subscribe('timepoints', patientId);
|
||||
self.subscribe('measurements', patientId);
|
||||
|
||||
if (!self.subscriptionsReady()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (timepointsAdded === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
ViewerStudies.find().forEach(function(study) {
|
||||
var timepoint = Timepoints.findOne({timepointName: study.studyDate});
|
||||
if (timepoint) {
|
||||
log.warn("A timepoint with that study date already exists!");
|
||||
return;
|
||||
}
|
||||
|
||||
var timepointID = uuid.v4();
|
||||
|
||||
var testTimepoint = Timepoints.findOne({});
|
||||
if (testTimepoint && testTimepoint.patientId !== study.patientId) {
|
||||
log.warn("Timepoints collection related to the wrong subject");
|
||||
return;
|
||||
}
|
||||
|
||||
log.info('Inserting a new timepoint');
|
||||
Timepoints.insert({
|
||||
patientId: study.patientId,
|
||||
timepointID: timepointID,
|
||||
timepointName: study.studyDate
|
||||
});
|
||||
});
|
||||
|
||||
timepointsAdded = true;
|
||||
});
|
||||
|
||||
OHIF.viewer.updateImageSynchronizer = new cornerstoneTools.Synchronizer("CornerstoneNewImage", cornerstoneTools.updateImageSynchronizer);
|
||||
});
|
||||
|
||||
|
||||
Template.viewer.onDestroyed(function() {
|
||||
log.info("onDestroyed");
|
||||
OHIF.viewer.updateImageSynchronizer.destroy();
|
||||
|
||||
Reference in new issue
Block a user