Skip to content

AttributError in fields.py for Function #298

@Barneby77

Description

@Barneby77

Hi Deid - Team!

When updating from deid 0.4.6 to 0.4.7 I get this error in the log:

 python3.11/site-packages/deid/dicom/fields.py", line 376, in _get_field_lookup_keys case_insensitive_field = field.lower()
AttributeError : 
'function' object has no attribute 'lower'

For debugging I added the line with the prints to the code of _get_field_lookup_keys:

    def _get_field_lookup_keys(self, field):
        if not isinstance(field, DicomField):
            print(field, type(field))
            case_insensitive_field = field.lower()

With the next run I get this right before the traceback:

<function shiftDate at 0x7f1ed292bb00>
<class 'function'>

shiftDate is a function that I created and use in the recipe as follows:

REPLACE StudyDate func:shiftDate

Are functions no longer supported?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions