feat: add CDISC PPTESTCD/PPTEST columns to PKNCAresults#536
Draft
Gero1999 wants to merge 12 commits intohumanpred:mainfrom
Draft
feat: add CDISC PPTESTCD/PPTEST columns to PKNCAresults#536Gero1999 wants to merge 12 commits intohumanpred:mainfrom
Gero1999 wants to merge 12 commits intohumanpred:mainfrom
Conversation
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.
011c3e5 to
7be890e
Compare
008f37c to
c74c4e6
Compare
Member
|
Can you please add tests for the newly missing lines? https://app.codecov.io/gh/humanpred/pknca/pull/536 Also, I have removed document.yaml in |
91f12bd to
be16dae
Compare
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.
Fixes #403
What this does
Adds
out_format = \"cdisc\"toas.data.frame.PKNCAresults(). Translates PPTESTCD to CDISC PP domain codes and adds a PPTEST column.Key design decisions
CDISC metadata stored in
add.interval.col()— newpptestcd_cdisc/pptest_cdiscargs, defaulting to parameter name/description. All parameter files updated.Route-dependent codes — CL, VZ, MRT, VSS use
list(route = list(extravascular = ..., intravascular = ...)). Resolved per row by joining against dose data. Falls back to extravascular. Seeresolve_cdisc_value()andpknca_cdisc_get_route()inclass-PKNCAresults.R.PPSTINT/PPENINT columns — Added when any PPTESTCD contains "INT". ISO 8601 durations relative to last dose time (most recent dose ≤ interval start). Time unit designator from
timeu_prefortimeu. Only populated for INT rows,NAotherwise.DN parameters — Inherit base CDISC code with "D" appended. Route-dependent lists passed through unchanged.
Files changed
R/001-add.interval.col.R— new argsR/class-PKNCAresults.R— translation + PPSTINT/PPENINT logicR/zzz-pk.calc.dn.R— DN CDISC derivationadd.interval.col()callstests/testthat/test-class-PKNCAresults.R— 9 new testsHow to test