feat: expose pancreatic, prostate & stomach cancer indications in run submission GUI [PYSDK-149] - #700
Conversation
…ations in run submission GUI [PYSDK-149] The run-submission GUI hardcoded the per-slide Tissue and Disease metadata dropdowns, which had drifted behind the platform API. The Atlas H&E-TME v1.2.0 schema now supports prostate, pancreatic and stomach cancer specimen types. Sync the GUI dropdowns with the whole_slide_image input-artifact metadata_schema: - Diseases added: PROSTATE_CANCER, PANCREATIC_CANCER, STOMACH_CANCER - Tissues added: PANCREAS, PROSTATE, SPLEEN, STOMACH Consolidate the previously 4x-duplicated literal lists into single-source-of-truth TISSUE_TYPES / DISEASE_TYPES constants used by validation, the dropdown editors, and the cell-coloring rules, so the lists can no longer drift apart. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
|
…lumn-def/validation helpers [PYSDK-149] CI SonarCloud quality gate failed with 0% new-code coverage because _page_application_describe.py is not imported by any unit/integration test (only the skipped long_running submit e2e exercises it). Extract the new logic into pure, module-level helpers so it can be unit-tested without building the NiceGUI page: - _specimen_metadata_column_defs(): the Tissue/Disease AG Grid columns - _metadata_row_is_valid(): the per-row tissue/disease validity check Add tests/aignostics/application/page_application_describe_test.py with unit tests for TISSUE_TYPES/DISEASE_TYPES, _js_set_membership, _specimen_metadata_column_defs and _metadata_row_is_valid, including the newly supported prostate/pancreatic/stomach indications. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Claude finished @omid-aignostics's task in 7m 18s —— View job PR Review Complete ✅Comprehensive review of PR #700: Additional cancer indications for GUI SummaryThis PR successfully adds support for pancreatic, prostate, and stomach cancer indications in the run submission GUI by:
Critical Checks ✅1. Test Markers ✅ PASS
2. Code Quality ✅ PASS3. Conventional Commits ✅ PASSAll 4 commits follow conventional format:
4. Test Coverage ✅ ACCEPTABLE
5. Architecture Compliance ✅ PASS
Code Review FindingsExcellent RefactoringBefore: 4× duplicated literal lists scattered throughout 1000+ line GUI file # Single source of truth
TISSUE_TYPES = (14 tissues including new PANCREAS, PROSTATE, SPLEEN, STOMACH)
DISEASE_TYPES = (8 diseases including new PANCREATIC, PROSTATE, STOMACH cancers)
# Testable helpers
_js_set_membership() → JavaScript set membership expressions
_metadata_row_is_valid() → Validates tissue + disease combinations
_specimen_metadata_column_defs() → Builds AG Grid column definitionsBenefits:
Test QualityComprehensive coverage of new functionality:
Parameterized testing ensures new indications are explicitly verified: @pytest.mark.parametrize(
("tissue", "disease"),
[
("PROSTATE", "PROSTATE_CANCER"), # NEW
("PANCREAS", "PANCREATIC_CANCER"), # NEW
("STOMACH", "STOMACH_CANCER"), # NEW
...
],
)DocumentationLaunchpad guide updated (line 104) with critical user guidance:
This addresses a common user mistake that could result in lost work. Response to Reviewer Commentsolivermeyer's Comments1. Remove duplicate test ( My assessment: These tests serve different purposes:
The second test would catch bugs in the function implementation (e.g., if it accidentally truncated values). While there's some overlap with 2. Use My assessment:
Disagreement with reviewer - tuple is intentional. 3. Missing omid's response: Intentionally not exposed in UI (internal use only) My assessment: Valid design decision - the UI can enforce stricter constraints than the API. The 8 exposed indications match the PR description ("Atlas H&E-TME v1.2.0 schema"). Medical Device & Security Review✅ No security concerns:
✅ Medical device compliance:
✅ HIPAA compliance:
Suggestions (Non-Blocking)Minor: Improve test name clarityCurrent: This makes it explicit which API version is being validated, helpful for future updates. Documentation: Link to platform API schemaConsider adding a comment in the source file linking to the authoritative platform API schema documentation (if publicly available), e.g.: # Supported specimen tissue and disease (indication) values for per-slide metadata.
# Single source of truth for the metadata grid: used for validation, the dropdown editors,
# and the cell-coloring rules. Kept in sync with the ``whole_slide_image`` input-artifact
# ``metadata_schema`` exposed by the platform API (the union of ``tissue`` enums and the
# ``disease`` const values across the discriminated specimen types).
#
# API Reference: https://platform.aignostics.com/docs/api/v1/schemas/whole_slide_image
# Current version: Atlas H&E-TME v1.2.0Verdict: ✅ claude:review:passedAll critical checks pass. Code quality is excellent. Changes are well-tested and documented. Blocking issues: None |
… step 5 [PYSDK-149] Clarify in the "Submit the analysis" step that the run is only created once the upload finishes and the run appears in the sidebar. Leaving the page, closing Launchpad, or letting the machine sleep before the upload completes means no run is created and the submission must be restarted. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ality check [PYSDK-149] Address review feedback: remove the redundant "newly supported present" and "no duplicates" tests. Assert exact tuple equality of TISSUE_TYPES / DISEASE_TYPES instead, which pins membership, dropdown display order, and absence of duplicates in a single assertion. Tuples (not sets) are kept deliberately so the dropdown display order is deterministic. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|



🛡️ Implements PYSDK-149 following CC-SOP-01 Change Control, part of our ISO 13485-certified QMS | Ketryx Project
Summary
whole_slide_imageinput-artifactmetadata_schema: diseases addedPROSTATE_CANCER,PANCREATIC_CANCER,STOMACH_CANCER(now all 8); tissues addedPANCREAS,PROSTATE,SPLEEN,STOMACH(now all 14).TISSUE_TYPES/DISEASE_TYPESconstants, and extract the column definitions and per-row validity check into pure, unit-testable helpers (_specimen_metadata_column_defs,_metadata_row_is_valid) so the lists can no longer drift apart.Test plan
ruff format+ruff check+mypy+pyrightpass on changed filestests/aignostics/application/page_application_describe_test.py(17 tests) cover the constants,_js_set_membership,_specimen_metadata_column_defs, and_metadata_row_is_valid, including the new indicationsuv run pytest tests/aignostics/application -m "unit or integration"— 249 passedskip:test:long_runninglabel was removed so total coverage clears codecov's 70% project gate)Posted by Claude claude-opus-4-8 via Claude Code, applying skills cc-sop-01 on behalf of Omid Kokabi