diff --git a/extensions/default/src/DicomWebDataSource/index.ts b/extensions/default/src/DicomWebDataSource/index.ts index 6bf6c4e12d3..676b54bbb6c 100644 --- a/extensions/default/src/DicomWebDataSource/index.ts +++ b/extensions/default/src/DicomWebDataSource/index.ts @@ -67,6 +67,8 @@ export type DicomWebConfig = { staticWado?: boolean; /** User authentication service */ userAuthenticationService: Record; + /** Case sensitivity configuration */ + caseSensitive?: Record; }; export type BulkDataURIConfig = { @@ -147,6 +149,7 @@ function createDicomWebApi(dicomWebConfig: DicomWebConfig, servicesManager) { qidoConfig = { url: dicomWebConfig.qidoRoot, + caseSensitive: dicomWebConfig.caseSensitive || {}, staticWado: dicomWebConfig.staticWado, singlepart: dicomWebConfig.singlepart, headers: userAuthenticationService.getAuthorizationHeader(), @@ -155,6 +158,7 @@ function createDicomWebApi(dicomWebConfig: DicomWebConfig, servicesManager) { wadoConfig = { url: dicomWebConfig.wadoRoot, + caseSensitive: dicomWebConfig.caseSensitive || {}, staticWado: dicomWebConfig.staticWado, singlepart: dicomWebConfig.singlepart, headers: userAuthenticationService.getAuthorizationHeader(), diff --git a/extensions/default/src/DicomWebDataSource/utils/StaticWadoClient.ts b/extensions/default/src/DicomWebDataSource/utils/StaticWadoClient.ts index 519e8109c03..1c9baf87766 100644 --- a/extensions/default/src/DicomWebDataSource/utils/StaticWadoClient.ts +++ b/extensions/default/src/DicomWebDataSource/utils/StaticWadoClient.ts @@ -156,18 +156,27 @@ export default class StaticWadoClient extends api.DICOMwebClient { * * @param {*} desired * @param {*} actual + * @param {boolean} caseSensitive * @returns true if the values match */ - compareValues(desired, actual) { + compareValues(desired, actual, caseSensitive = true) { if (Array.isArray(desired)) { - return desired.find(item => this.compareValues(item, actual)); + return desired.find(item => this.compareValues(item, actual, caseSensitive)); } if (Array.isArray(actual)) { - return actual.find(actualItem => this.compareValues(desired, actualItem)); + return actual.find(actualItem => this.compareValues(desired, actualItem, caseSensitive)); } if (actual?.Alphabetic) { actual = actual.Alphabetic; } + + if (typeof actual == 'string') { + if (!caseSensitive) { + desired = desired.toLowerCase(); + actual = actual.toLowerCase(); + } + } + if (typeof actual == 'string') { if (actual.length === 0) { return true; @@ -227,7 +236,9 @@ export default class StaticWadoClient extends api.DICOMwebClient { return this.compareDateRange(testValue, valueElem.Value[0]); } const value = valueElem.Value; - return this.compareValues(testValue, value); + const caseSensitive = this.config.caseSensitive[key]; + + return this.compareValues(testValue, value, caseSensitive); } /** Converts the query parameters to lower case query parameters */ diff --git a/platform/app/public/config/default.js b/platform/app/public/config/default.js index 1b118b5b067..ba63736e836 100644 --- a/platform/app/public/config/default.js +++ b/platform/app/public/config/default.js @@ -53,6 +53,12 @@ window.config = { supportsFuzzyMatching: false, supportsWildcard: true, staticWado: true, + caseSensitive: { + patientname: false, + studydescription: false, + accessionnumber: false, + '00100020': false, + }, singlepart: 'bulkdata,video', // whether the data source should use retrieveBulkData to grab metadata, // and in case of relative path, what would it be relative to, options diff --git a/platform/app/public/config/e2e.js b/platform/app/public/config/e2e.js index 25fab2917aa..d3937fd098b 100644 --- a/platform/app/public/config/e2e.js +++ b/platform/app/public/config/e2e.js @@ -46,6 +46,12 @@ window.config = { relativeResolution: 'studies', transform: url => url.replace('/pixeldata.mp4', '/index.mp4'), }, + caseSensitive: { + patientname: false, + studydescription: false, + accessionnumber: false, + '00100020': false, + }, }, }, { @@ -118,6 +124,12 @@ window.config = { relativeResolution: 'studies', transform: url => url.replace('/pixeldata.mp4', '/rendered'), }, + caseSensitive: { + patientname: false, + studydescription: false, + accessionnumber: false, + '00100020': false, + }, }, }, diff --git a/platform/docs/docs/configuration/configurationFiles.md b/platform/docs/docs/configuration/configurationFiles.md index db24e8da95f..f7865332d36 100644 --- a/platform/docs/docs/configuration/configurationFiles.md +++ b/platform/docs/docs/configuration/configurationFiles.md @@ -193,6 +193,15 @@ if auth headers are used, a preflight request is required. - `activateViewportBeforeInteraction`: (default to true), if set to false, tools can be used directly without the need to click and activate the viewport. - `autoPlayCine`: (default to false), if set to true, data sets with the DICOM frame time tag (i.e. (0018,1063)) will auto play when displayed - `addWindowLevelActionMenu`: (default to true), if set to false, the window level action menu item is NOT added to the viewport action corners +- `caseSensitive`: an object with filter keys that should be case sensitive, only works on STATIC-WADO backends. By default, all filters are case sensitive. If you want to set a filter to be case insensitive, you can set it to false. Example: + ```js + caseSensitive: { + patientname: false, + studydescription: false, + accessionnumber: false, + '00100020': false, + } + ``` - `dangerouslyUseDynamicConfig`: Dynamic config allows user to pass `configUrl` query string. This allows to load config without recompiling application. If the `configUrl` query string is passed, the worklist and modes will load from the referenced json rather than the default .env config. If there is no `configUrl` path provided, the default behaviour is used and there should not be any deviation from current user experience.
Points to consider while using `dangerouslyUseDynamicConfig`:
- User have to enable this feature by setting `dangerouslyUseDynamicConfig.enabled:true`. By default it is `false`.