Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LongCodeValue can cause a failure in search_tree #309

Closed
rhaxton opened this issue Oct 3, 2024 · 2 comments
Closed

LongCodeValue can cause a failure in search_tree #309

rhaxton opened this issue Oct 3, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@rhaxton
Copy link
Contributor

rhaxton commented Oct 3, 2024

In highdicom.sr.utils.py find_content_items()::search_tree() near line:

value=name_code.CodeValue,

fetching name_code.CodeValue can fail if the ContentSequence uses either LongCodeValue or URNCodeValue instead of CodeValue.

https://dicom.innolitics.com/ciods/comprehensive-sr/sr-document-content/0040a730/0040a168/00080100

Something like:

if hasattr(name_code, 'CodeValue'):
    code_value = name_code.CodeValue
elif hasattr(name_code, 'LongCodeValue'):
    code_value = name_code.LongCodeValue
else:
    code_value = name_code.URNCodeValue

might be needed here?

@CPBridge CPBridge self-assigned this Oct 3, 2024
@CPBridge CPBridge added the bug Something isn't working label Oct 3, 2024
@CPBridge
Copy link
Collaborator

CPBridge commented Oct 3, 2024

Hi @rhaxton, thanks for reporting the issue. Your suggestion makes sense to me, though I haven't thoroughly thought through whether it might have any other unintended consequences.

Would you be interested in submitting a pull request with your change, and adding a test for this case?

CPBridge added a commit that referenced this issue Oct 9, 2024
@CPBridge
Copy link
Collaborator

Resolved by #310

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants