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 Recruitment Feasibility Assessor

Format
Code-aware
Lines
121
Sections
11
Linked challenge
Build a Synthetic Cohort Clinical Trial Recruitment Feasibility Assessor

Prompt source

Original prompt text with formatting preserved for inspection.

121 lines
11 sections
No variables
1 code block
## Build
Evaluate clinical trial protocol inclusion and exclusion criteria against synthetic deidentified longitudinal patient profiles. Estimate cohort enrollment yield and identify criterion bottlenecks across study sites.

## User
Clinical Research Coordinator

## Workflow
1. Ingest trial eligibility parameters and a synthetic multi-site cohort dataset of deidentified patient metrics.
2. Evaluate age, diagnostic code history, and lab biomarker thresholds against each synthetic record.
3. Calculate stage-by-stage attrition curves and highlight restrictive exclusion criteria.
4. Synthesize a recruitment feasibility dossier with cohort yield projections for research review.

## Interface
Interactive cohort explorer presenting criteria filter controls, waterfall attrition diagrams, and feasibility summaries.

## Data
Synthesize tabular cohort records with age, lab values, and synthetic ICD-10 codes, or load public mock FHIR bundles.
Starter examples below are synthetic. They are not downloaded records.

## Source
[HL7 FHIR overview](https://hl7.org/fhir/overview.html)
Adopt FHIR Clinical Reasoning and ResearchStudy criteria modeling conventions to structure eligibility evaluation predicates.

## Tools
langgraph, pandas, pydantic.
langgraph coordinates cyclical feasibility evaluation passes across eligibility criteria and aggregates attrition stages.
Fast hosted or local model capable of summarizing criterion bottlenecks from structured attrition tables.

## 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 multi-criteria inclusion/exclusion rules into executable filtering logic.
- Processes at least 1,000 synthetic patient records and computes step-wise attrition metrics.
- Generates a structured feasibility report identifying the most restrictive criterion.
- Provides human review checkpoints for adjusting protocol thresholds and re-running yield analysis.

## Starter Examples
```json
[
  {
    "input": {
      "protocol_id": "NCT-SYNTH-101",
      "target_enrollment": 50,
      "criteria": {
        "min_age": 18,
        "max_age": 65,
        "required_condition": "E11",
        "max_serum_creatinine": 1.5
      },
      "synthetic_cohort": [
        {
          "patient_id": "P01",
          "age": 45,
          "conditions": [
            "E11"
          ],
          "serum_creatinine": 1.1
        },
        {
          "patient_id": "P02",
          "age": 70,
          "conditions": [
            "E11"
          ],
          "serum_creatinine": 1.2
        },
        {
          "patient_id": "P03",
          "age": 30,
          "conditions": [
            "I10"
          ],
          "serum_creatinine": 0.9
        },
        {
          "patient_id": "P04",
          "age": 55,
          "conditions": [
            "E11"
          ],
          "serum_creatinine": 1.8
        }
      ]
    },
    "expected_output": {
      "protocol_id": "NCT-SYNTH-101",
      "total_screened": 4,
      "eligible_count": 1,
      "eligible_ids": [
        "P01"
      ],
      "attrition_summary": {
        "age_excluded": 1,
        "condition_excluded": 1,
        "lab_excluded": 1
      },
      "feasibility_status": "at_risk"
    }
  },
  {
    "input": {
      "protocol_id": "NCT-SYNTH-102",
      "target_enrollment": 1,
      "criteria": {
        "min_age": 20,
        "max_age": 80,
        "required_condition": "J45",
        "max_serum_creatinine": 2
      },
      "synthetic_cohort": []
    },
    "expected_output": {
      "protocol_id": "NCT-SYNTH-102",
      "total_screened": 0,
      "eligible_count": 0,
      "eligible_ids": [],
      "attrition_summary": {
        "age_excluded": 0,
        "condition_excluded": 0,
        "lab_excluded": 0
      },
      "feasibility_status": "insufficient_data"
    }
  }
]
```

## Safety
Research feasibility tool only; uses purely synthetic records and makes no clinical enrollment determinations.
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.