CLAUDE.md: Rewrite the "Version and date bump" subsection to document that:
- Exactly ONE version bump is allowed per PR (PRs are squash-merged into one
commit on the default branch, so one commit = one version increment)
- The correct version is computed from git history:
currentversion="${currenttag}.$((commits_since_tag + 9001 + 1))"
with the +1 accounting for the PR's own squash commit not yet on the
default branch
- Fall back to incrementing DESCRIPTION's version by 1 if git describe fails
- The Date: field tracks the date of the *last* PR commit (updated each time)
DESCRIPTION / NEWS.md: Correct the version from 3.0.1.9030 back to 3.0.1.9029.
Two version bumps were made across two commits in this PR; since it will be
squash-merged as one commit only one bump is correct. Also update Date to
today (2026-03-07).
https://claude.ai/code/session_01Cp154UtssHg84bw38xiiTG
R/sir.R (line 571):
Guard purely numeric strings (e.g. "1", "8") from the Unicode letter
filter. Values matching the broad SIR regex but consisting only of digits
must not be stripped; add `x %unlike% "^[0-9+]$"` predicate.
R/mic.R (lines 220-222):
Preserve the letter 'e' during Unicode-letter removal so that MIC values
in scientific notation (e.g. "1e-3", "2.5e-2") survive the cleaning step.
- Line 220: [\\p{L}] → [^e\\P{L}] (remove all letters except 'e')
- Line 222: [^0-9.><= -]+ → [^0-9e.><= -]+ (allow 'e' in whitelist)
tests/testthat/test-mdro.R:
New tests for the drug+inhibitor inference added in the previous commit
(issue #209):
- TZP=R with no PIP column → PIP inferred R → MDRO class elevated
- TZP=S with no PIP column → proxy col is NA (not S) → class lower
- verbose mode emits "Inferring resistance" message
- AMC=R with no AMX column runs without error (Enterococcus faecium)
https://claude.ai/code/session_01Cp154UtssHg84bw38xiiTG
When a base beta-lactam column (e.g., piperacillin/PIP) is absent but a
corresponding drug+inhibitor combination (e.g., piperacillin/tazobactam/TZP)
is present and resistant, resistance in the base drug is now correctly
inferred. This is clinically sound: resistance in a combination implies the
inhibitor provided no benefit, so the base drug is also resistant.
Susceptibility in a combination is NOT propagated to the base drug (the
inhibitor may be responsible for susceptibility), so only R values are
inferred; missing base drugs remain NA otherwise.
Implementation details:
- Uses AB_BETALACTAMS_WITH_INHIBITOR to identify all beta-lactam+inhibitor
combinations present in the user's data
- Derives base drug AB codes by stripping the "/inhibitor" part from names
- Creates synthetic proxy columns (.sir_proxy_<AB>) in x, set to "R" when
any matching combination is R, otherwise NA
- Proxy columns are added to cols_ab before drug variable assignment,
so all existing guideline logic benefits without any changes
- Multiple combos for the same base drug are OR-ed (any R → R)
- Adds internal ab_without_inhibitor() helper for the name->base mapping
- Verbose mode reports which combinations are used for inference
Bumps version: 3.0.1.9028 -> 3.0.1.9029
https://claude.ai/code/session_01Cp154UtssHg84bw38xiiTG
* fix: restore valid AB codes mangled by generalise_antibiotic_name() (#245)
When as.ab() received a vector containing both valid AB codes (like ETH,
PHN, PHE, STH, THA, MTH, THI1) and an untranslatable value, the fast
path at line 100 was skipped. The slow path then applied
generalise_antibiotic_name(), which rewrites "TH"->"T" and "PH"->"F",
mangling these short AB codes (e.g. ETH->"ET", PHN->"FN") so they could
no longer be found in the lookup table.
Fix: save the pre-generalised values before applying
generalise_antibiotic_name(), then restore any elements that were already
valid AB codes in their original form.
https://claude.ai/code/session_01Sujw89qa48NoUmMPDBJLz9
* fix: use toupper() in AB code restoration to handle lowercase input (#245)
Ensures that lowercase user input (e.g. 'eth', 'phn') is matched
case-insensitively against the uppercase AB codes in $ab, and that
the restored value is stored in uppercase to match the lookup table.
https://claude.ai/code/session_01Sujw89qa48NoUmMPDBJLz9
* revert: remove unnecessary toupper() since x is already uppercased
https://claude.ai/code/session_01Sujw89qa48NoUmMPDBJLz9
* Revise versioning and date bump requirements for PRs
Updated versioning instructions for pull requests to include date bump.
---------
Co-authored-by: Claude <noreply@anthropic.com>