Viewers icon indicating copy to clipboard operation
Viewers copied to clipboard

[Bug] getHangingProtocolModule Name or Id ?

Open salimkanoun opened this issue 1 year ago • 2 comments

Describe the Bug

It seems to be a discordance between documentation and code

in the documentation : https://docs.ohif.org/platform/services/data/hangingprotocolservice/#protocol-definition Hanging protocol should be registered by Id

But in the code they are registered by name property : https://github.com/OHIF/Viewers/blob/c73a403cdcbc687981308d03462d2d2d10f73df5/extensions/default/src/getHangingProtocolModule.js#L101

Also the url param to set a HP is hangingProtocolId so I guess there is a error in the code (should use id instead of name, and will led to breaking change)

Steps to Reproduce

None

The current behavior

registering of HP use name

The expected behavior

should use id property

OS

linux

Node version

20

Browser

Chrome 100+

salimkanoun avatar Oct 31 '23 00:10 salimkanoun

I think id makes more sense, you are saying URL is based on name?

sedghi avatar May 04 '24 16:05 sedghi

The weird thing is that getHangingProtocolModule is mapping the id of the hanging protocol to a "name" property

The HP object has itself a "name" and an "id" property, so I guess getHangingProtocolModule could simply return array of protocols. If needed to add a differentiating key then I guess it would be better to expose "id" instead of "name" in this getHangingProtocolModule

salimkanoun avatar May 04 '24 22:05 salimkanoun