$npx -y skills add QSong-github/DrugClaw --skill cadecQuery the CADEC (CSIRO Adverse Drug Event Corpus). Use whenever the user asks about adverse drug event mentions in consumer health text, entity annotations from patient forum posts, MedDRA/SNOMED-CT normalised ADR spans, or wants to look up drugs, symptoms, or coded entities in t
| 1 | # CADEC Query Skill |
| 2 | |
| 3 | Search CADEC annotated patient forum posts by any entity. Auto-detects type: |
| 4 | |
| 5 | | Input Pattern | Detected As | Match Logic | |
| 6 | |---|---|---| |
| 7 | | `10019211` (8 digits) | MedDRA code | exact on normalizations.code | |
| 8 | | `22253000` (6-18 digits) | SNOMED CT code | exact on normalizations.code | |
| 9 | | anything else | free text | substring on entity text, type, or doc_id | |
| 10 | |
| 11 | ## API |
| 12 | |
| 13 | | Function | Input | Returns | |
| 14 | |---|---|---| |
| 15 | | `load_cadec(path)` | JSON path | list[dict] (cached) | |
| 16 | | `search(entity)` | single entity string | list[dict] | |
| 17 | | `search_batch(entities)` | list of entity strings | dict[str, list[dict]] | |
| 18 | | `summarize(hits, entity)` | hits + label | compact text | |
| 19 | | `to_json(hits)` | list[dict] | same list (JSON-ready) | |
| 20 | |
| 21 | ## Entity Types in Corpus |
| 22 | |
| 23 | | Type | Description | |
| 24 | |---|---| |
| 25 | | ADR | Adverse Drug Reaction | |
| 26 | | Drug | Medication mention | |
| 27 | | Disease | Pre-existing condition | |
| 28 | | Symptom | Patient-reported symptom | |
| 29 | | Finding | Clinical finding | |
| 30 | |
| 31 | ## Usage |
| 32 | |
| 33 | See `if __name__ == "__main__"` block in `34_CADEC.py` for runnable examples: |
| 34 | drug name search, ADR text search, MedDRA code lookup, batch search, JSON output. |
| 35 | |
| 36 | ## Data |
| 37 | |
| 38 | - **Source**: CADEC v2, CSIRO (AskaPatient.com forum posts) |
| 39 | - **Local file**: `cadec_combined.json` built from BRAT `.txt` + `.ann` files |
| 40 | - **Annotations**: Original spans + MedDRA + SNOMED CT normalisations |
| 41 | - **Stats**: ~1,250 documents, ~7,600 entity annotations |
| 42 | - **Path**: `DATA_PATH` variable in `34_CADEC.py` |
| 43 | - **Citation**: Karimi et al., 2015. *J Biomed Inform* 55:73–81 |