Repository navigation
fix(anonymizer): correct the 103 non-resolving names in tagNamesToEmpty - #590
Merged
Merged
Conversation
The default tagNamesToEmpty list carried 103 entries that matched no dictionary keyword (misspellings, singular/plural mistakes, and ad-hoc abbreviations like RefStudySeq), so cleanTags silently skipped the attributes they were meant to scrub and the PHI survived anonymization (issue #345). Port the corrected list from the rewrite line: every entry now maps 1:1 to its real dictionary keyword, with retired attributes using the dictionary's RETIRED_ prefix. The most visible newcomers are the six diagnostic sequences named in docs/BREAKING_CHANGES.md (ContentSequence, SourceImageSequence, ReferencedImageSequence, AcquisitionContextSequence, RequestAttributesSequence, IconImageSequence), which PS3.15 Table E.1-1 assigns removal actions to. Unskips the KNOWN GAP #345 structural pin (every name resolves via DicomMetaDictionary.nameMap), adds a behavioral test that a previously-skipped ContentSequence is actually emptied, flips the catalog entry to green, and updates the pre-landed BREAKING_CHANGES entry's status note. Closes review finding 2 of the PR #512 review map. Co-Authored-By: Claude Fable 5 <[email protected]>
This was referenced Oct 3, 2026
Merged
|
🎉 This PR is included in version 1.0.0-beta.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This closes the last code item of review finding 2 (
anonymizer.js,cleanTags) from the PR #512 review map — the documentation half pre-landed in #562, and this PR delivers the list it promised.What was wrong: the anonymizer's default
tagNamesToEmptylist carried 103 entries that match no dictionary keyword — singular/plural mistakes likePhysicianOfRecordandOperatorName, plus ad-hoc abbreviations likeRefStudySeqandSPSStartDate.cleanTagsresolves each name throughDicomMetaDictionary.nameMapand silently skips anything that doesn't resolve, so nearly half the list did nothing and the data those entries were meant to scrub stayed in the file. That's issue #345.The fix ports the corrected list from the rewrite line: all 103 non-resolving entries mapped 1:1 to their real dictionary keywords, with retired attributes using the dictionary's
RETIRED_prefix. Nothing else in the file changed —getTagsNameToEmpty()already returned a copy on this branch, andcleanTagsitself is untouched. I verified the port is confined to the list and its header comment by diffing everything below the list againstv2.0-development(identical).Why the new behavior is right: PS3.15 Table E.1-1 (the Basic Application Level Confidentiality Profile) assigns removal actions to these attributes. The most consequential newcomers are six sequences that can carry diagnostic content —
ContentSequence(0040,A730),SourceImageSequence(0008,2112),ReferencedImageSequence(0008,1140),AcquisitionContextSequence(0040,0555),RequestAttributesSequence(0040,0275),IconImageSequence(0088,0200). Leaving them untouched, which is what the misspelled list silently did, is the behavior that departs from the profile. The review map's verdict on finding 2 is that this widening is an improvement to keep, not a regression to revert.If you depended on the old behavior: the opt-out already exists as a parameter —
getTagsNameToEmpty()returns a copy, filter out the names you want to keep, and pass the result as the third argument tocleanTags. The recipe is written out indocs/BREAKING_CHANGES.mdunder "Fix anonymizer keywords", whose "not yet landed" status note this PR replaces with the landed reality.Red-green story:
test/issues/issue345-anonymizer-names.test.jscarried the structural pin as anit.skipKNOWN GAP. I unskipped it and added a behavioral test (aContentSequenceholding SR text must come out ofcleanTagsempty); both failed against the old list — the pin's diff listed all 103 non-resolving names, and the ContentSequence survived untouched. Both pass with the corrected list. The 0.x suitetest/anonymizer.test.jspasses unchanged — none of its assertions depended on the broken entries, so no deliberate adjustments were needed. Catalog entry #345 flips gap → green. Full suite: 846 passed / 11 skipped / 857 total (baseline 844/12/856 — one unskip, one new test),pnpm run buildgreen.Master note, for honesty's sake: the same broken list exists on master today, so a hotfix there is a legitimate candidate — but master hotfixes are currently deferred by the repo owner, so this PR targets the release branch only.
🤖 Generated with Claude Code