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

Exception when JITTER performed on empty field #189

Closed
wetzelj opened this issue Sep 21, 2021 · 1 comment
Closed

Exception when JITTER performed on empty field #189

wetzelj opened this issue Sep 21, 2021 · 1 comment

Comments

@wetzelj
Copy link
Contributor

wetzelj commented Sep 21, 2021

When a JITTER rule is performed on a header field which contains an empty string rather than a DICOM formatted date/timestamp value, an exception occurs, stopping the deidentification of the header.

Cause:

  • On parser.py line 467, jitter_timestamp() is called to obtain the new value for the timestamp field. This function then calls get_timestamp(), which actually calculates the new value. In get_timestamp(), if the value is "" or None, the new value returned is None.
  • Subsequently, on parser.py line 468, replace_field() is called with the new "None" value. Within replace_field, we eventually get to the parse_field() method. Parse field attempts to perform a regex search (to look for potential expanders) on the None value, causing the exception.

Proposed Fix:

  • For JITTER actions, check the new value returned for the field. Only call replace_field if the value is not None. (pull request coming shortly)
@vsoch
Copy link
Member

vsoch commented Sep 21, 2021

Sounds good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants