Skip to content

fix(StaticWadoClient): make study filters case-insensitive#6037

Open
bobu-putheeckal wants to merge 1 commit into
OHIF:masterfrom
bobu-putheeckal:fix-static-wado-case-insensitive-filters
Open

fix(StaticWadoClient): make study filters case-insensitive#6037
bobu-putheeckal wants to merge 1 commit into
OHIF:masterfrom
bobu-putheeckal:fix-static-wado-case-insensitive-filters

Conversation

@bobu-putheeckal
Copy link
Copy Markdown

@bobu-putheeckal bobu-putheeckal commented May 24, 2026

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-sensitive indexOf and equality checks.

Reproduction proof before the fix:

  • I checked out clean origin/master in a temporary worktree and added only the regression test from this PR.
  • Command:
    ../Viewers/node_modules/.bin/jest --config extensions/default/jest.config.js extensions/default/src/DicomWebDataSource/utils/StaticWadoClient.test.ts --runInBand
  • Result on origin/master: 3 failures.
    • compareValues('*brain*', 'BRAIN WO CONTRAST', {}) returned false.
    • compareValues('mrn123', 'MRN123', {}) returned false.
    • filterItem for lowercase MRN wildcard matching returned undefined.

Changes & Results

  • Normalize both desired and actual string values before wildcard and exact comparisons in StaticWadoClient.compareValues.
  • Add regression coverage for lowercase wildcard and exact matching.
  • Add a higher-level filterItem regression 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:

./node_modules/.bin/jest --config extensions/default/jest.config.js extensions/default/src/DicomWebDataSource/utils/StaticWadoClient.test.ts --runInBand

Result:

PASS extensions/default/src/DicomWebDataSource/utils/StaticWadoClient.test.ts
Test Suites: 1 passed, 1 total
Tests: 3 passed, 3 total

Also checked formatting and diff whitespace:

./node_modules/.bin/prettier --check extensions/default/src/DicomWebDataSource/utils/StaticWadoClient.ts extensions/default/src/DicomWebDataSource/utils/StaticWadoClient.test.ts
git diff --check

Checklist

PR

  • My Pull Request title is descriptive, accurate and follows the semantic-release format and guidelines.

Code

  • My code has been well-documented (function documentation, inline comments, etc.). No new public API was added; regression tests document the changed behavior.

Public Documentation Updates

  • The documentation page has been updated as necessary for any public API additions or removals. N/A: no public API additions or removals.

Tested Environment

  • OS: macOS
  • Node version: v25.6.1
  • Browser: N/A, focused unit test only

Greptile Summary

This PR fixes case-sensitive string matching in StaticWadoClient.compareValues so that WorkList filters for MRN, Study Description, and Accession Number correctly match stored values regardless of input casing.

  • Both actual and desired string values are now lowercased before wildcard (*word*, word*, *word) and exact comparisons; the fuzzy-matching branch was already case-insensitive and is unchanged.
  • The type guard was tightened from typeof actual === 'string' to typeof actual === 'string' && typeof desired === 'string', which also fixes a subtle edge case where a non-string desired would previously enter the string-handling block.
  • A new test file adds compareValues unit tests for all three wildcard forms plus exact matching, and a higher-level filterItem integration 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

Filename Overview
extensions/default/src/DicomWebDataSource/utils/StaticWadoClient.ts compareValues now normalizes both actual and desired strings to lowercase before wildcard and exact comparisons; also tightens the type guard to require both values be strings.
extensions/default/src/DicomWebDataSource/utils/StaticWadoClient.test.ts New test file adding regression coverage for case-insensitive wildcard/exact compareValues and higher-level filterItem scenarios for MRN, Study Description, and Accession Number.

Reviews (1): Last reviewed commit: "Fix static WADO case-insensitive study f..." | Re-trigger Greptile

Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 24, 2026

Deploy Preview for ohif-dev failed. Why did it fail? →

Name Link
🔨 Latest commit 7c188a3
🔍 Latest deploy log https://app.netlify.com/projects/ohif-dev/deploys/6a1368954cf2e700083a85dd

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.

[Bug] MRN, Description, and Accession Number filtering does not work properly for lowercase input.

1 participant