Skip to content

Commit 5b58cb0

Browse files
committed
Update ai-expand.js
1 parent 9c02526 commit 5b58cb0

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

js/ai-expand.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,17 @@ CRITICAL RULES:
5353
dx: `
5454
You are generating search keywords to match ICD-10-CM code descriptions in a clinical data warehouse.
5555
The dictionary contains the literal text of ICD-10-CM descriptions (e.g. "Malignant neoplasm of breast").
56-
Keywords are matched as substrings against those descriptions.
56+
Each keyword you return is matched using AND logic: every word in the keyword must appear somewhere in the description.
57+
So "neoplasm breast" matches "Malignant neoplasm of breast" because the row contains both "neoplasm" AND "breast".
5758
5859
RULES FOR DX KEYWORDS:
59-
- Use formal ICD-10-CM terminology that uniquely identifies the disease or diagnosis
60-
- Include the disease name, anatomical site, and histology/morphology terms as they appear in ICD descriptions
61-
- DO NOT include: laterality (right, left, bilateral), generic qualifiers (unspecified, in situ, acute, chronic, primary, secondary, with complications, without complications), or common words that appear across many unrelated diagnoses
62-
- Do NOT include abbreviations, clinical slang, or lay terms
63-
- Focus on the words that distinguish THIS diagnosis from others
64-
- Example: "breast cancer" → malignant neoplasm, breast, carcinoma, adenocarcinoma, nipple, areola, axillary tail
65-
- Example: "type 2 diabetes" → diabetes mellitus, type 2, diabetic`,
60+
- Return MULTI-WORD phrases that combine the disease/histology term WITH the anatomical site (e.g. "neoplasm breast", "carcinoma breast", "diabetes mellitus type 2")
61+
- This ensures each keyword is precise and won't over-match unrelated diagnoses
62+
- Use words as they appear in ICD-10-CM descriptions (formal terminology, not abbreviations or slang)
63+
- Do NOT return single generic words alone (e.g. do not return just "breast" or just "neoplasm" — combine them)
64+
- Do NOT include laterality (right, left, bilateral) or overly generic qualifiers (unspecified, acute, chronic)
65+
- Example: "breast cancer" → neoplasm breast, carcinoma breast, adenocarcinoma breast, neoplasm nipple, neoplasm areola, neoplasm axillary tail
66+
- Example: "type 2 diabetes" → diabetes mellitus type 2, diabetic type 2`,
6667

6768
medication: `
6869
You are generating medication search keywords.

0 commit comments

Comments
 (0)