-
-
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
Bug Fixes and Unit Tests for BLANK & REPLACE Actions & Sequences #242
Conversation
1. Expanded BLANK Action to other VRs. 2. Added unit tests for validating action interaction. 3. Added table of action interactions to help docs.
The testing is failing due to the changes that were merged into deid-data. The CI testing is still using the old image. |
Old image == old release? |
@wetzelj if you can do a PR to bump the version / changelog over there, I can make a new release! |
Yeah... sorry about that. I just realized I didn't bump the version of deid-data. Will do it now. |
Correcting bad test method names.
okay sorry for delay - went into meetings and just coming out! I just merged/released deid-data and did a re-run of the test. |
Reverted expand_field_expression to always return desired as a Tag. Instead convert to DataElement in blank_field.
Updating BLANK test coverage to all VRs.
Updating unit tests failing due to field count changes in test image.
Restructured blank_action unit tests.
Woot! passing now, and these tests are fantastic! @wetzelj when you are ready for merge, it shall be so. |
Thanks! I'm working on a fix for #244 as well that I'd like to get included in this PR (along with some new tests for REPLACE which mirror what I did for BLANK). |
@wetzelj you're amazing!! |
@vsoch - I think I'm set on what I'd like to get in this PR, but am interested in your feedback if there's anything that you'd like done differently. |
Removing deid-data pin.
Co-authored-by: Vanessasaurus <814322+vsoch@users.noreply.github.com>
Committing review suggestions.
Adding #243 to this PR as well. Please hold off merging. New commits will arrive tomorrow. |
Corrected issue pydicom#243 which prevented tags within sequences from being acted upon. Added unit tests for sequence processing.
Updated test_replace_identifiers to target ctbrain1.dcm by name.
Updated test_user_provided_func to target ctbrain1.dcm
@@ -160,8 +160,9 @@ def get_nested_field(self, field, return_parent=False): | |||
# Otherwise it's an index into a sequence | |||
else: | |||
|
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.
Here's an explanation of the change below:
If we fall into the else, the uid is a sequence. We don't want to check for it's presence in a dictionary, but instead want to check to ensure that the uid (index) is within the bounds of the array of items in the SQ DataElements value which is a Sequence - an iterable. If the index is outside the bounds we return None as the parent. If the index is within the bounds of the array, we want to return the DataElement at that index (the specific occurrence of the
sequence element) for update.
@@ -118,16 +118,12 @@ def test_replace_with_constant(self): | |||
] | |||
recipe = create_recipe(actions) | |||
|
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.
Explanation of the change below:
After implementing the change for sequence processing, this unit test was failing with an index out of bounds exception. This exception was occurring because the DicomParser object was applying the stock deid.dicom recipe which was causing the Accession Number field to be removed. I did not dig into why the sequence change affected this unittest in this manner, but since it was only impacting the check for getting the "before" values and all other unit tests passed, I didn't feel that it warranted further investigation. Instead I just updated this to red the file and directly retrieve the "before" values
@vsoch - This wraps up what I'm intending (plus a little more) for this PR. Once you're good with the inclusions, please go ahead with the merge at your convenience. |
Woohoo! Well done. https://pypi.org/project/deid/0.3.2/ |
Thank you! Speedy merge as always! :) |
I just happen to be up since 6am debugging registry authentication for another OSS project - trying to squeeze in before the workday. Hashtag, maintainer life! 😆 |
Description
Related issues:
Checklist
Open questions