ImagingDataCommons / highdicom

High-level DICOM abstractions for the Python programming language
https://highdicom.readthedocs.io
MIT License
164 stars 34 forks source link

Coded Concept with Long Code Value #225

Closed wryan-itk closed 1 year ago

wryan-itk commented 1 year ago

The CodedConcept __init() assigns the value to a LongCodeValue tag if it is >16 characters, and the value() method also supports retrieving the value from either CodeValue, LongCodeValue, or URNCodeValue. But the from_dataset() classmethod raises an attribute error if the passed in dataset does not have the CodeValue tag.
coding.py line 129

Is there a way to handle LongCodeNames in this method? The exception doesn't occur when we create the actual CodedConcept, but it does when the concept is embedded in the dataset passed into hd.sr.EnhancedSR() which calls the from_dataset() method.

CPBridge commented 1 year ago

Hi @wryan-itk thanks for reporting this. It's just a simple oversight, we should allow code values in any one of these attributes. I'll do a fix in the next few days

CPBridge commented 1 year ago

@wryan-itk the fix was released in v0.21.1