Skip to content

Accept worklist.create_test_item actions and process with Modality Emulator - #162

Merged
steventux merged 4 commits into
mainfrom
DTOSS-13119-accept-worklist-create-test-item
Jul 20, 2026
Merged

Accept worklist.create_test_item actions and process with Modality Emulator#162
steventux merged 4 commits into
mainfrom
DTOSS-13119-accept-worklist-create-test-item

Conversation

@steventux

@steventux steventux commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Description

Counterpart of https://github.com/NHSDigital/dtos-manage-breast-screening/pull/1728

This PR amends the relay listener so that it can accept test worklist items sent from Manage.
The test items are used to verify that we have relay connectivity, have a working gateway and are able to accept emulated dicom images via the manage API.

Relay listener is modified to identify a specific type of gateway action, it saves the test worklist item to the worklist db. then invokes the modality emulator's process_worklist_items function immediately to emulate storing to PACS and uploading resulting dicom files to the Manage API.

Jira link

https://nhsd-jira.digital.nhs.uk/browse/DTOSS-13119

Review notes

Review checklist

  • Check database queries are correctly scoped to current_provider

@steventux steventux changed the title Accept worklist.create_test_item actions and process with Modality Em… Accept worklist.create_test_item actions and process with Modality Emulator Jul 8, 2026
@steventux
steventux force-pushed the DTOSS-13119-accept-worklist-create-test-item branch 2 times, most recently from 25ba8fd to e1a112b Compare July 14, 2026 14:09
…ulator

Processes test worklist items immediately sending emulated DICOM files
with sample images via the uploader.
@steventux
steventux force-pushed the DTOSS-13119-accept-worklist-create-test-item branch from e1a112b to acc6109 Compare July 14, 2026 15:14
@steventux
steventux marked this pull request as ready for review July 14, 2026 15:21
@steventux
steventux requested a review from Copilot July 14, 2026 15:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Enables the gateway’s relay listener to accept a new worklist.create_test_item action (sent from Manage) and trigger the Modality Emulator to process the created worklist item(s), with support for passing a patient name into the MWL C-FIND query.

Changes:

  • Added handling for worklist.create_test_item in RelayListener, including invoking Modality Emulator processing.
  • Updated ModalityEmulator to accept an optional patient_name and include it in the C-FIND dataset.
  • Added/updated unit tests covering the new action and the new patient-name filtering behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/relay_listener.py Adds worklist.create_test_item handling and a helper to run Modality Emulator processing.
src/modality_emulator.py Extends MWL query generation to optionally filter by PatientName.
tests/test_relay_listener.py Adds coverage asserting worklist.create_test_item triggers Modality Emulator invocation.
tests/test_modality_emulator.py Adds coverage asserting patient_name is forwarded into c_find_dataset.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/relay_listener.py Outdated
Comment thread tests/test_relay_listener.py Outdated
Comment thread src/relay_listener.py
steventux and others added 2 commits July 14, 2026 16:41
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@steventux
steventux force-pushed the DTOSS-13119-accept-worklist-create-test-item branch from ee3c5ed to 51480a0 Compare July 14, 2026 15:56
@steventux
steventux requested a review from carlosmartinez July 16, 2026 09:30
Comment thread src/relay_listener.py
carlosmartinez
carlosmartinez previously approved these changes Jul 16, 2026

@carlosmartinez carlosmartinez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks great

@steventux
steventux force-pushed the DTOSS-13119-accept-worklist-create-test-item branch from 403c0b5 to 976fe38 Compare July 20, 2026 09:51
Safeguard against accidentally processing items without a patient name in the C-FIND criteria. This ensures processing test items are correctly scoped.
@steventux
steventux force-pushed the DTOSS-13119-accept-worklist-create-test-item branch from 976fe38 to cfb9072 Compare July 20, 2026 09:53
@steventux
steventux requested a review from carlosmartinez July 20, 2026 10:17
@steventux
steventux merged commit 0fb0417 into main Jul 20, 2026
9 checks passed
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