Skip to content

Commit

Permalink
#107 style code
Browse files Browse the repository at this point in the history
  • Loading branch information
edgar-manukyan committed Dec 11, 2024
1 parent 59c0072 commit 4ba5d3f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 0 additions & 2 deletions R/generate_code.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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)

Expand Down
3 changes: 1 addition & 2 deletions tests/testthat/test-generate_code.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 = <Fixed Unit>", "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_
Expand Down

0 comments on commit 4ba5d3f

Please sign in to comment.