Intelligent patient-trial matching system combining structured eligibility checks with AI-powered medical analysis.
Trial Discovery
- Fetches actively recruiting trials via clinicaltrials.gov API
Core Matching
Performs 3-stage verification:
- Age/Gender checks
- Medical condition matching
- AI-powered exclusion analysis
Output Generation
Produces Excel/JSON files with:
- Eligible trial IDs
- Match confidence indicators
- Human-readable explanations
1.Two-Stage Verification
- First-pass rule-based filtering
- Secondary LLM analysis of complex criteria
2.AI Integration
- Uses GPT-3.5-turbo for:
- Free-text criteria interpretation
- Medication history analysis
- Temporal condition evaluation
1.Install dependencies: (bash)
- pip install pandas requests openai openpyxl
2.Set OpenAI API key: (python)
- os.environ["OPENAI_API_KEY"] = "your-key-here"
3.Run matching: (python)
- matcher.run_matching(
input_xml="patient_data.xml",
output_file="matches.xlsx"
)
Patient data in structured XML format
```xml
<patient>
<id>PT-001</id>
<demographics>
<dob>1980-05-15</dob>
<gender>Male</gender>
</demographics>
<medicalconditions>
<condition>Diabetes Type II</condition>
</medicalconditions>
</patient>