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

Add a separate queue for querying PACS #503

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

p-j-smith
Copy link
Contributor

@p-j-smith p-j-smith commented Sep 30, 2024

Description

Fixes https://github.com/SAFEHR-data/the-rolling-skeleton/issues/416

  • add a second queue (_imaging_secondary) for querying PACS
  • messages processed by the existing imaging queue will only query the VNA. If a study is not available in the VNA, the corresponding message will be published to the new secondary imaging queue
  • messages are only processed by the secondary imaging queue outside of working hours (as we don't want to query PACS during working hours)

Type of change

Please delete options accordingly to the description.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Suggested Checklist

  • I have performed a self-review of my own code.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have passed on my local host device. (see further details at the CONTRIBUTING document)
  • Make sure your branch is up-to-date with main branch. See CONTRIBUTING for a general example to syncronise your branch with the main branch.
  • I have requested PR review to UCLH-Foundtry/arc-dev
  • I have adddressed and marked as resolved all the review comments in my PR.
  • Finally, I have selected squash and merge

Also add a PixlOutOfHoursError that is raised by the pacs queue when out of hours
…PrimaryArchiveError error

The consumer then sends the message to the secondary imaging queue.
Only process messages in the secondary imaging queue outside of working hours. During working hours, re-queue the message
@p-j-smith p-j-smith requested a review from a team September 30, 2024 08:15
Copy link

codecov bot commented Sep 30, 2024

Codecov Report

Attention: Patch coverage is 66.19718% with 24 lines in your changes missing coverage. Please review.

Project coverage is 87.31%. Comparing base (c7f42c7) to head (59bc5c3).

Files with missing lines Patch % Lines
pixl_core/src/core/patient_queue/subscriber.py 28.57% 10 Missing ⚠️
pixl_imaging/src/pixl_imaging/main.py 0.00% 8 Missing ⚠️
cli/src/pixl_cli/_message_processing.py 20.00% 4 Missing ⚠️
pixl_imaging/src/pixl_imaging/_processing.py 92.85% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #503      +/-   ##
==========================================
- Coverage   87.78%   87.31%   -0.48%     
==========================================
  Files          76       76              
  Lines        3415     3438      +23     
==========================================
+ Hits         2998     3002       +4     
- Misses        417      436      +19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@stefpiatek stefpiatek left a comment

Choose a reason for hiding this comment

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

Some of this may be outdated because I thought I submitted 🤦🏻

pixl_core/src/core/patient_queue/subscriber.py Outdated Show resolved Hide resolved
pixl_core/src/core/token_buffer/tokens.py Show resolved Hide resolved
pixl_imaging/src/pixl_imaging/_processing.py Outdated Show resolved Hide resolved
pixl_imaging/src/pixl_imaging/_processing.py Show resolved Hide resolved
pixl_imaging/src/pixl_imaging/main.py Outdated Show resolved Hide resolved
@stefpiatek
Copy link
Contributor

Oh also its worth checking the checklist in https://github.com/SAFEHR-data/the-rolling-skeleton/issues/416 to make sure that we've covered all of that

Copy link
Contributor

@stefpiatek stefpiatek left a comment

Choose a reason for hiding this comment

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

Looking good, would be nice to do set off a run overnight tonight to check that it successfuly runs through both queues still (no need to take volumes down)

Comment on lines +73 to +74
"imaging-primary": "imaging_api",
"imaging-secondary": "imaging_api",
Copy link
Contributor

Choose a reason for hiding this comment

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

oooh this is nice

Comment on lines 123 to 127
# We don't want to modify the queues we're populating, but if we're populating imaging-primary
# we also need to wait for imaging-secondary to be empty
queues_to_count = queues_to_populate.copy()
if "imaging-primary" in queues_to_populate and "imaging-secondary" not in queues_to_populate:
queues_to_count.append("imaging-secondary")
Copy link
Contributor

Choose a reason for hiding this comment

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

could make just make this a set and then add it to it without checking?

@p-j-smith
Copy link
Contributor Author

Looking good, would be nice to do set off a run overnight tonight to check that it successfuly runs through both queues still (no need to take volumes down)

yeah good shout - I've set it running on pixl_test

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.

2 participants