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: draftEditUnder review
What this benchmark means
README.md

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

Goal: derive PARAMCD, PARAM, AVAL, AVALC, ADT, SRCDOM, SRCVAR, and SRCSEQ for each qualifying temperature record in an ADaM analysis dataset (ADFA).

Input: Study Data Tabulation Model (SDTM) Vital Signs (VS) records, one per collected result, carrying the test code, the category, the result and unit as collected, the result in the standard unit, the completion status, and the date and time of the assessment.

Variables:

  • PARAMCD and PARAM are always FEVER and Fever Occurrence.
  • AVALC is Y for a temperature of 38 degrees Celsius or higher and N for a lower one, read from the result in the standard unit, Celsius (C), so a temperature collected in Fahrenheit is judged after its conversion; blank when the result is missing.
  • AVAL is 1 when the occurrence flag is Y, 0 when it is N, and blank when the flag is blank.
  • ASEQ numbers the subject's analysis records 1, 2, 3 ... in assessment-date order, the collected sequence breaking ties.
  • ADT is the calendar date of the assessment.
  • SRCDOM, SRCVAR, and SRCSEQ point back to the source result: always VS, VSSTRESN, and the collected sequence number.

Note: only temperature records in the reactogenicity category qualify; other vital signs records give no row.

Inputs

Under review
1 source file

input/vs.csv

Edit
7 rows
input/vs.csv
STUDYIDUSUBJIDVSSEQVSTESTCDVSCATVSORRESVSORRESUVSSTRESNVSSTRESUVSSTATVSDTC
PROJ11TEMPREACTOGENICITY38.5C38.5C—2024-01-15T08:30
PROJ12TEMPREACTOGENICITY37.5C37.5C—2024-01-16T08:30
PROJ13TEMPREACTOGENICITY————NOT DONE2024-01-17T08:30
PROJ14SYSBPREACTOGENICITY120mmHg120mmHg—2024-01-15T08:30
PROJ11TEMPREACTOGENICITY101.3F38.5C—2024-01-15T09:00
PROJ12TEMPOTHER38.1C38.1C—2024-01-16T09:00
PROJ13TEMPREACTOGENICITY39.2C39.2C—2024-01-17T09:00

Expected output

Under review
5 expected rows

expected/adfa.csv

Edit
5 rows
expected/adfa.csv
DOMAINSTUDYIDUSUBJIDASEQPARAMCDPARAMAVALAVALCADTSRCDOMSRCVARSRCSEQ
ADFAPROJ11FEVERFever Occurrence1Y2024-01-15VSVSSTRESN1
ADFAPROJ12FEVERFever Occurrence0N2024-01-16VSVSSTRESN2
ADFAPROJ13FEVERFever Occurrence——2024-01-17VSVSSTRESN3
ADFAPROJ11FEVERFever Occurrence1Y2024-01-15VSVSSTRESN1
ADFAPROJ12FEVERFever Occurrence1Y2024-01-17VSVSSTRESN3
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
ADFADOMAINDomain AbbreviationcharacterSet constant value "ADFA".Assigned
ADFASTUDYIDStudy IdentifiercharacterCopy value from VS.STUDYID.Predecessor
ADFAUSUBJIDUnique Subject IdentifiercharacterCopy value from VS.USUBJID.Predecessor
ADFAASEQAnalysis Sequence NumbernumericRow number within each group of STUDYID, USUBJID, ordered by VS.VSDTC then VS.VSSEQ.Derived
ADFAADTAnalysis DatenumericISO 8601Take the date part of VS.VSDTC, blank for a year or a year and month alone.Derived
ADFAPARAMCDParameter CodecharacterSet constant value "FEVER".Assigned
ADFAPARAMParametercharacterSet constant value "Fever Occurrence".Assigned
ADFAAVALCCharacter Analysis ValuecharacterIf VS.VSSTRESN >= 38 then "Y"; If VS.VSSTRESN < 38 then "N"; otherwise blank.Derived
ADFAAVALAnalysis ValuenumericIf AVALC = 'Y' then "1"; If AVALC = 'N' then "0"; otherwise blank.Derived
ADFASRCDOMSource DomaincharacterSet constant value "VS".Assigned
ADFASRCVARSource VariablecharacterSet constant value "VSSTRESN".Assigned
ADFASRCSEQSource Sequence NumbernumericCopy value from VS.VSSEQ.Predecessor
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-adfa-fever/full.md

Edit
21 lines

Following CDISC ADaM standards, use the provided VS dataset to create an ADFA dataset with one record per qualifying temperature record.

The output dataset should contain the following columns in this order: DOMAIN, STUDYID, USUBJID, ASEQ, PARAMCD, PARAM, AVAL, AVALC, ADT, SRCDOM, SRCVAR, SRCSEQ

A record qualifies only when it is a temperature record in the reactogenicity category: its test code is "TEMP" and its category is "REACTOGENICITY". Other vital signs records give no row. PARAMCD is "FEVER" and PARAM is "Fever Occurrence" on every record. AVALC is "Y" for a temperature of 38 degrees Celsius or higher and "N" for a lower one, judged on the result in the standard unit (VSSTRESN, in "C"), not on the collected result. AVALC has no value when the result is missing. AVAL is 1 when AVALC is "Y", 0 when AVALC is "N", and has no value when AVALC has no value. ASEQ numbers each subject's records 1, 2, 3, ... in order of the assessment date, the collected sequence number breaking ties. ADT is the calendar date of the assessment. SRCDOM is "VS", SRCVAR is "VSSTRESN", and SRCSEQ is the collected sequence number of the source record.

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

prompts/adam-adfa-fever/conventions.md

Edit
13 lines

Following CDISC ADaM standards, use the provided VS dataset to create an ADFA dataset with one record per qualifying temperature record.

The output dataset should contain the following columns in this order: DOMAIN, STUDYID, USUBJID, ASEQ, PARAMCD, PARAM, AVAL, AVALC, ADT, SRCDOM, SRCVAR, SRCSEQ

PARAMCD is "FEVER" and PARAM is "Fever Occurrence" on every record. AVALC is "Y" or "N", or has no value. AVAL is 1 for "Y" and 0 for "N", or has no value.

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

prompts/adam-adfa-fever/brief.md

Edit
9 lines

Following CDISC ADaM standards, use the provided VS dataset to create an ADFA dataset with one record per qualifying temperature record.

The output dataset should contain the following columns in this order: DOMAIN, STUDYID, USUBJID, ASEQ, PARAMCD, PARAM, AVAL, AVALC, ADT, SRCDOM, SRCVAR, SRCSEQ

Read the source datasets from /app/input and save the completed dataset as /app/output/adfa.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-adfa-fever/result.R

Edit
54 lines
# Reference solution for the yamaa benchmark adam-adfa-fever (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)vs <- read_csv(  "/app/input/vs.csv",  col_types = cols(    VSSEQ = col_integer(),    VSSTRESN = col_double(),    .default = col_character()  ))# Only temperature records in the reactogenicity category qualify.adfa <- vs |>  filter(VSTESTCD == "TEMP", VSCAT == "REACTOGENICITY") |>  mutate(    DOMAIN = "ADFA",    PARAMCD = "FEVER",    PARAM = "Fever Occurrence",    # VSSTRESN is the standard result in C, even for a temperature    # collected in Fahrenheit.    AVALC = case_when(      VSSTRESN >= 38 ~ "Y",      VSSTRESN < 38 ~ "N"    ),    AVAL = case_when(      AVALC == "Y" ~ 1,      AVALC == "N" ~ 0    ),    ADT = as.Date(substr(VSDTC, 1, 10)),    SRCDOM = "VS",    SRCVAR = "VSSTRESN",    SRCSEQ = VSSEQ  ) |>  # Number each subject's records 1, 2, 3 ... in assessment-date order,  # the collected sequence breaking ties on the same date.  arrange(STUDYID, USUBJID, ADT, VSSEQ) |>  group_by(STUDYID, USUBJID) |>  mutate(ASEQ = row_number()) |>  ungroup() |>  arrange(USUBJID, ASEQ) |>  select(    DOMAIN, STUDYID, USUBJID, ASEQ, PARAMCD, PARAM,    AVAL, AVALC, ADT, SRCDOM, SRCVAR, SRCSEQ  )dir.create("/app/output", showWarnings = FALSE)write_csv(adfa, "/app/output/adfa.csv", na = "")

solutions/adam-adfa-fever/result.py

Edit
85 lines
# Reference solution for the yamaa benchmark adam-adfa-fever (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 ADFA (Fever Occurrence) from the VS dataset.One record per qualifying temperature record: VSTESTCD "TEMP" in the"REACTOGENICITY" category. AVALC is "Y" for a temperature of 38 C orhigher and "N" below that, judged on the standard result VSSTRESN, whichSDTM holds in "C" even when the collected result is in Fahrenheit; it hasno value when the result is missing. AVAL is 1 for "Y" and 0 for "N"."""import csvINPUT_VS = "/app/input/vs.csv"OUTPUT_ADFA = "/app/output/adfa.csv"COLUMNS = [    "DOMAIN", "STUDYID", "USUBJID", "ASEQ", "PARAMCD", "PARAM",    "AVAL", "AVALC", "ADT", "SRCDOM", "SRCVAR", "SRCSEQ",]def main():    with open(INPUT_VS, newline="", encoding="utf-8") as f:        rows = list(csv.DictReader(f))    qualifying = [        r for r in rows        if r["VSTESTCD"] == "TEMP" and r["VSCAT"] == "REACTOGENICITY"    ]    # Group by subject, keeping first-appearance order of subjects.    subjects = []    by_subject = {}    for r in qualifying:        key = (r["STUDYID"], r["USUBJID"])        if key not in by_subject:            by_subject[key] = []            subjects.append(key)        by_subject[key].append(r)    out = []    for studyid, usubjid in subjects:        recs = by_subject[(studyid, usubjid)]        recs.sort(key=lambda r: (r["VSDTC"][:10], float(r["VSSEQ"])))        for i, r in enumerate(recs, start=1):            result = r["VSSTRESN"].strip()            if result == "":                avalc = ""                aval = ""            elif float(result) >= 38:                avalc = "Y"                aval = "1"            else:                avalc = "N"                aval = "0"            seq = r["VSSEQ"].strip()            srcseq = str(int(float(seq))) if seq else ""            out.append({                "DOMAIN": "ADFA",                "STUDYID": studyid,                "USUBJID": usubjid,                "ASEQ": str(i),                "PARAMCD": "FEVER",                "PARAM": "Fever Occurrence",                "AVAL": aval,                "AVALC": avalc,                "ADT": r["VSDTC"][:10],                "SRCDOM": "VS",                "SRCVAR": "VSSTRESN",                "SRCSEQ": srcseq,            })    with open(OUTPUT_ADFA, "w", newline="", encoding="utf-8") as f:        writer = csv.DictWriter(f, fieldnames=COLUMNS)        writer.writeheader()        writer.writerows(out)if __name__ == "__main__":    main()

solutions/adam-adfa-fever/result.sas

Edit
29 lines
/* opensas reference solution for the yamaa benchmark adam-adfa-fever.   Reads the benchmark inputs and derives the requested output.   Execute with the existing opensas runtime: opensas /app/output/result.sas. */data vs;  length STUDYID USUBJID VSTESTCD VSCAT VSORRES VSORRESU VSSTRESU VSSTAT VSDTC $1024;  infile "/app/input/vs.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char1024. USUBJID : $char1024. VSSEQ VSTESTCD : $char1024. VSCAT : $char1024. VSORRES : $char1024. VSORRESU : $char1024. VSSTRESN VSSTRESU : $char1024. VSSTAT : $char1024. VSDTC : $char1024.;run;data dated; set vs; length ADT $10; ADT=substr(VSDTC,1,10); NODATE=missing(ADT); run;proc sort data=dated(where=(VSTESTCD='TEMP' and VSCAT='REACTOGENICITY')) out=ordered; by STUDYID USUBJID NODATE ADT VSSEQ; run;data result;  length DOMAIN $4 PARAMCD $16 PARAM $40 AVALC $1 ADT $10 SRCDOM $2 SRCVAR $16;  set ordered; by STUDYID USUBJID;  if first.USUBJID then ASEQ=0; ASEQ+1;  DOMAIN='ADFA'; PARAMCD='FEVER'; PARAM='Fever Occurrence'; ADT=substr(VSDTC,1,10);  SRCDOM='VS'; SRCVAR='VSSTRESN'; SRCSEQ=VSSEQ;  /* VSSTRESN is the standard result in C, even when collected in F. */  if not missing(VSSTRESN) then do;    if VSSTRESN>=38 then do; AVAL=1; AVALC='Y'; end;    else do; AVAL=0; AVALC='N'; end;  end;run;proc sql;  create table final as select DOMAIN, STUDYID, USUBJID, ASEQ, PARAMCD, PARAM, AVAL, AVALC, ADT, SRCDOM, SRCVAR, SRCSEQ from result;quit;proc export data=final outfile="/app/output/adfa.csv" dbms=csv replace; run;