Unified study history endpoint: GET /studies/{id}/history (deferred from #54)
Purpose
Server-side unified history timeline endpoint, deferred from #54 (closed) (§6.5) to keep the agentic-coding dry run focused. In the current #54 (closed) implementation, clients assemble the study timeline client-side from the worklist item's Meta (reserved keys ReviewHistory, RequestedProcedure, PerformedProcedure) merged with the existing comments API. This issue promotes that merge to a first-class server endpoint.
Specification (carried over from #54 (closed) §6.5)
GET .../studies/{id}/history → merged, chronologically ordered entries of kinds:
-
status— fromReviewHistory(including the creation entry), with linked note viaCommentUID -
procedure_requested/procedure_performed— from the reserved procedure keys -
comment— free-standing study comments
ACL-gated with the same policy as the rest of the study drawer (NFR-5 in #54 (closed)).
Implementation notes
- Route registration follows the existing pattern in
sonador_orthanc/worklist/__init__.py(init_reviewer_worklist); view insonador_orthanc/worklist/web.py. - The client contract must match the shape the viewer's client-side merge produces (see the Study Drawer thread on #54 (closed)), so the drawer can switch to the endpoint without UI changes — keep the merge logic isolated in the viewer's
logic.jsfor an easy swap. - De-duplication: comments referenced by a
ReviewHistoryentry'sCommentUIDrender inside that transition entry, not as free-standing comments.
Dependencies
Requires the #54 (closed) server MR (reserved keys + ReviewHistory) to be merged first.