You need to agree to share your contact information to access this dataset

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this dataset content.

YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

Clinical Trial Intake — Prompt Extraction & Assembly

Tooling to turn raw reviewer submissions into agent-ready evaluation payloads for reproducing the statistical design of Phase 3 registrational trials.

Layout

submissions/                 raw reviewer submissions, one folder per trial+user
  <trial>__<user>/
    <timestamp>.json         a submitted version (a folder may hold several)
extracted/                   generated — one folder per submission
  <trial>__<user>/
    prompts.json             extracted question skeleton (output values nulled)
    agent_input.json         system prompt + question block, ready for an agent
template_system_prompt.txt   shared system prompt for the statistician agent
extract_prompts.py           submissions -> extracted/<folder>/prompts.json
assemble_prompts.py          prompts.json + template -> agent_input.json
reviews/                     reviewer feedback on submissions

Workflow

1. Extract the question skeleton

For each submission folder, pick the latest version (by submittedAt) and strip it down to the question block, nulling every answer field. The output shape depends on each question's question_type:

  • extraction_onlyoutput.extracted_value = null
  • derivation_requiredoutput.dimensions.{inputs_used, method, calculated_value} = null
# batch: every folder under submissions/ -> extracted/<folder>/prompts.json
python3 extract_prompts.py --batch submissions

# single file -> stdout (or -o FILE)
python3 extract_prompts.py path/to/submission.json -o out.json

2. Assemble agent inputs

Combine the template system prompt with each extracted question block into a per-folder payload the agent runs against.

python3 assemble_prompts.py
# overridable:
python3 assemble_prompts.py --extracted extracted \
    --template template_system_prompt.txt --filename agent_input.json

Each agent_input.json has two keys:

{
  "system_prompt": "You are an experienced trial statistician. ...",
  "prompt": [ { "id": "P-001", "question_type": "extraction_only", "output": { ... } }, ... ]
}

The SAP/protocol document itself is supplied separately at run time (the template refers to "the input document provided below").

Agent contract

Per template_system_prompt.txt, the agent must return:

  • output.json — a single output block: copy the entire prompt block in and replace each null with the extracted or derived result. No other fields added, removed, renamed, or modified.
  • output.R — R code implementing every derivation_required calculation, printing (1) source inputs, (2) method and formula, (3) the final value.

Constraints: closed-book (input document only), every value traceable to a section/page (or to traceable inputs), numerics to ≥4 decimal places.

Downloads last month
30

Space using trialdesignbench/intake_form_data 1