[PyHealth2.0 Bounty] OMOP Readmission Prediction #788
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR updates the
readmission_prediction_omop_fnfor PyHealth 2.0. It is a follow on to #751.In addition to supporting PyHealth 2.0, the new
ReadmissionPredictionOMOPtask has the following improvements. First, it takes adatetime.timedeltainstead of anintfor 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,
ReadmissionPredictionOMOPshould be logically equivalent toreadmission_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 toexamples/readmission/.Additionally, I updated
tests/core/test_omop.pyto fail if it cannot findtest-resources/omopinstead of skipping.Testing
tests/core/test_omop_readmission_prediction.pytest-resources/omopto facilitate unit testingexamples/readmission/readmission_omop_rnn.pyexamples/readmission/readmission_mimic3_rnn.py