2015-11-19 21:11:41 +01:00
|
|
|
Meteor.publish('timepoints', function(patientId) {
|
2015-12-19 04:24:00 +01:00
|
|
|
return Timepoints.find({
|
|
|
|
|
patientId: patientId
|
|
|
|
|
});
|
2015-11-19 21:11:41 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Meteor.publish('measurements', function(patientId) {
|
2015-12-19 04:24:00 +01:00
|
|
|
return Measurements.find({
|
|
|
|
|
patientId: patientId
|
|
|
|
|
});
|
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() {
|
|
|
|
|
var globalObject = Meteor.isClient ? window : global;
|
|
|
|
|
for (var property in globalObject) {
|
|
|
|
|
var object = globalObject[property];
|
|
|
|
|
if (object instanceof Meteor.Collection) {
|
2015-11-19 21:11:41 +01:00
|
|
|
object.remove({});
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-01-11 11:32:20 +01:00
|
|
|
});
|