Merged
Conversation
…ated all endpoints
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces USDM JSON generation for activities and study cells, along with supporting database migrations and UI enhancements.
- Adds scripts to export USDM-compliant JSON for activities and study cells
- Implements database migrations for epoch_uid and activity label/description fields
- Enhances UI to support activity editing with label and description
Reviewed changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/usdm/generate_activities.py | Generates USDM Activity-Output JSON with biomedical concept references |
| src/usdm/generate_study_cells.py | Generates USDM StudyCells-Output JSON with arm/epoch/element relationships |
| src/soa_builder/web/utils.py | Adds concept_uid generation and table column checking utilities |
| src/soa_builder/web/routers/activities.py | Extends activity CRUD with label/description, adds UI form handlers |
| src/soa_builder/web/routers/epochs.py | Adds epoch_uid generation and backfills for USDM compliance |
| src/soa_builder/web/migrate_database.py | Adds epoch_uid migration with unique indexing |
| src/soa_builder/web/initialize_database.py | Updates schema to include activity label/description and concept_uid columns |
| src/soa_builder/web/app.py | Integrates migrations, updates freeze/rollback logic for new schema fields |
| src/soa_builder/web/templates/edit.html | Adds inline editing forms for activity properties |
| src/soa_builder/web/schemas.py | Adds optional label/description fields to ActivityCreate/Update |
| tests/test_study_cell_uid_reuse.py | Tests that study_cell_uid is reused for same arm/epoch combinations |
| tests/test_study_cell_uid_reuse_later.py | Tests that study_cell_uid is reused when elements are added later |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/usdm/generate_activities.py
Outdated
| rows = cur.fetchall() | ||
| conn.close() | ||
| bc_uids = [r[0] for r in rows] or [] | ||
| print(bc_uids) |
There was a problem hiding this comment.
Debug print statement should be removed from production code. This will output to stdout during normal execution, potentially interfering with the JSON output when using stdout mode.
Suggested change
| print(bc_uids) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added scripts to generate the 'activities' and 'studyCells' entities in the USDM JSON format.