fix(hp): Display set should allow remembered updates (#4707)

This commit is contained in:
Bill Wallace 2025-01-20 09:06:28 -05:00 committed by GitHub
parent 544dc543d9
commit 464148ece6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 18 additions and 8 deletions

View File

@ -32,6 +32,7 @@ export const hpMN: Types.HangingProtocol.Protocol = {
toolGroupIds: ['default'], toolGroupIds: ['default'],
displaySetSelectors: { displaySetSelectors: {
defaultDisplaySetId: { defaultDisplaySetId: {
allowUnmatchedView: true,
seriesMatchingRules: seriesWithImages, seriesMatchingRules: seriesWithImages,
}, },
}, },
@ -39,7 +40,6 @@ export const hpMN: Types.HangingProtocol.Protocol = {
viewportOptions: { viewportOptions: {
viewportType: 'stack', viewportType: 'stack',
toolGroupId: 'default', toolGroupId: 'default',
allowUnmatchedView: true,
syncGroups: [HYDRATE_SEG_SYNC_GROUP], syncGroups: [HYDRATE_SEG_SYNC_GROUP],
}, },
displaySets: [ displaySets: [

View File

@ -680,7 +680,7 @@ export default class HangingProtocolService extends PubSubService {
} }
// If the viewport options says to allow any instance, then we can assume // 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) { if (protocolViewport.viewportOptions.allowUnmatchedView) {
return defaultReturn; return defaultReturn;
} }
@ -692,7 +692,8 @@ export default class HangingProtocolService extends PubSubService {
protocolViewport.displaySets[0]; protocolViewport.displaySets[0];
const displaySetSelector = protocol.displaySetSelectors[displaySetSelectorId]; const displaySetSelector = protocol.displaySetSelectors[displaySetSelectorId];
if (!displaySetSelector) { // The display set can allow any view
if (!displaySetSelector || displaySetSelector.allowUnmatchedView) {
return defaultReturn; return defaultReturn;
} }
@ -1352,9 +1353,7 @@ export default class HangingProtocolService extends PubSubService {
// Use the display set provided instead // Use the display set provided instead
if (reuseDisplaySetUID) { if (reuseDisplaySetUID) {
if (viewportOptions.allowUnmatchedView !== true) { // This display set should have already been validated
this.validateDisplaySetSelectMatch(viewportDisplaySet, id, reuseDisplaySetUID);
}
const displaySetInfo: HangingProtocol.DisplaySetInfo = { const displaySetInfo: HangingProtocol.DisplaySetInfo = {
displaySetInstanceUID: reuseDisplaySetUID, displaySetInstanceUID: reuseDisplaySetUID,
displaySetOptions, displaySetOptions,

View File

@ -134,6 +134,14 @@ export type ViewportStructure = {
*/ */
export type DisplaySetSelector = { export type DisplaySetSelector = {
id?: string; 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 // The image matching rule (not currently implemented) selects which image to
// display initially, only for stack views. // display initially, only for stack views.
imageMatchingRules?: MatchingRule[]; imageMatchingRules?: MatchingRule[];
@ -179,8 +187,11 @@ export type ViewportOptions = {
initialImageOptions?: CustomOption<initialImageOptions>; initialImageOptions?: CustomOption<initialImageOptions>;
syncGroups?: CustomOption<SyncGroup>[]; syncGroups?: CustomOption<SyncGroup>[];
customViewportProps?: Record<string, unknown>; customViewportProps?: Record<string, unknown>;
// 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; allowUnmatchedView?: boolean;
}; };