
Parsing Trial Eligibility
Parses free-text clinical-trial eligibility criteria into structured inclusion and...
Install
npx skills add maziyarpanahi/openmed --skill parsing-trial-eligibility -g -a claude-code -y- Repository
- maziyarpanahi/openmed5.8k
- Category
- Engineering
- Updated
- 4d ago
- License
- Apache-2.0
- Context cost
- Mediumabout 1,820 tokens
- Runs scripts
- No, instructions only
What it does
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.
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-clinicaltrialsand 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.
# 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
