deid
deid copied to clipboard
Function return types need handling
As discussed in https://github.com/pydicom/deid/pull/113#pullrequestreview-370586965, currently it's possible to provide a function that returns the wrong return type for a variable. This will trigger an error, and likely it should be better handled. Here are some examples from @wetzelj:
- PatientID is defined as DICOM datatype LO (Long String) - custom function returns an integer
- CTDIvol is defined as DICOM datatype FD (Floating Point Double) - custom function returns string
We'd want to better check / handle this, along with adding tests for it.
I think we would still need to add this check (quick glance I don't see it).