From 98650302c7575f0aea386e32cfc4112c378035e6 Mon Sep 17 00:00:00 2001 From: Bill Wallace Date: Mon, 8 Jan 2024 13:15:54 -0500 Subject: [PATCH] fix: PDF display request in v3 (#3878) Co-authored-by: Alireza --- .circleci/config.yml | 2 +- extensions/default/package.json | 2 +- .../default/src/DicomWebDataSource/index.js | 11 ++++++++--- extensions/default/src/utils/getDirectURL.js | 6 +++++- platform/app/package.json | 2 +- platform/app/public/config/e2e.js | 2 +- platform/core/package.json | 2 +- yarn.lock | 18 +++++++++--------- 8 files changed, 27 insertions(+), 18 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d2fce6395a3..30c35af46ae 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,7 +13,7 @@ version: 2.1 ## orbs: codecov: codecov/codecov@1.0.5 - cypress: cypress-io/cypress@3.1.4 + cypress: cypress-io/cypress@3.2.1 executors: cypress-custom: diff --git a/extensions/default/package.json b/extensions/default/package.json index 847a060a53d..96d6ef6f1af 100644 --- a/extensions/default/package.json +++ b/extensions/default/package.json @@ -33,7 +33,7 @@ "@ohif/core": "3.8.0-beta.37", "@ohif/i18n": "3.8.0-beta.37", "dcmjs": "^0.29.12", - "dicomweb-client": "^0.10.2", + "dicomweb-client": "^0.10.4", "prop-types": "^15.6.2", "react": "^17.0.2", "react-dom": "^17.0.2", diff --git a/extensions/default/src/DicomWebDataSource/index.js b/extensions/default/src/DicomWebDataSource/index.js index 2ae44dc7e69..a0748d86471 100644 --- a/extensions/default/src/DicomWebDataSource/index.js +++ b/extensions/default/src/DicomWebDataSource/index.js @@ -373,11 +373,12 @@ function createDicomWebApi(dicomWebConfig, servicesManager) { // in which case it isn't necessary to re-read this. if (value && value.BulkDataURI && !value.Value) { // Provide a method to fetch bulkdata - value.retrieveBulkData = () => { + value.retrieveBulkData = (options = {}) => { // handle the scenarios where bulkDataURI is relative path fixBulkDataURI(value, naturalized, dicomWebConfig); - const options = { + const { mediaType } = options; + const useOptions = { // The bulkdata fetches work with either multipart or // singlepart, so set multipart to false to let the server // decide which type to respond with. @@ -388,9 +389,13 @@ function createDicomWebApi(dicomWebConfig, servicesManager) { // isn't well specified in the standard, but is needed in // any implementation that stores static copies of the metadata StudyInstanceUID: naturalized.StudyInstanceUID, + mediaTypes: mediaType + ? [{ mediaType }, { mediaType: 'application/octet-stream' }] + : undefined, + ...options, }; // Todo: this needs to be from wado dicom web client - return qidoDicomWebClient.retrieveBulkData(options).then(val => { + return qidoDicomWebClient.retrieveBulkData(useOptions).then(val => { // There are DICOM PDF cases where the first ArrayBuffer in the array is // the bulk data and DICOM video cases where the second ArrayBuffer is // the bulk data. Here we play it safe and do a find. diff --git a/extensions/default/src/utils/getDirectURL.js b/extensions/default/src/utils/getDirectURL.js index a43bdeb45bb..823d7eaef07 100644 --- a/extensions/default/src/utils/getDirectURL.js +++ b/extensions/default/src/utils/getDirectURL.js @@ -37,7 +37,11 @@ const getDirectURL = (config, params) => { } if (!singlepart || (singlepart !== true && singlepart.indexOf(fetchPart) === -1)) { if (value.retrieveBulkData) { - return value.retrieveBulkData().then(arr => { + // Try the specified retrieve type. + const options = { + mediaType: defaultType, + }; + return value.retrieveBulkData(options).then(arr => { value.DirectRetrieveURL = URL.createObjectURL(new Blob([arr], { type: defaultType })); return value.DirectRetrieveURL; }); diff --git a/platform/app/package.json b/platform/app/package.json index 7a3b780d684..7f246d55703 100644 --- a/platform/app/package.json +++ b/platform/app/package.json @@ -95,7 +95,7 @@ "devDependencies": { "@babel/plugin-proposal-private-methods": "^7.18.6", "@percy/cypress": "^3.1.1", - "cypress": "^13.2.0", + "cypress": "13.6.2", "cypress-file-upload": "^3.5.3", "glob": "^8.0.3", "identity-obj-proxy": "3.0.x", diff --git a/platform/app/public/config/e2e.js b/platform/app/public/config/e2e.js index 5ffdab32af0..46a50c939e1 100644 --- a/platform/app/public/config/e2e.js +++ b/platform/app/public/config/e2e.js @@ -53,7 +53,7 @@ window.config = { supportsFuzzyMatching: false, supportsWildcard: true, staticWado: true, - singlepart: 'bulkdata,video,pdf', + singlepart: 'video', bulkDataURI: { enabled: true, relativeResolution: 'studies', diff --git a/platform/core/package.json b/platform/core/package.json index cfc11b5764f..0a7fd09dac3 100644 --- a/platform/core/package.json +++ b/platform/core/package.json @@ -43,7 +43,7 @@ "dependencies": { "@babel/runtime": "^7.20.13", "dcmjs": "^0.29.12", - "dicomweb-client": "^0.10.2", + "dicomweb-client": "^0.10.4", "gl-matrix": "^3.4.3", "isomorphic-base64": "^1.0.2", "lodash.clonedeep": "^4.5.0", diff --git a/yarn.lock b/yarn.lock index 599edd71acb..ed1ecc28809 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8281,10 +8281,10 @@ cypress-file-upload@^3.5.3: resolved "https://registry.yarnpkg.com/cypress-file-upload/-/cypress-file-upload-3.5.3.tgz#cd706485de3fb2cbd4a8c2dd90fe96d537bb4311" integrity sha512-S/czzqAj1BYz6Xxnfpx2aSc6hXsj76fd8/iuycJ2RxoxCcQMliw8eQV0ugzVlkzr1GD5dKGviNFGYqv3nRJ+Tg== -cypress@^13.2.0: - version "13.6.1" - resolved "https://registry.yarnpkg.com/cypress/-/cypress-13.6.1.tgz#c5f714f08551666ed3ac1fa95718eabb23a416df" - integrity sha512-k1Wl5PQcA/4UoTffYKKaxA0FJKwg8yenYNYRzLt11CUR0Kln+h7Udne6mdU1cUIdXBDTVZWtmiUjzqGs7/pEpw== +cypress@13.6.2: + version "13.6.2" + resolved "https://registry.yarnpkg.com/cypress/-/cypress-13.6.2.tgz#c70df09db0a45063298b3cecba2fa21109768e08" + integrity sha512-TW3bGdPU4BrfvMQYv1z3oMqj71YI4AlgJgnrycicmPZAXtvywVFZW9DAToshO65D97rCWfG/kqMFsYB6Kp91gQ== dependencies: "@cypress/request" "^3.0.0" "@cypress/xvfb" "^1.2.4" @@ -8832,10 +8832,10 @@ dicomicc@^0.1: resolved "https://registry.yarnpkg.com/dicomicc/-/dicomicc-0.1.0.tgz#c73acc60a8e2d73a20f462c8c7d0e1e0d977c486" integrity sha512-kZejPGjLQ9NsgovSyVsiAuCpq6LofNR9Erc8Tt/vQAYGYCoQnTyWDlg5D0TJJQATKul7cSr9k/q0TF8G9qdDkQ== -dicomweb-client@^0.10.2: - version "0.10.3" - resolved "https://registry.yarnpkg.com/dicomweb-client/-/dicomweb-client-0.10.3.tgz#b4fe550037166dff5d8afd88db3800eb579c91f4" - integrity sha512-/fHNEAYiz8j+9TNOrNJ0k+hYqirbOT85B7vM7I4VkY8DeDQb4BDUeL3RX6huDVtn6ZQlR91dI+2tejLc5c99wA== +dicomweb-client@^0.10.4: + version "0.10.4" + resolved "https://registry.yarnpkg.com/dicomweb-client/-/dicomweb-client-0.10.4.tgz#f32f8659e51fbaf3f924c81fe8b7ad80297f2bc5" + integrity sha512-TEt26c0JI37IGmSqoj1k1/Y/ZIyq33/ysVaUwE0/Haosn2IBM55NEIPkT+AnhFss2nFAMVtKKWKWLox4luthVw== dicomweb-client@^0.8: version "0.8.4" @@ -14217,7 +14217,7 @@ media-typer@0.3.0: resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" integrity sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ== -medium-zoom@^1.0.4: +medium-zoom@^1.0.8: version "1.1.0" resolved "https://registry.yarnpkg.com/medium-zoom/-/medium-zoom-1.1.0.tgz#6efb6bbda861a02064ee71a2617a8dc4381ecc71" integrity sha512-ewyDsp7k4InCUp3jRmwHBRFGyjBimKps/AJLjRSox+2q/2H4p/PNpQf+pwONWlJiOudkBXtbdmVbFjqyybfTmQ==