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

Fix/v3 dicomweb client prefixs #2767

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

Conversation

kzgrzendek
Copy link

Dicomweb requests fixes

  • Refactoring the usage of the dicomweb client to keep one client for all the dicomweb-related operations (still keeping the staticWado client appart)
  • All relevant details are mentioned here -> https://community.ohif.org/t/qido-wado-endpoints-handling-in-ohif-v3/24/8
  • Updated config file templates and docs
  • Also updated the base node image in the dockerfile, the one from the v3/stable was causing issues in the image build process
  • Slight changes in the DicomWeb Datasource config (needs to specify qido, wado and stow prefixes in the config file)
  • @swederik this is what we talk last month :) don't hesitate to tell me if you need me to modify anything

@netlify
Copy link

netlify bot commented Apr 2, 2022

Deploy Preview for ohif-platform-docs ready!

Name Link
🔨 Latest commit 8d48cf2
🔍 Latest deploy log https://app.netlify.com/sites/ohif-platform-docs/deploys/64b41968fefbf00008ed5afb
😎 Deploy Preview https://deploy-preview-2767--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.

@netlify
Copy link

netlify bot commented Apr 2, 2022

Deploy Preview for ohif-platform-viewer ready!

Name Link
🔨 Latest commit 47cef51
🔍 Latest deploy log https://app.netlify.com/sites/ohif-platform-viewer/deploys/644ced2f5d0ed30008ea1d78
😎 Deploy Preview https://deploy-preview-2767--ohif-platform-viewer.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 settings.

@codecov
Copy link

codecov bot commented Apr 2, 2022

Codecov Report

Merging #2767 (8d48cf2) into master (18156bb) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 265c1fb...8d48cf2. Read the comment docs.

@sedghi
Copy link
Member

sedghi commented Nov 10, 2022

@wayfarer3130 can you please review this after you come back from vacation?

@kzgrzendek why we are changing qidoRoot to qidoPrefixURL? (and others)

@kzgrzendek
Copy link
Author

kzgrzendek commented Nov 14, 2022

@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.

@wayfarer3130
Copy link
Contributor

For a single web service, the DICOMweb definition in part 18 specifies:
The Studies Resource enables a user agent to store, retrieve, update, and search an origin server for DICOM Studies, Series, and Instances, along with their /metadata, /rendered, and /thumbnail variants; as well as Frames and Bulkdata.

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
Copy link
Contributor

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,
Copy link
Contributor

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 = {
Copy link
Contributor

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}`;
Copy link
Contributor

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.

Copy link
Contributor

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.

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.

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}`;
Copy link
Contributor

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}`;
Copy link
Contributor

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',
Copy link
Contributor

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.

@sedghi sedghi changed the base branch from v3-stable to master June 19, 2023 13:29
@sedghi
Copy link
Member

sedghi commented Jun 19, 2023

@kzgrzendek Thanks for this PR, any one free you have to work on this?

@kzgrzendek
Copy link
Author

@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

@netlify
Copy link

netlify bot commented Jul 16, 2023

Deploy Preview for ohif-dev ready!

Name Link
🔨 Latest commit 8d48cf2
🔍 Latest deploy log https://app.netlify.com/sites/ohif-dev/deploys/64b41968d4b17b000876e2e2
😎 Deploy Preview https://deploy-preview-2767--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.

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.

3 participants