sas_note.RdEvery derivation in admiralease exists because a SAS macro or DATA
step is rewritten for it on every study. sas_note() returns that mapping at
the console, so a reviewer moving from SAS can see what a function stands in
for without opening the help page. The same text appears in each function's
"Replaces this SAS idiom" help section.
sas_note(derivation = NULL)An admiralease_sas_note object: a list of entries, each with
derivation, sas (the idiom replaced) and note (what changes), with a
print() method.
sas_note("collapse_ae_episodes")
#>
#> ── collapse_ae_episodes() ──
#>
#> • SAS idiom replaced: %AE_EPISODE - PROC SORT BY usubjid aedecod astdt, then a
#> BY-group RETAIN of _prev_end with IF astdt - _prev_end > 1 THEN episode + 1;
#> ✔ Merging against the running maximum end date, not the previous record's end
#> date, which is the bug the RETAIN version hides; ongoing events (missing end
#> date) are handled explicitly.
sas_note()
#>
#> ── grade_lab() ──
#>
#> • SAS idiom replaced: %LABGRADE / %CTCAE - a DATA step of nested IF paramcd =
#> 'ALT' AND aval > 3*anrhi THEN atoxgr = 2; ELSE IF ... branches, one block per
#> parameter, re-typed per study.
#> ✔ The hand-typed branches become published NCI-CTCAE lab criteria (admiral
#> package data, selectable v4/v5/US-conventional/DAIDS); the IF/ELSE cascade
#> becomes one call, and grade 0 is distinguished from a missing or uncovered
#> result rather than both landing on 0. Lab terms only - the criteria cover 40
#> lab terms, not the full CTCAE term set.
#>
#> ── collapse_ae_episodes() ──
#>
#> • SAS idiom replaced: %AE_EPISODE - PROC SORT BY usubjid aedecod astdt, then a
#> BY-group RETAIN of _prev_end with IF astdt - _prev_end > 1 THEN episode + 1;
#> ✔ Merging against the running maximum end date, not the previous record's end
#> date, which is the bug the RETAIN version hides; ongoing events (missing end
#> date) are handled explicitly.
#>
#> ── derive_pop_flags() ──
#>
#> • SAS idiom replaced: %POPFLAG - the ADSL DATA step block of IF trtsdt NE .
#> THEN saffl = 'Y'; ELSE saffl = 'N'; repeated once per analysis population.
#> ✔ Population definitions live in a table that maps one-to-one onto the
#> protocol; an unevaluable condition stops the run naming the flag instead of
#> quietly writing a missing value.
names(sas_note())
#> [1] "grade_lab" "collapse_ae_episodes" "derive_pop_flags"