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: derive each subject's date of last exposure (TRTEDT) from the exposure records, reporting the subjects with more than one record instead of stopping the run.

Input: one spec.yaml declaring two datasets. DM carries one row per subject. EX carries exposure records: subject, sequence number, start date and end date.

Variables:

  • TRTEDT is the end date of the subject's exposure record that starts last, the later sequence number breaking a tie; a subject with one record takes that record's end date. It is blank when the subject has no exposure record or the selected record has no end date.

Lookups: LAST_EX names each subject's latest exposure record. The subject is expected to appear once in the exposure records; one that appears more often is reported, and the latest of its records is read.

The run report (adsl-checks.csv) has one row per item the run handled, each naming the dataset (ARTIFACT), the kind of item (KIND), where the spec states it (SPEC_PATH) and the item's name (NAME, identifying an input, row source, reported event, column, or check): the run and its outcome (OUTCOME), the input datasets read, the subjects built, then the two counts of the exposure read: the subjects for which the latest record was chosen among several, and those for which no record was found. Each count names the column it feeds (TARGET) and the rule its answer stands in for (RULE). One row per output column follows, with its missing values and longest text, then the one check, which carries its label (ID), its RULE and SEVERITY, the condition it found (CONDITION), and how many subjects repeat out of how many subjects the exposure records hold (COUNT, TOTAL). Its KEYS list each repeated subject once, in the order its first exposure record appears, and its DETAILS name the subject columns, the exposure dataset and the lookup.

Note: the repeated subjects are reported before any row is built and change nothing that is read: every subject still takes its latest record. Without the order and the choice of the last record, a repeated subject would have no record to read, so the check could not warn and would have to stop the run.

Inputs

Under review
2 source files

input/dm.csv

Edit
3 rows
input/dm.csv
STUDYIDUSUBJID
YAMAA-01
YAMAA-01
YAMAA-01

input/ex.csv

Edit
5 rows
input/ex.csv
STUDYIDUSUBJIDEXSEQEXSTDTCEXENDTC
YAMAA-0112024-01-022024-01-30
YAMAA-0112024-01-042024-01-31
YAMAA-0112024-01-052024-02-03
YAMAA-0122024-02-012024-02-28
YAMAA-0122024-02-042024-03-01

Expected output

Under review
13 expected rows

expected/adsl-checks.csv

Edit
10 rows
expected/adsl-checks.csv
ARTIFACTKINDSPEC_PATHNAMEIDTARGETRULESEVERITYOUTCOMECONDITIONCOUNTTOTALKEYSDETAILS
adsl.csvrunoutput—————succeeded—3——{}
adsl.csvinputinput.DMDM——————3——{"bytes":55,"path":"input/dm.csv","profile":"csv"}
adsl.csvinputinput.EXEX——————5——{"bytes":223,"path":"input/ex.csv","profile":"csv"}
adsl.csvrowsbaseDM——————33—{}
adsl.csvhandlercolumns.TRTEDT.derivation.source.multiple_matchesmultiple_matches—TRTEDTLOOKUP-10———2——{}
adsl.csvhandlercolumns.TRTEDT.derivation.source.absentabsent—TRTEDTLOOKUP-24———0——{}
adsl.csvcolumncolumns.STUDYIDSTUDYID——————03—{"max_length":8}
adsl.csvcolumncolumns.USUBJIDUSUBJID——————03—{"max_length":3}
adsl.csvcolumncolumns.TRTEDTTRTEDT——————03—{}
adsl.csvcheckintermediates.LAST_EX.verifications[0].uniqueuniqueone-exposure-record—LOOKUP-17warningviolatedduplicate_intermediate_records23[{"STUDYID":"YAMAA-01","USUBJID":"P03"},{"STUDYID":"YAMAA-01","USUBJID":"P02"}]{"columns":["STUDYID","USUBJID"],"dataset":"EX","intermediate":"LAST_EX"}

expected/adsl.csv

Edit
3 rows
expected/adsl.csv
STUDYIDUSUBJIDTRTEDT
YAMAA-012024-01-30
YAMAA-012024-03-01
YAMAA-012024-02-28
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

Dataset NameVariable NameVariable LabelTypeCodelist/Controlled TermsCoreComputational MethodOrigin
ADSLSTUDYIDStudy IdentifiercharacterCopy value from DM.STUDYID.Predecessor
ADSLUSUBJIDUnique Subject IdentifiercharacterCopy value from DM.USUBJID.Predecessor
ADSLTRTEDTDate of Last Exposure to TreatmentnumericISO 8601Take EXENDTC from the last EX record matching on STUDYID and USUBJID, ordered by EX.EXSTDTC then EX.EXSEQ, and no match yields blank.Derived
VersionDateAuthorDescriptionReviewerSign-off
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