# data-obfuscator 0.0.0.23 - run2 prompts # Paste ONE prompt below into your LLM together with the *_masked files. Never share keymap2.txt or summary2.txt. ## What was masked 4 dataset(s) were masked together, level 3. Masking is consistent across the datasets: - identifiers (subject, study, site, ...) have ONE code table: the same real subject has the same code in every file, so the files can be joined on those columns; - every date was moved by the SAME number of days in every file, so differences between dates (time since first dose, visit windows) and their order are real; - the numeric column(s) AGE, WEIGHTBL, AVAL were multiplied or divided by a hidden constant (one constant per column name, the same in every file); - free text was removed; nothing in the files can identify a person. ## The datasets 1. adsl_masked.csv - 12 rows, 17 columns columns: STUDYID, USUBJID, SUBJID, SITEID, INVNAM, ARM, TRT01P, TRT01PN, AGE, SEX, RACE, WEIGHTBL, CRCLBL, TRTSDT, TRTEDT, BRTHDT, COMMENT masked columns: - STUDYID: study codes - the same real value has the same code in every dataset - USUBJID: subject codes - the same real value has the same code in every dataset - SUBJID: subject codes - the same real value has the same code in every dataset - SITEID: site codes - the same real value has the same code in every dataset - INVNAM: user codes - the same real value has the same code in every dataset - ARM: treatment codes - the same real value has the same code in every dataset - TRT01P: treatment codes - the same real value has the same code in every dataset - TRT01PN: treatment codes - the same real value has the same code in every dataset - AGE: numbers multiplied or divided by a hidden constant (not in real units; ratios within the column are real) - SEX: sex codes - the same real value has the same code in every dataset - RACE: race codes - the same real value has the same code in every dataset - WEIGHTBL: numbers multiplied or divided by a hidden constant (not in real units; ratios within the column are real) - TRTSDT: dates moved by one constant number of days (the same in every dataset; intervals and order are real) - TRTEDT: dates moved by one constant number of days (the same in every dataset; intervals and order are real) - BRTHDT: dates moved by one constant number of days (the same in every dataset; intervals and order are real) - COMMENT: free text removed (every value is '.') 2. adex_masked.csv - 24 rows, 7 columns columns: STUDYID, USUBJID, EXTRT, EXDOSE, EXDOSU, EXSTDTC, ARM masked columns: - STUDYID: study codes - the same real value has the same code in every dataset - USUBJID: subject codes - the same real value has the same code in every dataset - EXSTDTC: dates moved by one constant number of days (the same in every dataset; intervals and order are real) - ARM: treatment codes - the same real value has the same code in every dataset 3. adpc_masked.csv - 168 rows, 8 columns columns: STUDYID, USUBJID, PARAMCD, AVALU, ADTM, ATPT, AVAL, BLQFL masked columns: - STUDYID: study codes - the same real value has the same code in every dataset - USUBJID: subject codes - the same real value has the same code in every dataset - ADTM: dates moved by one constant number of days (the same in every dataset; intervals and order are real) - AVAL: numbers multiplied or divided by a hidden constant (not in real units; ratios within the column are real) 4. adlb_masked.csv - 72 rows, 7 columns columns: STUDYID, USUBJID, PARAMCD, AVALU, ADT, AVISIT, AVAL masked columns: - STUDYID: study codes - the same real value has the same code in every dataset - USUBJID: subject codes - the same real value has the same code in every dataset - ADT: dates moved by one constant number of days (the same in every dataset; intervals and order are real) - AVAL: numbers multiplied or divided by a hidden constant (not in real units; ratios within the column are real) ## Prompt 1 - build the NONMEM-style master dataset ``` You are an experienced pharmacometrician. I attach several masked ADaM-style datasets from one clinical pharmacology study (listed above). Combine them into ONE NONMEM-ready master dataset: one row per dosing or observation record, with ID, TIME, TAD, AMT, RATE (if infused), DV, EVID, MDV, CMT (and DVID for several endpoints), plus the covariates I will need. Write the code (R or Python) that does it and run it on the files. The data are masked. Please follow these rules, because I will later put the real values back into your result with a private key, and that only works if the masked values stay as they are: 1. Treat every identifier (subject, study, site, treatment, ...) as an opaque code. Join datasets on the columns they share (for example STUDYID + USUBJID). Do not change, re-format or re-order the codes. 2. Keep the masked identifier columns in the master dataset under their ORIGINAL column names (USUBJID, STUDYID, SITEID, ARM, ...) next to the numeric ID you create. Derive the numeric NONMEM ID from the digits of the masked USUBJID (for example SUBJ007 gives ID 7) instead of renumbering subjects 1..N. 3. Dates are shifted by a constant, which does not matter for TIME: compute TIME, TAD and the study day from DIFFERENCES between dates and times. If you keep a calendar date column in the master dataset keep its original column name and its ISO format (YYYY-MM-DD or YYYY-MM-DDTHH:MM:SS). 4. The values of AGE, WEIGHTBL, AVAL are not in real units. Do not convert units, apply reference ranges or transform them in place. Put any derived value (log, normalised, categorised) in a NEW column and keep the masked column as it is. If one master column (for example DV) takes values from several of these columns, add a column (DVID or SRC) that says which source column each row came from. 5. Do not guess real identities, dates or units. If something is missing or ambiguous, say so instead of inventing it. Return: (a) the master dataset as CSV, (b) the code, (c) a table of every master column and the source column and rule it came from, (d) a list of assumptions and open questions, (e) record counts per source dataset and per EVID in the master dataset, so I can reconcile them with the sources. ``` ## Prompt 2 - check the master dataset against the sources ``` Here are the masked source datasets and the master dataset you built. Check the master dataset: every subject in the sources appears; record counts reconcile; TIME is non-negative within a subject and non-decreasing; each subject's first record is a dose when there are observations after it; EVID/MDV/CMT/DVID combinations are valid; no DV for dosing records; AMT only on dosing records; no duplicated ID+TIME+EVID+CMT records unless intended; covariates are constant within subject unless time-varying by design. List every problem with the row numbers and the source records involved. Do not change the masked values. ``` ## Getting the real values back Save the master dataset the LLM returns, then on your computer, with the private key: data-obfuscator reverse --input master.csv --keymap keymap2.txt --output ./restored Columns that kept their original names are restored automatically. If the LLM renamed or merged columns, tell `reverse` where they came from with --map, for example --map ID=USUBJID (a numeric ID built from the digits of the masked USUBJID) or --map DV=AVAL.