Commit Β·
2a3badd
1
Parent(s): 8103f33
Add 15 drug profiles to pharma KB from Kaggle dataset
Browse files- knowledge/pharma/features.yaml +90 -0
- scripts/kaggle_to_yaml.py +23 -7
knowledge/pharma/features.yaml
CHANGED
|
@@ -96,3 +96,93 @@ documents:
|
|
| 96 |
standard treatment at scale. Enrollment eligibility is defined by inclusion
|
| 97 |
and exclusion criteria in the protocol.
|
| 98 |
tags: [clinical-trial, study, investigational]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
standard treatment at scale. Enrollment eligibility is defined by inclusion
|
| 97 |
and exclusion criteria in the protocol.
|
| 98 |
tags: [clinical-trial, study, investigational]
|
| 99 |
+
|
| 100 |
+
- id: pharma_drug_001
|
| 101 |
+
title: "Seroxetine50 β Drug Profile"
|
| 102 |
+
content: >
|
| 103 |
+
Seroxetine50 is indicated for the treatment or management of Allergy relief. Known adverse events include: Fatigue, Nausea. Contraindicated in patients with: Bleeding disorders. Prescriber warning: Avoid alcohol. Serious unexpected adverse events must be reported to the regulatory authority within 15 days.
|
| 104 |
+
tags: ["seroxetine50", "allergy-relief", "adverse-event", "drug-profile"]
|
| 105 |
+
|
| 106 |
+
- id: pharma_drug_002
|
| 107 |
+
title: "Mecoparin93 β Drug Profile"
|
| 108 |
+
content: >
|
| 109 |
+
Mecoparin93 is indicated for the treatment or management of Allergy relief. Known adverse events include: Nausea. Contraindicated in patients with: Allergic reaction. Prescriber warning: Take with food. Serious unexpected adverse events must be reported to the regulatory authority within 15 days.
|
| 110 |
+
tags: ["mecoparin93", "allergy-relief", "adverse-event", "drug-profile"]
|
| 111 |
+
|
| 112 |
+
- id: pharma_drug_003
|
| 113 |
+
title: "Daxozole89 β Drug Profile"
|
| 114 |
+
content: >
|
| 115 |
+
Daxozole89 is indicated for the treatment or management of Allergy relief. Known adverse events include: Diarrhea, Blurred vision, Dizziness. Contraindicated in patients with: High blood pressure. Prescriber warning: Take with food. Serious unexpected adverse events must be reported to the regulatory authority within 15 days.
|
| 116 |
+
tags: ["daxozole89", "allergy-relief", "adverse-event", "drug-profile"]
|
| 117 |
+
|
| 118 |
+
- id: pharma_drug_004
|
| 119 |
+
title: "Viracillin84 β Drug Profile"
|
| 120 |
+
content: >
|
| 121 |
+
Viracillin84 is indicated for the treatment or management of Inflammation reduction. Known adverse events include: Fatigue, Dry mouth. Contraindicated in patients with: Kidney impairment. Prescriber warning: Do not operate machinery. Serious unexpected adverse events must be reported to the regulatory authority within 15 days.
|
| 122 |
+
tags: ["viracillin84", "inflammation-reduction", "adverse-event", "drug-profile"]
|
| 123 |
+
|
| 124 |
+
- id: pharma_drug_005
|
| 125 |
+
title: "Amoxstatin62 β Drug Profile"
|
| 126 |
+
content: >
|
| 127 |
+
Amoxstatin62 is indicated for the treatment or management of Psychosis control. Known adverse events include: Insomnia, Dry mouth, Fatigue. Contraindicated in patients with: Bleeding disorders. Prescriber warning: Do not operate machinery. Serious unexpected adverse events must be reported to the regulatory authority within 15 days.
|
| 128 |
+
tags: ["amoxstatin62", "psychosis-control", "adverse-event", "drug-profile"]
|
| 129 |
+
|
| 130 |
+
- id: pharma_drug_006
|
| 131 |
+
title: "Loxocillin72 β Drug Profile"
|
| 132 |
+
content: >
|
| 133 |
+
Loxocillin72 is indicated for the treatment or management of Viral infections. Known adverse events include: Rash, Dizziness. Contraindicated in patients with: Bleeding disorders. Prescriber warning: May affect fertility. Serious unexpected adverse events must be reported to the regulatory authority within 15 days.
|
| 134 |
+
tags: ["loxocillin72", "viral-infections", "adverse-event", "drug-profile"]
|
| 135 |
+
|
| 136 |
+
- id: pharma_drug_007
|
| 137 |
+
title: "Fenoxetine43 β Drug Profile"
|
| 138 |
+
content: >
|
| 139 |
+
Fenoxetine43 is indicated for the treatment or management of Psychosis control. Known adverse events include: Blurred vision. Contraindicated in patients with: Bleeding disorders. Prescriber warning: May affect fertility. Serious unexpected adverse events must be reported to the regulatory authority within 15 days.
|
| 140 |
+
tags: ["fenoxetine43", "psychosis-control", "adverse-event", "drug-profile"]
|
| 141 |
+
|
| 142 |
+
- id: pharma_drug_008
|
| 143 |
+
title: "Fenomab17 β Drug Profile"
|
| 144 |
+
content: >
|
| 145 |
+
Fenomab17 is indicated for the treatment or management of Bacterial infections. Known adverse events include: Nausea. Contraindicated in patients with: Seizures. Prescriber warning: Avoid alcohol. Serious unexpected adverse events must be reported to the regulatory authority within 15 days.
|
| 146 |
+
tags: ["fenomab17", "bacterial-infections", "adverse-event", "drug-profile"]
|
| 147 |
+
|
| 148 |
+
- id: pharma_drug_009
|
| 149 |
+
title: "Cefparin42 β Drug Profile"
|
| 150 |
+
content: >
|
| 151 |
+
Cefparin42 is indicated for the treatment or management of Prevent infectious disease. Known adverse events include: Dry mouth. Contraindicated in patients with: Asthma. Prescriber warning: Avoid alcohol. Serious unexpected adverse events must be reported to the regulatory authority within 15 days.
|
| 152 |
+
tags: ["cefparin42", "prevent-infectious-disease", "adverse-event", "drug-profile"]
|
| 153 |
+
|
| 154 |
+
- id: pharma_drug_010
|
| 155 |
+
title: "Rivaprofen81 β Drug Profile"
|
| 156 |
+
content: >
|
| 157 |
+
Rivaprofen81 is indicated for the treatment or management of Bacterial infections. Known adverse events include: Insomnia, Fatigue, Headache. Contraindicated in patients with: Pregnancy. Prescriber warning: Take with food. Serious unexpected adverse events must be reported to the regulatory authority within 15 days.
|
| 158 |
+
tags: ["rivaprofen81", "bacterial-infections", "adverse-event", "drug-profile"]
|
| 159 |
+
|
| 160 |
+
- id: pharma_drug_011
|
| 161 |
+
title: "Fenocillin43 β Drug Profile"
|
| 162 |
+
content: >
|
| 163 |
+
Fenocillin43 is indicated for the treatment or management of Allergy relief. Known adverse events include: Dizziness, Fatigue. Contraindicated in patients with: Liver disease. Prescriber warning: Risk of addiction. Serious unexpected adverse events must be reported to the regulatory authority within 15 days.
|
| 164 |
+
tags: ["fenocillin43", "allergy-relief", "adverse-event", "drug-profile"]
|
| 165 |
+
|
| 166 |
+
- id: pharma_drug_012
|
| 167 |
+
title: "Amoxxetine60 β Drug Profile"
|
| 168 |
+
content: >
|
| 169 |
+
Amoxxetine60 is indicated for the treatment or management of Allergy relief. Known adverse events include: Dry mouth. Contraindicated in patients with: Allergic reaction. Prescriber warning: Do not operate machinery. Serious unexpected adverse events must be reported to the regulatory authority within 15 days.
|
| 170 |
+
tags: ["amoxxetine60", "allergy-relief", "adverse-event", "drug-profile"]
|
| 171 |
+
|
| 172 |
+
- id: pharma_drug_013
|
| 173 |
+
title: "Zylomab54 β Drug Profile"
|
| 174 |
+
content: >
|
| 175 |
+
Zylomab54 is indicated for the treatment or management of Fungal infections. Known adverse events include: Rash, Diarrhea, Insomnia. Contraindicated in patients with: Liver disease. Prescriber warning: Monitor blood pressure. Serious unexpected adverse events must be reported to the regulatory authority within 15 days.
|
| 176 |
+
tags: ["zylomab54", "fungal-infections", "adverse-event", "drug-profile"]
|
| 177 |
+
|
| 178 |
+
- id: pharma_drug_014
|
| 179 |
+
title: "Amoxstatin52 β Drug Profile"
|
| 180 |
+
content: >
|
| 181 |
+
Amoxstatin52 is indicated for the treatment or management of Depression treatment. Known adverse events include: Constipation, Diarrhea, Blurred vision. Contraindicated in patients with: Pregnancy. Prescriber warning: Do not operate machinery. Serious unexpected adverse events must be reported to the regulatory authority within 15 days.
|
| 182 |
+
tags: ["amoxstatin52", "depression-treatment", "adverse-event", "drug-profile"]
|
| 183 |
+
|
| 184 |
+
- id: pharma_drug_015
|
| 185 |
+
title: "Virazole50 β Drug Profile"
|
| 186 |
+
content: >
|
| 187 |
+
Virazole50 is indicated for the treatment or management of Viral infections. Known adverse events include: Headache, Dizziness, Constipation. Contraindicated in patients with: Seizures. Prescriber warning: May cause drowsiness. Serious unexpected adverse events must be reported to the regulatory authority within 15 days.
|
| 188 |
+
tags: ["virazole50", "viral-infections", "adverse-event", "drug-profile"]
|
scripts/kaggle_to_yaml.py
CHANGED
|
@@ -24,9 +24,12 @@ from pathlib import Path
|
|
| 24 |
KNOWLEDGE_ROOT = Path(__file__).parent.parent / "knowledge"
|
| 25 |
|
| 26 |
_DRUG_COLS = ["drug_name", "Drug Name", "name", "drug", "drugName"]
|
| 27 |
-
_USE_COLS = ["medical_condition", "condition", "use", "uses",
|
|
|
|
| 28 |
_EFFECT_COLS = ["side_effects", "Side_Effects", "Side Effects", "sideEffects",
|
| 29 |
"adverse_effects", "adverse_events"]
|
|
|
|
|
|
|
| 30 |
|
| 31 |
|
| 32 |
def _find_col(headers: list[str], candidates: list[str]) -> str | None:
|
|
@@ -71,12 +74,15 @@ def convert(csv_path: Path, max_drugs: int, dry_run: bool, domain: str) -> None:
|
|
| 71 |
drug_col = _find_col(headers, _DRUG_COLS)
|
| 72 |
use_col = _find_col(headers, _USE_COLS)
|
| 73 |
effect_col = _find_col(headers, _EFFECT_COLS)
|
|
|
|
|
|
|
| 74 |
|
| 75 |
if not drug_col:
|
| 76 |
print(f"ERROR: no drug name column found. Headers: {headers}", file=sys.stderr)
|
| 77 |
sys.exit(1)
|
| 78 |
|
| 79 |
-
print(f"Detected columns β drug: {drug_col!r}, use: {use_col!r},
|
|
|
|
| 80 |
|
| 81 |
blocks: list[str] = []
|
| 82 |
seen: set[str] = set()
|
|
@@ -92,15 +98,25 @@ def convert(csv_path: Path, max_drugs: int, dry_run: bool, domain: str) -> None:
|
|
| 92 |
|
| 93 |
condition = row.get(use_col, "").strip() if use_col else ""
|
| 94 |
effects = row.get(effect_col, "").strip() if effect_col else ""
|
|
|
|
|
|
|
|
|
|
| 95 |
condition_str = condition or "the indicated condition"
|
| 96 |
effects_str = _truncate(effects) if effects else "not listed"
|
| 97 |
|
| 98 |
-
|
| 99 |
-
f"{drug} is indicated for the treatment or management of {condition_str}.
|
| 100 |
-
f"Known adverse events
|
| 101 |
-
|
| 102 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
)
|
|
|
|
| 104 |
|
| 105 |
tags = list(filter(None, [
|
| 106 |
_slugify(drug),
|
|
|
|
| 24 |
KNOWLEDGE_ROOT = Path(__file__).parent.parent / "knowledge"
|
| 25 |
|
| 26 |
_DRUG_COLS = ["drug_name", "Drug Name", "name", "drug", "drugName"]
|
| 27 |
+
_USE_COLS = ["indications", "medical_condition", "condition", "use", "uses",
|
| 28 |
+
"indication", "Medical Condition"]
|
| 29 |
_EFFECT_COLS = ["side_effects", "Side_Effects", "Side Effects", "sideEffects",
|
| 30 |
"adverse_effects", "adverse_events"]
|
| 31 |
+
_CONTRA_COLS = ["contraindications", "contraindication", "Contraindications"]
|
| 32 |
+
_WARN_COLS = ["warnings", "warning", "Warnings", "precautions"]
|
| 33 |
|
| 34 |
|
| 35 |
def _find_col(headers: list[str], candidates: list[str]) -> str | None:
|
|
|
|
| 74 |
drug_col = _find_col(headers, _DRUG_COLS)
|
| 75 |
use_col = _find_col(headers, _USE_COLS)
|
| 76 |
effect_col = _find_col(headers, _EFFECT_COLS)
|
| 77 |
+
contra_col = _find_col(headers, _CONTRA_COLS)
|
| 78 |
+
warn_col = _find_col(headers, _WARN_COLS)
|
| 79 |
|
| 80 |
if not drug_col:
|
| 81 |
print(f"ERROR: no drug name column found. Headers: {headers}", file=sys.stderr)
|
| 82 |
sys.exit(1)
|
| 83 |
|
| 84 |
+
print(f"Detected columns β drug: {drug_col!r}, use: {use_col!r}, "
|
| 85 |
+
f"effects: {effect_col!r}, contra: {contra_col!r}, warnings: {warn_col!r}")
|
| 86 |
|
| 87 |
blocks: list[str] = []
|
| 88 |
seen: set[str] = set()
|
|
|
|
| 98 |
|
| 99 |
condition = row.get(use_col, "").strip() if use_col else ""
|
| 100 |
effects = row.get(effect_col, "").strip() if effect_col else ""
|
| 101 |
+
contra = row.get(contra_col, "").strip() if contra_col else ""
|
| 102 |
+
warnings = row.get(warn_col, "").strip() if warn_col else ""
|
| 103 |
+
|
| 104 |
condition_str = condition or "the indicated condition"
|
| 105 |
effects_str = _truncate(effects) if effects else "not listed"
|
| 106 |
|
| 107 |
+
parts = [
|
| 108 |
+
f"{drug} is indicated for the treatment or management of {condition_str}.",
|
| 109 |
+
f"Known adverse events include: {effects_str}.",
|
| 110 |
+
]
|
| 111 |
+
if contra:
|
| 112 |
+
parts.append(f"Contraindicated in patients with: {contra}.")
|
| 113 |
+
if warnings:
|
| 114 |
+
parts.append(f"Prescriber warning: {warnings}.")
|
| 115 |
+
parts.append(
|
| 116 |
+
"Serious unexpected adverse events must be reported to the regulatory "
|
| 117 |
+
"authority within 15 days."
|
| 118 |
)
|
| 119 |
+
content = " ".join(parts)
|
| 120 |
|
| 121 |
tags = list(filter(None, [
|
| 122 |
_slugify(drug),
|