From 464148ece66b48b583dc6e998ca4d11c66746f3a Mon Sep 17 00:00:00 2001 From: Bill Wallace Date: Mon, 20 Jan 2025 09:06:28 -0500 Subject: [PATCH] fix(hp): Display set should allow remembered updates (#4707) --- .../default/src/hangingprotocols/hpMNGrid.ts | 2 +- .../HangingProtocolService.ts | 9 ++++----- platform/core/src/types/HangingProtocol.ts | 15 +++++++++++++-- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/extensions/default/src/hangingprotocols/hpMNGrid.ts b/extensions/default/src/hangingprotocols/hpMNGrid.ts index 5792d4203..29fc17401 100644 --- a/extensions/default/src/hangingprotocols/hpMNGrid.ts +++ b/extensions/default/src/hangingprotocols/hpMNGrid.ts @@ -32,6 +32,7 @@ export const hpMN: Types.HangingProtocol.Protocol = { toolGroupIds: ['default'], displaySetSelectors: { defaultDisplaySetId: { + allowUnmatchedView: true, seriesMatchingRules: seriesWithImages, }, }, @@ -39,7 +40,6 @@ export const hpMN: Types.HangingProtocol.Protocol = { viewportOptions: { viewportType: 'stack', toolGroupId: 'default', - allowUnmatchedView: true, syncGroups: [HYDRATE_SEG_SYNC_GROUP], }, displaySets: [ diff --git a/platform/core/src/services/HangingProtocolService/HangingProtocolService.ts b/platform/core/src/services/HangingProtocolService/HangingProtocolService.ts index 558426d32..d5f60dd4b 100644 --- a/platform/core/src/services/HangingProtocolService/HangingProtocolService.ts +++ b/platform/core/src/services/HangingProtocolService/HangingProtocolService.ts @@ -680,7 +680,7 @@ export default class HangingProtocolService extends PubSubService { } // If the viewport options says to allow any instance, then we can assume - // it just updates this viewport + // it just updates this viewport. This is deprecated and will be removed if (protocolViewport.viewportOptions.allowUnmatchedView) { return defaultReturn; } @@ -692,7 +692,8 @@ export default class HangingProtocolService extends PubSubService { protocolViewport.displaySets[0]; const displaySetSelector = protocol.displaySetSelectors[displaySetSelectorId]; - if (!displaySetSelector) { + // The display set can allow any view + if (!displaySetSelector || displaySetSelector.allowUnmatchedView) { return defaultReturn; } @@ -1352,9 +1353,7 @@ export default class HangingProtocolService extends PubSubService { // Use the display set provided instead if (reuseDisplaySetUID) { - if (viewportOptions.allowUnmatchedView !== true) { - this.validateDisplaySetSelectMatch(viewportDisplaySet, id, reuseDisplaySetUID); - } + // This display set should have already been validated const displaySetInfo: HangingProtocol.DisplaySetInfo = { displaySetInstanceUID: reuseDisplaySetUID, displaySetOptions, diff --git a/platform/core/src/types/HangingProtocol.ts b/platform/core/src/types/HangingProtocol.ts index 1e6e2e4ba..eeb91424b 100644 --- a/platform/core/src/types/HangingProtocol.ts +++ b/platform/core/src/types/HangingProtocol.ts @@ -134,6 +134,14 @@ export type ViewportStructure = { */ export type DisplaySetSelector = { id?: string; + + /** + * This can be set to true to allow unmatched views to replace a view showing this instance + * This is done at hte display set selector level to ensure that viewports sharing a display set + * don't get different values of allowUnmatchedView + */ + allowUnmatchedView?: boolean; + // The image matching rule (not currently implemented) selects which image to // display initially, only for stack views. imageMatchingRules?: MatchingRule[]; @@ -179,8 +187,11 @@ export type ViewportOptions = { initialImageOptions?: CustomOption; syncGroups?: CustomOption[]; customViewportProps?: Record; - // Set to true to allow non-matching drag and drop or options provided - // from options.displaySetSelectorsMap + /** + * Set to true to allow non-matching drag and drop or options provided + * from options.displaySetSelectorsMap + * @deprecated Moving to display set selector + */ allowUnmatchedView?: boolean; };