Skip to content

Commit 6c1e049

Browse files
committed
Use relay message status in response
We don't want to replay the status we've set on the worklist item, we want a message status from the gateway so we can update the GatewayAction used in this relay communication.
1 parent 0d6706a commit 6c1e049

5 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/services/mwl/update_worklist_item_status.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def call(self, payload: dict):
1717
if updated_item is None:
1818
return {"status": "error", "message": f"Worklist item '{accession_number}' not found"}
1919

20-
return {"accession_number": accession_number, "status": status}
20+
return {"accession_number": accession_number, "status": "confirmed"}
2121
except KeyError as e:
2222
return {"status": "error", "message": f"Missing key: {e}"}
2323
except Exception as e:

src/services/storage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ def update_status(
463463
Transition a worklist item to a new status, enforcing valid state transitions.
464464
465465
Args:
466-
accession_number: The accession number to update
466+
accession_number: The accession number of the worklist item to update
467467
status: Target status
468468
mpps_instance_uid: Optional MPPS instance UID
469469

tests/integration/test_relay_listener_processes_actions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ async def test_relay_listener_updates_worklist_item_status(self, update_payload,
5656
with fake_relay(relay_message, json.dumps(update_payload)) as ws_client:
5757
await listener.listen()
5858

59-
ws_client.send.assert_called_once_with(json.dumps({"accession_number": "ACC999999", "status": "IN PROGRESS"}))
59+
ws_client.send.assert_called_once_with(json.dumps({"accession_number": "ACC999999", "status": "confirmed"}))
6060
stored_items = storage.find_worklist_items()
6161
assert len(stored_items) == 1
6262
item = stored_items[0]

tests/services/mwl/test_update_worklist_item_status.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def test_call_success(self, mwl_storage, worklist_item_data, status_update_paylo
4141

4242
subject = UpdateWorklistItemStatus(mwl_storage)
4343
response = subject.call(status_update_payload)
44-
assert response == {"accession_number": "ACC123", "status": "COMPLETED"}
44+
assert response == {"accession_number": "ACC123", "status": "confirmed"}
4545

4646
def test_call_missing_keys(self, mwl_storage, status_update_payload):
4747
subject = UpdateWorklistItemStatus(mwl_storage)

tests/test_relay_listener.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def test_process_update_item_status_action(self, storage_instance, listener_payl
105105
}
106106

107107
response = subject.process_action(update_payload)
108-
assert response == {"accession_number": "ACC999999", "status": "IN PROGRESS"}
108+
assert response == {"accession_number": "ACC999999", "status": "confirmed"}
109109

110110
storage_instance.update_status.assert_called_once_with("ACC999999", "IN PROGRESS")
111111

0 commit comments

Comments
 (0)