Review ask

As a clinical trial statistician or programmer, answer three short questions in Your review: the task, the inputs and outputs, and the AI-assisted review. Agreeing with all three approves this benchmark; disagreeing with any 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: reviewedEditUnder review
What this benchmark means
README.md

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

Goal: flag each exposure administration whose dose was reduced from the previous administration, adding DOSREDFL (Dose Reduced Flag).

Input: exposure (EX) records carrying a sequence number (EXSEQ), treatment start date/time (EXSTDTM), and collected dose (EXDOSE).

Variables:

  • DOSREDFL is Y when the current dose is lower than the previous dose for the same subject; empty otherwise, for the first record and whenever the current or the previous dose is zero or missing.

Note: the comparison runs in chronological treatment-start order within each subject, breaking timestamp ties by sequence number. The previous dose is always the administration just before, never an earlier nonzero dose, so a pause in dosing (a zero dose) is not flagged and neither is the administration after it.

Inputs

Under review
1 source file

input/ex.csv

Edit
13 rows
input/ex.csv
STUDYIDUSUBJIDEXSEQEXSTDTMEXDOSE
YAMAA-0112024-01-08T08:00200.0
YAMAA-0122024-01-15T08:00200.0
YAMAA-0132024-01-22T08:00150.0
YAMAA-0142024-01-29T08:000.0
YAMAA-0152024-02-05T08:00150.0
YAMAA-0162024-02-12T08:00—
YAMAA-0172024-02-19T08:00100.0
YAMAA-0182024-02-26T08:0080.0
YAMAA-0112024-01-10T08:00250.0
YAMAA-0112024-01-09T08:00200.0
YAMAA-0122024-01-09T08:00120.0
YAMAA-0112024-01-11T08:000.0
YAMAA-0122024-01-18T08:00100.0

Expected output

Under review
13 expected rows

expected/adex.csv

Edit
13 rows
expected/adex.csv
STUDYIDUSUBJIDEXSEQEXSTDTMEXDOSEDOSREDFL
YAMAA-0112024-01-08T08:00:00200—
YAMAA-0122024-01-15T08:00:00200—
YAMAA-0132024-01-22T08:00:00150Y
YAMAA-0142024-01-29T08:00:000—
YAMAA-0152024-02-05T08:00:00150—
YAMAA-0162024-02-12T08:00:00——
YAMAA-0172024-02-19T08:00:00100—
YAMAA-0182024-02-26T08:00:0080Y
YAMAA-0112024-01-10T08:00:00250—
YAMAA-0112024-01-09T08:00:00200—
YAMAA-0122024-01-09T08:00:00120Y
YAMAA-0112024-01-11T08:00:000—
YAMAA-0122024-01-18T08:00:00100—
Shaded columns are derived— = missing value

Human review and assessment

Your review

3 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
ADEXSTUDYIDStudy IdentifiercharacterCopy value from EX.STUDYID.Predecessor
ADEXUSUBJIDUnique Subject IdentifiercharacterCopy value from EX.USUBJID.Predecessor
ADEXEXSEQSequence NumbernumericCopy value from EX.EXSEQ.Predecessor
ADEXEXSTDTMStart Date/Time of TreatmentnumericISO 8601Copy value from EX.EXSTDTM.Predecessor
ADEXEXDOSEDosenumericCopy value from EX.EXDOSE.Predecessor
ADEXDOSREDFLDose Reduced Flagcharacter"Y" when EXDOSE > 0 AND EXDOSE < PREVDOSE; blank otherwise.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

Agent prompt

The request an agent receives with the input files; each tier states no more than the one above

prompts/adam-adex-dose-reduction/full.md

Edit
18 lines

Following CDISC ADaM standards, use the provided EX dataset to create an ADEX dataset with one record per exposure administration.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, EXSEQ, EXSTDTM, EXDOSE, DOSREDFL

DOSREDFL is Y when the current dose (EXDOSE) is lower than the previous dose for the same subject, and has no value otherwise. Within each subject, administrations are ordered by treatment start date/time (EXSTDTM), with administrations that share a start date/time ordered by sequence number (EXSEQ), and the previous dose is the dose of the administration just before in that order. DOSREDFL has no value for the subject's first administration and whenever the current dose or the previous dose is zero or has no value. The previous dose is never an earlier nonzero dose: a pause in dosing, where the dose is zero, is not flagged, and neither is the administration after it.

Read the source datasets from /app/input and save the completed dataset as /app/output/adex.csv.

prompts/adam-adex-dose-reduction/conventions.md

Edit
10 lines

Following CDISC ADaM standards, use the provided EX dataset to create an ADEX dataset with one record per exposure administration.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, EXSEQ, EXSTDTM, EXDOSE, DOSREDFL

DOSREDFL is Y or has no value.

Read the source datasets from /app/input and save the completed dataset as /app/output/adex.csv.

prompts/adam-adex-dose-reduction/brief.md

Edit
8 lines

Following CDISC ADaM standards, use the provided EX dataset to create an ADEX dataset with one record per exposure administration.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, EXSEQ, EXSTDTM, EXDOSE, DOSREDFL

Read the source datasets from /app/input and save the completed dataset as /app/output/adex.csv.

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

Solution without yamaa

Written from the full prompt and the inputs alone; CI checks it reproduces the expected output

solutions/adam-adex-dose-reduction/result.R

Edit
42 lines
# Reference solution for the yamaa benchmark adam-adex-dose-reduction (R track).## Written from the benchmark's full prompt and its inputs alone, as an agent# would write it. Harbor's oracle agent runs it to check that the prompt can# be solved and that the grader scores a correct answer 1.library(dplyr, warn.conflicts = FALSE)library(readr)ex <- read_csv(  "/app/input/ex.csv",  col_types = cols(EXSEQ = col_integer(), .default = col_character()))adex <- ex |>  mutate(    EXSTDTM = if_else(      !is.na(EXSTDTM) & nchar(EXSTDTM) == 16L, paste0(EXSTDTM, ":00"), EXSTDTM    ),    EXDOSE = suppressWarnings(as.numeric(EXDOSE))  ) |>  # Chronological treatment-start order within each subject, breaking  # timestamp ties by sequence number.  arrange(USUBJID, EXSTDTM, EXSEQ) |>  group_by(USUBJID) |>  mutate(    PREVDOSE = lag(EXDOSE),    # Y when the current dose is lower than the previous one; no value for    # the first record and whenever either dose is zero or missing. The    # previous dose is always the administration just before.    DOSREDFL = if_else(      !is.na(EXDOSE) & EXDOSE != 0 & !is.na(PREVDOSE) & PREVDOSE != 0 &        EXDOSE < PREVDOSE,      "Y",      NA_character_    )  ) |>  ungroup() |>  select(STUDYID, USUBJID, EXSEQ, EXSTDTM, EXDOSE, DOSREDFL)dir.create("/app/output", showWarnings = FALSE)write_csv(adex, "/app/output/adex.csv", na = "")

solutions/adam-adex-dose-reduction/result.py

Edit
62 lines
# Reference solution for the yamaa benchmark adam-adex-dose-reduction (Python track).## Written from the benchmark's full prompt and its inputs alone, as an agent# would write it. Harbor's oracle agent runs it to check that the prompt can# be solved and that the grader scores a correct answer 1."""Create ADEX from EX: flag administrations whose dose is lower than thedose of the subject's immediately preceding administration."""import csvINPUT = "/app/input/ex.csv"OUTPUT = "/app/output/adex.csv"COLUMNS = ["STUDYID", "USUBJID", "EXSEQ", "EXSTDTM", "EXDOSE", "DOSREDFL"]def parse_dose(text):    """Return the numeric dose, or None when the value is missing."""    if text is None or text.strip() == "":        return None    return float(text)def main():    with open(INPUT, newline="") as f:        rows = list(csv.DictReader(f))    # Order administrations within each subject by start date/time,    # breaking ties by sequence number.    ordered = sorted(        rows,        key=lambda r: (r["USUBJID"], r["EXSTDTM"], int(r["EXSEQ"])),    )    previous = {}  # subject -> numeric dose of the preceding administration    for row in ordered:        subject = row["USUBJID"]        current = parse_dose(row["EXDOSE"])        flag = ""        if subject in previous:            prev = previous[subject]            if (                current is not None                and prev is not None                and current != 0                and prev != 0                and current < prev            ):                flag = "Y"        row["DOSREDFL"] = flag        previous[subject] = current    with open(OUTPUT, "w", newline="") as f:        writer = csv.DictWriter(f, fieldnames=COLUMNS)        writer.writeheader()        for row in ordered:            writer.writerow({col: row[col] for col in COLUMNS})if __name__ == "__main__":    main()

solutions/adam-adex-dose-reduction/result.sas

Edit
24 lines
/* opensas reference solution for the yamaa benchmark adam-adex-dose-reduction.   Reads the benchmark inputs and derives the requested output.   Execute with the existing opensas runtime: opensas /app/output/result.sas. */data ex;  length STUDYID USUBJID EXSTDTM $1024;  infile "/app/input/ex.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char1024. USUBJID : $char1024. EXSEQ EXSTDTM : $char1024. EXDOSE;run;proc sort data=ex out=ordered; by STUDYID USUBJID EXSTDTM EXSEQ; run;data result;  length DOSREDFL $1;  retain previous;  set ordered; by STUDYID USUBJID;  if first.USUBJID then previous=.;  if EXDOSE>0 and previous>0 and EXDOSE<previous then DOSREDFL='Y';  previous=EXDOSE;run;proc sql;  create table final as select STUDYID, USUBJID, EXSEQ, EXSTDTM, EXDOSE, DOSREDFL from result;quit;proc export data=final outfile="/app/output/adex.csv" dbms=csv replace; run;