RevMan Study Studio
Context
Manages the study-centric data model under reviews/<short_name>/.revman/studies/. Read references/study-schema.md before reading or writing any study files.
Active review is already resolved by the orchestrator. The REVIEW_DIR path is passed as context.
Commands
revman studio
List all studies in the active review.
Procedure:
-
Read
{REVIEW_DIR}/.revman/studies/index.json. -
If no studies exist, show:
No studies yet. Add one with `revman studio add`. -
For each study in the index, read the study file and display a table:
Studies in "{title}" (total: N) ID Citation Year Design Arms Outcomes ──── ─────── ──── ────── ──── ──────── s001 Author et al. 2020 2020 RCT 2 3 s002 Researcher et al. 2021 2021 cohort 2 1 Commands: revman studio add Add a new study revman studio show <id> Show study details revman studio edit <id> Edit a study revman studio rm <id> Remove a study revman studio import <file> Import studies from JSON/CSV
revman studio add
Add a new study interactively.
Procedure:
-
Read
index.jsonto getnext_id. Generatestudy_id = s{next_id}padded to 3 digits (e.g., s001, s010, s100). -
Collect required fields one by one:
| Prompt | Field | Default | |--------|-------|---------| | "Citation:" | citation | — | | "Title:" | title | — | | "Year:" | year | — | | "Design (RCT/cohort/case-control/etc):" | design | RCT | | "Setting:" | setting | — | | "Country:" | country | — | | "Population:" | population | — | | "Total sample size:" | sample_size | — |
-
Add arms. For each arm:
- "Arm label (e.g., Intervention):" → label
- "Description:" → description
- "Number of participants (n):" → n
- "Add another arm? (y/n):" → loop or stop
- Auto-generate arm_ids: a1, a2, a3...
-
Ask: "Add outcomes now? (y/n):" If yes, for each outcome:
- "Outcome label:" → label
- "Timepoint:" → timepoint
- "Data type (dichotomous/continuous):" → data_type
- For each arm, collect data:
- Dichotomous: "Events in {arm_label}:" + "Total in {arm_label}:"
- Continuous: "Mean in {arm_label}:" + "SD in {arm_label}:" + "N in {arm_label}:"
- "Add another outcome? (y/n):" → loop or stop
- Auto-generate outcome_ids: o1, o2, o3...
-
Write study file to
{REVIEW_DIR}/.revman/studies/{study_id}.json. -
Update
index.json: append study_id, increment next_id. -
Confirm: "Added study {study_id}: {citation}"
revman studio show <study_id>
Display full study details.
Procedure:
-
Read
{REVIEW_DIR}/.revman/studies/{study_id}.json. -
If not found, error: "Study {study_id} not found."
-
Display:
Study: {study_id} Citation: {citation} Title: {title} ({year}) Design: {design} | Setting: {setting} | Country: {country} Population: {population} Sample size: {sample_size} Arms: {arm_id} {label:20} n={n} Outcomes: {outcome_id} {label:30} {data_type:15} {timepoint} Arm data: {arm_id}={events}/{total} ...
revman studio edit <study_id>
Edit a study's fields.
Procedure:
- Read the study file. Display current values.
- Ask: "Field to edit (citation/title/year/design/setting/country/population/sample_size/arms/outcomes/notes):"
- Update the specified field. For arms/outcomes, re-enter the full array.
- Save file and confirm.
revman studio rm <study_id>
Remove a study and all its data.
Procedure:
- Confirm: "Remove study {study_id} ({citation})? This cannot be undone. Type
yesto confirm." - If confirmed, delete the study file.
- Update
index.json: remove from list. - Confirm: "Removed study {study_id}."
revman studio import <file>
Import studies from a JSON or CSV file.
Procedure:
- Check file exists. Error if not.
- Detect format from extension (.json or .csv).
- For JSON: expect an array of study objects matching the study schema.
- For CSV: expect columns matching study fields. Parse accordingly.
- For each study in the import:
- Generate new study_id (don't keep imported IDs to avoid collisions).
- Write study file.
- Update index.
- Report: "Imported {N} studies."
Files
| File | Location | Purpose |
|------|----------|---------|
| Study files | {REVIEW_DIR}/.revman/studies/s*.json | Per-study data |
| Index | {REVIEW_DIR}/.revman/studies/index.json | Study registry + next_id |
Error Handling
| Situation | Response |
|-----------|----------|
| No index.json | Initialize it: {"studies":[],"next_id":1} |
| Study file missing but in index | Remove from index, warn: "Study {id} missing. Removed from index." |
| Invalid data_type | "Data type must be dichotomous or continuous." |
| Empty arms list | "Each study needs at least one arm." |
| Import file not found | "File {path} not found." |
| Unknown import format | "Supported formats: .json, .csv" |
Scan to join WeChat group