|
a |
|
b/README.md |
|
|
1 |
# Clinical Trial Matching System |
|
|
2 |
|
|
|
3 |
Intelligent patient-trial matching system combining structured eligibility checks with AI-powered medical analysis. |
|
|
4 |
|
|
|
5 |
## Key Features |
|
|
6 |
|
|
|
7 |
- Dynamic clinical trial data fetching from clinicaltrials.gov |
|
|
8 |
- Hybrid matching system (rule-based + LLM analysis) |
|
|
9 |
- XML patient data processing |
|
|
10 |
- Detailed eligibility explanations |
|
|
11 |
- Excel/JSON output generation |
|
|
12 |
|
|
|
13 |
## Matching Process |
|
|
14 |
|
|
|
15 |
Trial Discovery |
|
|
16 |
- Fetches actively recruiting trials via clinicaltrials.gov API |
|
|
17 |
|
|
|
18 |
Core Matching |
|
|
19 |
Performs 3-stage verification: |
|
|
20 |
- Age/Gender checks |
|
|
21 |
- Medical condition matching |
|
|
22 |
- AI-powered exclusion analysis |
|
|
23 |
|
|
|
24 |
Output Generation |
|
|
25 |
Produces Excel/JSON files with: |
|
|
26 |
- Eligible trial IDs |
|
|
27 |
- Match confidence indicators |
|
|
28 |
- Human-readable explanations |
|
|
29 |
|
|
|
30 |
## Methodology Highlights |
|
|
31 |
|
|
|
32 |
1.Two-Stage Verification |
|
|
33 |
- First-pass rule-based filtering |
|
|
34 |
- Secondary LLM analysis of complex criteria |
|
|
35 |
|
|
|
36 |
2.AI Integration |
|
|
37 |
- Uses GPT-3.5-turbo for: |
|
|
38 |
- Free-text criteria interpretation |
|
|
39 |
- Medication history analysis |
|
|
40 |
- Temporal condition evaluation |
|
|
41 |
|
|
|
42 |
## Setup & Usage |
|
|
43 |
|
|
|
44 |
1.Install dependencies: (bash) |
|
|
45 |
- pip install pandas requests openai openpyxl |
|
|
46 |
|
|
|
47 |
2.Set OpenAI API key: (python) |
|
|
48 |
- os.environ["OPENAI_API_KEY"] = "your-key-here" |
|
|
49 |
|
|
|
50 |
3.Run matching: (python) |
|
|
51 |
- matcher.run_matching( |
|
|
52 |
input_xml="patient_data.xml", |
|
|
53 |
output_file="matches.xlsx" |
|
|
54 |
) |
|
|
55 |
|
|
|
56 |
## Input Requirements |
|
|
57 |
|
|
|
58 |
Patient data in structured XML format |
|
|
59 |
```xml |
|
|
60 |
<Patient> |
|
|
61 |
<ID>PT-001</ID> |
|
|
62 |
<Demographics> |
|
|
63 |
<DOB>1980-05-15</DOB> |
|
|
64 |
<Gender>Male</Gender> |
|
|
65 |
</Demographics> |
|
|
66 |
<MedicalConditions> |
|
|
67 |
<Condition>Diabetes Type II</Condition> |
|
|
68 |
</MedicalConditions> |
|
|
69 |
</Patient> |
|
|
70 |
|