-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Fix/v3 dicomweb client prefixs #2767
base: master
Are you sure you want to change the base?
Fix/v3 dicomweb client prefixs #2767
Conversation
Merge branch 'v3-stable' into fix/v3-dicomweb-client-prefixs
✅ Deploy Preview for ohif-platform-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for ohif-platform-viewer ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Codecov Report
@@ Coverage Diff @@
## master #2767 +/- ##
=======================================
Coverage 42.75% 42.75%
=======================================
Files 82 82
Lines 1450 1450
Branches 338 338
=======================================
Hits 620 620
Misses 667 667
Partials 163 163 Continue to review full report in Codecov by Sentry.
|
@wayfarer3130 can you please review this after you come back from vacation? @kzgrzendek why we are changing qidoRoot to qidoPrefixURL? (and others) |
Hi @sedghi! The goal is to adapt to the way the dicomweb-client we use is working -> https://github.com/dcmjs-org/dicomweb-client/blob/447dfe040b454037ed86d55a1ad35304dbb5041e/src/api.js#L62 It expects a base URL, then different prefixs for the dicomweb endpoint you want to consume. That way, we use the same dicom web client for QIDO, WADO and STOW. I've detailed my actions in a series of (too) long posts in the OHIF Community forum -> https://community.ohif.org/t/qido-wado-endpoints-handling-in-ohif-v3/24/8 PS : I've updated the PR with the laste version of the ohif-v3 branch to resolve conflicts. I've also fixed the Dockerfile that wasn't building at all. |
For a single web service, the DICOMweb definition in part 18 specifies: That actually means that if the studies query response returns a response, you are supposed to be able to fetch data etc from the same path on it. Now, you can simply say that they are three unrelated services, but the standard's compliant method of doing that is to have the study response include the Tag RetrieveURL included in the response. Note that this tag MAY be included for series level queries and be different for different series. It is also allowed to return the RetrieveAE field, and key off the AE name for the next retrieve level. You can also have some proprietary method to determine the next level, such as having fixed AE names (aka data source names), or the custom prefixes you suggested. It would be very useful instead of having the logic to determine the paths be embedded in the dicomweb client, to have that determined by the data source provider, and to simply define multiple data sources in the case that they reference different URLs. That way, one could define a WADO URI retriever, a WADO RS one on several paths, and some sort of method to determine which data source is used for a given level/mapping. That is, unfortunately, harder to implement. I think we can probably get by with fewer changes by having some of the values be optional. Let me try to make some suggestions in the files themselves. |
* @param {boolean} qidoSupportsIncludeField - Whether QIDO supports the "Include" option to request additional fields in response | ||
* @param {string} imageRengering - wadors | ? (unsure of where/how this is used) | ||
* @param {string} thumbnailRendering - wadors | ? (unsure of where/how this is used) | ||
* @param {string} baseUrl - The root URL for DICOMWeb calls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have the names matche the dicomweb client definition - that is, it should take url as the base url parameter, and ONLY add wadoURLPrefix etc if specified.
* @param {string|bool} singlepart - indicates of the retrieves can fetch singlepart. Options are bulkdata, video, image or boolean true | ||
*/ | ||
function createDicomWebApi(dicomWebConfig, UserAuthenticationService) { | ||
const { | ||
qidoRoot, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just extract the ...options from the parameter, so that you can pass any additional options in as required.
url: wadoRoot, | ||
staticWado, | ||
singlepart, | ||
const dicomWebClientConfig = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just pass in options directly, or else use
const wadoConfig = {
...options,
<any custom over-rides}
}
@@ -220,16 +207,16 @@ function createDicomWebApi(dicomWebConfig, UserAuthenticationService) { | |||
(hasAccept ? '' : (hasQuery ? '&' : '?') + `accept=${defaultType}`); | |||
if (BulkDataURI.indexOf('http') === 0) return acceptUri; | |||
if (BulkDataURI.indexOf('/') === 0) { | |||
return wadoRoot + acceptUri; | |||
return `${baseUrl}/${wadoURLPrefix}/${acceptUri}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create a function on the data access object which gets the URL for a given query type, defaulting to the base URL. That way there is just a single query generator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could put the getter function on the config object, so that it can be used for doing things like generating the wadors URI's. Something like
if( !config.getUrl ) {
config.getUrl = function(typeId, ...additions)
to get the URL. It should handle query parameters defined in the base URL or in the suffixes as well.... typeId would be 'wado' or 'qido' etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be more consistent with the dicomweb client if that is the direction we want to take - that is, use url and then only define the prefixes as necessary. Encapsulate the logic to do all that.
@@ -220,16 +207,16 @@ function createDicomWebApi(dicomWebConfig, UserAuthenticationService) { | |||
(hasAccept ? '' : (hasQuery ? '&' : '?') + `accept=${defaultType}`); | |||
if (BulkDataURI.indexOf('http') === 0) return acceptUri; | |||
if (BulkDataURI.indexOf('/') === 0) { | |||
return wadoRoot + acceptUri; | |||
return `${baseUrl}/${wadoURLPrefix}/${acceptUri}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could put the getter function on the config object, so that it can be used for doing things like generating the wadors URI's. Something like
if( !config.getUrl ) {
config.getUrl = function(typeId, ...additions)
to get the URL. It should handle query parameters defined in the base URL or in the suffixes as well.... typeId would be 'wado' or 'qido' etc.
@@ -13,7 +13,7 @@ function buildInstanceWadoUrl(config, instance) { | |||
|
|||
const paramString = params.join('&'); | |||
|
|||
return `${config.wadoUriRoot}?${paramString}`; | |||
return `${config.baseUrl}/${config.wadoURLPrefix}?${paramString}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the function added to the config to get the query parameters/setup, eg make it:
config.getUrl('wado', ?{paramString}
)
@@ -6,8 +6,9 @@ describe('addServers', () => { | |||
{ | |||
name: 'DCM4CHEE', | |||
wadoUriRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/wado', | |||
qidoRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/rs', | |||
wadoRoot: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/rs', | |||
qidoUrlPrefix: 'https://server.dcmjs.org/dcm4chee-arc/aets/DCM4CHEE/rs', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should all be replaced with just uri. Then, if necessary, specific versions can include the prefix definitions as needed.
@kzgrzendek Thanks for this PR, any one free you have to work on this? |
Hello @sedghi, not at the moment. I can have a look at it on my free time, but atm I'm very busy on other topics, and unfortunately not allowed to do it on my working hours for legal reasons. If you have people available for doing the requested changes, I'd be glad to assist! If not, I'll try to have a look at it in the following days/week but can't give any estimations unfortunately |
✅ Deploy Preview for ohif-dev ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Dicomweb requests fixes