Conversation
A worklist item is created in a scheduled state. If no C-STORE operation occurs the worklist items does not transition to in progress. This prevents an appointment/item being discontinued before any images are stored. This commit eases the transition rules to allow multiple 'from' states. Specifically that scheduled and in progress worklist items can be discontinued.
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Add storage-level regression coverage for scheduled-to-discontinued updates.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
What changed in this PR
Allows scheduled worklist items to transition directly to discontinued.
Changes:
- Supports multiple valid source states.
- Updates SQL status filtering.
- Adds transition tests and SQLite connection cleanup.
| File | Summary |
|---|---|
tests/services/test_storage.py |
Updates storage test setup and connection cleanup. |
tests/services/mwl/test_mwl_status_manager.py |
Tests transition mappings and validation. |
src/services/storage.py |
Applies multi-state transition updates. |
src/services/mwl/__init__.py |
Allows scheduled items to become discontinued. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
|
Looks good. Shall we ticket up a SCHEDULED → COMPLETED transition to go along with Rubie's "switch to manual" functionality? |
| MWLStatus.COMPLETED: MWLStatus.IN_PROGRESS, | ||
| MWLStatus.DISCONTINUED: MWLStatus.IN_PROGRESS, | ||
| REVERSED_TRANSITIONS = { | ||
| MWLStatus.IN_PROGRESS: [MWLStatus.SCHEDULED], |
Contributor
There was a problem hiding this comment.
Suggested change
| MWLStatus.IN_PROGRESS: [MWLStatus.SCHEDULED], | |
| MWLStatus.IN_PROGRESS: [MWLStatus.SCHEDULED, IN_PROGRESS], |
if we want same-state idempotency for an N-CREATE of the future
steventux
deleted the
allow-discontinued-state-transition-for-scheduled-worklist-items
branch
September 22, 2026 14:22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Description
Allow scheduled worklist items to be discontinued.
A worklist item is created in a scheduled state. If no C-STORE operation occurs the worklist item does not transition to in progress.
This prevents an appointment being discontinued before any images are stored. The real world case here is a failed identity check.
This PR eases the transition rules to allow multiple 'from' states. Specifically that scheduled and in progress worklist items can transition discontinued.
Jira link
https://nhsd-jira.digital.nhs.uk/browse/DTOSS-12567
Review notes
Review checklist