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 throughMetawith server-sideRequestedBy/RequestedDateTimeattribution; creation seeds exactly oneReviewHistoryentry 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 (missingCodeValue).
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, thePreviousState/Statechain, chronological ordering, actor attribution, and that notes link viaCommentUIDand 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— forgedRequestedProcedure/PerformedProcedure/ReviewHistoryvalues submitted through the generalMetachannel are stripped while free-form clientMetakeys 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 localViewcan read the item including its procedure/historyMeta; without localModify, state transitions and procedure writes are denied with 403.
Notes
- The rejection suite caught a latent server bug: pydantic
loctuples 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