-
Notifications
You must be signed in to change notification settings - Fork 37
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
DICOMweb URL manipulation for Google Cloud Healthcare API #48
DICOMweb URL manipulation for Google Cloud Healthcare API #48
Conversation
I see that this breaks the build for Python versions 3.6 and 3.7 due to missing features of |
I'm going to jump in here and suggest that Google support doesn't should not be a first class property of the python package, but should be provided as another layer on top. I added support to Slicer that assumes We also follow this model in javascript, where the dicomweb client is a layer beneath the Google-specific project/location/dataset/dicomstore layers. |
I generally agree with you @pieper and share your concerns regarding the inclusion of code that is specific to a particular vendor implementation. |
@ntenenz what do you think? |
I agree with @pieper that having this functionality in the main client feels a bit strange, in particular, because it adds a fairly minor feature (string templatization) in exchange for what appears to be an added dependency. An alternate approach may be to conditionally make available vendor-specific clients with auth, path building, etc built-in if As an aside, I don't see the |
@agharwal I have put further thought into this PR and @ntenenz's suggestion. I like the idea of creating vendor-specific extensions ( |
I'd recommend using extra requirements. Relative to the size of the added code, I wouldn't want to handle the extra complexity and package management that comes along with namespace packages. |
Sounds good. That's also the approach we have been taking so far. Implementing the extension mechanism will require minor changes to the repository structure. @agharwal I would suggest moving the I would further suggest moving the |
Given the move, this may be a good time to revisit the API/implementation. If the GCP functionality can be accomplished with a decorator, it may make sense to first implement the proposal discussed in #50 and then create a GCPDICOMwebClient which injects the required decorator. |
What exactly do you have in mind? I don't think the extension mechanism would require passing any decorators to |
I'm unfamiliar with the Google product, however if it requires custom headers or auth, the decorator approach would be a pretty seamless way of incorporating it. I'm assuming the vendor-specific client would wrap all vendor functionality under a single umbrella for ease of use? |
…p.session_utils` and add deprecation warning to the original.
@hackermd: Apologies for the delayed turnaround, and thank you for the feedback! Per your suggestion, I've moved @ntenenz: Thank you for helping incorporate vendor-specific implementations in a meaningful and non-disruptive fashion. |
Glad to see the project is still going strong. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@agharwal this looks great! Thank you! I have only one minor suggestion/question.
…ntials()` to `ext.gcp.session_utils`.
Markus - thank you for your kind consideration!
The PR introduces a
GoogleCloudHealthcareURL
class to facilitate parsing and creation of DICOMweb API Service URLs for the Google Cloud Healthcare API.Implementation notes:
base_url
parameter, I focused the API's interactions with thebase_url
string.str
<--> CHC DICOM Store), more than one method was needed. In order to limit the footprint of vendor-specific features within theuri
module, I opted to encapsulate the requisite functionality under a dedicated class.attr
in favor ofdataclasses.dataclass
for compatibility with Python 3.6. I understand, however, that this is not part of the Standard Library, so you may preferdataclass
with a Python 3.6 backport. Alternately, we could drop any such dependency and implement a custom container. Given how simple the non-attribute-functionality is, however, this may be overkill.I look forward to your feedback :-)