File size: 10,570 Bytes
b119ee1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
{
  "version": "1.0",
  "description": "50-prompt labeled test set for DSPy Tool Selector training and evaluation",
  "created": "2025-11-21",
  "ambiguous_query_policy": "If query asks for patients themselves (filtered by condition/medication) -> condition_cohort_tool. If asks for related entities (medications OF patients) -> multi_hop_graph_rag.",
  "test_set": [
    {
      "id": 1,
      "query": "Show me diabetic patients",
      "expected_tool": "condition_cohort_tool",
      "category": "cohort_list",
      "notes": "Primary test case - simple patient listing by condition"
    },
    {
      "id": 2,
      "query": "Patients with diabetes",
      "expected_tool": "condition_cohort_tool",
      "category": "cohort_list",
      "notes": "Variant phrasing"
    },
    {
      "id": 3,
      "query": "List patients with hypertension",
      "expected_tool": "condition_cohort_tool",
      "category": "cohort_list",
      "notes": "Explicit 'list' keyword"
    },
    {
      "id": 4,
      "query": "How many patients have diabetes?",
      "expected_tool": "condition_cohort_tool",
      "category": "cohort_count",
      "notes": "Count query"
    },
    {
      "id": 5,
      "query": "Count patients with prediabetes",
      "expected_tool": "condition_cohort_tool",
      "category": "cohort_count",
      "notes": "Explicit count keyword"
    },
    {
      "id": 6,
      "query": "Show me patients with asthma",
      "expected_tool": "condition_cohort_tool",
      "category": "cohort_list",
      "notes": "Different condition"
    },
    {
      "id": 7,
      "query": "Find patients with heart disease",
      "expected_tool": "condition_cohort_tool",
      "category": "cohort_list",
      "notes": "'Find' keyword variant"
    },
    {
      "id": 8,
      "query": "Who has diabetes?",
      "expected_tool": "condition_cohort_tool",
      "category": "cohort_list",
      "notes": "Colloquial phrasing"
    },
    {
      "id": 9,
      "query": "Patients diagnosed with diabetes",
      "expected_tool": "condition_cohort_tool",
      "category": "cohort_list",
      "notes": "'Diagnosed' keyword"
    },
    {
      "id": 10,
      "query": "List diabetic patients",
      "expected_tool": "condition_cohort_tool",
      "category": "cohort_list",
      "notes": "Adjective form"
    },
    {
      "id": 11,
      "query": "Diabetic patients in the system",
      "expected_tool": "condition_cohort_tool",
      "category": "cohort_list",
      "notes": "Standalone adjective form"
    },
    {
      "id": 12,
      "query": "Patients with both diabetes and hypertension",
      "expected_tool": "condition_cohort_tool",
      "category": "cohort_comorbidity",
      "notes": "Comorbidity - still asking for patients"
    },
    {
      "id": 13,
      "query": "What medications do diabetic patients take?",
      "expected_tool": "multi_hop_graph_rag",
      "category": "relationship",
      "notes": "Asks for related entity (medications)"
    },
    {
      "id": 14,
      "query": "Show medications for patients with diabetes",
      "expected_tool": "multi_hop_graph_rag",
      "category": "relationship",
      "notes": "Medications OF patients with condition"
    },
    {
      "id": 15,
      "query": "Find conditions in patients taking metformin",
      "expected_tool": "multi_hop_graph_rag",
      "category": "relationship",
      "notes": "Conditions OF patients on medication"
    },
    {
      "id": 16,
      "query": "Medications for hypertensive patients",
      "expected_tool": "multi_hop_graph_rag",
      "category": "relationship",
      "notes": "Shortened relationship query"
    },
    {
      "id": 17,
      "query": "What drugs are prescribed for diabetes?",
      "expected_tool": "multi_hop_graph_rag",
      "category": "relationship",
      "notes": "Drug-condition relationship"
    },
    {
      "id": 18,
      "query": "Patients with diabetes who take metformin",
      "expected_tool": "multi_hop_graph_rag",
      "category": "relationship",
      "notes": "Intersection query - condition AND medication"
    },
    {
      "id": 19,
      "query": "Diabetic patients on insulin",
      "expected_tool": "multi_hop_graph_rag",
      "category": "relationship",
      "notes": "Ambiguous but involves medication - traversal needed"
    },
    {
      "id": 20,
      "query": "How many diabetic patients take metformin?",
      "expected_tool": "multi_hop_graph_rag",
      "category": "relationship",
      "notes": "Count of intersection"
    },
    {
      "id": 21,
      "query": "What conditions do patients on lisinopril have?",
      "expected_tool": "multi_hop_graph_rag",
      "category": "relationship",
      "notes": "Medication to condition traversal"
    },
    {
      "id": 22,
      "query": "Common medications among diabetic patients",
      "expected_tool": "multi_hop_graph_rag",
      "category": "relationship",
      "notes": "Aggregation over relationship"
    },
    {
      "id": 23,
      "query": "How many male patients?",
      "expected_tool": "demographics_analytics_tool",
      "category": "demographics",
      "notes": "Gender count"
    },
    {
      "id": 24,
      "query": "Show female patients",
      "expected_tool": "demographics_analytics_tool",
      "category": "demographics",
      "notes": "Gender filter"
    },
    {
      "id": 25,
      "query": "Gender breakdown",
      "expected_tool": "demographics_analytics_tool",
      "category": "demographics",
      "notes": "Distribution query"
    },
    {
      "id": 26,
      "query": "Race distribution",
      "expected_tool": "demographics_analytics_tool",
      "category": "demographics",
      "notes": "Demographic stats"
    },
    {
      "id": 27,
      "query": "Database statistics",
      "expected_tool": "demographics_analytics_tool",
      "category": "demographics",
      "notes": "General stats"
    },
    {
      "id": 28,
      "query": "Total patient count",
      "expected_tool": "demographics_analytics_tool",
      "category": "demographics",
      "notes": "Overall count"
    },
    {
      "id": 29,
      "query": "How many patients in the database?",
      "expected_tool": "demographics_analytics_tool",
      "category": "demographics",
      "notes": "Database-level query"
    },
    {
      "id": 30,
      "query": "Age distribution of patients",
      "expected_tool": "demographics_analytics_tool",
      "category": "demographics",
      "notes": "Age demographic"
    },
    {
      "id": 31,
      "query": "Most prescribed medication",
      "expected_tool": "topn_analytics_tool",
      "category": "topn",
      "notes": "Top-1 medication"
    },
    {
      "id": 32,
      "query": "Most common condition",
      "expected_tool": "topn_analytics_tool",
      "category": "topn",
      "notes": "Top-1 condition"
    },
    {
      "id": 33,
      "query": "Top medications",
      "expected_tool": "topn_analytics_tool",
      "category": "topn",
      "notes": "Top-N medications"
    },
    {
      "id": 34,
      "query": "What is the most prescribed drug?",
      "expected_tool": "topn_analytics_tool",
      "category": "topn",
      "notes": "Question form"
    },
    {
      "id": 35,
      "query": "Most frequent diagnosis",
      "expected_tool": "topn_analytics_tool",
      "category": "topn",
      "notes": "Variant wording"
    },
    {
      "id": 36,
      "query": "Top 10 conditions",
      "expected_tool": "topn_analytics_tool",
      "category": "topn",
      "notes": "Explicit N"
    },
    {
      "id": 37,
      "query": "Find patient John Smith",
      "expected_tool": "find_patient",
      "category": "patient_lookup",
      "notes": "Name search"
    },
    {
      "id": 38,
      "query": "Search for Maria Rodriguez",
      "expected_tool": "find_patient",
      "category": "patient_lookup",
      "notes": "Alternate wording"
    },
    {
      "id": 39,
      "query": "Look up patient MRN 12345",
      "expected_tool": "find_patient",
      "category": "patient_lookup",
      "notes": "MRN search"
    },
    {
      "id": 40,
      "query": "Find John Doe",
      "expected_tool": "find_patient",
      "category": "patient_lookup",
      "notes": "Minimal form"
    },
    {
      "id": 41,
      "query": "Patient named Williams",
      "expected_tool": "find_patient",
      "category": "patient_lookup",
      "notes": "Last name search"
    },
    {
      "id": 42,
      "query": "Search patient Robert",
      "expected_tool": "find_patient",
      "category": "patient_lookup",
      "notes": "First name search"
    },
    {
      "id": 43,
      "query": "What medications is this patient taking?",
      "expected_tool": "get_medications",
      "category": "patient_data",
      "notes": "Current patient context"
    },
    {
      "id": 44,
      "query": "Show diagnoses for patient",
      "expected_tool": "get_medications",
      "category": "patient_data",
      "notes": "Patient-specific data"
    },
    {
      "id": 45,
      "query": "Get encounters for patient",
      "expected_tool": "get_encounters",
      "category": "patient_data",
      "notes": "Encounter history"
    },
    {
      "id": 46,
      "query": "Patient's medication list",
      "expected_tool": "get_medications",
      "category": "patient_data",
      "notes": "Possessive form"
    },
    {
      "id": 47,
      "query": "What is the weather?",
      "expected_tool": "out_of_scope",
      "category": "out_of_scope",
      "notes": "Non-medical query"
    },
    {
      "id": 48,
      "query": "Write me a poem",
      "expected_tool": "out_of_scope",
      "category": "out_of_scope",
      "notes": "Creative request"
    },
    {
      "id": 49,
      "query": "Tell me a joke",
      "expected_tool": "out_of_scope",
      "category": "out_of_scope",
      "notes": "Entertainment request"
    },
    {
      "id": 50,
      "query": "How do I cook pasta?",
      "expected_tool": "out_of_scope",
      "category": "out_of_scope",
      "notes": "Unrelated topic"
    }
  ],
  "category_distribution": {
    "cohort_list": 11,
    "cohort_count": 2,
    "cohort_comorbidity": 1,
    "relationship": 10,
    "demographics": 8,
    "topn": 6,
    "patient_lookup": 6,
    "patient_data": 4,
    "out_of_scope": 4
  },
  "tool_distribution": {
    "condition_cohort_tool": 12,
    "multi_hop_graph_rag": 10,
    "demographics_analytics_tool": 8,
    "topn_analytics_tool": 6,
    "find_patient": 6,
    "get_medications": 3,
    "get_encounters": 1,
    "out_of_scope": 4
  }
}