diff --git a/R/generate_code.R b/R/generate_code.R index 8325c2a..0e66367 100644 --- a/R/generate_code.R +++ b/R/generate_code.R @@ -104,7 +104,6 @@ generate_code <- function(spec, domain, out_dir = ".") { #' @keywords internal #' style_the_code <- function(code_by_topics, domain) { - admiraldev::assert_list_of(code_by_topics, "character") prefix_f <- paste0(domain, "_template_prefix") @@ -296,7 +295,6 @@ remove_last_pipe <- function(code_blocks) { #' @keywords internal #' get_domain_spec <- function(spec, domain) { - admiraldev::assert_data_frame(spec, required_vars = rlang::syms(expected_columns_min())) admiraldev::assert_character_scalar(domain) diff --git a/tests/testthat/test-generate_code.R b/tests/testthat/test-generate_code.R index 2e1a608..cc9ef66 100644 --- a/tests/testthat/test-generate_code.R +++ b/tests/testthat/test-generate_code.R @@ -36,7 +36,6 @@ test_that("generate_code works for one topic domain", { }) test_that("generate_code works for multiple topics domain", { - # nolint start spec <- tibble::tribble( ~study_number, ~raw_dataset, ~raw_dataset_label, ~raw_variable, ~raw_variable_label, ~raw_variable_ordinal, ~raw_variable_type, ~raw_data_format, ~raw_fmt, ~raw_unk, ~study_specific, ~annotation_ordinal, ~mapping_is_dataset, ~annotation_text, ~target_sdtm_domain, ~target_sdtm_variable, ~target_sdtm_variable_role, ~topic, ~target_sdtm_variable_codelist_code, ~target_sdtm_variable_controlled_terms_or_format, ~target_sdtm_variable_ordinal, ~origin, ~mapping_algorithm, ~entity_sub_algorithm, ~target_hardcoded_value, ~target_term_value, ~target_value, ~target_term_code, ~condition_ordinal, ~condition_group_ordinal, ~condition_add_raw_dat, ~condition_add_tgt_dat, ~condition_left_raw_dataset, ~condition_left_raw_variable, ~condition_left_sdtm_domain, ~condition_left_sdtm_variable, ~condition_operator, ~condition_right_text_value, ~condition_right_sdtm_domain, ~condition_right_sdtm_variable, ~condition_right_raw_dataset, ~condition_right_raw_variable, ~condition_next_logical_operator, ~merge_type, ~merge_left, ~merge_right, ~merge_condition, ~unduplicate_keys, ~groupby_keys, ~target_resource_raw_dataset, ~target_resource_raw_variable, @@ -47,7 +46,7 @@ test_that("generate_code works for multiple topics domain", { "lp_study", "vitals_raw_data", "Vital Signs", "SYS_BP", "Systolic blood pressure", "6", "Text", "3", NA, NA, "FALSE", "2", "FALSE", "VS.VSTEST = 'Systolic Blood Pressure'", "VS", "VSTEST", "Synonym Qualifier", "SYS_BP", "C67153", "(VSTEST)", "8", "Assigned", "hardcode_ct", NA, NA, "Systolic Blood Pressure", "Systolic Blood Pressure", "C25298", NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, "lp_study", "vitals_raw_data", "Vital Signs", "SYS_BP", "Systolic blood pressure", "6", "Text", "3", NA, NA, "FALSE", "1", "FALSE", "VS.VSORRES when VS.VSTESTCD = 'SYSBP'", "VS", "VSORRES", "Result Qualifier", "SYS_BP", NA, NA, "12", "CRF", "assign_no_ct", NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, "lp_study", "vitals_raw_data", "Vital Signs", "SYS_BP", "Systolic blood pressure", "6", "Text", "3", NA, NA, "FALSE", "3", "FALSE", "VS.VSORRESU = ", "VS", "VSORRESU", "Variable Qualifier", "SYS_BP", "C66770", "(VSRESU)", "13", "Assigned", "hardcode_ct", NA, NA, "mmHg", "mmHg", "C49670", NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA - ) + ) # nolint end # Convert all NA to NA_character_