-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Fix to handle date fields with empty values #190
Conversation
Added check to prevent exception when JITTER action is performed on a field with a blank value.
deid/dicom/parser.py
Outdated
@@ -465,7 +465,8 @@ def _run_action(self, field, action, value=None): | |||
if value is not None: | |||
# Jitter the field by the supplied value | |||
new_val = jitter_timestamp(field=field, value=value) | |||
self.replace_field(field, new_val) | |||
if new_val is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this would be okay as an empty string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(or actually is it not possible to return that?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_timestamp() currently only returns None or a formatted timestamp, but, I'll look for both just in case. Doesn't hurt to be extra careful.
Checking new value for space in addition to none
Thank you @wetzelj ! |
Thank you @vsoch! You're always so speedy getting these things merged in... I really appreciate it! |
Oh don’t worry I updated it locally and just need to push the change! |
Added check to prevent exception when JITTER action is performed on a field with a blank value.
Description
Related issues: #189
Checklist
Open questions
Questions that require more discussion or to be addressed in future development: