fix(StaticWadoClient): make study filters case-insensitive#6037
Open
bobu-putheeckal wants to merge 1 commit into
Open
fix(StaticWadoClient): make study filters case-insensitive#6037bobu-putheeckal wants to merge 1 commit into
bobu-putheeckal wants to merge 1 commit into
Conversation
❌ Deploy Preview for ohif-dev failed. Why did it fail? →
|
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.
Context
Fixes #6029.
The issue reports that WorkList filtering works when MRN, Study Description, and Accession Number are typed with uppercase input, but does not return the expected studies when the same values are typed lowercase.
For static WADO searches, these fields flow through
StaticWadoClient.compareValues. Patient-name fuzzy matching already normalizes casing, but the non-fuzzy wildcard/exact string path was using case-sensitiveindexOfand equality checks.Reproduction proof before the fix:
origin/masterin a temporary worktree and added only the regression test from this PR.../Viewers/node_modules/.bin/jest --config extensions/default/jest.config.js extensions/default/src/DicomWebDataSource/utils/StaticWadoClient.test.ts --runInBandorigin/master: 3 failures.compareValues('*brain*', 'BRAIN WO CONTRAST', {})returnedfalse.compareValues('mrn123', 'MRN123', {})returnedfalse.filterItemfor lowercase MRN wildcard matching returnedundefined.Changes & Results
StaticWadoClient.compareValues.filterItemregression covering the study fields from the issue: MRN, Study Description, and Accession Number.After the fix, lowercase filters match uppercase stored values for static WADO study filtering while preserving existing date/range and non-string comparison behavior.
Testing
Ran the focused unit test:
Result:
Also checked formatting and diff whitespace:
Checklist
PR
Code
Public Documentation Updates
Tested Environment
Greptile Summary
This PR fixes case-sensitive string matching in
StaticWadoClient.compareValuesso that WorkList filters for MRN, Study Description, and Accession Number correctly match stored values regardless of input casing.actualanddesiredstring values are now lowercased before wildcard (*word*,word*,*word) and exact comparisons; the fuzzy-matching branch was already case-insensitive and is unchanged.typeof actual === 'string'totypeof actual === 'string' && typeof desired === 'string', which also fixes a subtle edge case where a non-stringdesiredwould previously enter the string-handling block.compareValuesunit tests for all three wildcard forms plus exact matching, and a higher-levelfilterItemintegration test covering the three affected DICOM fields.Confidence Score: 5/5
Safe to merge — the change is narrowly scoped to the non-fuzzy string comparison path and does not affect date/range, numeric, or fuzzy-matching logic.
The normalization is applied consistently across all three wildcard forms and the exact-match fallback. The tightened type guard improves correctness for non-string desired values. Regression tests cover every changed branch and the three real-world DICOM fields from the bug report. No existing behaviour outside the broken case-sensitive path is altered.
No files require special attention.
Important Files Changed
Reviews (1): Last reviewed commit: "Fix static WADO case-insensitive study f..." | Re-trigger Greptile