Allowing follow-up number to be controlled by configuration

This commit is contained in:
Bruno Alves de Faria 2017-02-23 14:01:16 -03:00
parent e7cd285f9c
commit 710d7c9a02
5 changed files with 25 additions and 19 deletions

View File

@ -642,7 +642,7 @@ HP.ProtocolEngine = class ProtocolEngine {
} }
if (!currentViewportData.displaySetInstanceUid) { if (!currentViewportData.displaySetInstanceUid) {
throw 'No matching display set found?'; throw new Meteor.Error('No matching display set found?');
} }
viewportData.push(currentViewportData); viewportData.push(currentViewportData);

View File

@ -220,6 +220,8 @@ class TimepointApi {
// Check if this is a Baseline timepoint, if it is, return 'Baseline' // Check if this is a Baseline timepoint, if it is, return 'Baseline'
if (timepoint.timepointType === 'baseline') { if (timepoint.timepointType === 'baseline') {
return 'Baseline'; return 'Baseline';
} else if (timepoint.visitNumber) {
return 'Follow-up ' + timepoint.visitNumber;
} }
// Retrieve all of the relevant follow-up timepoints for this patient // Retrieve all of the relevant follow-up timepoints for this patient

View File

@ -27,5 +27,10 @@ export const schema = new SimpleSchema({
latestDate: { latestDate: {
type: Date, type: Date,
label: 'Most recent Study Date from associated studies', label: 'Most recent Study Date from associated studies',
},
visitNumber: {
type: Number,
label: 'Number of patient\'s visit',
optional: true
} }
}); });

View File

@ -12,6 +12,8 @@ OHIF.measurements.getTimepointName = timepoint => {
// Check if this is a Baseline timepoint, if it is, return 'Baseline' // Check if this is a Baseline timepoint, if it is, return 'Baseline'
if (timepoint.timepointType === 'baseline') { if (timepoint.timepointType === 'baseline') {
return 'Baseline'; return 'Baseline';
} else if (timepoint.visitNumber) {
return 'Follow-up ' + timepoint.visitNumber;
} }
// Retrieve all of the relevant follow-up timepoints for this patient // Retrieve all of the relevant follow-up timepoints for this patient

View File

@ -12,8 +12,8 @@ import { OHIF } from 'meteor/ohif:core';
export class LayoutManager { export class LayoutManager {
/** /**
* Constructor: initializes a Layout Manager object. * Constructor: initializes a Layout Manager object.
* @param {DOM element} parentNode DOM element representing the parent node, which wraps the Layout Manager content * @param {DOM element} parentNode DOM element representing the parent node, which wraps the Layout Manager content
* @param {Array} studies Array of studies objects that will be rendered in the Viewer. Each object will be rendered in a div.imageViewerViewport * @param {Array} studies Array of studies objects that will be rendered in the Viewer. Each object will be rendered in a div.imageViewerViewport
*/ */
constructor(parentNode, studies) { constructor(parentNode, studies) {
OHIF.log.info('LayoutManager constructor'); OHIF.log.info('LayoutManager constructor');
@ -80,9 +80,7 @@ export class LayoutManager {
// Get all the display sets for the viewer studies // Get all the display sets for the viewer studies
let displaySets = []; let displaySets = [];
this.studies.forEach(study => { this.studies.forEach(study => {
study.displaySets.forEach(displaySet => { study.displaySets.forEach(dSet => dSet.images.length && displaySets.push(dSet));
displaySet.images.length && displaySets.push(displaySet);
});
}); });
// Get the display sets that will be appended to the current ones // Get the display sets that will be appended to the current ones
@ -143,7 +141,7 @@ export class LayoutManager {
*/ */
updateLayoutClass() { updateLayoutClass() {
const newLayoutClass = this.getLayoutClass(); const newLayoutClass = this.getLayoutClass();
// If layout has changed, change its class // If layout has changed, change its class
if (this.layoutClassName !== newLayoutClass) { if (this.layoutClassName !== newLayoutClass) {
this.parentNode.classList.remove(this.layoutClassName); this.parentNode.classList.remove(this.layoutClassName);
@ -155,9 +153,9 @@ export class LayoutManager {
} }
/** /**
* Updates the grid with the new layout props. * Updates the grid with the new layout props.
* It iterates over all viewportData to render the studies * It iterates over all viewportData to render the studies
* in the viewports. * in the viewports.
* If no viewportData or no viewports defined, it renders the default viewport data. * If no viewportData or no viewports defined, it renders the default viewport data.
*/ */
updateViewports() { updateViewports() {
@ -176,7 +174,7 @@ export class LayoutManager {
viewportData: [] viewportData: []
}, layoutProps); }, layoutProps);
this.viewportData.forEach( viewportData => { this.viewportData.forEach(viewportData => {
const viewportDataAndLayoutProps = $.extend(viewportData, layoutProps); const viewportDataAndLayoutProps = $.extend(viewportData, layoutProps);
data.viewportData.push(viewportDataAndLayoutProps); data.viewportData.push(viewportDataAndLayoutProps);
}); });
@ -266,7 +264,7 @@ export class LayoutManager {
columns: 1 columns: 1
}; };
const layoutTemplate = Template['gridLayout']; const layoutTemplate = Template.gridLayout;
$(this.parentNode).html(''); $(this.parentNode).html('');
Blaze.renderWithData(layoutTemplate, data, this.parentNode); Blaze.renderWithData(layoutTemplate, data, this.parentNode);
@ -279,7 +277,7 @@ export class LayoutManager {
} }
/** /**
* Resets to the previous layout configuration. * Resets to the previous layout configuration.
* Useful after enlarging a single viewport. * Useful after enlarging a single viewport.
*/ */
resetPreviousLayout() { resetPreviousLayout() {
@ -305,8 +303,7 @@ export class LayoutManager {
if (this.isZoomed) { if (this.isZoomed) {
this.resetPreviousLayout(); this.resetPreviousLayout();
} } else {
else {
// Don't enlarge the viewport if we only have one Viewport // Don't enlarge the viewport if we only have one Viewport
// to begin with // to begin with
if (this.getNumberOfViewports() > 1) { if (this.getNumberOfViewports() > 1) {
@ -416,7 +413,7 @@ export class LayoutManager {
// Get the setting that defines if the display set navigation is multiple // Get the setting that defines if the display set navigation is multiple
const isMultiple = OHIF.uiSettings.displaySetNavigationMultipleViewports; const isMultiple = OHIF.uiSettings.displaySetNavigationMultipleViewports;
// Get the setting that allow display set navigation looping over series // Get the setting that allow display set navigation looping over series
const allowLooping = OHIF.uiSettings.displaySetNavigationLoopOverSeries; const allowLooping = OHIF.uiSettings.displaySetNavigationLoopOverSeries;
@ -446,7 +443,7 @@ export class LayoutManager {
const amount = study.displaySets.length; const amount = study.displaySets.length;
const move = !isMultiple ? 1 : ((amount % layoutViewports) || layoutViewports); const move = !isMultiple ? 1 : ((amount % layoutViewports) || layoutViewports);
const lastStepIndex = amount - move; const lastStepIndex = amount - move;
// 9999 for index means empty viewport, see getDisplaySetSequenceMap function // 9999 for index means empty viewport, see getDisplaySetSequenceMap function
if (viewportIndex !== 9999 && viewportIndex !== lastStepIndex) { if (viewportIndex !== 9999 && viewportIndex !== lastStepIndex) {
endReached = false; endReached = false;
@ -464,7 +461,7 @@ export class LayoutManager {
// Check if the begin was reached // Check if the begin was reached
let beginReached = true; let beginReached = true;
if(activeViewportIndex >= 0) { if (activeViewportIndex >= 0) {
sequenceMap.forEach((studyViewports, study) => { sequenceMap.forEach((studyViewports, study) => {
// Get active viewport index if isMultiple is false ortherwise get first // Get active viewport index if isMultiple is false ortherwise get first
const studyViewport = studyViewports[activeViewportIndex !== null ? activeViewportIndex : 0]; const studyViewport = studyViewports[activeViewportIndex !== null ? activeViewportIndex : 0];
@ -650,7 +647,7 @@ export class LayoutManager {
*/ */
moveDisplaySets(isNext) { moveDisplaySets(isNext) {
OHIF.log.info('LayoutManager moveDisplaySets'); OHIF.log.info('LayoutManager moveDisplaySets');
//Check if navigation is on a single or multiple viewports //Check if navigation is on a single or multiple viewports
if (OHIF.uiSettings.displaySetNavigationMultipleViewports) { if (OHIF.uiSettings.displaySetNavigationMultipleViewports) {
// Move display sets on multiple viewports // Move display sets on multiple viewports
@ -682,4 +679,4 @@ export class LayoutManager {
return this.layoutProps.row !== 1 && this.layoutProps.columns !== 1; return this.layoutProps.row !== 1 && this.layoutProps.columns !== 1;
} }
}; }