PWV-1: Requesting timepoint data from PIM TIMC API

This commit is contained in:
Bruno Alves de Faria authored and Erik Ziegler committed 2016-11-15 08:24:30 +01:00
1 parent 37fcf9f004
commit c84d0c21f3
5 files changed
+16 -18

No files matched your search

@@ -8,7 +8,13 @@ measurementTools.forEach(tool => {
MeasurementCollections[tool.id] = new Mongo.Collection(tool.id); MeasurementCollections[tool.id] = new Mongo.Collection(tool.id);
}); });
Timepoints = new Mongo.Collection('timepoints'); const Timepoints = new Mongo.Collection('timepoints');
Timepoints.find().observe({
remove() {
console.warn('REMOVED');
}
});
// Drop our collections for testing purposes // Drop our collections for testing purposes
Meteor.startup(() => { Meteor.startup(() => {
@@ -7,7 +7,7 @@ let configuration = {};
class MeasurementApi { class MeasurementApi {
static setConfiguration(config) { static setConfiguration(config) {
configuration = config; _.extend(configuration, config);
} }
static getConfiguration() { static getConfiguration() {
@@ -9,7 +9,7 @@ let configuration = {};
class TimepointApi { class TimepointApi {
static setConfiguration(config) { static setConfiguration(config) {
configuration = config; _.extend(configuration, config);
} }
static getConfiguration() { static getConfiguration() {
@@ -20,8 +20,6 @@ class TimepointApi {
if (currentTimepointId) { if (currentTimepointId) {
this.currentTimepointId = currentTimepointId; this.currentTimepointId = currentTimepointId;
} }
this.config = configuration || OHIF.measurements.MeasurementApi.getConfiguration();
} }
retrieveTimepoints() { retrieveTimepoints() {
@@ -29,7 +27,7 @@ class TimepointApi {
this.timepoints.attachSchema(TimepointSchema); this.timepoints.attachSchema(TimepointSchema);
this.timepoints._debugName = 'Timepoints'; this.timepoints._debugName = 'Timepoints';
const retrievalFn = this.config.dataExchange.retrieve; const retrievalFn = configuration.dataExchange.retrieve;
if (!_.isFunction(retrievalFn)) { if (!_.isFunction(retrievalFn)) {
return; return;
} }
@@ -49,7 +47,7 @@ class TimepointApi {
} }
storeTimepoints() { storeTimepoints() {
const storeFn = this.config.dataExchange.store; const storeFn = configuration.dataExchange.store;
if (!_.isFunction(storeFn)) { if (!_.isFunction(storeFn)) {
return; return;
} }
+2 -2
View File
@@ -20,7 +20,7 @@ Meteor.startup(() => {
}) })
// TODO: Make storage use update instead of clearing the entire collection and // TODO: Make storage use update instead of clearing the entire collection and
// re-inserting everything. // re-inserting everything.
Meteor.methods({ Meteor.methods({
storeTimepoints(timepoints) { storeTimepoints(timepoints) {
@@ -62,4 +62,4 @@ Meteor.methods({
return measurementData; return measurementData;
} }
}); });
@@ -1,14 +1,8 @@
import { Meteor } from 'meteor/meteor'; import { Meteor } from 'meteor/meteor';
import { OHIF } from 'meteor/ohif:core'; import { OHIF } from 'meteor/ohif:core';
Meteor.publish('studyImportStatus', () => { Meteor.publish('studyImportStatus', () => OHIF.studylist.collections.StudyImportStatus.find());
return OHIF.studylist.collections.StudyImportStatus.find();
});
Meteor.publish('servers', () => { Meteor.publish('servers', () => Servers.find());
return Servers.find();
});
Meteor.publish('currentServer', () => { Meteor.publish('currentServer', () => CurrentServer.find());
return CurrentServer.find();
});