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: derive UPPERTXT, LOWERTXT, EQUALFL, LEASTTXT,
GREATESTTXT, MAPCAT, TEXTSEQ, MINTXT, and MAXTXT for each
subject from the collected text and a comparison text.
Input: demographics records carrying RAWTXT (collected text)
and PEERTXT (comparison text).
Variables:
UPPERTXTisRAWTXTwith American Standard Code for Information Interchange (ASCII) lowercase letters changed to uppercase; every other character is unchanged, and missing text gives the textMISSING.LOWERTXTisRAWTXTwith ASCII uppercase letters changed to lowercase; every other character is unchanged, and missing text gives the textMISSING.EQUALFLisYwhenRAWTXTandPEERTXThold identical character sequences (same code points in the same order), including when both are missing; otherwise it isN.LEASTTXTis the earlier non-missing value ofRAWTXTandPEERTXTby Unicode code-point order (called scalar order below), left blank when both are missing.GREATESTTXTis the later non-missing value ofRAWTXTandPEERTXTby scalar order, left blank when both are missing.MAPCATgroups spellings that differ only in the case of ASCII letters: any casing ofabcgivesASCIIandiorIgivesASCII_I. Missing text gives the textMISSING, and any other text givesOTHER, so text holding a character outside ASCII never joins a group.TEXTSEQnumbers rows in scalar order of the collected text, breaking ties by subject, with missing text last.MINTXTis the earliest collected text in the study by scalar order, shown on every row.MAXTXTis the latest collected text in the study by scalar order, shown on every row.
Note: text is never normalized, so a composed and a decomposed spelling of the same word (an accented letter stored as one character, or as the base letter plus a combining accent) are different values. The flag, the earlier and later values, the sequence, and the minimum and maximum all follow scalar order.
Inputs
Under review1 source fileinput/dm.csv
Edit8 rows| STUDYID | USUBJID | RAWTXT | PEERTXT |
|---|---|---|---|
| TEXT | abc | abc | |
| TEXT | AbC | abc | |
| TEXT | café | café | |
| TEXT | café | café | |
| TEXT | straße | straße | |
| TEXT | İIıi | İIıi | |
| TEXT | 😀ABCDE | 😀ABCDE | |
| TEXT | — | — |
Expected output
Under review8 expected rowsexpected/adsl.csv
Edit8 rows| STUDYID | USUBJID | RAWTXT | UPPERTXT | LOWERTXT | EQUALFL | LEASTTXT | GREATESTTXT | MAPCAT | TEXTSEQ | MINTXT | MAXTXT |
|---|---|---|---|---|---|---|---|---|---|---|---|
| TEXT | AbC | ABC | abc | N | AbC | abc | ASCII | 1 | AbC | 😀ABCDE | |
| TEXT | abc | ABC | abc | Y | abc | abc | ASCII | 2 | AbC | 😀ABCDE | |
| TEXT | café | CAFÉ | café | N | café | café | OTHER | 3 | AbC | 😀ABCDE | |
| TEXT | café | CAFé | café | N | café | café | OTHER | 4 | AbC | 😀ABCDE | |
| TEXT | straße | STRAßE | straße | Y | straße | straße | OTHER | 5 | AbC | 😀ABCDE | |
| TEXT | İIıi | İIıI | İiıi | Y | İIıi | İIıi | OTHER | 6 | AbC | 😀ABCDE | |
| TEXT | 😀ABCDE | 😀ABCDE | 😀abcde | Y | 😀ABCDE | 😀ABCDE | OTHER | 7 | AbC | 😀ABCDE | |
| TEXT | — | MISSING | MISSING | Y | — | — | MISSING | 8 | AbC | 😀ABCDE |
Comments and assessment materials
| Dataset Name | Variable Name | Variable Label | Type | Codelist/Controlled Terms | Core | Computational Method | Origin |
|---|---|---|---|---|---|---|---|
| ADSL | STUDYID | Study Identifier | character | Copy value from DM.STUDYID. | Predecessor | ||
| ADSL | USUBJID | Unique Subject Identifier | character | Copy value from DM.USUBJID. | Predecessor | ||
| ADSL | RAWTXT | Raw Text | character | Copy value from DM.RAWTXT. | Predecessor | ||
| ADSL | UPPERTXT | Uppercase ASCII Text | character | Convert RAWTXT to upper case; a missing source → "MISSING". | Derived | ||
| ADSL | LOWERTXT | Lowercase ASCII Text | character | Convert RAWTXT to lower case; a missing source → "MISSING". | Derived | ||
| ADSL | EQUALFL | Exact Text Equality Flag | character | If RAWTXT IS NULL AND PEERTXT IS NULL then "Y"; If RAWTXT = PEERTXT then "Y"; otherwise "N". | Derived | ||
| ADSL | LEASTTXT | Earlier Text by Scalar Order | character | Least of RAWTXT and PEERTXT. | Derived | ||
| ADSL | GREATESTTXT | Later Text by Scalar Order | character | Greatest of RAWTXT and PEERTXT. | Derived | ||
| ADSL | MAPCAT | ASCII Folded Mapping Category | character | If RAWTXT IS NULL then "MISSING"; otherwise recode RAWTXT: "ABC" → "ASCII", "I" → "ASCII_I"; missing values are errors; unlisted values → "OTHER"; matching ignores letter case. | Derived | ||
| ADSL | TEXTSEQ | Text Scalar Order Sequence | numeric | Row number within each group of , ordered by RAWTXT then USUBJID. | Derived | ||
| ADSL | MINTXT | Minimum Study Text | character | Aggregate MIN(DM.RAWTXT) over records grouped by DM.STUDYID, matching on STUDYID. | Derived | ||
| ADSL | MAXTXT | Maximum Study Text | character | Aggregate MAX(DM.RAWTXT) over records grouped by DM.STUDYID, matching on STUDYID. | Derived |
| 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