Functional tests for worklist Requested/Performed Procedure capture and per-transition review history

Functional test coverage for the worklist enhancements of orthanc-sonador#54 (closed) (structured Requested/Performed Procedure + per-transition review history), completing the testing checklist there per the worklist testing plan in imaging-development-env#87.

Server implementation under test: orthanc-sonador!54 (merged). Client counterpart: oak-tree/medical-imaging/ohif-viewers!58.

What's included

New suite tests/tests_ext_worklist_procedures.py (SonadorWorklistProcedureHistoryTests, registered in tests/__init__.py), covering:

Procedure capture & validation (FR-1/FR-2/FR-3)

  • test_requested_procedure_capture — fully populated Requested Procedure (ID, description, coded sequence, priority, reason) round-trips through Meta with server-side RequestedBy/RequestedDateTime attribution; creation seeds exactly one ReviewHistory entry attributed to the same user.
  • test_procedure_facets_description_or_code — FR-3: description-only Requested Procedure and code-only Performed Procedure are both accepted as first-class.
  • test_procedure_validation_rejected — malformed blocks return 400 and leave the item unmodified: empty facet, ID-only facet (no content-bearing attribute), unknown facet, unknown attribute within a facet, and a malformed Code Sequence item (missing CodeValue).

Review history (FR-4/FR-5/FR-6)

  • test_review_history_full_arc / test_review_history_full_arc_dicomweb — the full arc as a limited (non-admin) user over both the standard and DICOMweb endpoint families: request (with Requested Procedure) → in-progress (with note) → complete (with Performed Procedure + note). Verifies one entry per transition plus the creation entry, the PreviousState/State chain, chronological ordering, actor attribution, and that notes link via CommentUID and resolve through the comments API.
  • test_comment_only_update_appends_history — a note without a state change still appends a linked history entry.

Namespace protection & state locks (FR-7)

  • test_meta_reserved_keys_protected — forged RequestedProcedure/PerformedProcedure/ReviewHistory values submitted through the general Meta channel are stripped while free-form client Meta keys round-trip; server-owned values survive.
  • test_cancelled_with_note_locked — cancellation records the transition + linked note; the locked item then rejects both state changes and procedure writes (exercising the repaired completed/cancelled validation path).

ACL parity (NFR-5)

  • test_history_acl_parity — a user with local View can read the item including its procedure/history Meta; without local Modify, state transitions and procedure writes are denied with 403.

Notes

  • The rejection suite caught a latent server bug: pydantic loc tuples for list-item errors contain integer indices, which crashed the plugin's validation-error formatter and surfaced a 500 instead of a 400. Fixed in orthanc-sonador!54 (merged) (validation/base.py, commit bbcec21).
  • Requires the orthanc-sonador!54 (merged) plugin build; run with python ftests.py -T tests.tests_ext_worklist_procedures.
Edited by Sonador Claude

Merge request reports

Loading