# Parsing Trial Eligibility

Parses free-text clinical-trial eligibility criteria into structured inclusion and...

- Repository: https://github.com/maziyarpanahi/openmed (5755 stars)
- Category: Engineering
- License: Apache-2.0
- Last updated: 2026-10-31
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add maziyarpanahi/openmed --skill parsing-trial-eligibility -g -a claude-code -y`
Codex: `npx skills add maziyarpanahi/openmed --skill parsing-trial-eligibility -g -a codex -y`
Cursor: `npx skills add maziyarpanahi/openmed --skill parsing-trial-eligibility -g -a cursor -y`
Gemini CLI: `npx skills add maziyarpanahi/openmed --skill parsing-trial-eligibility -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add maziyarpanahi/openmed`

## Description

Parses free-text clinical-trial eligibility criteria into structured inclusion and exclusion logic, then matches them against patient facts that OpenMed extracted. Use when the user wants to turn a ClinicalTrials.gov eligibility block into machine-readable rules, screen a synthetic patient for trial fit, or explain why a patient does or does not meet criteria. Trigger keywords: eligibility criteria, inclusion, exclusion, trial matching, patient screening, criteria parsing, eligibilityModule, age/sex gates. Pairs after OpenMed and after searching-clinicaltrials: consume the eligibilityModule text from a study, structure it, and match against conditions, medications, labs, and demographics from openmed.analyze_text. Decision-support only, never autonomous enrollment.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Parsing trial eligibility & matching patients

A ClinicalTrials.gov study exposes its eligibility as a single free-text block
(`protocolSection.eligibilityModule.eligibilityCriteria`) plus a few typed fields
(`sex`, `minimumAge`, `maximumAge`, `healthyVolunteers`). This skill turns that
prose into **structured inclusion / exclusion criteria** and matches each rule
against patient facts that **OpenMed** extracted, producing an explainable
`eligible | ineligible | unknown` verdict per criterion.

This is **decision support, not enrollment**. The output is a candidate list and
a rationale for a clinician to review, never an automated eligibility decision.

## When to use

- You pulled a study with `searching-clinicaltrials` and need its eligibility as
  machine-readable rules.
- You have a (synthetic) patient profile and want to screen it against one or many
  trials, with a per-criterion reason.
- You want to highlight which patient facts are missing to decide a criterion.

## Quick start

The typed gates are deterministic, apply them first. The free-text criteria need
parsing into bullet-level inclusion/exclusion items.

```python
# Study from ClinicalTrials.gov v2 (see searching-clinicaltrials)
elig = study["protocolSection"]["eligibilityModule"]

raw = elig["eligibilityCriteria"]            # free text, often markdown bullets
sex = elig.get("sex", "ALL")                 # ALL | FEMALE | MALE
min_age = elig.get("minimumAge")             # e.g. "18 Years"
max_age = elig.get("maximumAge")             # e.g. "75 Years"
healthy_ok = elig.get("healthyVolunteers")   # bool

The rest: https://github.com/maziyarpanahi/openmed/blob/HEAD/skills/parsing-trial-eligibility/SKILL.md
