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

filter.py - Allow tags to be specified using a string containing a 0x-prefix hex number #254

Merged
merged 4 commits into from
May 10, 2023

Conversation

howff
Copy link
Contributor

@howff howff commented May 3, 2023

Description

Allow tags to be specified using a string containing a 0x-prefix hex number

Related issues: #253

Converts a field name which is a string in the form '0xGGGGEEEE' (GroupElement) into a number so that it can be found in the dataset dict. This allows recipe rules to specify tags numerically. One use for this is to filter on private tags.

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • My code follows the style guidelines of this project

Open questions

Questions that require more discussion or to be addressed in future development:

Need to consider the implications of #205 (Finding relocated private elements using "PrivateCreator")

@howff
Copy link
Contributor Author

howff commented May 3, 2023

I've also updated the documentation, CHANGELOG, and added a new test (with associated recipe file).

Copy link
Member

@vsoch vsoch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great start! We will want to bump the version. Also ping @wetzelj to discuss the tests he thinks would be good to add.

CHANGELOG.md Outdated Show resolved Hide resolved
@howff howff requested a review from vsoch May 3, 2023 16:33
@vsoch
Copy link
Member

vsoch commented May 3, 2023

This overall looks great - the formatting is failing because you likely don't have black==23.3.0 locally. My one question is if we want a test or two more? From @wetzelj:

Just glancing at the code, I'm wondering if converting the field to an int will be enough. Does this correctly retrieve the private tag field in all situations? This change would be a great opportunity to add some private tag unit tests to test_filter_detect.py. These tests were initially added focusing on the interplay between two conditions within a rule (#142), but it would be beneficial to add more atomic tests for private/public tags and each of the filter types.

Specifically this part:

it would be beneficial to add more atomic tests for private/public tags and each of the filter types.

@wetzelj do you think more tests are warranted here, or was this scoped to another follow up PR?

@howff
Copy link
Contributor Author

howff commented May 3, 2023

I've added a test specifically for the new feature, so I guess if you want different tests then maybe they could be in a different issue/pr?

@wetzelj
Copy link
Contributor

wetzelj commented May 3, 2023

I haven't had a chance to look at this today and don't expect to be able to circle back to it until Friday, but I would also contend that it's important to test that this new feature didn't unintentionally break existing expected functionality.

@wetzelj
Copy link
Contributor

wetzelj commented May 4, 2023

This should be okay. Given that the other tests check the string method, they're already validating existing functionality. Thanks for your work @howff!

Copy link
Member

@vsoch vsoch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @howff !

Signed-off-by: vsoch <[email protected]>
@wetzelj
Copy link
Contributor

wetzelj commented May 10, 2023

@vsoch, @howff - Can this be merged and completed?

@vsoch
Copy link
Member

vsoch commented May 10, 2023

This was my bad! I was probably waiting for tests to finish and my browser crashed and I forgot to check again. Thanks for the reminder @wetzelj and apologies @howff!

@vsoch vsoch merged commit f714359 into pydicom:master May 10, 2023
@vsoch
Copy link
Member

vsoch commented May 10, 2023

Thank you! https://pypi.org/project/deid/0.3.22/

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

Successfully merging this pull request may close these issues.

3 participants