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

[OHI-1357] feat(static-wado): add support for case-insensitive searching #4603

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

IbrahimCSAE
Copy link
Collaborator

@IbrahimCSAE IbrahimCSAE commented Dec 13, 2024

Context

This adds the option to filter static-wado results without being case-sensitive. You need to set the caseSensitive property on your static wado dataSource to false, the default is true.

Orthanc and other sources support case insensitive searching already.

Fixes OHI-1357
Close #4522

Copy link

netlify bot commented Dec 13, 2024

Deploy Preview for ohif-platform-docs ready!

Name Link
🔨 Latest commit fd6f3d6
🔍 Latest deploy log https://app.netlify.com/sites/ohif-platform-docs/deploys/67789fb66cb4ed0008e4485d
😎 Deploy Preview https://deploy-preview-4603--ohif-platform-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Dec 13, 2024

Deploy Preview for ohif-dev ready!

Name Link
🔨 Latest commit fd6f3d6
🔍 Latest deploy log https://app.netlify.com/sites/ohif-dev/deploys/67789fb631d7d40008b1f994
😎 Deploy Preview https://deploy-preview-4603--ohif-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@sedghi sedghi left a comment

Choose a reason for hiding this comment

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

we should make it per qido call and not global

Copy link

cypress bot commented Dec 13, 2024

Viewers    Run #4623

Run Properties:  status check passed Passed #4623  •  git commit fd6f3d6878: Merge branch 'master' into feat/case-insensitive-searching-for-static-wado
Project Viewers
Branch Review feat/case-insensitive-searching-for-static-wado
Run status status check passed Passed #4623
Run duration 02m 04s
Commit git commit fd6f3d6878: Merge branch 'master' into feat/case-insensitive-searching-for-static-wado
Committer Alireza
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 2
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 44
View all changes introduced in this branch ↗︎

@IbrahimCSAE IbrahimCSAE requested a review from sedghi December 13, 2024 16:59
@sedghi
Copy link
Member

sedghi commented Dec 13, 2024

Can you try it in Orthanc too please?

@IbrahimCSAE
Copy link
Collaborator Author

Can you try it in Orthanc too please?

I did, it works fine

@sedghi
Copy link
Member

sedghi commented Dec 20, 2024

@wayfarer3130 can you take a look at this please

Copy link
Contributor

@wayfarer3130 wayfarer3130 left a comment

Choose a reason for hiding this comment

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

Just a couple of small changes.

@wayfarer3130
Copy link
Contributor

Also, please change the default.js and e2e.js configurations to set this on by default - you may need to modify an integration test to support that.

@IbrahimCSAE
Copy link
Collaborator Author

Just a couple of small changes.

thanks Bill, I'll do them as soon as I can

Copy link
Member

@sedghi sedghi left a comment

Choose a reason for hiding this comment

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

wait a minute does this only work on static wado backends? what happened to orthanc testing? did you do it?

@IbrahimCSAE
Copy link
Collaborator Author

IbrahimCSAE commented Jan 4, 2025

wait a minute does this only work on static wado backends? what happened to orthanc testing? did you do it?

orthanc case sensitivity is server side, OHIF doesn’t control it. I tested what orthanc does server side and that this doesn’t break or interfere with it

@sedghi
Copy link
Member

sedghi commented Jan 4, 2025

I thought the filtering happens client side when we looked at the code

@IbrahimCSAE
Copy link
Collaborator Author

IbrahimCSAE commented Jan 4, 2025

I thought the filtering happens client side when we looked at the code

It only happens if it's a static wado datasource, otherwise it calls the super method, we don't control or filter anything there, so it's all up to backend (orthanc in this case) what to return

See here

async searchForStudies(options) {
if (!this.staticWado) {
return super.searchForStudies(options);
}
const searchResult = await super.searchForStudies(options);
const { queryParams } = options;
if (!queryParams) {
return searchResult;
}
const lowerParams = this.toLowerParams(queryParams);
const filtered = searchResult.filter(study => {
for (const key of Object.keys(StaticWadoClient.studyFilterKeys)) {
if (!this.filterItem(key, lowerParams, study, StaticWadoClient.studyFilterKeys)) {
return false;
}
}
return true;
});
return filtered;
}

  async searchForStudies(options) {
    if (!this.staticWado) {
      return super.searchForStudies(options);
    }

    const searchResult = await super.searchForStudies(options);
    const { queryParams } = options;

    if (!queryParams) {
      return searchResult;
    }

    const lowerParams = this.toLowerParams(queryParams);
    const filtered = searchResult.filter(study => {
      for (const key of Object.keys(StaticWadoClient.studyFilterKeys)) {
        if (!this.filterItem(key, lowerParams, study, StaticWadoClient.studyFilterKeys)) {
          return false;
        }
      }
      return true;
    });
    return filtered;
  }

@sedghi
Copy link
Member

sedghi commented Jan 6, 2025

I'm hesitant to merge this PR if it's only for static WADO. Sorry if that wasn't clear from the start.

Based on my research, the standard doesn't specify anything about this.

As you mentioned, Orthanc has a setting called CaseSensitivePN. DCM4CHEE treats all caps as case insensitive, so searching for FIRSTNAMELASTNAME is case insensitive. I'm still trying to determine how the Google Healthcare API handles it.

Then we can decide how to proceed.

@sedghi
Copy link
Member

sedghi commented Jan 7, 2025

I think the way forward is to add fuzzyMatching to our static wado, since that seems to be wildly supported by lots of dicom servers, see https://cloud.google.com/healthcare-api/docs/dicom#search_transaction fuzzyMatching section.

Right now it is set in the config file as supportsFuzzyMatching:false

From the link
fuzzymatching: If set to true, fuzzy matching will be applied to the PatientName tag. Fuzzy matching will perform tokenization and normalization of both the value of PatientName in the query and the stored value. It will match if any search token is a prefix of any stored token. For example, if PatientName is "John^Doe", then "jo", "Do" and "John Doe" will all match. However "ohn" will not match.

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] How to modify a configuration file to make case insensitive when searching?
3 participants