fix: PDF display request in v3 (#3878)

Co-authored-by: Alireza <ar.sedghi@gmail.com>
This commit is contained in:
Bill WallaceandAlireza authored and GitHub committed 2024-01-08 13:15:54 -05:00
1 parent bf846c94c3
commit 98650302c7
8 files changed
+27 -18

No files matched your search

@@ -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.
+5 -1
View File
@@ -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;
});