File size: 568 Bytes
877add7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""Simple drug catalog."""

from __future__ import annotations

DRUG_CLASSES: dict[str, str] = {
    "warfarin_like": "anticoagulant",
    "benzodiazepine_like": "sedative",
    "metformin_like": "glucose_lowering",
    "statin_like": "lipid_lowering",
    "ace_inhibitor_like": "antihypertensive",
    "nsaid_like": "analgesic",
    "opioid_like": "analgesic",
    "ssri_like": "antidepressant",
    "ppi_like": "gastro",
    "beta_blocker_like": "antihypertensive",
}


def canonicalize_drug_name(name: str) -> str:
    return name.strip().lower().replace(" ", "_")