Fixing issues on exportPdf and adding extensibility to location labels

This commit is contained in:
Bruno Alves de Faria 2017-02-08 08:19:10 -02:00
parent 96a747a2ef
commit ffc32fb214
7 changed files with 31 additions and 25 deletions

View File

@ -41,6 +41,5 @@ Package.onUse(function(api) {
api.export('TrialCriteriaTypes', 'client'); api.export('TrialCriteriaTypes', 'client');
// Export collections spanning both client and server // Export collections spanning both client and server
api.export('AdditionalFindings', [ 'client', 'server' ]);
api.export('Configuration', ['client', 'server']); api.export('Configuration', ['client', 'server']);
}); });

View File

@ -32,16 +32,6 @@ Meteor.publish('singlePatientImageMeasurements', function(patientId) {
}); });
}); });
Meteor.publish('additionalFindings', function() {
return AdditionalFindings.find();
});
Meteor.publish('singlePatientAdditionalFindings', function(patientId) {
return AdditionalFindings.find({
patientId: patientId
});
});
Meteor.publish('reviewers', function() { Meteor.publish('reviewers', function() {
return Reviewers.find(); return Reviewers.find();
}); });

View File

@ -20,7 +20,7 @@
<div class="measurementDetails"> <div class="measurementDetails">
<div class='location'> <div class='location'>
{{#if rowItem.location}} {{#if rowItem.location}}
{{rowItem.location}} {{getLocationLabel rowItem.location}}
{{else}} {{else}}
(No description) (No description)
{{/if}} {{/if}}

View File

@ -7,3 +7,8 @@ import { OHIF } from 'meteor/ohif:core';
Template.registerHelper('measurementConfiguration', () => { Template.registerHelper('measurementConfiguration', () => {
return OHIF.measurements.MeasurementApi.getConfiguration(); return OHIF.measurements.MeasurementApi.getConfiguration();
}); });
// Translates the location and return a string containing its label
Template.registerHelper('getLocationLabel', label => {
return OHIF.measurements.getLocationLabel(label);
});

View File

@ -10,7 +10,7 @@ OHIF.measurements.exportPdf = (measurementApi, timepointApi) => {
const report = new MeasurementReport({ const report = new MeasurementReport({
header: { header: {
trial: 'RECIST 1.1', trial: 'RECIST 1.1',
patientName: formatPN(study.patientName), patientName: OHIF.viewerbase.helpers.formatPN(study.patientName),
mrn: study.patientId, mrn: study.patientId,
timepoint: timepointApi.name(currentTimepoint) timepoint: timepointApi.name(currentTimepoint)
} }
@ -69,7 +69,7 @@ OHIF.measurements.exportPdf = (measurementApi, timepointApi) => {
report.printMeasurement({ report.printMeasurement({
type, type,
number: measurement.measurementNumber, number: measurement.measurementNumber,
location: measurement.location || '', location: OHIF.measurements.getLocationLabel(measurement.location) || '',
info, info,
image: enabledElement.canvas.toDataURL('image/jpeg', 0.85) image: enabledElement.canvas.toDataURL('image/jpeg', 0.85)
}); });

View File

@ -0,0 +1,11 @@
import { OHIF } from 'meteor/ohif:core';
/**
* Extensible method to translate the location and return a string containing its label
*
* @param location
* @returns string - label for the given location
*/
OHIF.measurements.getLocationLabel = location => {
return location;
};

View File

@ -1,11 +1,12 @@
import './jumpToRowItem.js'; import './jumpToRowItem';
import './activateMeasurements.js'; import './activateMeasurements';
import './deactivateAllToolData.js'; import './deactivateAllToolData';
import './exportPdf.js'; import './exportPdf';
import './getMeasurementsGroupedByNumber.js'; import './getMeasurementsGroupedByNumber';
import './getTimepointName.js'; import './getLocationLabel';
import './hangingProtocolCustomizations.js'; import './getTimepointName';
import './MeasurementHandlers.js'; import './hangingProtocolCustomizations';
import './MeasurementManager.js'; import './MeasurementHandlers';
import './syncMeasurementAndToolData.js'; import './MeasurementManager';
import './toggleLabelButton.js'; import './syncMeasurementAndToolData';
import './toggleLabelButton';