Skip to content

Slides on the patient Summary timeline: backend (slide timing) - #13

Closed
raylim wants to merge 9 commits into
codex/wsi-resource-datafrom
codex/wsi-summary-timeline
Closed

raylim wants to merge 9 commits into
codex/wsi-resource-datafrom
codex/wsi-summary-timeline

Conversation

@raylim

@raylim raylim commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

Slides on the patient Summary timeline: backend (slide timing). Draft. Stacked on the WSI foundation, cBioPortal#12378 (wsi-serving-v6), which should be reviewed and land first.

Layer PR
Core raylim/cbioportal-core#5
Frontend raylim/cbioportal-frontend#28

Rebuilt on the v6 foundation on 2026-10-08. On 2026-10-12 the foundation head e4073d9 was merged in (migration 3.8.0: entity_type renamed to resource_scope, type dropped, Int64 key; the WSI mappers filter on resource_id only). The hierarchy reads timing from resource_data metadata and uses neither type nor entity_type. The branch adds timing:

  • Hierarchy response: a slide's optional timing keys in resource_data metadata (timeline_start_days, timeline_date_status|kind|source|reason, timeline_coordinate_system, timepoint_source) come back as procedureDateDays, procedureDateStatus|Kind|Source|Reason, procedureCoordinateSystem and timepointSource.
  • Optional per slide: a slide without timing keys gets nulls. A slide with any timing key must carry a complete, consistent set (the earlier validateTiming rules); otherwise that patient's hierarchy request fails.
  • No table and no migration. Timing lives in resource_data. wsi_slide_timing stays dropped (3.7.0), and 3.4.0 remains a reserved no-op. db.version is the foundation's 3.8.0.
  • Docs: File-Formats lists the optional timing keys and the converter behaviour (validated and written when the file has timing columns). The ClickHouse README describes the hierarchy timing fields.

Out of scope: slide counts. The WSI slide-count clinical attributes, including WSI_PATIENT_UNDATED_SLIDE_COUNT, are not part of this PR. They are in raylim/cbioportal-core#6 and #15. A small follow-up will add WSI_PATIENT_UNDATED_SLIDE_COUNT once core #5 and core #6 land.

Tests: 159 targeted tests pass (Wsi*Test, ClickhouseWsi*Test, ClickhouseResourceData*Test, SchemaVersion*Test, SchemaParityTest). Timed, untimed, mixed and undated slides are accepted. Partial and inconsistent sets are rejected.

🤖 Generated with Claude Code

Restores slide timing (procedure dates, timepoint source and their
validation) that moved out of the WSI foundation, as the starting point
for showing slides on the patient Summary timeline.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
raylim and others added 2 commits October 8, 2026 12:34
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
raylim and others added 3 commits October 8, 2026 16:52
Takes codex/wsi-resource-data (9809b89) as-is: the earlier revert of the
slide-timing move predates sealed sources (format v4, migration 3.7.0) and is
replaced by a fresh timing change on top.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
For slides on the patient Summary timeline: the hierarchy reads the optional timing keys from a slide's resource metadata (timeline_start_days, timeline_date_*, timeline_coordinate_system, timepoint_source) and returns them as procedureDate*/timepointSource. A slide without timing keys gets nulls; a slide with timing keys is validated as before. Timing stays in resource_data: no table, no migration.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Matches raylim/cbioportal-core#5. Migration 3.4.0's description now just
says it is reserved: slide timing lives in resource_data and needs no
table.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
raylim added a commit to raylim/cbioportal-core that referenced this pull request Oct 8, 2026
The portal's hierarchy (raylim/cbioportal#13) rejects a timed slide without
timepoint_source, so the resource validator now does too. The legacy WSI
file may still leave TIMEPOINT_SOURCE blank; the converter derives it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
raylim and others added 3 commits October 12, 2026 12:28
…to the timeline branch

Brings in the backend foundation e4073d9 (migration 3.8.0, WSI mappers
filtering on resource_id only). Conflicts:

- clickhouse_data.sql: the WSI fixtures take the foundation's shape
  (resource_scope, no type column). The foundation stripped the timing keys
  from them; the timed (900101), legacy (900104) and undated (900102) rows get
  their timeline_*/timepoint_source keys back, and 900201 stays timing-free.
- ClickhouseWsiHierarchyMapperTest: keeps the timing assertions and the
  null-timing test; drops readsEmptyHierarchyPayload with the foundation's
  removed duplicate empty-hierarchy fixture; the forbidden-key list follows the
  foundation (partDesignator/pathDxTitle dropped) plus raw timeline keys.
- clickhouse README: the foundation's wording without type, plus the optional
  timing keys.

File-Formats.md no longer mentions WSI_PATIENT_UNDATED_SLIDE_COUNT: slide
counts are out of scope here and come in a follow-up.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… no migration 3.8.0)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…into the Summary timeline

Conflicts:
- The hierarchy repository takes stringValue() and the SLIDE_KEY-derived key patterns. The timing reads now use stringValue() as well.
- The 900104 fixture row and the part_designator test are gone. The timed 900101 row stays.
- The README takes the shorter WSI intro (mentioning the optional timing keys) and keeps the slide-timing note.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@raylim

raylim commented Oct 13, 2026

Copy link
Copy Markdown
Owner Author

Closing: slide timing now lives only in the pdm pathology timeline file, imported as PATHOLOGY SLIDES clinical events (pathology-data-mining/pdm_databricks_pipelines#48). The slide hierarchy and resource metadata stay timing-free, so this PR is no longer needed. The Summary timeline track (raylim/cbioportal-frontend#28) is built from those clinical events.

🤖 Generated with Claude Code

@raylim raylim closed this Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant