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');
// Export collections spanning both client and server
api.export('AdditionalFindings', [ '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() {
return Reviewers.find();
});

View File

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

View File

@ -7,3 +7,8 @@ import { OHIF } from 'meteor/ohif:core';
Template.registerHelper('measurementConfiguration', () => {
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({
header: {
trial: 'RECIST 1.1',
patientName: formatPN(study.patientName),
patientName: OHIF.viewerbase.helpers.formatPN(study.patientName),
mrn: study.patientId,
timepoint: timepointApi.name(currentTimepoint)
}
@ -69,7 +69,7 @@ OHIF.measurements.exportPdf = (measurementApi, timepointApi) => {
report.printMeasurement({
type,
number: measurement.measurementNumber,
location: measurement.location || '',
location: OHIF.measurements.getLocationLabel(measurement.location) || '',
info,
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 './activateMeasurements.js';
import './deactivateAllToolData.js';
import './exportPdf.js';
import './getMeasurementsGroupedByNumber.js';
import './getTimepointName.js';
import './hangingProtocolCustomizations.js';
import './MeasurementHandlers.js';
import './MeasurementManager.js';
import './syncMeasurementAndToolData.js';
import './toggleLabelButton.js';
import './jumpToRowItem';
import './activateMeasurements';
import './deactivateAllToolData';
import './exportPdf';
import './getMeasurementsGroupedByNumber';
import './getLocationLabel';
import './getTimepointName';
import './hangingProtocolCustomizations';
import './MeasurementHandlers';
import './MeasurementManager';
import './syncMeasurementAndToolData';
import './toggleLabelButton';