Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
9d32942
Added enrollments, geographicScipes, dateValue to amendments
pendingintent May 28, 2026
b4d7e86
Aligned UI partial HTMX
pendingintent May 28, 2026
0bcb8d1
Geographic scopes now include Region and Country Codes
pendingintent May 28, 2026
8ba0469
Extended diff report to cover all USDM entities created in the SOA Wo…
pendingintent May 29, 2026
4fb277d
Added HTML report export for the SOA Matrix
pendingintent May 29, 2026
a980bd1
Merge branch 'pendingintent-extend-diff-report' into release-v-1.4
pendingintent May 29, 2026
0b75080
Merge branch 'pendingintent-add-html-matrix' into release-v-1.4
pendingintent May 29, 2026
1a23226
Added TDD Viewer to display TDD in UI
pendingintent May 29, 2026
5f5ab3a
Renamed the function and added to generate extensionAttribute for ass…
pendingintent May 29, 2026
4393283
Added SOA delete functionality
pendingintent May 29, 2026
85b70b7
Added extensionAttribute to BiomedicalConcept to support DSS
pendingintent May 29, 2026
d390579
Merge branch 'pendingintent-delete-soa-function' into release-v-1.4
pendingintent May 29, 2026
fe391ef
Added versions.titles
pendingintent May 29, 2026
ad528a8
Added organizations feature to the Workbench and USDM generator
pendingintent May 29, 2026
9505d10
Added Organizations entity with full USDM output
pendingintent May 29, 2026
3444e57
Set USDM systemVersion to current git branch name
pendingintent May 29, 2026
87a8656
Normalize release-v- branch prefix in USDM systemVersion
pendingintent May 29, 2026
f53f329
Fix BCP data loss when API returns empty on populate
pendingintent May 29, 2026
b8117fa
Fix missing BCs in USDM output caused by broken code chains
pendingintent May 29, 2026
9b146e2
Added export/import soa functionality
pendingintent Jun 2, 2026
d850869
Added roles to study design and presented on the edit ui page
pendingintent Jun 2, 2026
9b5049c
Added studyInterventions to study design
pendingintent Jun 2, 2026
167197f
Added estimands
pendingintent Jun 2, 2026
872e087
Added indications to the estimand pages
pendingintent Jun 3, 2026
12be7f6
Added PersonName and AssignedPerson
pendingintent Jun 3, 2026
3782ecc
USDM generator will now populate roles.organizationIds or roles.assig…
pendingintent Jun 5, 2026
7414f0d
Fixed truncation of bc properties at startup and population script on…
pendingintent Jun 5, 2026
c2357b5
Fixed USDM study entity format; added rules for roles attribute format
pendingintent Jun 5, 2026
aa93318
Fixed USDM generation issues - codeSystem values and fallback to gene…
pendingintent Jun 5, 2026
316dffa
Added datetime suffix to systemVersion to help identify source workbe…
pendingintent Jun 5, 2026
51187f6
Limited to add only one studyIdentifier per study version
pendingintent Jun 8, 2026
de54c86
Added most recent USDM JSON files with systemVersion-datetime
pendingintent Jun 8, 2026
2148da9
_list_orgs function now joins the code table and filters to only orga…
pendingintent Jun 8, 2026
c71f4ce
Cleaning files, docs, help directory
pendingintent Jun 8, 2026
83b53fd
Created config.env file to manage all global, environmental variables
pendingintent Jun 8, 2026
538d8a1
index.html now includes message to indicate if CDISC API is available…
pendingintent Jun 9, 2026
0a48d88
Added checks for CORE rule DDF00190
pendingintent Jun 9, 2026
c69b0ce
Added .open class to replace .hover for the menu in the UI
pendingintent Jun 9, 2026
15e7998
Added feature to assign biomedical concept categor(ies) to an Activity
pendingintent Jun 10, 2026
5c8cb2d
Added report for biomedical concepts not assigned to any category
pendingintent Jun 10, 2026
85bd5e3
Fixed Dataset-JSON format to match version 1.1
pendingintent Jun 10, 2026
76819ae
Added define-json generation
pendingintent Jun 10, 2026
935c632
Improved Define-JSON generation and USDM systemVersion stamping
pendingintent Jun 11, 2026
0f38130
feat(crf): add CRF Specialization assignment and USDM export
pendingintent Jun 11, 2026
c3837b1
Includes CRF extensionAttributes
pendingintent Jun 11, 2026
9c29dfa
Merge branch 'pi-add-define-json' into pi-implement-crf-specializations
pendingintent Jun 12, 2026
446a80a
File no longer relevant
pendingintent Jun 12, 2026
f3701b2
feat(mcp): add MCP server with 11 tools for agent-driven SoA workflows
pendingintent Jun 12, 2026
177c8cf
fix(bc): clean up stale & mismatched BiomedicalConceptProperty respon…
pendingintent Jun 16, 2026
be0099b
docs: summarize BiomedicalConceptProperty response code cleanup
pendingintent Jun 17, 2026
9e21260
Fixed issue with orphaned response codes for BCs in all SOAs
pendingintent Jun 17, 2026
f877277
Additional files to support the development of the workbench
pendingintent Jun 17, 2026
31e8509
feat(define): populate Define-JSON concepts / conceptProperties (gap 4)
pendingintent Jun 17, 2026
6100ded
Created from the pi-enhance-define-json branch
pendingintent Jun 17, 2026
540ac7c
Added experimental tag
pendingintent Jun 18, 2026
8aa153b
Added ExtensionClass for SoA Workbench to track usdm generation
pendingintent Jun 18, 2026
b03362a
Latest JSON files generated with release v1.4
pendingintent Jun 18, 2026
abba38e
Removed release-* branch statement from the deployments.
pendingintent Jun 22, 2026
e02f9e2
Addressed CodeQL reports
pendingintent Jun 22, 2026
b90e577
Removed release-* branch statement from the deployments.
pendingintent Jun 22, 2026
f362f57
fix(test): restrict pytest collection to tests/ directory
pendingintent Jun 22, 2026
0e26f12
Delete files/D1_Master Protocol 2022-501050-11 redacted.pdf
pendingintent Jun 22, 2026
f1ba749
fix(security): address remaining CodeQL alerts
pendingintent Jun 22, 2026
f5fed68
Fix remaining CodeQL alerts: clear-text logging, SSRF, stack trace ex…
pendingintent Jun 22, 2026
14ba602
Fix remaining 3 CodeQL alerts: SSRF URL reconstruction, stack trace e…
pendingintent Jun 22, 2026
34b4739
Fix BCP datatype source and add validation tests (issue #218)
pendingintent Jun 22, 2026
c344df8
Replace MD5 with SHA-256 in _generate_hex_oid
pendingintent Jun 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/azure-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- master
- release-*
# - release-*
workflow_dispatch: #Allow manual triggers

permissions:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ files/pilot_LZZT_narrative_2026MAR10.json
.help
files/NCT01797120.pdf
.mcp.json
docs/*.md
./files/D1_Master\ Protocol\ 2022-501050-11\ redacted.pdf


# End of file
125 changes: 122 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,85 @@ Recommended: editable install for development.
> pre-commit run --all-files
```

## Configuration

All runtime settings are controlled through `config.env` in the project root.
The file is loaded automatically at startup via python-dotenv.

Edit `config.env` before starting the server:

```ini
# Server
SOA_BUILDER_HOST=0.0.0.0
SOA_BUILDER_PORT=8008

# Database (relative to working directory)
SOA_BUILDER_DB=soa_builder_web.db

# Logging — set to 1 for DEBUG output
SOA_BUILDER_DEBUG=0

# Output directory for normalized SOA files
SOA_BUILDER_NORMALIZED_ROOT=normalized

# CDISC Library Cosmos v2 API base URL
CDISC_BC_API_BASE_URL=https://api.library.cdisc.org/api/cosmos/v2

# Set to 1 to skip all remote CDISC Library API calls (offline mode)
CDISC_SKIP_REMOTE=0

# Cache TTL in seconds for all CDISC Library API responses (default: 1 hour)
SOA_BUILDER_CACHE_TTL=3600

# HTTP timeout in seconds for outbound CDISC Library API requests
CDISC_REQUEST_TIMEOUT=15

# Set to 0 to disable eager BCP property loading at startup
SOA_EAGER_BCP_POPULATION=1
```

> **CDISC API credentials** — `CDISC_API_KEY` and `CDISC_SUBSCRIPTION_KEY` are
> secrets and must **not** be placed in `config.env`. Set them in your shell
> environment instead:
>
> ```bash
> export CDISC_API_KEY=your-key-here
> ```
>
> The server will pick them up automatically via the process environment.

### Full settings reference

| Variable | Default | Description |
|---|---|---|
| `SOA_BUILDER_HOST` | `0.0.0.0` | IP address the server binds to |
| `SOA_BUILDER_PORT` | `8008` | TCP port the server listens on |
| `SOA_BUILDER_DB` | `soa_builder_web.db` | SQLite database file path |
| `SOA_BUILDER_DEBUG` | `0` | Set `1` for DEBUG-level logging |
| `SOA_BUILDER_NORMALIZED_ROOT` | `normalized` | Root dir for normalized SOA output |
| `CDISC_BC_API_BASE_URL` | `https://api.library.cdisc.org/api/cosmos/v2` | CDISC Cosmos v2 API base URL |
| `CDISC_SKIP_REMOTE` | `0` | Set `1` to skip remote CDISC API calls |
| `CDISC_CONCEPTS_JSON` | _(empty)_ | Override biomedical concepts (JSON file path or inline JSON) |
| `CDISC_SDTM_SPECIALIZATIONS_JSON` | _(empty)_ | Override SDTM specializations (JSON file path or inline JSON) |
| `SOA_BUILDER_CACHE_TTL` | `3600` | Cache TTL (seconds) for all CDISC API responses |
| `CDISC_REQUEST_TIMEOUT` | `15` | HTTP timeout (seconds) for CDISC Library API requests |
| `SOA_EAGER_BCP_POPULATION` | `1` | Set `0` to enable lazy BCP property loading |
| `CDISC_API_KEY` | _(shell env)_ | CDISC Library API key — set in shell, not `config.env` |
| `CDISC_SUBSCRIPTION_KEY` | _(shell env)_ | CDISC Library subscription key — set in shell, not `config.env` |

---

## Start web server
```bash
soa-builder-web # starts uvicorn on 0.0.0.0:8000 with reload
soa-builder-web # starts uvicorn on the host/port set in config.env
```

Or manually:
```bash
uvicorn soa_builder.web.app:app --reload --port 8000
uvicorn soa_builder.web.app:app --reload --port 8008
```
HTML UI:
- Open http://localhost:8000/ in a browser.
- Open http://localhost:8008/ in a browser (or the port set in `config.env`).
- Create a new Schedule of Activities for a study or access an existing one.
- When a study is chosen, additional navigation links are available in the navigation menu that are unique to the Study context.
- More options and parameters for configuring the USDM classes are available through these navigation links.
Expand Down Expand Up @@ -96,6 +164,57 @@ python -m usdm.generate_study_epochs 1 -o epochs.json

---

## MCP Server

The workbench ships an [MCP (Model Context Protocol)](https://modelcontextprotocol.io/) server that exposes SoA data as tools for Claude agents. This enables workflows such as "analyze this protocol PDF and populate the visit schedule" without copy-paste.

### Setup

The server is registered in `.mcp.json` and starts automatically when Claude Code loads the project. Confirm it is listed with `/mcp` in a Claude session.

The `soa-mcp` command is installed alongside `soa-builder-web`:

```bash
pip install -e .
soa-mcp # starts the MCP stdio server (for manual testing)
```

The server reads `SOA_BUILDER_DB` from the environment (falls back to `soa_builder_web.db`). No web server needs to be running — it accesses the SQLite database directly.

### Available Tools (11)

| Tool | Description |
|------|-------------|
| `list_soas` | List all Schedules of Activities |
| `create_soa` | Create a new SoA; returns `soa_id` |
| `get_soa` | Get SoA metadata by id |
| `list_visits` | List visit definitions ordered by `order_index` |
| `create_visit` | Add a visit (name, label, type) |
| `list_activities` | List activities ordered by `order_index` |
| `create_activity` | Add an activity (name, label, description) |
| `assign_instance_activity` | Mark an activity at a ScheduledActivityInstance; use `get_soa_matrix` for ids |
| `get_soa_matrix` | Return the visits × activities grid (instances, activities, cells) |
| `get_usdm_json` | Generate a USDM component as JSON (`full`, `encounters`, `activities`, `biomedical_concepts`, etc.) |
| `get_define_json` | Generate a Define-JSON document (requires `sdtmct` date and `CDISC_API_KEY`) |

### Configuration

The `.mcp.json` entry uses the absolute path to the venv console script:

```json
"soa-workbench": {
"command": "/path/to/.venv/bin/soa-mcp",
"args": [],
"env": {
"SOA_BUILDER_DB": "/path/to/soa_builder_web.db"
}
}
```

Update the paths to match your environment after cloning.

---

## Architecture Notes
- **Database**: SQLite with WAL mode (production) or DELETE mode (tests)
- **Test Isolation**: Tests use `soa_builder_web_tests.db` (set via `SOA_BUILDER_DB` env var)
Expand Down
85 changes: 0 additions & 85 deletions changelog/biomedical-concept-grouping_60ce0d1.md

This file was deleted.

Loading
Loading