Building the viewer data inside routes
This commit is contained in:
1 parent
7718d31a77
commit
9ccebb76bd
9 files changed
+193
-94
No files matched your search
@@ -36,11 +36,11 @@ export const storeMeasurements = (measurementData, timepointIds) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const retrieveTimepoints = (patientId) => {
|
||||
export const retrieveTimepoints = filter => {
|
||||
console.log('retrieveTimepoints');
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
Meteor.call('retrieveTimepoints', patientId, (error, response) => {
|
||||
Meteor.call('retrieveTimepoints', filter, (error, response) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
|
||||
@@ -8,8 +8,6 @@ import { OHIF } from 'meteor/ohif:core';
|
||||
* @param title The title to be used for the tab heading
|
||||
*/
|
||||
OHIF.lesiontracker.openNewTabWithTimepoint = timepointId => {
|
||||
const contentId = 'viewerTab';
|
||||
|
||||
const Timepoints = OHIF.studylist.timepointApi.timepoints;
|
||||
const timepoint = Timepoints.findOne({
|
||||
timepointId: timepointId
|
||||
@@ -27,7 +25,6 @@ OHIF.lesiontracker.openNewTabWithTimepoint = timepointId => {
|
||||
|
||||
// Update the OHIF.viewer.data global object
|
||||
OHIF.viewer.data = {
|
||||
contentId: contentId,
|
||||
studyInstanceUids: data.studyInstanceUids,
|
||||
timepointIds: data.timepointIds,
|
||||
currentTimepointId: timepointId
|
||||
|
||||
@@ -44,11 +44,11 @@ Meteor.methods({
|
||||
disassociateStudy(timepointIds, studyInstanceUid) {
|
||||
OHIF.log.info('Disassociating Study from Timepoints');
|
||||
timepointIds.forEach(timepointId => {
|
||||
const timepoint = Timepoints.findOne({timepointId});
|
||||
const timepoint = Timepoints.findOne({ timepointId });
|
||||
if (!timepoint) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Find the index of the current studyInstanceUid in the array
|
||||
// of reference studyInstanceUids
|
||||
const index = timepoint.studyInstanceUids.indexOf(studyInstanceUid);
|
||||
@@ -59,8 +59,6 @@ Meteor.methods({
|
||||
// Remove the specified studyInstanceUid from the array of associated studyInstanceUids
|
||||
timepoint.studyInstanceUids.splice(index, 1);
|
||||
|
||||
let updated = [];
|
||||
let removed = [];
|
||||
if (timepoint.studyInstanceUids.length) {
|
||||
Timepoints.update(timepoint._id, {
|
||||
$set: {
|
||||
@@ -78,14 +76,14 @@ Meteor.methods({
|
||||
timepointId: timepointId
|
||||
};
|
||||
|
||||
MeasurementCollections[tool.id].remove(filter)
|
||||
MeasurementCollections[tool.id].remove(filter);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
removeTimepoint(timepointId) {
|
||||
OHIF.log.info('Removing Timepoint from the Server');
|
||||
Timepoints.remove({timepointId});
|
||||
Timepoints.remove({ timepointId });
|
||||
},
|
||||
|
||||
updateTimepoint(timepointData, query) {
|
||||
@@ -95,14 +93,8 @@ Meteor.methods({
|
||||
Timepoints.update(timepointData, query);
|
||||
},
|
||||
|
||||
retrieveTimepoints(patientId) {
|
||||
retrieveTimepoints(filter={}) {
|
||||
OHIF.log.info('Retrieving Timepoints from the Server');
|
||||
|
||||
const filter = {}
|
||||
if (patientId) {
|
||||
filter.patientId = patientId;
|
||||
};
|
||||
|
||||
return Timepoints.find(filter).fetch();
|
||||
},
|
||||
|
||||
@@ -128,7 +120,7 @@ Meteor.methods({
|
||||
OHIF.log.info('Retrieving Measurements from the Server');
|
||||
let measurementData = {};
|
||||
|
||||
const filter = {}
|
||||
const filter = {};
|
||||
if (patientId) {
|
||||
filter.patientId = patientId;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user