Skip to content

Create worklist item in progress - #237

Closed
steventux wants to merge 5 commits into
mainfrom
update-worklist-item-to-in-progress-in-service-class
Closed

steventux wants to merge 5 commits into
mainfrom
update-worklist-item-to-in-progress-in-service-class

Conversation

@steventux

@steventux steventux commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR changes the default status of a worklist item to IN PROGRESS on creation.
This de-couples the C-STORE operation from worklist status update.

We originally updated from C-STORE as a commonly used workaround when a modality does not make MPPS N-CREATE and N-SET operations on the worklist.

This reflects the point in the Rubie appointment workflow where the appointment starts with the benefit that all workflow transitions are now initiated by Rubie and not a side effect of a modality operation.

This also has the benefit of being able to discontinue items which never received any images from the modality. There is currently a bug preventing this update if no images were stored.

We should be able to discontinue a worklist item when an identity check fails before any screening takes place.

Jira link

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

Review notes

Review checklist

  • Check database queries are correctly scoped to current_provider

Helps us to track the status changes for a worklist item.
Moving the status update for a worklist item to the service class which creates the item de-couples the C-STORE operation from worklist state transitions. This is a commonly used workaround when a modality does not make MPPS N-CREATE and N-SET operations on the worklist. The update now occurs as soon as the item is created. This reflects the point in the Rubie appointment workflow where the appointment starts, the immediate transition to IN PROGRESS makes sense. This also has the benefit of being able to DISCONTINUE items which never received any images from the modality. There is a case for this where an identity check may fail and no screening takes place.

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.

Copilot review overview

🟡 Changes recommended

Fix the invalid exception syntax and make status advancement retry-safe.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity · 1 Medium severity · 1 Low severity

Open (3)
What changed in this PR

Moves the worklist status transition from C-STORE handling into worklist item creation.

Changes:

  • Marks newly created items as IN PROGRESS.
  • Removes C-STORE status updates.
  • Updates related tests and logging.
File Summary
tests/​test_relay_listener.py Updates status-action expectations.
tests/​services/​mwl/​test_create_worklist_item.py Tests creation-time status behavior; contains a documentation typo.
tests/​services/​dicom/​test_c_store.py Removes obsolete status tests.
tests/​integration/​test_relay_listener_processes_actions.py Verifies created item status.
tests/​integration/​test_c_store_saves_metadata.py Removes obsolete integration coverage.
src/​services/​storage.py Adjusts query formatting.
src/​services/​mwl/​create_worklist_item.py Adds the status transition; retry behavior can leave items permanently scheduled.
src/​services/​mwl/​__init__.py Adds transition logging; contains invalid Python exception syntax preventing import.
src/​services/​dicom/​c_store.py Removes C-STORE status updates.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/services/mwl/__init__.py
Comment thread src/services/mwl/create_worklist_item.py Outdated
Comment thread tests/services/mwl/test_create_worklist_item.py Outdated
@steventux steventux changed the title Update worklist item to in progress in service class Create worklist item in progress Sep 22, 2026
@steventux

Copy link
Copy Markdown
Contributor Author

Closing in favour of another approach, making status changes more flexible with allow us to preserve MPPS N-CREATE compatibility.

@steventux steventux closed this Sep 22, 2026
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