Skip to content

Support fractional age values for trial eligibility filtering#204

Merged
imaurer merged 3 commits intomainfrom
fix-age-fractional-year
Mar 13, 2026
Merged

Support fractional age values for trial eligibility filtering#204
imaurer merged 3 commits intomainfrom
fix-age-fractional-year

Conversation

@imaurer
Copy link
Collaborator

@imaurer imaurer commented Mar 13, 2026

Summary

  • Change --age CLI flag and TrialSearchFilters.age field from u32 to f32 to support fractional year values (e.g. 0.5 for 6 months)
  • Update verify_age_eligibility to drop the now-redundant age as f32 cast
  • Add help text clarifying that decimals are accepted (e.g. 0.5 for 6 months)
  • Add --age 0.5 --count-only example to the search trial EXAMPLES block and list trial reference output
  • Add a fractional-age regression contract to spec/04-trial.md with timeout=180 to accommodate the CTGov age-only count traversal cost
  • Add a CLI parse test asserting that non-numeric --age abc input is rejected with a clear error

Test plan

  • biomcp search trial --age 0.5 --count-only exits 0 and returns a numeric Total:
  • biomcp search trial --age 67 --count-only exits 0 (integer backward compatibility)
  • biomcp search trial --age abc --count-only exits non-zero with a float parse error
  • --help output shows "decimals accepted, e.g. 0.5 for 6 months" and the new EXAMPLES entry
  • 596 unit tests pass, clippy clean

@imaurer imaurer merged commit 105af38 into main Mar 13, 2026
3 checks passed
@imaurer imaurer deleted the fix-age-fractional-year branch March 13, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant