Skip to content

Commit

Permalink
fix createDicomWebTreeApi to use serviceManager
Browse files Browse the repository at this point in the history
  • Loading branch information
m00n620 committed Apr 26, 2024
1 parent 0851a07 commit aa5c8e0
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/createDicomWebTreeApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ const initializeHealthlakeFetch = (healthlake) => {
* @param {bool} lazyLoadStudy - "enableStudyLazyLoad"; Request series meta async instead of blocking
* @param {string|bool} singlepart - indicates of the retrieves can fetch singlepart. Options are bulkdata, video, image or boolean true
*/
function createDicomWebTreeApi(dicomWebConfig, UserAuthenticationService) {
function createDicomWebTreeApi(dicomWebConfig, servicesManager) {
const { userAuthenticationService } = servicesManager.services;
const {
qidoRoot,
wadoRoot,
Expand All @@ -123,7 +124,7 @@ function createDicomWebTreeApi(dicomWebConfig, UserAuthenticationService) {
staticWado,
healthlake,
singlepart,
headers: UserAuthenticationService.getAuthorizationHeader(),
headers: userAuthenticationService.getAuthorizationHeader(),
errorInterceptor: errorHandler.getHTTPErrorHandler(),
};

Expand All @@ -132,7 +133,7 @@ function createDicomWebTreeApi(dicomWebConfig, UserAuthenticationService) {
singlepart,
staticWado,
healthlake,
headers: UserAuthenticationService.getAuthorizationHeader(),
headers: userAuthenticationService.getAuthorizationHeader(),
errorInterceptor: errorHandler.getHTTPErrorHandler(),
};

Expand Down Expand Up @@ -160,7 +161,7 @@ function createDicomWebTreeApi(dicomWebConfig, UserAuthenticationService) {
studies: {
mapParams: mapParams.bind(),
search: async function (origParams) {
const headers = UserAuthenticationService.getAuthorizationHeader();
const headers = userAuthenticationService.getAuthorizationHeader();
if (headers) {
qidoDicomWebClient.headers = headers;
}
Expand Down Expand Up @@ -207,7 +208,7 @@ function createDicomWebTreeApi(dicomWebConfig, UserAuthenticationService) {
series: {
// mapParams: mapParams.bind(),
search: async function (studyInstanceUid) {
const headers = UserAuthenticationService.getAuthorizationHeader();
const headers = userAuthenticationService.getAuthorizationHeader();
if (headers) {
qidoDicomWebClient.headers = headers;
}
Expand Down Expand Up @@ -240,7 +241,7 @@ function createDicomWebTreeApi(dicomWebConfig, UserAuthenticationService) {

instances: {
search: (studyInstanceUid, queryParameters) => {
const headers = UserAuthenticationService.getAuthorizationHeader();
const headers = userAuthenticationService.getAuthorizationHeader();
if (headers) {
qidoDicomWebClient.headers = headers;
}
Expand Down Expand Up @@ -342,7 +343,7 @@ function createDicomWebTreeApi(dicomWebConfig, UserAuthenticationService) {
sortFunction,
madeInClient = false,
}) => {
const headers = UserAuthenticationService.getAuthorizationHeader();
const headers = userAuthenticationService.getAuthorizationHeader();
if (headers) {
wadoDicomWebClient.headers = headers;
}
Expand All @@ -368,7 +369,7 @@ function createDicomWebTreeApi(dicomWebConfig, UserAuthenticationService) {
store: {
dicom: async dataset => {
// remove
const headers = UserAuthenticationService.getAuthorizationHeader();
const headers = userAuthenticationService.getAuthorizationHeader();
if (headers) {
wadoDicomWebClient.headers = headers;
}
Expand Down

0 comments on commit aa5c8e0

Please sign in to comment.