pydicom / deid

best effort anonymization for medical images using python
https://pydicom.github.io/deid/
MIT License
141 stars 43 forks source link

notContains not expecting a field? #98

Closed fimafurman closed 5 years ago

fimafurman commented 5 years ago

I had to use 'notContains' clause in deid rules and expected it to work just like contains clause with the opposite effect, however, I found that the parser does not actually expect the value to be present. It looks like a bug, as notcontains should expect a field value:

In utils.py:

# Missing, empty, notcontains expect only a field elif action in ['missing', 'empty','notcontains', 'present']: field = member.strip()

fimafurman commented 5 years ago

Yes, I verified that moving ''notcontains' to the field expecting condition fixes this issue:

if action in ['contains','equals','notequals','notcontains']:

vsoch commented 5 years ago

Thanks @fimafurman I'll get this fixed up soon.