2016-07-22 14:26:29 +02:00
|
|
|
import { Meteor } from 'meteor/meteor';
|
|
|
|
|
|
2016-01-13 16:17:32 +01:00
|
|
|
Meteor.publish('timepoints', function() {
|
|
|
|
|
return Timepoints.find();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Meteor.publish('singlePatientTimepoints', function(patientId) {
|
2015-12-19 04:24:00 +01:00
|
|
|
return Timepoints.find({
|
|
|
|
|
patientId: patientId
|
|
|
|
|
});
|
2015-11-19 21:11:41 +01:00
|
|
|
});
|
|
|
|
|
|
2016-01-13 16:17:32 +01:00
|
|
|
Meteor.publish('studies', function() {
|
|
|
|
|
return Studies.find();
|
|
|
|
|
});
|
|
|
|
|
|
2016-02-09 23:46:04 +01:00
|
|
|
Meteor.publish('singlePatientAssociatedStudies', function(patientId) {
|
|
|
|
|
return Studies.find({
|
|
|
|
|
patientId: patientId
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2016-01-13 16:17:32 +01:00
|
|
|
Meteor.publish('singlePatientMeasurements', function(patientId) {
|
2015-12-19 04:24:00 +01:00
|
|
|
return Measurements.find({
|
|
|
|
|
patientId: patientId
|
|
|
|
|
});
|
2015-11-19 21:11:41 +01:00
|
|
|
});
|
|
|
|
|
|
2016-02-13 18:57:04 +01:00
|
|
|
Meteor.publish('singlePatientImageMeasurements', function(patientId) {
|
|
|
|
|
return ImageMeasurements.find({
|
|
|
|
|
patientId: patientId
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2016-07-01 17:51:09 +02:00
|
|
|
Meteor.publish('additionalFindings', function() {
|
|
|
|
|
return AdditionalFindings.find();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Meteor.publish('singlePatientAdditionalFindings', function(patientId) {
|
|
|
|
|
return AdditionalFindings.find({
|
|
|
|
|
patientId: patientId
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2016-04-04 06:00:33 +02:00
|
|
|
Meteor.publish('reviewers', function() {
|
|
|
|
|
return Reviewers.find();
|
|
|
|
|
});
|
|
|
|
|
|
2016-08-10 15:39:31 +02:00
|
|
|
Meteor.publish('servers', () => {
|
2016-04-21 23:14:28 +02:00
|
|
|
return Servers.find();
|
|
|
|
|
});
|
|
|
|
|
|
2015-11-19 21:11:41 +01:00
|
|
|
// Temporary fix to drop all Collections on server restart
|
|
|
|
|
// http://stackoverflow.com/questions/23891631/meteor-how-can-i-drop-all-mongo-collections-and-clear-all-data-on-startup
|
2015-12-19 04:24:00 +01:00
|
|
|
Meteor.startup(function() {
|
2016-04-21 23:14:28 +02:00
|
|
|
for (var property in global) {
|
|
|
|
|
var object = global[property];
|
2015-12-19 04:24:00 +01:00
|
|
|
if (object instanceof Meteor.Collection) {
|
2015-11-19 21:11:41 +01:00
|
|
|
object.remove({});
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-01-11 11:32:20 +01:00
|
|
|
});
|