As a clinical trial statistician or programmer, challenge anything in this benchmark: describe a problem in Comments, or propose a fix with the Edit button on any source file.
- Task: Would a real study need this derivation, specified this way? Does it follow CDISC ADaM: variable names, controlled terms, record structure? Flag any rule that is ambiguous or that a sponsor would handle differently.
- Inputs: Do they look like data collected in a real trial, and do they include the situations you would expect to meet in one?
- Expected output: Would independent QC programming reproduce every value from these inputs and rules?
The other tabs beside Comments are background for assessment, not under review.
Summary
README.mdGoal: build output rows from input records and groups with the three row-template shapes: record-driven templates with input filters, a case split across several templates, and a grouped template whose own filter decides each candidate row.
Input: one spec.yaml over LB, which carries one record per lab
test per visit: subject, visit number, test code, and result, with the
tests interleaved in the file. A result may be missing.
Templates:
altmakes oneALTrow perALTrecord that has a result, writing the result as the analysis value (AVAL) and leavingDTYPEblank. Its filter reads the input record, so a record with a missing result is dropped before any row is built.astdoes the same forAST. EveryALTrow comes before everyASTrow even though the input interleaves the tests: templates are sections of the output and concatenate in specification order.visit_totalbuilds one candidateTOTALrow per subject and visit, in the order each pair first appears in the input, withAVALthe sum of that visit's results, skipping missing ones. Its filter reads the finished candidate and keeps it only when the total exceeds 100, withDTYPEset toCALCULATION. A visit whose results are all missing sums to missing, which is neither above 100 nor not, so its candidate is dropped too.
Shared columns: the study identifier, subject, and visit number are the same for every template, so they are stated once at column level. The subject and visit read the input record on the record-driven templates and the group keys on the grouped template.
Inputs
Under review1 source fileinput/lb.csv
Edit9 rows| USUBJID | VISIT | LBTESTCD | LBSTRESN |
|---|---|---|---|
| 1 | ALT | 40 | |
| 1 | AST | 30 | |
| 2 | ALT | 50 | |
| 2 | AST | 45 | |
| 1 | ALT | 60 | |
| 1 | AST | 55 | |
| 2 | ALT | — | |
| 2 | AST | — | |
| 1 | ALT | 30 |
Expected output
Under review8 expected rowsexpected/adlb.csv
Edit8 rows| STUDYID | USUBJID | VISIT | PARAMCD | PARAM | AVAL | DTYPE |
|---|---|---|---|---|---|---|
| YAMAA-01 | 1 | ALT | Alanine Aminotransferase | 40 | — | |
| YAMAA-01 | 2 | ALT | Alanine Aminotransferase | 50 | — | |
| YAMAA-01 | 1 | ALT | Alanine Aminotransferase | 60 | — | |
| YAMAA-01 | 1 | ALT | Alanine Aminotransferase | 30 | — | |
| YAMAA-01 | 1 | AST | Aspartate Aminotransferase | 30 | — | |
| YAMAA-01 | 2 | AST | Aspartate Aminotransferase | 45 | — | |
| YAMAA-01 | 1 | AST | Aspartate Aminotransferase | 55 | — | |
| YAMAA-01 | 1 | TOTAL | Total of Components | 115 | CALCULATION |
Comments and assessment materials
| Dataset Name | Variable Name | Variable Label | Type | Codelist/Controlled Terms | Core | Computational Method | Origin |
|---|---|---|---|---|---|---|---|
| ADLB | STUDYID | Study Identifier | character | Set constant value "YAMAA-01". | Assigned | ||
| ADLB | USUBJID | Unique Subject Identifier | character | Copy value from LB.USUBJID. | Predecessor | ||
| ADLB | VISIT | Visit Number | numeric | Copy value from LB.VISIT. | Predecessor | ||
| ADLB | PARAMCD | Parameter Code | character | Set per constructed row; see the Row construction sheet. | Derived | ||
| ADLB | PARAM | Parameter | character | Set per constructed row; see the Row construction sheet. | Derived | ||
| ADLB | AVAL | Analysis Value | numeric | Set per constructed row; see the Row construction sheet. | Derived | ||
| ADLB | DTYPE | Derivation Type | character | Set per constructed row; see the Row construction sheet. | Derived |
| Template | Include when | PARAMCD | PARAM | AVAL | DTYPE |
|---|---|---|---|---|---|
| alt | LB.LBTESTCD = 'ALT' AND LB.LBSTRESN IS NOT NULL | Constant "ALT" | Constant "Alanine Aminotransferase" | Copy LB.LBSTRESN | Constant "None" |
| ast | LB.LBTESTCD = 'AST' AND LB.LBSTRESN IS NOT NULL | Constant "AST" | Constant "Aspartate Aminotransferase" | Copy LB.LBSTRESN | Constant "None" |
| visit_total | AVAL > 100 | Constant "TOTAL" | Constant "Total of Components" | Aggregate SUM(LB.LBSTRESN) over records matching on the shared output keys | Constant "CALCULATION" |
| Version | Date | Author | Description | Reviewer | Sign-off |
|---|---|---|---|---|---|
| 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
Comments
Signed in with GitHub; saved in repository Discussions