Skip to content

Commit

Permalink
fix: PDF display request in v3 (#3878)
Browse files Browse the repository at this point in the history
Co-authored-by: Alireza <ar.sedghi@gmail.com>
  • Loading branch information
wayfarer3130 and sedghi authored Jan 8, 2024
1 parent bf846c9 commit 9865030
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion extensions/default/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
11 changes: 8 additions & 3 deletions extensions/default/src/DicomWebDataSource/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down
6 changes: 5 additions & 1 deletion extensions/default/src/utils/getDirectURL.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand Down
2 changes: 1 addition & 1 deletion platform/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion platform/app/public/config/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ window.config = {
supportsFuzzyMatching: false,
supportsWildcard: true,
staticWado: true,
singlepart: 'bulkdata,video,pdf',
singlepart: 'video',
bulkDataURI: {
enabled: true,
relativeResolution: 'studies',
Expand Down
2 changes: 1 addition & 1 deletion platform/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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==
Expand Down

0 comments on commit 9865030

Please sign in to comment.