Skip to content

test: pin anonymizer names, UID rewrites, prototype safety, and small value behaviors - #529

Merged
awatson1978 merged 1 commit into
release/1.0-beta-corefrom
core/bank-misc
Sep 29, 2026
Merged

awatson1978 merged 1 commit into
release/1.0-beta-corefrom
core/bank-misc

Conversation

@awatson1978

@awatson1978 awatson1978 commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

This closes out the regression bank: the last set of suites pinning behavior that already passes on this branch, with anything still broken checked in as an it.skip naming its issue. With this merged, the bank covers every issue-derived test that passes against the current branch. The fourteen suites that exercise the event stream arrive with the engine code itself, and two suites pinning fixed logging behavior (#368 and #457) travel with those fixes.

Six behavior areas across seven files.

test/issues/issue345-anonymizer-names.test.js — the anonymizer. For #172 it pins the public surface: cleanTags and getTagsNameToEmpty are exported, and cleanTags replaces PatientName/PatientID and empties the rest of its list. #345 is the sharp edge: many entries in that to-empty list aren't real dictionary keywords (singular/plural slips, ad-hoc abbreviations like "RefStudySeq"), so the anonymizer silently skips them and the data they were meant to scrub survives. 103 of the 221 names fail to resolve — that's the skipped KNOWN GAP #345. A green sanity test pins that the five corrected keywords the issue proposes do exist, so fixing the list needs no dictionary changes:

const correct = [
    "ReferringPhysicianTelephoneNumbers",
    "PhysiciansOfRecord",
    "NameOfPhysiciansReadingStudy",
    "OperatorsName",
    "AdmittingDiagnosesDescription"
];
const unresolved = correct.filter(name => !DicomMetaDictionary.nameMap[name]);
expect(unresolved).toEqual([]);

test/issues/issue315-uid-rewrite.test.js — #315: changing an instance UID and rewriting must yield a valid file (upstream, the re-read threw "Invalid DICOM file, expected header is missing"). Both flows are pinned green: the issue's own repro flow with a new StudyInstanceUID, and the documented datasetToDict pattern where a new SOPInstanceUID must land in both the dataset and the file meta.

test/issues/issue10-prototype-pollution.test.js — #10: with an enumerable property added to Object.prototype (the old meteor-based OHIF environment), the full naturalize → denaturalize → write → re-read cycle must succeed with no "__polluted" key materializing anywhere in the output trees. Green.

test/issues/issue356-private-creator-range.test.js — #356: Tag.isPrivateCreator should accept elements 0x0010–0x00FF of odd groups and nothing else; that's where private creator elements (the labels that reserve a private block) live per the standard. The valid range and the obvious rejections are green; the current check also admits the reserved 0x0001–0x000F range, which is the skipped KNOWN GAP #356.

test/issues/issue46-lt-single-valued.test.js — #46: LT (Long Text) is a single-valued VR, so a backslash inside it is ordinary text, not a value separator. Round trips with backslash-bearing history text and Windows paths stay one value. Green, no skips.

test/issues/issue505-unit2codingvalue.test.js — #505: the TID300 unit2CodingValue mapping table. "mm", "cm2", and "HU" map to their proper UCUM codes (green); plain "cm" is missing from the table and falls through to the arbitrary-unit branch as [arb'U]{cm}, which is the skipped KNOWN GAP #505.

test/issues/issue78-unobtainable-fixtures.test.js is different: its skips are BLOCKED placeholders, not known gaps. They spell out exactly what will be asserted for #78 (RLE SEG read failures) and #86 (palette color LUT read failures) the day a usable fixture lands — both upstream fixture links are dead. A third placeholder covers #363, whose attachment does reproduce but carries real patient identity and failed PHI vetting, so it was deleted rather than cached (#347 is likewise fixture-dead).

🤖 Generated with Claude Code

… value-handling behaviors

Co-Authored-By: Claude Fable 5 <[email protected]>
@awatson1978
awatson1978 merged commit 14f0d95 into release/1.0-beta-core Sep 29, 2026
8 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.0.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant