Review ask

As a clinical trial statistician or programmer, answer two short questions in Your review: the task and the inputs and outputs. Agreeing with both approves this benchmark; disagreeing with either needs a comment. Propose a fix with the Edit button on any source file, or add it to your comments.

We suggest spending no more than 5 minutes on a review. The other tabs beside Your review are background for assessment, not under review.

Summary

Lifecycle: draftEditUnder review
What this benchmark means
README.md

Public entries: Python and R. Passing coverage requires an installed inventory.

Goal: give each dose and sample row of a population pharmacokinetic (PK) dataset the datetime of the subject's first dose and of the latest dose before the row, while each dose row carries its number of additional doses (ADDL) and interdose interval (II), all from each dose record's span, stated once.

Input: one spec.yaml over collected exposure records (EX), each with a dose, a dosing frequency and start and end dates that may lack a time, and concentration records (PC), each with a sample datetime.

Variables:

  • EVID: 1 on a dose row, one per exposure record; 0 on a sample row, one per concentration record.
  • SEQ: the exposure record's sequence number on a dose row, the concentration record's on a sample row.
  • ADTM: the dose's start, a missing time taken as the start of the day, or the sample's datetime.
  • AMT, ADDL, II: on a dose row, its dose, the number of whole intervals between its start and its end, a missing end time taken as the end of the day, and the interval in hours (QD 24, BID 12); empty on a sample row.
  • FADTM: the start of the subject's earliest dose record.
  • PADTM: the start of the latest dose record that starts strictly before ADTM; empty when none does, so a dose row never takes its own record and a sample taken at a dose's start takes the dose before it, if there is one.

Note: each dose record's completed start, end and dosing interval are calculated once. The dose row, the subject's first-dose selection and each prior-dose selection all read those same completed values.

Inputs

Under review
2 source files

input/ex.csv

Edit
3 rows
input/ex.csv
USUBJIDEXSEQEXDOSEEXDOSFRQEXSTDTCEXENDTC
1100QD2025-03-03T08:002025-03-07T08:00
250BID2025-03-10T08:002025-03-12
150QD2025-03-032025-03-04T09:00

input/pc.csv

Edit
5 rows
input/pc.csv
USUBJIDPCSEQPCDTC
12025-03-03T07:00
22025-03-05T10:00
32025-03-11T09:00
42025-03-10T08:00
12025-03-04T12:00

Expected output

Under review
8 expected rows

expected/pk.csv

Edit
8 rows
expected/pk.csv
USUBJIDEVIDSEQADTMAMTADDLIIFADTMPADTM
012025-03-03T07:00:00———2025-03-03T08:00:00—
112025-03-03T08:00:001004242025-03-03T08:00:00—
022025-03-05T10:00:00———2025-03-03T08:00:002025-03-03T08:00:00
042025-03-10T08:00:00———2025-03-03T08:00:002025-03-03T08:00:00
122025-03-10T08:00:00505122025-03-03T08:00:002025-03-03T08:00:00
032025-03-11T09:00:00———2025-03-03T08:00:002025-03-10T08:00:00
112025-03-03T00:00:00501242025-03-03T00:00:00—
012025-03-04T12:00:00———2025-03-03T00:00:002025-03-03T00:00:00
Shaded columns are derived— = missing value

Human review and assessment

Your review

2 questions and your comments · View benchmark discussions

Mapping spec

Generated from the benchmark YAML; do not edit by hand

Variable NameVariable LabelTypeLengthControlled Terms or FormatOriginCoreConversion DefinitionVariable TypeVariable OrderComments for Define
USUBJIDUnique Subject IdentifierCharDerivedSet per constructed row; see the Row construction sheet.SDTM1
EVIDEvent IdentifierNumDerivedSet per constructed row; see the Row construction sheet.SDTM2
SEQSequence NumberNumDerivedSet per constructed row; see the Row construction sheet.SDTM3
ADTMAnalysis DatetimeCharISO 8601DerivedSet per constructed row; see the Row construction sheet.SDTM4
AMTDose AmountNumDerivedSet per constructed row; see the Row construction sheet.SDTM5
ADDLNumber of Additional DosesNumDerivedSet per constructed row; see the Row construction sheet.SDTM6
IIInterdose Interval (h)NumDerivedSet per constructed row; see the Row construction sheet.SDTM7
FADTMFirst Dose DatetimeCharISO 8601DerivedTake STDTM from the first EXREC record whose USUBJID equals USUBJID, ordered by EXREC.STDTM, and no match yields blank.SDTM8
PADTMPrior Dose DatetimeCharISO 8601DerivedTake STDTM from the last EXREC record whose USUBJID equals USUBJID, where ADTM is more than STDTM, and a record with no STDTM never matches, ordered by EXREC.STDTM, and no match yields blank.SDTM9
TemplateInclude whenUSUBJIDEVIDSEQADTMAMTADDLII
doseCopy USUBJID from the EX record matching on the shared output keys, and no match yields blankConstant "1"Copy EXSEQ from the EX record matching on the shared output keys, and no match yields blankCopy STDTM from the EX record matching on the shared output keys, where STDTM is derived as impute incomplete datetime from EXSTDTC, giving each time part the source lacks its earliest value; a source without a complete date gives blank; invalid text is an error, and no match yields blankCopy EXDOSE from the EX record matching on the shared output keys, and no match yields blankCopy MORE from the EX record matching on the shared output keys, where MORE is derived as compute FLOOR(SPAN / IIH), and no match yields blankCopy IIH from the EX record matching on the shared output keys, where IIH is derived as recode EXDOSFRQ: "QD" → "24", "BID" → "12"; missing values stay missing; unlisted values are errors, and no match yields blank
sampleCopy PC.USUBJIDConstant "0"Copy PC.PCSEQImpute incomplete datetime from PC.PCDTC, giving each time part the source lacks its earliest value; a source without a complete date gives blank; invalid text is an errorConstant "None"Constant "None"Constant "None"
VersionDateAuthorDescriptionReviewerSign-off
1.82026-11-19yamaa docs buildState open and closed range endpoints, including bounds of zero
1.72026-10-20yamaa docs buildRead a specification in the 1.0 surface as its 0.5 counterpart; state that missing values stay missing where a mapping declares no missing handler, and leave out a declared missing answer that restates a handler's default
1.62026-10-17yamaa docs buildDescribe collected date parts written as ISO 8601 date text and times of day counted in seconds since midnight
1.52026-10-17yamaa docs buildName collected precision in words instead of letter codes; state imputation fallbacks, minimum source precision, bounds ignored outside the collected period, and invalid text with no handler as an error; describe date and datetime shifts, imputation flag codes, and partial text giving no date part
1.42026-10-15yamaa docs buildState datetime precision codes through the hour and minute, and complete only the time parts a collected datetime lacks
1.32026-09-29yamaa docs buildShow study codelist names, external dictionaries, and ISO 8601 formats in variable rows; list the document's codelist values and metadata
1.22026-09-29yamaa docs buildClassify ADaM copies from a declared input as Predecessor and recodes as Derived, and SDTM recodes of locally derived columns as Derived
1.12026-09-29yamaa docs buildResolve lookups into the donor record they select, and give every derivation shape a plain-language rule instead of its raw YAML
1.0yamaa docs buildInitial generation from spec.yaml

yamaa code

Public calls generated from benchmark.yaml; results must match the expected output

R

Edit
3 lines
library(yamaa)yamaa_spec("spec.yaml")$run()$output

Python

Edit
3 lines
import yamaayamaa.spec("spec.yaml").run().output