-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fix criteria offsets #19
Conversation
WalkthroughThe changes involve updates to two YAML configuration files related to predicting health conditions in patients. The first file refines criteria for predicting Chronic Kidney Disease (CKD) in diabetic patients, clarifying eligibility and timeframes. The second file adjusts time windows for assessing myocardial infarction (MI) occurrences following annual physicals, ensuring clearer definitions for input and target periods. Both files maintain existing structures while enhancing specificity in their respective tasks. Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Outside diff range and nitpick comments (2)
src/MEDS_DEV/tasks/criteria/disease_progression/diabetes/ckd_post_kidney_labs.yaml (2)
75-75
: Approved: Time window accurately defined. Consider minor improvement.The change from a relative term to "1825D" (1825 days) for the 5-year period is correct and aligns well with the PR objectives. This improves clarity and precision in the time window definition.
For consistency with other time expressions in the file (e.g., "90d" on line 70), consider using lowercase 'd' instead of uppercase 'D'. Apply this minor change:
- end: start + 1825D # 5 years + end: start + 1825d # 5 years
Line range hint
1-84
: Placeholder values need to be replacedI noticed that several predicates in the file use placeholder values (???). These need to be replaced with actual values or expressions for the task to function correctly.
Would you like assistance in identifying which predicates need to be defined and suggestions for their potential implementations?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
- src/MEDS_DEV/tasks/criteria/disease_progression/diabetes/ckd_post_kidney_labs.yaml (1 hunks)
- src/MEDS_DEV/tasks/criteria/phenotyping/outpatient/MI/1y-5y.yaml (1 hunks)
start: trigger + 365D | ||
end: start + 1825D # 5 years |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Inconsistency Found in Time Window Definitions
The end
time is currently set to start + 1825D
, which results in a total duration of approximately 6 years instead of the intended 5 years.
- File: src/MEDS_DEV/tasks/criteria/phenotyping/outpatient/MI/1y-5y.yaml
start: trigger + 365D
end: start + 1825D # 5 years
🔗 Analysis chain
Approve the conversion to days, but verify the use of 'start' for the end time
The changes align with the PR objective of expressing years in terms of days, which improves precision. The added comment clarifying that 1825D represents 5 years enhances readability.
Please confirm if start + 1825D
is semantically equivalent to the previous trigger + 5y
. If not, consider using trigger + 1825D
to maintain consistency with the description that mentions "between 1 and 5 years after their annual physical".
To verify the impact of this change and ensure consistency, you can run the following script:
This will help ensure consistency across similar task definitions.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for other occurrences of time windows defined relative to 'trigger' or 'start'
# Search for 'trigger' and 'start' in time window definitions
rg --type yaml 'trigger \+|\bstart \+' src/MEDS_DEV/tasks/criteria/phenotyping/
Length of output: 357
@@ -22,14 +22,14 @@ | |||
index_timestamp: end | |||
gap: | |||
start: trigger | |||
end: trigger + 1y | |||
end: start + 365D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Inconsistent Time Window Definitions After Conversion
The change from trigger + 1y
to start + 365D
in src/MEDS_DEV/tasks/criteria/phenotyping/outpatient/MI/1y-5y.yaml
results in:
start: trigger + 365D
end: start + 365D
(effectivelytrigger + 730D
)end: start + 1825D
(# 5 years)
This adjustment shifts the gap window from one year after the trigger to two years, which may deviate from the intended criteria of "within 1 year of their annual physical."
🔗 Analysis chain
Approve the conversion to days, but verify the use of 'start'
The change from trigger + 1y
to start + 365D
aligns with the PR objective of expressing years in terms of days, which improves precision. However, using start
instead of trigger
might alter the semantic meaning of the gap window.
Please confirm if start + 365D
is semantically equivalent to the previous trigger + 1y
. If not, consider using trigger + 365D
to maintain consistency with the description that mentions "within 1 year of their annual physical".
To verify the impact of this change, you can run the following script:
This will help ensure consistency across similar task definitions.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for other occurrences of time windows defined relative to 'trigger' or 'start'
# Search for 'trigger' and 'start' in time window definitions
rg --type yaml 'trigger \+|\bstart \+' src/MEDS_DEV/tasks/criteria/phenotyping/
Length of output: 357
Script:
#!/bin/bash
# Description: Verify consistency of time window definitions across all phenotyping outpatient MI YAML files
# Search for YAML files in src/MEDS_DEV/tasks/criteria/phenotyping/outpatient/MI/ directory
fd --type f --extension yaml src/MEDS_DEV/tasks/criteria/phenotyping/outpatient/MI/ | while read file; do
echo "File: $file"
rg 'start\s*:\s*trigger\s*\+\s*\d+D' "$file"
rg 'end\s*:\s*start\s*\+\s*\d+D' "$file"
done
Length of output: 619
Script:
#!/bin/bash
# Description: Verify consistency of time window definitions across all phenotyping outpatient MI YAML files
# Search for YAML files in src/MEDS_DEV/tasks/criteria/phenotyping/outpatient/MI/ directory using a match-all pattern
fd . --type f --extension yaml --full-path 'src/MEDS_DEV/tasks/criteria/phenotyping/outpatient/MI/' | while read file; do
echo "File: $file"
rg 'start\s*:\s*trigger\s*\+\s*\d+D' "$file"
rg 'end\s*:\s*start\s*\+\s*\d+D' "$file"
done
Length of output: 559
Year must be expressed in terms of days, so 1Y = 365D then 5Y = 1865D
Summary by CodeRabbit
New Features
Bug Fixes