Skip to main content
Back to Prompt Library
implementation

Build the application

Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.

Linked challenge: Build a Synthetic Cohort Clinical Trial Protocol Amendment Simulator

Format
Code-aware
Lines
96
Sections
11
Linked challenge
Build a Synthetic Cohort Clinical Trial Protocol Amendment Simulator

Prompt source

Original prompt text with formatting preserved for inspection.

96 lines
11 sections
No variables
1 code block
## Build
Simulate the impact of proposed clinical trial protocol amendments on participant eligibility using synthetic cohort records. Quantify candidate pool expansion and flag potential protocol safety margin deviations.

## User
Clinical Protocol Design Analyst

## Workflow
1. Ingest existing trial eligibility criteria and proposed amendment delta values.
2. Execute comparative eligibility queries across a benchmark synthetic patient repository.
3. Quantify marginal recruitment gain and calculate shifts in baseline cohort risk distributions.
4. Compile an amendment impact dossier with visual trade-off matrices for protocol review committees.

## Interface
Interactive parameter slider interface comparing baseline vs amended criteria yields and demographic distributions.

## Data
Construct synthetic patient datasets with lab ranges, vitals, and condition histories or load open mock datasets.
Starter examples below are synthetic. They are not downloaded records.

## Source
[HL7 FHIR overview](https://hl7.org/fhir/overview.html)
Apply FHIR Clinical Reasoning and ResearchStudy definitions to encode baseline and amended eligibility parameters.

## Tools
crewai, pandas, pydantic.
crewai coordinates multi-agent evaluation of protocol safety limits, recruitment delta calculations, and summary writing.
Hosted LLM with reasoning capability for comparative clinical criteria analysis.

## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.

## Acceptance
- Parses baseline and amended criteria configurations without numeric ambiguities.
- Calculates net change in eligible synthetic subjects across stratified biomarker ranges.
- Produces a structured impact scorecard detailing recruited delta and risk shift warnings.
- Allows protocol analysts to download reproducible simulation manifests.

## Starter Examples
```json
[
  {
    "input": {
      "amendment_id": "AMD-42",
      "criteria_changes": {
        "platelet_count_min": {
          "baseline": 100000,
          "amended": 75000
        }
      },
      "synthetic_records": [
        {
          "id": "S1",
          "platelet_count": 80000
        },
        {
          "id": "S2",
          "platelet_count": 120000
        },
        {
          "id": "S3",
          "platelet_count": 60000
        }
      ]
    },
    "expected_output": {
      "amendment_id": "AMD-42",
      "baseline_eligible": 1,
      "amended_eligible": 2,
      "net_gain": 1,
      "newly_eligible_ids": [
        "S1"
      ],
      "safety_margin_flag": "mild_relaxation"
    }
  },
  {
    "input": {
      "amendment_id": "AMD-43",
      "criteria_changes": {
        "platelet_count_min": {
          "baseline": 100000,
          "amended": 100000
        }
      },
      "synthetic_records": [
        {
          "id": "S4",
          "platelet_count": 90000
        }
      ]
    },
    "expected_output": {
      "amendment_id": "AMD-43",
      "baseline_eligible": 0,
      "amended_eligible": 0,
      "net_gain": 0,
      "newly_eligible_ids": [],
      "safety_margin_flag": "no_change"
    }
  }
]
```

## Safety
Research protocol modeling application; evaluated exclusively on synthetic data; no medical advice or care delivery.
Use mock external writes. Require human review before any real deployment.

Adaptation plan

Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.

Keep stable

Hold the task contract and output shape stable so generated implementations remain comparable.

Tune next

Update libraries, interfaces, and environment assumptions to match the stack you actually run.

Verify after

Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.