Skip to content

Conversation

@EricSchrock
Copy link
Collaborator

@EricSchrock EricSchrock commented Jan 17, 2026

Overview

This PR updates the readmission_prediction_omop_fn for PyHealth 2.0. It is a follow on to #751.

In addition to supporting PyHealth 2.0, the new ReadmissionPredictionOMOP task has the following improvements. First, it takes a datetime.timedelta instead of an int for the readmission window, making the input parameter clearer and more flexible. Second, it can optionally exclude visits where the patient was under 18 years old (a previously unimplemented #todo).

Besides the items listed above, ReadmissionPredictionOMOP should be logically equivalent to readmission_prediction_omop_fn.

Other Changes

I ported the best practices from #777 to examples/readmission_mimic3_rnn.py (main guard and resource cleanup). To avoid creating a merge conflict with #773, I also moved this updated example file to examples/readmission/.

Additionally, I updated tests/core/test_omop.py to fail if it cannot find test-resources/omop instead of skipping.

Testing

  • Added tests/core/test_omop_readmission_prediction.py
  • Added a few canned entries to test-resources/omop to facilitate unit testing
  • Added and ran examples/readmission/readmission_omop_rnn.py
  • Ran the updated examples/readmission/readmission_mimic3_rnn.py

@EricSchrock EricSchrock added component: task Contribute a new task to PyHealth bounty Please see the bounty list in PyHealth Discord Server labels Jan 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bounty Please see the bounty list in PyHealth Discord Server component: task Contribute a new task to PyHealth

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant