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

Feature request: Allow running against a locally deployed DICOMweb endpoint #124

Open
jasonklotzer opened this issue Dec 22, 2020 · 0 comments
Labels
p2 Priority: Default priority, issue with HCLS products with not so great work around

Comments

@jasonklotzer
Copy link
Member

It looks like the code requires a service account for Healthcare API by default, which may not be supplied if someone is trying to run the adapter using local DIMSE and DICOMweb services, primarily in a testing/development environment.

At first glance it seems the remedy, at least for the DIMSE->STOW-RS mode (pub/sub has not been tested), is to put some logic around the following line:
https://github.com/GoogleCloudPlatform/healthcare-dicom-dicomweb-adapter/blob/master/import/src/main/java/com/google/cloud/healthcare/imaging/dicomadapter/ImportAdapter.java#L92, only including new HttpCredentialsAdapter(credentials) when necessary?

The error and stack that show up when trying to run the adapter w/o a service account:

ERROR com.google.cloud.healthcare.imaging.dicomadapter.CStoreService - C-STORE request failed:
com.google.cloud.healthcare.IDicomWebClient$DicomWebException: java.io.IOException: Scopes not configured for service account. Scoped should be specified by calling createScoped or passing scopes to constructor.
at com.google.cloud.healthcare.DicomWebClient.stowRs(DicomWebClient.java:132)
at com.google.cloud.healthcare.imaging.dicomadapter.CStoreService.lambda$store$3(CStoreService.java:129)
at com.google.cloud.healthcare.imaging.dicomadapter.CStoreService.processStream(CStoreService.java:174)
at com.google.cloud.healthcare.imaging.dicomadapter.CStoreService.store(CStoreService.java:137)
at org.dcm4che3.net.service.BasicCStoreSCP.onDimseRQ(BasicCStoreSCP.java:72)
at org.dcm4che3.net.service.DicomServiceRegistry.onDimseRQ(DicomServiceRegistry.java:86)
at org.dcm4che3.net.ApplicationEntity.onDimseRQ(ApplicationEntity.java:474)
at org.dcm4che3.net.Association.onDimseRQ(Association.java:713)
at org.dcm4che3.net.PDUDecoder.decodeDIMSE(PDUDecoder.java:467)
at org.dcm4che3.net.Association.handlePDataTF(Association.java:696)
at org.dcm4che3.net.State$4.onPDataTF(State.java:103)
at org.dcm4che3.net.Association.onPDataTF(Association.java:692)
at org.dcm4che3.net.PDUDecoder.nextPDU(PDUDecoder.java:177)
at org.dcm4che3.net.Association$2.run(Association.java:529)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:835)
Caused by: java.io.IOException: Scopes not configured for service account. Scoped should be specified by calling createScoped or passing scopes to constructor.
at com.google.auth.oauth2.ServiceAccountCredentials.refreshAccessToken(ServiceAccountCredentials.java:390)
at com.google.auth.oauth2.OAuth2Credentials.refresh(OAuth2Credentials.java:157)
at com.google.auth.oauth2.OAuth2Credentials.getRequestMetadata(OAuth2Credentials.java:145)
at com.google.auth.http.HttpCredentialsAdapter.initialize(HttpCredentialsAdapter.java:91)
at com.google.api.client.http.HttpRequestFactory.buildRequest(HttpRequestFactory.java:88)
at com.google.api.client.http.HttpRequestFactory.buildPostRequest(HttpRequestFactory.java:128)
at com.google.cloud.healthcare.DicomWebClient.stowRs(DicomWebClient.java:125)
... 16 more

@jasonklotzer jasonklotzer changed the title Feature request: Allow running dicom-adapter against a locally deployed DICOMweb endpoint Feature request: Allow running against a locally deployed DICOMweb endpoint Dec 22, 2020
@rakeshdave-gcp rakeshdave-gcp added the p2 Priority: Default priority, issue with HCLS products with not so great work around label Feb 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2 Priority: Default priority, issue with HCLS products with not so great work around
Projects
None yet
Development

No branches or pull requests

2 participants