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
README.mdPublic 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:
PARAMCDandPARAMare alwaysFEVERandFever Occurrence.AVALCisYfor a temperature of 38 degrees Celsius or higher andNfor 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.AVALis 1 when the occurrence flag isY, 0 when it isN, and blank when the flag is blank.ASEQnumbers the subject's analysis records 1, 2, 3 ... in assessment-date order, the collected sequence breaking ties.ADTis the calendar date of the assessment.SRCDOM,SRCVAR, andSRCSEQpoint back to the source result: alwaysVS,VSSTRESN, and the collected sequence number.
Note: only temperature records in the reactogenicity category qualify; other vital signs records give no row.
Inputs
Under review1 source fileinput/vs.csv
Edit7 rows| STUDYID | USUBJID | VSSEQ | VSTESTCD | VSCAT | VSORRES | VSORRESU | VSSTRESN | VSSTRESU | VSSTAT | VSDTC |
|---|---|---|---|---|---|---|---|---|---|---|
| PROJ1 | 1 | TEMP | REACTOGENICITY | 38.5 | C | 38.5 | C | — | 2024-01-15T08:30 | |
| PROJ1 | 2 | TEMP | REACTOGENICITY | 37.5 | C | 37.5 | C | — | 2024-01-16T08:30 | |
| PROJ1 | 3 | TEMP | REACTOGENICITY | — | — | — | — | NOT DONE | 2024-01-17T08:30 | |
| PROJ1 | 4 | SYSBP | REACTOGENICITY | 120 | mmHg | 120 | mmHg | — | 2024-01-15T08:30 | |
| PROJ1 | 1 | TEMP | REACTOGENICITY | 101.3 | F | 38.5 | C | — | 2024-01-15T09:00 | |
| PROJ1 | 2 | TEMP | OTHER | 38.1 | C | 38.1 | C | — | 2024-01-16T09:00 | |
| PROJ1 | 3 | TEMP | REACTOGENICITY | 39.2 | C | 39.2 | C | — | 2024-01-17T09:00 |
Expected output
Under review5 expected rowsexpected/adfa.csv
Edit5 rows| DOMAIN | STUDYID | USUBJID | ASEQ | PARAMCD | PARAM | AVAL | AVALC | ADT | SRCDOM | SRCVAR | SRCSEQ |
|---|---|---|---|---|---|---|---|---|---|---|---|
| ADFA | PROJ1 | 1 | FEVER | Fever Occurrence | 1 | Y | 2024-01-15 | VS | VSSTRESN | 1 | |
| ADFA | PROJ1 | 2 | FEVER | Fever Occurrence | 0 | N | 2024-01-16 | VS | VSSTRESN | 2 | |
| ADFA | PROJ1 | 3 | FEVER | Fever Occurrence | — | — | 2024-01-17 | VS | VSSTRESN | 3 | |
| ADFA | PROJ1 | 1 | FEVER | Fever Occurrence | 1 | Y | 2024-01-15 | VS | VSSTRESN | 1 | |
| ADFA | PROJ1 | 2 | FEVER | Fever Occurrence | 1 | Y | 2024-01-17 | VS | VSSTRESN | 3 |
Human review and assessment
| Dataset Name | Variable Name | Variable Label | Type | Codelist/Controlled Terms | Core | Computational Method | Origin |
|---|---|---|---|---|---|---|---|
| ADFA | DOMAIN | Domain Abbreviation | character | Set constant value "ADFA". | Assigned | ||
| ADFA | STUDYID | Study Identifier | character | Copy value from VS.STUDYID. | Predecessor | ||
| ADFA | USUBJID | Unique Subject Identifier | character | Copy value from VS.USUBJID. | Predecessor | ||
| ADFA | ASEQ | Analysis Sequence Number | numeric | Row number within each group of STUDYID, USUBJID, ordered by VS.VSDTC then VS.VSSEQ. | Derived | ||
| ADFA | ADT | Analysis Date | numeric | ISO 8601 | Take the date part of VS.VSDTC, blank for a year or a year and month alone. | Derived | |
| ADFA | PARAMCD | Parameter Code | character | Set constant value "FEVER". | Assigned | ||
| ADFA | PARAM | Parameter | character | Set constant value "Fever Occurrence". | Assigned | ||
| ADFA | AVALC | Character Analysis Value | character | If VS.VSSTRESN >= 38 then "Y"; If VS.VSSTRESN < 38 then "N"; otherwise blank. | Derived | ||
| ADFA | AVAL | Analysis Value | numeric | If AVALC = 'Y' then "1"; If AVALC = 'N' then "0"; otherwise blank. | Derived | ||
| ADFA | SRCDOM | Source Domain | character | Set constant value "VS". | Assigned | ||
| ADFA | SRCVAR | Source Variable | character | Set constant value "VSSTRESN". | Assigned | ||
| ADFA | SRCSEQ | Source Sequence Number | numeric | Copy value from VS.VSSEQ. | Predecessor |
| Version | Date | Author | Description | Reviewer | Sign-off |
|---|---|---|---|---|---|
| 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 |
prompts/adam-adfa-fever/full.md
Edit21 linesFollowing 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
Edit13 linesFollowing 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
Edit9 linesFollowing 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.
R
Edit3 lineslibrary(yamaa)yamaa_spec("spec.yaml")$run()$outputPython
Edit3 linesimport yamaayamaa.spec("spec.yaml").run().outputsolutions/adam-adfa-fever/result.R
Edit54 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
Edit85 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
Edit29 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;
yamaa