Conversation
- Parse sub-year age units (months, weeks, days) in eligibility age checks so trials with minimum ages like "6 Months" filter correctly - Return CTGov's upstream next-page token after an offset is satisfied within a page, preventing compound cursor format and keeping pagination stable across page boundaries - Add token-boundary matching for hyphenated biomarker terms with plus suffixes (e.g. PD-L1+) so keyword filters neither over- nor under-match New unit tests cover all four fix paths: parse_age_years for each unit, verify_age_eligibility for sub-year min/max, PD-L1+ token matching, and the CTGov cursor regression case.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Sub-year age eligibility:
parse_age_yearsnow converts months, weeks, and days to fractional years so trials with minimum ages like "6 Months" are correctly included or excluded when filtering by patient age. Previously only integer-year values were handled, causing all sub-year age bounds to be silently ignored.CTGov cursor stability: When an offset is fully satisfied within a fetched page, the search loop now stops at the page boundary and carries forward the upstream
nextPageTokenas-is. This prevents a compound cursor format from appearing and ensures callers can resume cleanly from the correct position.PD-L1+ token matching:
contains_keyword_tokensnow correctly matches hyphenated biomarker terms with a trailing+(e.g.PD-L1+) against text containing that exact token, while rejecting similar but non-matching text likePD-L1 positive.Test plan
parse_age_yearsreturns correct fractional values for months, weeks, and daysverify_age_eligibilitycorrectly filters trials with sub-year minimum and maximum agescontains_keyword_tokensacceptsPD-L1+in matching text and rejects non-matching textcargo test)cargo clippy -- -D warningscleancargo fmt --checkclean