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

[MRG] Add UPS and BWM to qrscp and UPS to findscu #837

Merged
merged 22 commits into from
Jun 23, 2023

Conversation

sjswerdloff
Copy link
Contributor

Reference issue

#835

Tasks

  • Unit tests added that reproduce issue or prove feature is working
  • Fix or feature added: Add UPS to findscu, Add minimal support for UPS and BWM to qrscp sufficient to allow testing of findscu
  • Documentation and examples updated (if relevant)
  • Unit tests passing and coverage at 100% after adding fix/feature (I think same coverage % as before)
  • Type annotations updated and passing with mypy (findscu has same issues as before my PR)
  • Apps updated and tested (if relevant)

@sjswerdloff sjswerdloff changed the title [WIP] Add UPS and BWM to qrscp and UPS to findscu [MRG] Add UPS and BWM to qrscp and UPS to findscu Jun 16, 2023
@sjswerdloff sjswerdloff marked this pull request as ready for review June 16, 2023 15:38
@sjswerdloff
Copy link
Contributor Author

When I use a lesser version of Sphinx, everything is fine in terms of building docs.
I thought I posted that in a previous comment.
When I try to update various dependencies that are listed in complaints by pip about latest Sphinx (7.0.1), they uninstall Spring 7 and install Sphinx 5.x

@sjswerdloff
Copy link
Contributor Author

When I use a lesser version of Sphinx, everything is fine in terms of building docs.
I thought I posted that in a previous comment.
When I try to update various dependencies that are listed in complaints by pip about latest Sphinx (7.0.1), they uninstall Spring 7 and install Sphinx 5.x

but now I get:
WARNING: extlinks: Sphinx-6.0 will require a caption string to contain exactly one '%s' and all other '%' need to be escaped as '%%'.

which is a bit more informative.
But I don't think I added anything that is any different from what was there before (I basically did copy/paste/modify)

Copy link
Member

@mrbean-bremen mrbean-bremen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that looks quite good to me! I will wait some time if somebody else will have a look (@darcymason ?), and for the linter issue to be handled before merging this.

yield 0xC322, None

yield 0xFF00, response
if model.name not in ['Unified Procedure Step - Pull SOP Class' ,'Modality Worklist Information Model - FIND'] :
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably better to use the keyword, which will surely not change, e.g.

if model.keyword not in ("UnifiedProcedureStepPull", "ModalityWorklistInformationModelFind"):

and maybe revert the logic for readability - that else branch is way down there

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great feedback. I am on it.

@darcymason
Copy link
Member

I will wait some time if somebody else will have a look (@darcymason ?), and for the linter issue to be handled before merging this.

I've had a quick look without significant comments - will try to do a proper review in the next couple of days.

using model.keyword rather than model.name, and inverted logic so that the action taken based on the truth of the conditional
is immediately visible to the reviewer.
The lint failure is for long present spelling of these words, presumably following the dictate that the Kings English be used
I tried using the --builtin 'en-GB_to_en-US' but that didn't work, so I just used the specific words and their spelling.
pydicom already has typing information in it
@codecov
Copy link

codecov bot commented Jun 22, 2023

Codecov Report

Merging #837 (1b87f23) into master (78d4b95) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##            master      #837   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           28        28           
  Lines         8639      8639           
=========================================
  Hits          8639      8639           

@mrbean-bremen
Copy link
Member

The checks now pass, only waiting for the review by @darcymason.

In addition, the ``qrscp`` application implements a Service Class Provider (SCP) for the
:dcm:`Basic Modality Worklist<part04/chapter_K.html>`, and :dcm:`Unified Procedure Step<part04/Chapter_CC>`
service classes, but currently will only return empty results (0 records)

.. warning::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In reviewing again, I'm wondering about the 'safety' of returning empty results... I don't know much about DICOM communications (as opposed to files) and pynetdicom's internals, but is this a potential problem for another pynetdicom library user, who tries to use this service assuming it would work fully?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty results are a legitimate and frequent outcome when issuing a C-FIND-RQ
This happens alot in IHE-RO TDW-II profile because the SCU implementations often poll every five minutes and there isn't a match at the time.
It also happens for typical Q/R and for BWM/MWL.

However, I am intending to provide a means for the tester supplying UPS to provide responses to matching queries.
I was going to do that separately from qrscp, and do it in a personal but public repo with TDW-II plus examples.

The reason I put in the successful empty response was so there could be a basic communication test. There wasn't one for BWM/WLM. Which was already supported by findscu. If you want me to remove the minimal support for UPS CFIND from qrscp and will still approve the changes for findscu, I will create a new PR and cancel this one. But if I have to implement a fully functional example, then we should remove support for BWM/MWL from findscu until it too has a fully functional test available.

I will be happy to transfer any and all of my personal repo work on UPS to pynetdicom apps once I am happy with it. I realise that counts as big bang PRs, but it can be done one paired set of apps at a time (mutual testing... It takes two to tango). I have that minimal pair already for UPS Watch, although it is not "feature complete".
I'm also happy to maintain ownership of my TDW-II/UPS working examples.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want me to remove the minimal support for UPS CFIND from qrscp and will still approve the changes for findscu, I will create a new PR and cancel this one.

Your first statement that this is legitimate and happens commonly is enough for me, especially with the additional abilities available soon. As to whether in your own repo, or contributed here, I'll let @mrbean-bremen comment on that one, I don't know enough to have an opinion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome.
There are a handful of RT 3rd party vendors eager to see the example of a findscu that supports UPS. Having this in the main (master) branch will make it easier for them.
Thank you

@mrbean-bremen
Copy link
Member

If you want me to remove the minimal support for UPS CFIND from qrscp and will still approve the changes for findscu, I will create a new PR and cancel this one.

I'm fine with this - while I'm also not an expert in DICOM communication, I think it is a good addition - thank you!

@mrbean-bremen mrbean-bremen merged commit a5beba7 into pydicom:master Jun 23, 2023
12 checks passed
@sjswerdloff
Copy link
Contributor Author

If you want me to remove the minimal support for UPS CFIND from qrscp and will still approve the changes for findscu, I will create a new PR and cancel this one.

I'm fine with this - while I'm also not an expert in DICOM communication, I think it is a good addition - thank you!

WooHoo!

@sjswerdloff sjswerdloff deleted the add_ups_mwl_to_qrscp branch June 24, 2023 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants