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 createDicomWebTreeApi to use serviceManager #34

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading