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
README.mdPublic 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:1on a dose row, one per exposure record;0on 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 (QD24,BID12); 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 beforeADTM; 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 review2 source filesinput/ex.csv
Edit3 rows| USUBJID | EXSEQ | EXDOSE | EXDOSFRQ | EXSTDTC | EXENDTC |
|---|---|---|---|---|---|
| 1 | 100 | QD | 2025-03-03T08:00 | 2025-03-07T08:00 | |
| 2 | 50 | BID | 2025-03-10T08:00 | 2025-03-12 | |
| 1 | 50 | QD | 2025-03-03 | 2025-03-04T09:00 |
input/pc.csv
Edit5 rows| USUBJID | PCSEQ | PCDTC |
|---|---|---|
| 1 | 2025-03-03T07:00 | |
| 2 | 2025-03-05T10:00 | |
| 3 | 2025-03-11T09:00 | |
| 4 | 2025-03-10T08:00 | |
| 1 | 2025-03-04T12:00 |
Expected output
Under review8 expected rowsexpected/pk.csv
Edit8 rows| USUBJID | EVID | SEQ | ADTM | AMT | ADDL | II | FADTM | PADTM |
|---|---|---|---|---|---|---|---|---|
| 0 | 1 | 2025-03-03T07:00:00 | — | — | — | 2025-03-03T08:00:00 | — | |
| 1 | 1 | 2025-03-03T08:00:00 | 100 | 4 | 24 | 2025-03-03T08:00:00 | — | |
| 0 | 2 | 2025-03-05T10:00:00 | — | — | — | 2025-03-03T08:00:00 | 2025-03-03T08:00:00 | |
| 0 | 4 | 2025-03-10T08:00:00 | — | — | — | 2025-03-03T08:00:00 | 2025-03-03T08:00:00 | |
| 1 | 2 | 2025-03-10T08:00:00 | 50 | 5 | 12 | 2025-03-03T08:00:00 | 2025-03-03T08:00:00 | |
| 0 | 3 | 2025-03-11T09:00:00 | — | — | — | 2025-03-03T08:00:00 | 2025-03-10T08:00:00 | |
| 1 | 1 | 2025-03-03T00:00:00 | 50 | 1 | 24 | 2025-03-03T00:00:00 | — | |
| 0 | 1 | 2025-03-04T12:00:00 | — | — | — | 2025-03-03T00:00:00 | 2025-03-03T00:00:00 |
Human review and assessment
| Variable Name | Variable Label | Type | Length | Controlled Terms or Format | Origin | Core | Conversion Definition | Variable Type | Variable Order | Comments for Define |
|---|---|---|---|---|---|---|---|---|---|---|
| USUBJID | Unique Subject Identifier | Char | Derived | Set per constructed row; see the Row construction sheet. | SDTM | 1 | ||||
| EVID | Event Identifier | Num | Derived | Set per constructed row; see the Row construction sheet. | SDTM | 2 | ||||
| SEQ | Sequence Number | Num | Derived | Set per constructed row; see the Row construction sheet. | SDTM | 3 | ||||
| ADTM | Analysis Datetime | Char | ISO 8601 | Derived | Set per constructed row; see the Row construction sheet. | SDTM | 4 | |||
| AMT | Dose Amount | Num | Derived | Set per constructed row; see the Row construction sheet. | SDTM | 5 | ||||
| ADDL | Number of Additional Doses | Num | Derived | Set per constructed row; see the Row construction sheet. | SDTM | 6 | ||||
| II | Interdose Interval (h) | Num | Derived | Set per constructed row; see the Row construction sheet. | SDTM | 7 | ||||
| FADTM | First Dose Datetime | Char | ISO 8601 | Derived | Take STDTM from the first EXREC record whose USUBJID equals USUBJID, ordered by EXREC.STDTM, and no match yields blank. | SDTM | 8 | |||
| PADTM | Prior Dose Datetime | Char | ISO 8601 | Derived | Take 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. | SDTM | 9 |
| Template | Include when | USUBJID | EVID | SEQ | ADTM | AMT | ADDL | II |
|---|---|---|---|---|---|---|---|---|
| dose | Copy USUBJID from the EX record matching on the shared output keys, and no match yields blank | Constant "1" | Copy EXSEQ from the EX record matching on the shared output keys, and no match yields blank | Copy 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 blank | Copy EXDOSE from the EX record matching on the shared output keys, and no match yields blank | Copy MORE from the EX record matching on the shared output keys, where MORE is derived as compute FLOOR(SPAN / IIH), and no match yields blank | Copy 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 | |
| sample | Copy PC.USUBJID | Constant "0" | Copy PC.PCSEQ | Impute 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 error | Constant "None" | Constant "None" | Constant "None" |
| Version | Date | Author | Description | Reviewer | Sign-off |
|---|---|---|---|---|---|
| 1.8 | 2026-11-19 | yamaa docs build | State open and closed range endpoints, including bounds of zero | ||
| 1.7 | 2026-10-20 | yamaa docs build | Read 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.6 | 2026-10-17 | yamaa docs build | Describe collected date parts written as ISO 8601 date text and times of day counted in seconds since midnight | ||
| 1.5 | 2026-10-17 | yamaa docs build | Name 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.4 | 2026-10-15 | yamaa docs build | State datetime precision codes through the hour and minute, and complete only the time parts a collected datetime lacks | ||
| 1.3 | 2026-09-29 | yamaa docs build | Show study codelist names, external dictionaries, and ISO 8601 formats in variable rows; list the document's codelist values and metadata | ||
| 1.2 | 2026-09-29 | yamaa docs build | Classify ADaM copies from a declared input as Predecessor and recodes as Derived, and SDTM recodes of locally derived columns as Derived | ||
| 1.1 | 2026-09-29 | yamaa docs build | Resolve lookups into the donor record they select, and give every derivation shape a plain-language rule instead of its raw YAML | ||
| 1.0 | yamaa docs build | Initial generation from spec.yaml |
yamaa