Overview
ADaM specification work starts early, often before the SDTM data is complete. Some domains have data early; others are empty until later in the study.
So at any point during the trial, the specification may describe more than the current SDTM data can produce. A specification written this way is still valid, but a program built from it fails when a domain or column it uses doesn’t exist yet. Keeping template programs in line with both the specification and the current data would take a lot of manual work.
To deal with this, mighty can generate two sets of programs:
- Complete programs that follow the full specification. They run once all SDTM domains and columns have been populated
- Executable programs that run on the data available today. Steps that can’t run are kept but commented out, with a comment above each one explaining which data is missing.
Types of missing data
- Missing domains (SDTM, ADaM or metadata)
- Missing columns in an existing domain
- Missing or incomplete values in a column
mighty handles 1 and 2. Your code components must handle 3, for example with a component that copes with NA values.
Workflow
- Write the full specification. Include every column and row operation you want, whether or not the data exists yet.
-
Describe the available data. Build a
data_contextfrom aconnectorobject and pass it togenerate_adam_code(data_context = ...). mighty reads only which tables and columns exist, not the values. ADaM domains that mighty builds itself don’t need to be in thedata_context, because their columns come from the specifications. - Compare the specification with the data. mighty checks every step, meaning each derivation, row operation and parameter, against the available data. A step can’t run if a domain or column it needs is missing, or if it depends on another step that can’t run.
-
Generate both sets of programs.
generate_adam_code()returns:-
result$programs: the complete programs, built from the full specification. -
result$executable_programs: the same programs, with every step that can’t run commented out. The comment above each step lists the missing data, and which columns can’t be created because of it. If only some of the columns a program reads are missing, the step still runs without them, and the comment lists the columns that were skipped.
-
If you don’t pass a data_context, both sets of programs are the same.
