-
Notifications
You must be signed in to change notification settings - Fork 47
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
add request option to retrieve instances #103
Conversation
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.
This seems very reasonable to me, but I'd like it if someone else could have a look and let us know if there are an concerns.
@LachlanNewman one issue is that the commit message should be in the semantic release format so this triggers a feature release. https://github.com/dcmjs-org/dicomweb-client?tab=readme-ov-file#for-maintainers |
8908c9b
to
c5d6bb3
Compare
@pieper i have amended the commit message. is there anything that needs to be done ? |
@LachlanNewman Thanks for doing that. I'm not 100% sure, but I think the message should start with "feat(request): " to be sure the release will be triggered. Also I do want to hear from either @sedghi or @wayfarer3130 since they would be more aware than I of any possible compatibility issues. |
c5d6bb3
to
c7c0c54
Compare
c7c0c54
to
65f3bac
Compare
Adding a request object constrains the implementation to use http requests, and also has this magic setup where things like data to be uploaded is configured in some http request. I'd rather see the core library be enhanced with specific pieces of functionality to allow specifying data to upload as a callback method, specifying a modifier for the method/attributes/url. That would give more functionality that was much more targetted. If you really want to have the request specified, it should be done as a createXmlHttpRequest method, but I'd rather have individual methods which take information about the request being generated and modify the basic/underlying request. The parts to modify:
These should be in an options argument, not added as single argument changes that would make future releases incompatible when other types of attributes got added. For example, could be: _httpGetMultipartApplicationDicom( The set of options should be fixed, declaring it in a type object and should apply to the various methods consistently. |
@wayfarer3130 I'm a little confused about what you're asking sorry. The point of this PR was to be able to inject a request object that is compatible with the XMLHttpRequest specification. Are you suggesting passing a call back that allows for creating the requesting object ? I am happy to refactor the functionality to allow for passing a callback such as |
Yeah. This PR is to align the API retrieveInstance to be similar to the storeInstances to support an option to pas in the request object so it can be used in nodejs env. Broader refactor to the underline "internal" methods can be done later in other PRs, I would suggest. |
hey @LachlanNewman thanks a lot for the PR. I was really looking to get this fixed as well. @wayfarer3130 and @pieper would it be possible to get this approved? |
Thanks for the review @wayfarer3130 - Looking at the change, does having a |
It doesn't preclude it, but it makes the API more messy because options get passed into the functions in various ways. |
Okay, so we want Does that work for @LachlanNewman @hao-dong-annalise @andrearampin |
We also should refactor other retrieve APIs like retrieveStudy, retrieveStudyMetadata, retrieveSeries, retrieveSeriesMetadata etc. to support the options.request option. |
Yes, please refactor anything else that takes the request as an option. |
6f2c4ce
to
2a73ab0
Compare
@wayfarer3130 i have add the required changes let me know if everything looks ok. |
@wayfarer3130 do the tests need to pass in order to merge ? this is the issue is think https://github.com/orgs/community/discussions/116610 |
That is a question for @pieper as I'm not quite as involved in this project so i don't know the test status right now. |
Yes, we want the tests to pass, and it looks like the docker compose change has fixed them 👍 |
🎉 This PR is included in version 0.11.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Provides the same functionality to pass an instance of a request like 'storeInstances` does.