Skip to content

Calculate and validate SCORE2-Diabetes test expected values #17

@fbraza

Description

@fbraza

Issue Description

The SCORE2-Diabetes implementation (PR #16) includes test structure with placeholder values that need to be calculated and validated using MDCalc before the tests can be properly executed.

Problem

  • All test expected values in tests/test_score2_diabetes.py are placeholders (0.00, "PLACEHOLDER")
  • Test assertions are commented out, preventing actual validation
  • 6 test cases covering diverse scenarios need proper expected values calculated

Test Cases Requiring Validation

Test Files in tests/inputs/score2_diabetes/:

  1. Patient 01: Male, 45 years, non-smoker, good diabetes control (HbA1c: 48)
  2. Patient 02: Female, 55 years, smoker, poor control (HbA1c: 58)
  3. Patient 03: Male, 65 years, non-smoker, very poor control (HbA1c: 68, low eGFR: 60)
  4. Patient 04: Female, 48 years, non-smoker, excellent control (HbA1c: 42)
  5. Patient 05: Male, 60 years, smoker, poor control (HbA1c: 75, very low eGFR: 50)
  6. Patient 06: Female, 42 years, smoker, moderate control (HbA1c: 53)

Required Actions

Phase 1: Calculate Expected Values

  • Use MDCalc SCORE2-Diabetes calculator for each test case
  • Record calculated risk percentages
  • Determine risk categories based on age groups:
    • <50 years: Low to moderate (<2.5%), High (2.5-7.5%), Very high (≥7.5%)
    • 50-69 years: Low to moderate (<5%), High (5-10%), Very high (≥10%)

Phase 2: Update Test File

  • Replace placeholder values with calculated values
  • Uncomment test assertions:
    assert pred_risk_category == expected_category
    assert pytest.approx(pred_risk, abs=0.1) == expected_risk
  • Update test parametrize decorator with real expected values

Phase 3: Comprehensive Edge Case Testing

  • Add edge case tests for boundary values
  • Test age boundaries (40, 49, 50, 69 years)
  • Test extreme biomarker values within reasonable ranges
  • Test different diabetes control scenarios

Example Expected Format

@pytest.mark.parametrize(
    "filename,expected",
    [
        ("test__input__patient_01.json", (45.00, 8.52, "High")),  # Example values
        ("test__input__patient_02.json", (55.00, 12.34, "Very high")),
        # ... etc
    ],
)

Success Criteria

  • All 6 test cases have validated expected values
  • Tests pass when run with make test
  • Risk categories align with age-specific thresholds
  • Test coverage includes diverse diabetes scenarios

Priority

High - This blocks proper validation of the SCORE2-Diabetes implementation

Related

Notes

  • Use Belgium (Low Risk) region calibration as implemented
  • Ensure calculated values match the implementation's Belgium calibration
  • Consider adding comments explaining specific risk scenarios for each test case

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions