Skip to content

Conversation

@cpaa4
Copy link

@cpaa4 cpaa4 commented May 7, 2025

Net Id: Chidiebere Anichebe (cpa4@illinois.edu), Naveen Baskaran(nc42@illinois.edu)

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