Skip to content

Add allergy conflict detection task, dataset, and tests #461

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cpaa4
Copy link

@cpaa4 cpaa4 commented May 7, 2025

Net Id: Chidiebere Anichebe ([email protected]), Naveen Baskaran([email protected])

Contribution Type: Dataset and Task

Project Description: This contribution introduces a new PyHealth-compatible dataset and task for detecting medication-allergy conflicts using free-text MIMIC-IV discharge summaries.

The dataset (MedAllergyConflictDataset) extracts prescribed medications and documented allergies from each patient’s discharge note, normalizes them using the RxNorm API, and converts them to ingredient-level CUIs. The associated task (AllergyConflictDetectionTask) labels each patient admission as a conflict case (1) or no conflict (0) based on whether any medication CUI overlaps with the allergy CUIs.

This functionality addresses potential allergic reactions that might not be caught by generic name matching and demonstrates how PyHealth can integrate clinical text, external APIs, and structured labeling.

Files:

  1. pyhealth/datasets/med_allergy_conflict_dataset.py - Custom dataset class that loads and processes MIMIC-IV discharge summaries. This also takes care of the preprocessing step and cleaning the file ready for labeling by the task class.
  2. pyhealth/tasks/allergy_conflict_task.py - Task class that defines labeling logic for medication-allergy conflict detection.
  3. yhealth/tasks/test_allergy_conflict_task.py - Unit tests verifying that labels are correctly generated and conflicts exported.

Contributors:
@cpaa4 , @naveenkcb

@Jathurshan0330 Jathurshan0330 added the Highlight for TAs to highlight label May 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Highlight for TAs to highlight
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants