-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Issue Description
The SCORE2 and SCORE2-Diabetes algorithms are designed for patients aged 40-69 years, but the current implementations don't validate this age range.
Problem
- No validation that age is within the 40-69 year range in both SCORE2 and SCORE2-Diabetes modules
- Could lead to incorrect risk calculations for patients outside this range
- SCORE2-Diabetes has additional concern: patients aged 70+ fall into the 50-69 logic without explicit upper bound validation
Suggested Implementation
For SCORE2 (vitals/score2/compute.py):
def cardiovascular_risk(filepath: str) -> tuple[float, float, str]:
# Extract biomarkers...
age = biomarkers.age
# Add age validation
if age < 40 or age > 69:
raise ValueError(f"SCORE2 is only validated for ages 40-69. Patient age: {age}")
# Continue with calculations...For SCORE2-Diabetes (vitals/score2_diabetes/compute.py):
def cardiovascular_risk(filepath: str | Path) -> tuple[float, float, RiskCategory]:
# Extract biomarkers...
age: float = biomarkers.age
# Add age validation
if not 40 <= age <= 69:
raise ValueError(f"SCORE2-Diabetes is validated for ages 40-69, got {age}")
# Continue with calculations...Impact
- Ensures the algorithms are only used for their validated populations
- Prevents misuse and incorrect risk assessments
- Improves code robustness in both modules
- Addresses edge case handling for age boundaries
Related
- PR feat: Implement SCORE2 cardiovascular risk assessment algorithm #2: feat: Implement SCORE2 cardiovascular risk assessment algorithm
- PR feat: implement SCORE2-Diabetes cardiovascular risk algorithm #16: feat: implement SCORE2-Diabetes cardiovascular risk algorithm
- SCORE2 specification mentions target population: "European patients aged 40-69 years"
- SCORE2-Diabetes specification also targets ages 40-69
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request