Represents a single field (data element) in an NDA data structure. This is a typed struct (similar to Go structs) that enforces schema consistency and provides validation for NDA field definitions.
element_nameElementName object - field name (ElementName in Excel)
data_typeDataType object - data type (String, Integer, Float, Date, GUID, Boolean)
sizeSize object - size for String types
requiredRequirementLevel object - requirement level (Required, Recommended, Conditional, No)
element_descriptionDescription object - field description
value_rangeValueRange object - allowed values or range
notesNotes object - field notes
aliasesAliases object - field aliases
selection_orderInteger - order in which field was selected
selected_for_submissionLogical - whether field is selected for NDA submission
source_metadataSourceMetadata object - field source tracking
missing_infoMissingInfo object - missing data information
validation_rulesValidationRules object - validation rules
new()Create a new NdaDataStructure instance
NdaDataStructure$new(
element_name,
data_type = "String",
size = NULL,
required = "No",
element_description = "",
value_range = "",
notes = "",
aliases = "",
selection_order = NULL,
source = NULL,
source_metadata = NULL,
missing_info = NULL,
validation_rules = NULL,
...
)element_nameField name (required) - accepts string or ElementName object
data_typeData type (default: "String") - accepts string or DataType object
sizeSize for String types - accepts numeric or Size object
requiredRequirement level (default: "No") - accepts string or RequirementLevel object
element_descriptionField description - accepts string or Description object
value_rangeAllowed values or range - accepts string or ValueRange object
notesField notes - accepts string or Notes object
aliasesField aliases - accepts string, list, or Aliases object
selection_orderSelection order
sourceField source (legacy - use source_metadata instead)
source_metadataSourceMetadata object
missing_infoMissingInfo object or list
validation_rulesValidationRules object or list
...Additional fields
A new NdaDataStructure object
to_excel_row()Convert to Excel row (returns named list for data.frame row)
NdaDataStructure$to_excel_row()Named list with Excel column names and values
to_list()Convert to legacy list format for backward compatibility
NdaDataStructure$to_list()List with field definition
is_super_required()Check if field is a super required field
NdaDataStructure$is_super_required()Logical
is_from_ndar_subject()Check if field came from ndar_subject01
NdaDataStructure$is_from_ndar_subject()Logical
is_dcc_required()Check if field is a DCC required field
NdaDataStructure$is_dcc_required()Logical
is_dcc_recommended()Check if field is a DCC recommended field
NdaDataStructure$is_dcc_recommended()Logical
modify()Create a modified copy of this field
NdaDataStructure$modify(
value_range = NULL,
notes = NULL,
modification_note = NULL,
...
)value_rangeNew value range (string or ValueRange object)
notesNew notes (string or Notes object)
modification_noteDescription of modification
...Other fields to modify
New NdaDataStructure object
Self (invisibly)
merge_value_ranges()Merge value ranges from multiple sources
NdaDataStructure$merge_value_ranges(
nda_range = NULL,
redcap_range = NULL,
data_range = NULL,
missing_codes = character(0)
)nda_rangeValueRange from NDA (may be NULL)
redcap_rangeValueRange from REDCap (may be NULL)
data_rangeValueRange from data (may be NULL)
missing_codesCharacter vector of missing data codes
Self (invisibly) with merged value_range
get_merge_warnings()Get any warnings from merge operations
NdaDataStructure$get_merge_warnings()Character vector of warnings
clear_merge_warnings()Clear merge warnings
NdaDataStructure$clear_merge_warnings()Self (invisibly)
clone()The objects of this class are cloneable with this method.
NdaDataStructure$clone(deep = FALSE)deepWhether to make a deep clone.
This class replaces ad-hoc list construction for NDA field definitions. It provides:
Type safety and validation for field definitions
Consistent structure across all code paths
Factory methods for creating fields from different sources
Helper methods for common operations
Direct mapping to Excel export columns
The field structure matches the NDA data dictionary schema: ElementName, DataType, Size, Required, ElementDescription, ValueRange, Notes, Aliases
Uses typed R6 classes from NdaClasses.R for all fields (ElementName, DataType, Size, RequirementLevel, Description, ValueRange, Notes, Aliases, etc.)