Skip to content

feat: add CDISC PPTESTCD/PPTEST columns to PKNCAresults#536

Draft
Gero1999 wants to merge 12 commits intohumanpred:mainfrom
Gero1999:403-cdisc-columns
Draft

feat: add CDISC PPTESTCD/PPTEST columns to PKNCAresults#536
Gero1999 wants to merge 12 commits intohumanpred:mainfrom
Gero1999:403-cdisc-columns

Conversation

@Gero1999
Copy link
Copy Markdown
Contributor

Description

Add CDISC PPTESTCD and PPTEST column support to as.data.frame.PKNCAresults(). Each NCA parameter registered via add.interval.col() now carries optional pptestcd_cdisc and pptest_cdisc metadata. When results are extracted, these are mapped into output columns.

Route-dependent parameters (CL, VZ, MRT, VSS and their dose-normalized variants) use nested lists keyed by \"intravascular\" / \"extravascular\" so the correct CDISC code is selected based on the dosing route.

Key changes:

  • add.interval.col() accepts pptestcd_cdisc and pptest_cdisc arguments (default to parameter name/description)
  • All parameter registration calls across 9 source files updated with CDISC mappings
  • as.data.frame.PKNCAresults() extracts CDISC columns from formalsmap metadata
  • Dose-normalized parameters in zzz-pk.calc.dn.R also carry CDISC mappings
  • 212-line test suite covering standard, route-dependent, and DN parameters

Related Issue(s)

Fixes #403

How to test

library(PKNCA)

# Verify CDISC metadata is stored
PKNCA:::.getIntervalColFormalsMap()[[\"cmax\"]]$pptestcd_cdisc
# Expected: \"CMAX\"

# Run the test suite
devtools::test(filter = \"cdisc\")
```"

Gero1999 added 10 commits April 20, 2026 15:04
New optional arguments for CDISC standard parameter code and name.
Accepts a character string for simple mappings or a named list for
route-dependent mappings. Defaults to name/desc when not provided.
Map all NCA parameters to CDISC PPTESTCD/PPTEST codes. Route-dependent
parameters (CL, VZ, MRT, VSS) use nested lists to distinguish
intravascular (IC) and extravascular (EV) CDISC codes.
Add as.data.frame.PKNCAresults() logic to extract PPTESTCD and PPTEST
columns from the CDISC metadata stored in each parameter's formalsmap.
Handles route-dependent parameters by matching against the dosing route.
Map DN parameters to their CDISC PPTESTCD/PPTEST codes. Uses the same
route-dependent nested list pattern for CL, VZ, MRT, and VSS variants.
Add pptestcd_cdisc and pptest_cdisc to expected lists in
test-001-add.interval.col.R. Remove test-cdisc.R; CDISC output tests
now live in test-class-PKNCAresults.R.
When out_format='cdisc' and any PPTESTCD contains 'INT', add PPSTINT
and PPENINT columns with ISO 8601 durations relative to the last dose
time. The time unit designator is derived from timeu_pref or timeu.
…esults.R

Cover PPTESTCD/PPTEST translation, route-dependent resolution,
PPSTINT/PPENINT with various time units, multi-dose relative timing,
and format_iso8601_duration edge cases.
@Gero1999 Gero1999 force-pushed the 403-cdisc-columns branch from 011c3e5 to 7be890e Compare April 22, 2026 09:16
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.

Add SDTM columns to output

1 participant